Date: Sat, 25 May 2002 12:22:57 -0700 From: Peter Wemm <peter@wemm.org> To: Dag-Erling Smorgrav <des@ofug.org> Cc: current@FreeBSD.ORG Subject: Re: i386 tinderbox failure Message-ID: <20020525192257.A48273807@overcee.wemm.org> In-Reply-To: <xzpvg9c8k22.fsf@flood.ping.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smorgrav wrote: > Peter Wemm <peter@wemm.org> writes: > > Indeed it is installed. Note that you have exposed a fundamental bug > > in the perl wrapper. It only searches $PATH, and /usr/local/bin is not > > in $PATH for many system tools (eg: pkg_add -r). > > How about this: > > Index: perl.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/perl/perl.c,v > retrieving revision 1.2 > diff -u -u -r1.2 perl.c > --- perl.c 18 May 2002 05:33:28 -0000 1.2 > +++ perl.c 25 May 2002 12:52:43 -0000 > @@ -59,5 +59,6 @@ > if (errno != ENOENT) > err(1, "%s", path); > } > + execve("/usr/local/bin/perl", argv, environ); > errx(1, "Perl is not installed, try 'pkg_add -r perl'"); > } > > Of course, it won't work if Perl was installed with a non-standard > PREFIX. That would work, but IMHO this should be the first location we try since it is the "most likely" location for it. Another idea. Suppose we have /etc/ports.conf or /etc/pkg.conf which is a symlink to the base of the installed location of ports/packages? (like we do with /etc/malloc.conf being a symlink). We could exec /etc/ports.conf/bin/perl as a last resort too. It would look pretty freaky but would be faster than parsing a text config file. pkg_add could do a readlink("/etc/ports.conf") to set the default for pkg_add -p <prefix> as well. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020525192257.A48273807>