[PATCH] man 1.6f - add bin/../share/man to manpath

Matt Domsch Matt_Domsch at dell.com
Wed Jan 14 19:58:48 UTC 2009


Forwarding for additional feedback.

----- Forwarded message from Matt Domsch <Matt_Domsch at dell.com> -----

Date: Wed, 14 Jan 2009 13:54:32 -0600
From: Matt Domsch <Matt_Domsch at dell.com>
To: flucifredi at acm.org, freestandards-fhs-discuss at lists.sourceforge.net
Cc: Ivana Varekova <varekova at redhat.com>, werner at suse.de,
	Colin Watson <cjwatson at debian.org>
Subject: [PATCH] man 1.6f - add bin/../share/man to manpath
Status: RO

man searches for package/bin/ directories on $PATH, and then looks for
package/man/ directories to exist as well.  When trying to place
packages into /opt/<provider>/<package> per FHS 2.3 [1], it expects
manpages to be found under this point, in share/man, not in man/.
/opt/<provider>/<package>/bin will get placed on $PATH, but share/man
won't be found without somehow editing $MANPATH, /etc/man.config, or
making share/man get automatically found by man.

Patch below adds ../share/man/ to the search path, after ../man/, for
bin/ directories on $PATH.  This adds one extra stat() call per bin/
directory listed in $PATH for each invocation of man.

Feedback requested.

[1] http://www.pathname.com/fhs/pub/fhs-2.3.html

Thanks,
Matt

-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux

diff -urNp --exclude-from=/home/mdomsch/excludes --minimal man-1.6f.orig/src/manpath.c man-1.6f/src/manpath.c
--- man-1.6f.orig/src/manpath.c	2009-01-14 12:54:25.000000000 -0600
+++ man-1.6f/src/manpath.c	2009-01-14 13:17:14.000000000 -0600
@@ -106,7 +106,8 @@ is_directory (char *path) {
 
 /*
  * Check to see if the current directory has man or MAN
- * or ../man or ../man1 or ../man8 subdirectories. 
+ * or ../man or ../man1 or ../man8  or ../share/man
+ * subdirectories.
  */
 static char *
 find_man_subdir (char *p) {
@@ -144,6 +145,12 @@ find_man_subdir (char *p) {
      if (is_directory (t) == 1)
 	  return t;
 
+     /* look for the situation with packagedir/bin and packagedir/share/man */
+     strcpy (t + len, "/share/man");
+
+     if (is_directory (t) == 1)
+	  return t;
+
      /* look for the situation with pkg/bin and pkg/man1 or pkg/man8 */
      /* (looking for all man[1-9] would probably be a waste of stats) */
      strcpy (t + len, "/man1");

----- End forwarded message -----

-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux




More information about the devel mailing list