Re: [Review please] (was: Re: cvs commit: src/gnu/usr.bin/man/manpath manpath.config)

1999-08-16 Thread Dag-Erling Smorgrav

Ruslan Ermilov [EMAIL PROTECTED] writes:
 How about the following patch.  It adds an OPTIONAL_MANPATH directive,
 which is equivalent to the MANDATORY_MANPATH, except an absence of the
 directory is not considered an error.

Sure.

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [Review please] (was: Re: cvs commit: src/gnu/usr.bin/man/manpath manpath.config)

1999-08-16 Thread Dag-Erling Smorgrav
Ruslan Ermilov r...@freebsd.org writes:
 How about the following patch.  It adds an OPTIONAL_MANPATH directive,
 which is equivalent to the MANDATORY_MANPATH, except an absence of the
 directory is not considered an error.

Sure.

DES
-- 
Dag-Erling Smorgrav - d...@flood.ping.uio.no


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: [Review please] (was: Re: cvs commit: src/gnu/usr.bin/man/manpath manpath.config)

1999-08-14 Thread Mark Murray
 DES, Mark, -hackers!
 
 How about the following patch.  It adds an OPTIONAL_MANPATH directive,
 which is equivalent to the MANDATORY_MANPATH, except an absence of the
 directory is not considered an error.

Cool! Do it, I say!

M
--
Mark Murray
Join the anti-SPAM movement: http://www.cauce.org


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



[Review please] (was: Re: cvs commit: src/gnu/usr.bin/man/manpath manpath.config)

1999-08-13 Thread Ruslan Ermilov
On Thu, Aug 12, 1999 at 04:19:59PM +0200, Dag-Erling Smorgrav wrote:
 Ruslan Ermilov r...@freebsd.org writes:
  Hmm, looking to the p5-* ports, I can't figure out what would be the
  appropriate PATH component for /usr/local/lib/perl/*/man manpath.
  Do you have an idea?
 
 You can't use MANPATH_MAP for /usr/local/lib/perl/*/man, because these
 man pages correpsond to Perl modules, not to binaries. You have to use
 MANDATORY_MANPATH, or some variation thereof.
 
DES, Mark, -hackers!

How about the following patch.  It adds an OPTIONAL_MANPATH directive,
which is equivalent to the MANDATORY_MANPATH, except an absence of the
directory is not considered an error.

Additionally, this patch fixes two other bugs:

1) The order of directives in manpath.config is honored, which is bogus.
   Run manpath (with and without -d flag) against the following config
   and see what happens:

MANPATH_MAP /usr/local/bin  /usr/local/man
MANDATORY_MANPATH   /usr/share/man
MANDATORY_MANPATH   /usr/share/perl/man

   
2) Infinite loop when the PATH isn't set or NULL, and MANDATORY_MANPATH
   directory doesn't exist.  Run `/usr/bin/env PATH= /usr/bin/manpath'
   or, better yet, `/usr/bin/env PATH= /usr/bin/man man' against the
   following manpath.config:

MANDATORY_MANPATH   /usr/share/man
MANDATORY_MANPATH   /nonexistent


Cheers,
-- 
Ruslan Ermilov  Sysadmin and DBA of the
r...@ucb.crimea.ua  United Commercial Bank,
r...@freebsd.orgFreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age
Index: manpath.config
===
RCS file: /usr/FreeBSD-CVS/src/gnu/usr.bin/man/manpath/manpath.config,v
retrieving revision 1.11
diff -u -c -r1.11 manpath.config
*** manpath.config  1999/07/25 19:33:06 1.11
--- manpath.config  1999/08/13 14:17:38
***
*** 6,11 
--- 6,12 
  #
  # MANBIN  pathname
  # MANDATORY_MANPATH   manpath_element
+ # OPTIONAL_MANPATHmanpath_element
  # MANPATH_MAP path_elementmanpath_element
  #
  # MANBIN is optional
***
*** 16,24 
  #
  MANDATORY_MANPATH /usr/share/man
  MANDATORY_MANPATH /usr/share/perl/man
! #MANDATORY_MANPATH/usr/local/man
! #MANDATORY_MANPATH/usr/local/lib/perl5/5.00503/man
! MANDATORY_MANPATH /usr/X11R6/man
  #
  # set up PATH to MANPATH mapping
  #
--- 17,23 
  #
  MANDATORY_MANPATH /usr/share/man
  MANDATORY_MANPATH /usr/share/perl/man
! OPTIONAL_MANPATH  /usr/local/lib/perl5/5.00503/man
  #
  # set up PATH to MANPATH mapping
  #
Index: manpath.h
===
RCS file: /usr/FreeBSD-CVS/src/gnu/usr.bin/man/manpath/manpath.h,v
retrieving revision 1.2
diff -u -c -r1.2 manpath.h
*** manpath.h   1995/05/30 05:02:06 1.2
--- manpath.h   1999/08/13 14:17:38
***
*** 18,25 
  {
char mandir[MAXPATHLEN];
char bin[MAXPATHLEN];
!   int mandatory;
  } DIRLIST;
  
  DIRLIST list[MAXDIRS];
  
--- 18,31 
  {
char mandir[MAXPATHLEN];
char bin[MAXPATHLEN];
!   int type;
  } DIRLIST;
+ 
+ /* manpath types */
+ #define MANPATH_NONE  0
+ #define MANPATH_MANDATORY 1   /* manpath is mandatory */
+ #define MANPATH_OPTIONAL  2   /* manpath is optional */
+ #define MANPATH_MAP   3   /* maps path to manpath */
  
  DIRLIST list[MAXDIRS];
  
Index: manpath.c
===
RCS file: /usr/FreeBSD-CVS/src/gnu/usr.bin/man/manpath/manpath.c,v
retrieving revision 1.6
diff -u -c -r1.6 manpath.c
*** manpath.c   1998/07/09 12:39:08 1.6
--- manpath.c   1999/08/13 14:17:38
***
*** 203,209 
if (!strncmp (MANBIN, bp, 6))
continue;
  
!   if (!strncmp (MANDATORY_MANPATH, bp, 17))
{
  if ((p = strchr (bp, ' ')) == NULL 
  (p = strchr (bp, '\t')) == NULL) {
--- 203,210 
if (!strncmp (MANBIN, bp, 6))
continue;
  
!   if (!strncmp (MANDATORY_MANPATH, bp, 17) ||
! !strncmp (OPTIONAL_MANPATH, bp, 16))
{
  if ((p = strchr (bp, ' ')) == NULL 
  (p = strchr (bp, '\t')) == NULL) {
***
*** 211,219 
return -1;
  }
  
! bp = p;
  
! dlp-mandatory = 1;
  
  while (*bp  *bp != '\n'  (*bp == ' ' || *bp == '\t'))
bp++;
--- 212,220 
return -1;
  }
  
! dlp-type = *bp == 'M'? MANPATH_MANDATORY: MANPATH_OPTIONAL;
  
! bp = p;
  
  while (*bp  *bp != '\n'  (*bp == ' ' || *bp == '\t'))
bp++;
***
*** 224,230 
  dlp-mandir[i] = '\0';
  
  if (debug)
!   fprintf (stderr, found mandatory man