On Wed, Sep 14, 2011 at 01:18:08AM +0200, Yann Dirson wrote:
> Hm, I just realized my patch shares a bit defect with the original
> one: the fakeroot script includes the name of the multiarch dir, which
> makes it different for all archs and violates the multiarch principle.
> 
> So if we cannot rely on the ld.so conf because of the subdirectory, I
> guess the only way out is to make a special case in the script: if
> dpkg-architecture is there and knows about multiarch, derive PATHS
> from this, or else do like we do today.

Well... someone less sleepy than I was yesterday may still have
noticed the obvious: this second patch *does not* remove the
arch-variant @libdir@ substitution.

Now that I'm looking at it, I realize that the default "make install"
does install libfakeroot.so directly in $prefix/lib/ - this brings me
back to the question of why we need to get it out of the standard
ld.so search path, especially if anyone installing from source get it
in that very search path.

Let's keep in mind that if we do the same, there is no problem to be
solved for PATHS: this variable won't be useful at all any more, since
ld.so would do for us that job it does well for others ;)

But if we still need that libfakeroot/ dir, looks like we need
something to make sure we have a fixed string where we currently have
@libdir@ - an auxiliary @scriptlibdir@ would do the trick.  A
configure flag to toggle multiarch mode, which would also check
dpkg-architecture and set @libdir@ and @scriptlibdir@ accordingly.

In the long run we will surely want to support multiarch on other
platforms than debian, but for now we don't really have to be more
generic.

Is that plan OK ?

> That is, something like (untested):
> 
> diff --git a/scripts/fakeroot.in b/scripts/fakeroot.in
> index 324a9dc..262a157 100755
> --- a/scripts/fakeroot.in
> +++ b/scripts/fakeroot.in
> @@ -35,7 +35,17 @@ FAKEROOT_BINDIR=@bindir@
>  
>  USEABSLIBPATH=@LDPRELOADABS@
>  LIB=lib@fakeroot_transformed@@DLSUFFIX@
> -PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
> +
> +MULTIARCH=
> +if command -v dpkg-architecture >/dev/null 2>&1; then
> +    MULTIARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null`
> +fi
> +if [ -z "$MULTIARCH" ]; then
> +    
> PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
> +else
> +    PATHS="$MULTIARCH"
> +fi
> +
>  FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
>  
>  FAKED_MODE="unknown-is-root"



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to