Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Nov 2007 18:04:52 +0200
From:      Alex Kozlov <spam@rm-rf.kiev.ua>
To:        current@freebsd.org, spam@rm-rf.kiev.ua
Subject:   Re: /usr/share/man/man8/MAKEDEV.8
Message-ID:  <20071104160452.GA18520@ravenloft.kiev.ua>

next in thread | raw e-mail | index | archive | help
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
@@ -85,6 +85,9 @@
 static char *roff_directive;
 static int apropos;
 static int whatis;
+#ifdef __FreeBSD__
+static int nocatcreate;
+#endif
 static int findall;
 static int print_where;
 
@@ -112,13 +115,13 @@
 
 #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
@@ -247,7 +250,8 @@
   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
@@ -342,6 +346,11 @@
 	case 'a':
 	  findall++;
 	  break;
+#ifdef __FreeBSD__
+	case 'c':
+	  nocatcreate++;
+	  break;
+#endif
 	case 'd':
 	  debug++;
 	  break;
@@ -1606,7 +1615,11 @@
 
 	  man_file = ultimate_source (*np, path);
 
+#ifdef __FreeBSD__
+	  if (!troff && !nocatcreate)
+#else
 	  if (!troff)
+#endif
 	    {
 	      to_cat = 1;
 

Index: man.c
@@ -85,6 +85,9 @@
 static char *roff_directive;
 static int apropos;
 static int whatis;
+#ifdef __FreeBSD__
+static int catcreate;
+#endif
 static int findall;
 static int print_where;
 
@@ -112,13 +115,13 @@
 
 #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
@@ -247,7 +250,8 @@
   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
@@ -342,6 +346,11 @@
 	case 'a':
 	  findall++;
 	  break;
+#ifdef __FreeBSD__
+	case 'c':
+	  catcreate++;
+	  break;
+#endif
 	case 'd':
 	  debug++;
 	  break;
@@ -1606,7 +1615,11 @@
 
 	  man_file = ultimate_source (*np, path);
 
+#ifdef __FreeBSD__
+	  if (!troff && catcreate)
+#else
 	  if (!troff)
+#endif
 	    {
 	      to_cat = 1;
 

--
Adios



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071104160452.GA18520>