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
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
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
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,
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,
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,
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,
Thank you for connecting with me on LinkedIn. Did you receive my previous email about Guangdong Hengjian Holdings Co., Ltd. Offer? Regards, Chao Hui