Re: /usr/share/man/man8/MAKEDEV.8

From: Alex Kozlov <spam_at_rm-rf.kiev.ua>
Date: Sun, 4 Nov 2007 18:04:52 +0200
On Sun, Nov 04, 2007 at 04:07:38PM +0200, Alex Kozlov wrote:
> On Sun, Nov 04, 2007 at 05:03:04AM -0800, Jeremy Chadwick wrote:
> > On Sun, Nov 04, 2007 at 02:10:40PM +0200, Alex Kozlov wrote:
> > > On Sat, Nov 03, 2007 at 01:48:54PM -0400, Andrew Lankford wrote:
> > > >   2) getting rid of catman and forcing man to generate a new one from 
> > > > scratch each time instead of filling up /usr/share/man/cat* with stale
> > > > files.  Is this going to be a big drain on a p4-era pc compared to 
> > > > something like another periodic.conf script?
> > > > 
> > > > or
> > > > 
> > > >   3) A compile or run-time option that disables catman as described above.
> > > > If I knew of one, I'd enable it without a second thought on my cutting
> > > > edge p3 desktop :)
> > > Put weekly_catman_enable="NO" in your /etc/periodic.conf
> > It defaults to "no".
> > 
> > Regardless, I think you miss Andrew's point.  AFAIK, there isn't any way
> > to disable automatic creation of catman pages when "man" is run as root.
> In all honesty, I forgot about that. I don't work under root.
> 
> > Being able to disable that feature would ultimately solve this issue
> > for those of us who don't want it (this thread has already mentioned
> > the problems with it).
> Relatively easy to add a new man option to disable creation of cat files.
> But I starting to think, that may be better disable this feature by default.
> Anyway, it work only in rare case, when man run under root.
> 
> Or it will be serious POLA violation?
> 
Ok, here is two patches.
First adds a new option, which prohibits the creation of cat files.
Second allows the creation of cat files only if the new option given.

Index: man.c
_at__at_ -85,6 +85,9 _at__at_
 static char *roff_directive;
 static int apropos;
 static int whatis;
+#ifdef __FreeBSD__
+static int nocatcreate;
+#endif
 static int findall;
 static int print_where;
 
_at__at_ -112,13 +115,13 _at__at_
 
 #ifdef HAS_TROFF
 #ifdef __FreeBSD__
-static char args[] = "M:P:S:adfhkm:op:tw?";
+static char args[] = "M:P:S:acdfhkm:op:tw?";
 #else
 static char args[] = "M:P:S:adfhkm:p:tw?";
 #endif
 #else
 #ifdef __FreeBSD__
-static char args[] = "M:P:S:adfhkm:op:w?";
+static char args[] = "M:P:S:acdfhkm:op:w?";
 #else
 static char args[] = "M:P:S:adfhkm:p:w?";
 #endif
_at__at_ -247,7 +250,8 _at__at_
   k : same as apropos(1)\n";
 
 #ifdef __FreeBSD__
-  static char s3[] = "  o : use original, non-localized manpages\n";
+  static char s3[] = "  o : use original, non-localized manpages\n\
+  c : do not create pre-formated man pages\n";
 #endif
 
 #ifdef HAS_TROFF
_at__at_ -342,6 +346,11 _at__at_
 	case 'a':
 	  findall++;
 	  break;
+#ifdef __FreeBSD__
+	case 'c':
+	  nocatcreate++;
+	  break;
+#endif
 	case 'd':
 	  debug++;
 	  break;
_at__at_ -1606,7 +1615,11 _at__at_
 
 	  man_file = ultimate_source (*np, path);
 
+#ifdef __FreeBSD__
+	  if (!troff && !nocatcreate)
+#else
 	  if (!troff)
+#endif
 	    {
 	      to_cat = 1;
 

Index: man.c
_at__at_ -85,6 +85,9 _at__at_
 static char *roff_directive;
 static int apropos;
 static int whatis;
+#ifdef __FreeBSD__
+static int catcreate;
+#endif
 static int findall;
 static int print_where;
 
_at__at_ -112,13 +115,13 _at__at_
 
 #ifdef HAS_TROFF
 #ifdef __FreeBSD__
-static char args[] = "M:P:S:adfhkm:op:tw?";
+static char args[] = "M:P:S:acdfhkm:op:tw?";
 #else
 static char args[] = "M:P:S:adfhkm:p:tw?";
 #endif
 #else
 #ifdef __FreeBSD__
-static char args[] = "M:P:S:adfhkm:op:w?";
+static char args[] = "M:P:S:acdfhkm:op:w?";
 #else
 static char args[] = "M:P:S:adfhkm:p:w?";
 #endif
_at__at_ -247,7 +250,8 _at__at_
   k : same as apropos(1)\n";
 
 #ifdef __FreeBSD__
-  static char s3[] = "  o : use original, non-localized manpages\n";
+  static char s3[] = "  o : use original, non-localized manpages\n\
+  c : create pre-formated man pages\n";
 #endif
 
 #ifdef HAS_TROFF
_at__at_ -342,6 +346,11 _at__at_
 	case 'a':
 	  findall++;
 	  break;
+#ifdef __FreeBSD__
+	case 'c':
+	  catcreate++;
+	  break;
+#endif
 	case 'd':
 	  debug++;
 	  break;
_at__at_ -1606,7 +1615,11 _at__at_
 
 	  man_file = ultimate_source (*np, path);
 
+#ifdef __FreeBSD__
+	  if (!troff && catcreate)
+#else
 	  if (!troff)
+#endif
 	    {
 	      to_cat = 1;
 

--
Adios
Received on Sun Nov 04 2007 - 16:52:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:21 UTC