From owner-freebsd-libh Wed Nov 1 10:50:54 2000 Delivered-To: freebsd-libh@freebsd.org Received: from oberon.dnai.com (oberon.dnai.com [207.181.194.97]) by hub.freebsd.org (Postfix) with ESMTP id 8447137B4CF for ; Wed, 1 Nov 2000 10:50:51 -0800 (PST) Received: from azoth.dnai.com (azoth.dnai.com [207.181.194.94]) by oberon.dnai.com (8.9.3/8.9.3) with ESMTP id KAA56164; Wed, 1 Nov 2000 10:50:38 -0800 (PST) Received: from acm.org (207-172-123-6.s260.tnt1.sfrn.ca.dialup.rcn.com [207.172.123.6]) by azoth.dnai.com (8.9.3/8.9.3) with ESMTP id KAA16139; Wed, 1 Nov 2000 10:50:22 -0800 (PST) Message-ID: <3A0065EC.C4ABA4AD@acm.org> Date: Wed, 01 Nov 2000 10:50:20 -0800 From: Tim Kientzle Reply-To: kientzle@acm.org X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.3-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Jordan Hubbard Cc: Patrick Bihan-Faou , "Daniel C. Sobral" , libh@FreeBSD.ORG Subject: Re: Making the Packages System Better References: <21943.973069819@winston.osd.bsdi.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jordan Hubbard wrote: > > > the approach that has been described is sound. However I would also like to > > hear about the arguments of people who oppose this. Maybe there is something > > that we missed and that will byte us badly at some point ? > > There are a number of more complex packages which "find" themselves by > examining argv[0] (or $0 if, more typically, they're scripts which > front-end executables which require significant environmental > pollution to run). These packages are often confused by finding their > base to be a symlink and will do parent-directory (..) relative path > smashing to find their other bits. If this fails to work, you're > hosed. > > These "complex packages" are also not very rare - both emacs 20.x as > well as java come immediately to mind, and there are others. > > - Jordan Later JDK releases are symlink-aware and do not have this problem. (I know for a fact that the native JDK 1.2.2 is symlink-aware. The Blackdown Linux JDK 1.2.2 is also symlink-aware, so I think it's a fix that's been incorporated in Sun's sources, not just a FreeBSD-specific fix.) There's also a stock workaround that should work for any such program: $ cd /usr/packages/emacs-20.35 $ mkdir bin-private $ mv bin/emacs bin-private/emacs $ cd bin $ cat >emacs #!/bin/sh exec /usr/packages/emacs-20.35/bin-private/emacs "$@" ^D $ chmod +x emacs Now, a symlink from /usr/packages/bin/emacs to /usr/packages/emacs-20.35/bin/emacs will invoke this shell script which will exec the "real" emacs with all of the expected path information. Gee, Jordan, I think even you could automate this one. ;-) - Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message