#433290 dpkg-query: Make -S handle unowned symlinks resolving to owned pathnames

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Date:
2021-11-12 04:00:03 UTC
Severity:
wishlist
#433290#5
Date:
2007-07-16 07:05:01 UTC
From:
To:

why not found  package man?

root@bridge:/etc# dpkg -S /usr/bin/man
dpkg: /usr/bin/man not found.

root@bridge:/var/log# uname -a
Linux bridge 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux
root@bridge:/etc# cat /etc/debian_version
4.0

#433290#10
Date:
2007-07-16 07:54:03 UTC
From:
To:
Because /usr/bin/man is a symlink and doesn't exist as a file in any
package. "dpkg -S" searches through the contents of
the /var/lib/dpkg/info/*.list files and will only find packaged paths.

$ ls -l /usr/bin/man
lrwxrwxrwx 1 root root 17 May 23 03:57 /usr/bin/man -> ../lib/man-db/man
$ dpkg -S /usr/lib/man-db/man
man-db: /usr/lib/man-db/man

This is a known wishlist item and should either be closed or merged with
bug #198220 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=198220)


- Bruce

#433290#13
Date:
2007-07-16 07:54:03 UTC
From:
To:
Because /usr/bin/man is a symlink and doesn't exist as a file in any
package. "dpkg -S" searches through the contents of
the /var/lib/dpkg/info/*.list files and will only find packaged paths.

$ ls -l /usr/bin/man
lrwxrwxrwx 1 root root 17 May 23 03:57 /usr/bin/man -> ../lib/man-db/man
$ dpkg -S /usr/lib/man-db/man
man-db: /usr/lib/man-db/man

This is a known wishlist item and should either be closed or merged with
bug #198220 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=198220)


- Bruce

#433290#18
Date:
2007-07-16 09:43:36 UTC
From:
To:
forcemerge 198220 433290
thanks

Agreed and merged. My personal opinion is that dpkg -S should follow
symlinks but not display it like a direct match. It should do something
similar to diversions.

For diversions we have:
$ LANG=C dpkg -S /usr/bin/objdump
diversion by binutils-multiarch from: /usr/bin/objdump
diversion by binutils-multiarch to: /usr/bin/objdump.single
binutils-multiarch, binutils: /usr/bin/objdump

For symlinks we could have:
$ dpkg -S /usr/bin/man
non-packaged symlink to /usr/lib/man-db/man: /usr/bin/man
man-db: /usr/lib/man-db/man

It should do symlink resolution one by one. Which means that for
alternatives we should have:
$ dpkg -S /usr/bin/editor
non-packaged symlink to /etc/alternatives/editor: /usr/bin/editor
non-packaged symlink to /usr/bin/vim: /etc/alternatives/editor
non-packaged symlink to /etc/alternatives/vim: /usr/bin/vim
non-packaged symlink to /usr/bin/vim.full: /etc/alternatives/vim
vim-full: /usr/bin/vim.full

Cheers,

#433290#23
Date:
2007-07-16 09:43:36 UTC
From:
To:
forcemerge 198220 433290
thanks

Agreed and merged. My personal opinion is that dpkg -S should follow
symlinks but not display it like a direct match. It should do something
similar to diversions.

For diversions we have:
$ LANG=C dpkg -S /usr/bin/objdump
diversion by binutils-multiarch from: /usr/bin/objdump
diversion by binutils-multiarch to: /usr/bin/objdump.single
binutils-multiarch, binutils: /usr/bin/objdump

For symlinks we could have:
$ dpkg -S /usr/bin/man
non-packaged symlink to /usr/lib/man-db/man: /usr/bin/man
man-db: /usr/lib/man-db/man

It should do symlink resolution one by one. Which means that for
alternatives we should have:
$ dpkg -S /usr/bin/editor
non-packaged symlink to /etc/alternatives/editor: /usr/bin/editor
non-packaged symlink to /usr/bin/vim: /etc/alternatives/editor
non-packaged symlink to /etc/alternatives/vim: /usr/bin/vim
non-packaged symlink to /usr/bin/vim.full: /etc/alternatives/vim
vim-full: /usr/bin/vim.full

Cheers,

#433290#28
Date:
2007-07-18 00:21:54 UTC
From:
To:
tag 433290 + patch
thanks

I just implemented this. Please find the patch attached.

As this is the first time I really dig through the C code of dpkg, a
proper review is in order. I believe it's sane but comments are welcome.

Cheers,

#433290#35
Date:
2008-01-17 11:12:14 UTC
From:
To:
I should add that applying this patch will break dpkg-shlibdeps which
parses the output of dpkg -S. So if it's ever applied, dpkg-shlibdeps
needs to be fixed at the same time (and a proper Breaks needs to be
added to dpkg).

Cheers,

#433290#58
Date:
2019-04-15 20:56:02 UTC
From:
To:
Thank you for connecting with me on LinkedIn. Did you receive my previous
email about Guangdong Hengjian Holdings Co., Ltd. Offer?

Regards,
Chao Hui