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

Re: dpkg-shlibdeps (was Re: Cannot install HURD: bsdutils missing)

On Sat, May 04, 2002 at 11:26:53AM +0200, Robert Millan wrote:
> On Sat, May 04, 2002 at 10:11:47AM -0400, Marcus Brinkmann wrote:
> > On Sat, May 04, 2002 at 07:45:04AM +0200, Robert Millan wrote:
> > > 
> > > okay then. btw, dpkg -S needs fixing too?
> > > 
> > 
> > you mean that dpkg -S /lib/libz.so.1  should come up with gzip?
> Yes, but i had in mind and that dpkg -S /usr/lib/libz.so.1 should
> come up with zlib1g

Well, it should do that already.  However, it doesn't come up with
zlib1g when you search for /lib/libz.so.1 (sorry for the gzip, I meant
zlib1g really).

This is, as you suspect, because a leading / makes it look for a full
path _as it thinks about the filesystem in the database_.  Any other
names for the same file are not found, in particular not the realpath()
of any name, which is one way to uniquely identify a file.  The problem
with that is that the realpath() is often not what dpkg thinks of the
file location, so you could only fall back to the other reliable
identifier, the inode and filesystem id (note: the filesystem id is
probably bogus on GNU/Linux because the kernel developers don't (or at
least did not) understand what it is used for).

However, if a sysadmin copies a file and then moves it back into the
position (or, if he restores a backup or anything like that),
the inode will change.  So you can't store the inode in a database.

What dpkg could do is get the inode (and fsid) for the path it is
searching for and for each file in the database.  This is of course very
slow.  An alternative might be to do some lose matching based on the
basename of the file (no directories).  Then it could be feasible.
Note: this is a spontaneous idea, I might overlook something.

If the dpkg maintainers would accept such a patch I don't know.


> However, the first doesn't look like a GNU-specific problem:
> rmh@aragorn:~$ dpkg -S lib/libz.so.1
> zlib1g: /usr/lib/libz.so.1.1.4
> zlib1g: /usr/lib/libz.so.1
> rmh@aragorn:~$ dpkg -S /lib/libz.so.1
> dpkg: /lib/libz.so.1 not found.
> rmh@aragorn:~$
> The trailing slash probably switches dpkg to "full path mode", I'll
> have a look at this.
> -- 
> Robert Millan
> "5 years from now everyone will be running
> free GNU on their 200 MIPS, 64M SPARCstation-5"
>               Andrew S. Tanenbaum, 30 Jan 1992

To UNSUBSCRIBE, email to debian-hurd-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: