[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: usrmerge in bookworm



Marco <mm@dorfdsl.de> writes:

> Am 06.10.2023 schrieb Steve Keller <keller.steve@gmx.de>:
> 
> > I have always been sceptical about /usr merge, since all binaries now
> > appear in two places, "type sh" in bash gives the strange looking
> > /usr/bin/sh where all Uni*ers are strongly used to /bin/sh.  But also
> > things like the following don't work anymore:
> 
> Historic reasons, they don't exist anymore on current systems.
> 
> >     $ dpkg -S $(type -p sh)
> >     dpkg-query: no path found matching pattern /usr/bin/sh
> 
> That is because /bin is now a symlink to /usr/bin and the file isn't
> provided in /usr/bin by the package.

I assume Steve (seemingly multi Un*x user) is aware about the historic
reasons and how and why /usr-merge is implemented using symlinks.

> > And I don't see a comfortable way around this.
> 
> One way would be to strip off /usr from the string to search.

That, of course, doesn't really help

    $ type -Pa ls
    /usr/bin/ls
    /bin/ls
    $ dpkg -S $(PATH=/bin type -Pa ls)
    coreutils: /bin/ls
    $ type -Pa gcc
    /usr/bin/gcc
    /bin/gcc
    $ dpkg -S $(PATH=/bin type -Pa gcc)
    dpkg-query: no path found matching pattern /bin/gcc
    
because some packages have their binaries in /bin and others in
/usr/bin, and likewise with /sbin vs. /usr/sbin, and /lib
vs. /usr/lib.

But the -a option to bash's 'type' builtin command helps:

    $ dpkg -S $(type -Pa ls gcc)
    dpkg-query: no path found matching pattern /usr/bin/ls
    coreutils: /bin/ls
    gcc: /usr/bin/gcc
    dpkg-query: no path found matching pattern /bin/gcc
    
urs


Reply to: