Date: Sun, 31 Aug 2003 17:52:24 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: Alexander Leidinger <Alexander@Leidinger.net> Cc: Steve Kargl <sgk@troutmask.apl.washington.edu> Subject: Re: /lib symlinks problem? Message-ID: <20030831145224.GC28845@sunbay.com> In-Reply-To: <20030831140742.3bd1b597.Alexander@Leidinger.net> References: <200308291454.h7TEsb913915@accms33.physik.rwth-aachen.de> <20030829172348.1aa0b5d4.Alexander@Leidinger.net> <20030829161907.GA89129@troutmask.apl.washington.edu> <20030830135427.0cea7fdb.Alexander@Leidinger.net> <20030830185653.GA10674@sunbay.com> <20030831140742.3bd1b597.Alexander@Leidinger.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--WChQLJJJfbwij+9x Content-Type: multipart/mixed; boundary="2/5bycvrmDh4d1IB" Content-Disposition: inline --2/5bycvrmDh4d1IB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 31, 2003 at 02:07:42PM +0200, Alexander Leidinger wrote: > On Sat, 30 Aug 2003 21:56:53 +0300 > Ruslan Ermilov <ru@FreeBSD.org> wrote: >=20 > > > I think a workaround would be to use absolute symlinks (at least as an > > > option). > > >=20 > > I might be missing an obvious, but I just don't see a reason > > why we should use relative linking here: we should just link > > to where we really install. With the attached patch, I get: > >=20 > > $ make -n install -DNOMAN DESTDIR=3D/foo > > install -C -o root -g wheel -m 444 libalias.a /foo/usr/lib > > install -s -o root -g wheel -m 444 libalias.so.4 /foo/lib > > ln -fs libalias.so.4 /foo/lib/libalias.so > > ln -fs /foo/lib/libalias.so.4 /foo/usr/lib/libalias.so >=20 > Don't you have to remove the first ${DESTDIR} to make this work in the > "put a harddisk into a running system and install a system via > installworld & distribute" case? >=20 Doh, you're of course right! An updated patch is attached. Now it looks like this: install -C -o root -g wheel -m 444 libalias.a /foo/usr/lib install -s -o root -g wheel -m 444 libalias.so.4 /foo/lib ln -fs libalias.so.4 /foo/lib/libalias.so ln -fs /lib/libalias.so.4 /foo/usr/lib/libalias.so This is also consistent with how we handle SYMLINKS: # make -f bsd.prog.mk BINDIR=3D/bin SYMLINKS=3D'${BINDIR}/file1 ${BINDIR}/f= ile2' install DESTDIR=3D/foo /foo/bin/file2 -> /bin/file1 # ls -l /foo/bin total 0 lrwxr-xr-x 1 root wheel 10 Aug 31 17:44 file2 -> /bin/file1 Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software Ltd, ru@FreeBSD.org FreeBSD committer --2/5bycvrmDh4d1IB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: bsd.lib.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.lib.mk,v retrieving revision 1.150 diff -u -r1.150 bsd.lib.mk --- bsd.lib.mk 17 Aug 2003 23:56:29 -0000 1.150 +++ bsd.lib.mk 31 Aug 2003 14:46:32 -0000 @@ -207,9 +207,8 @@ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} .if defined(SHLIB_LINK) ln -fs ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK} -.if (${LIBDIR} != ${SHLIBDIR}) - ln -fs ${LIBDIR:C|/[^/]+|/..|g:S|^/||}${SHLIBDIR}/${SHLIB_NAME} \ - ${DESTDIR}${LIBDIR}/${SHLIB_LINK} +.if ${LIBDIR} != ${SHLIBDIR} + ln -fs ${SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK} .endif .endif .endif --2/5bycvrmDh4d1IB-- --WChQLJJJfbwij+9x Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE/UguoUkv4P6juNwoRAjwsAKCFnzwG0CE+apJ3u1U7zQKkb9Do7QCfRi7G a4QJGGrGCzoGDjUAbHiQzCg= =rNBv -----END PGP SIGNATURE----- --WChQLJJJfbwij+9x--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030831145224.GC28845>