Le dimanche 20 juillet 2008, Osamu Aoki a écrit : > Hi, > > > > ~$ dpkg -S usr/bin/ctags > > > exuberant-ctags: /usr/bin/ctags-exuberant > > > ~$ dpkg -S /usr/bin/ctags > > > dpkg: /usr/bin/ctags not found. > > > ~$ dpkg -S '/usr/bin/ctags*' > > > exuberant-ctags: /usr/bin/ctags-exuberant > > ... > > > > The behavior change with leading "/" is different issue from > > > alternative symlinks. It was just sheer luck of matching string > > > which picked /usr/bin/ctags-exuberant. > > > > Indeed. To convince myself I did the search with usr/bin/editor and > > effectively, it doesn't work here, according to manual. > > Why you say "it doesn't work here"? It is alternative so following > should be shown as expected. > > $ dpkg -S bin/editor > dpkg: *bin/editor* not found. > > This is corect response per manual: dpkg-query(1). "This command > will not list extra files created by maintainer scripts, nor will it > list alternatives."
Yep I understand. That was what I tried to say with "it doesn't work here". I should have wrote "It doesn't work here as expected according to the manual of dpkg". > > > The last point I don't understand is why it do work with ctags > > which is an alternative. Is the packaging of this alternative (and > > firefox) different from those of editor alternative ? > > They use the same method. But each package comes with different > combination of names. > > When you run > ~$ dpkg -S usr/bin/ctags > it does substring match with "usr/bin/ctags" as I said which happens > to pick up one of the installed package /usr/bin/ctags-exuberant (and > this happen to be alternative but any substring matched installed > file name could be picked). Ok, you mean dpkg -S usr/bin/ctags will match *usr/bin/ctags* or something like that. Effectively it's all logical. I don't think enough sometimes. > > What you are doing here has nothing to do with alternative. No > symlinks created by alternative system is printed out by dpkg -S. Yeah I did understand, don't worry but I didn't think about how dpkg -S match the query with the result. > > ... > > > > If you think searching alternatives is important, I guess you > > > need to write tool for it. For installed packges, > > > > > > /var/lib/dpkg/alternatives$ grep ctags * > > > ctags:/usr/bin/ctags > > ... > > > > is what I do to find such. > > Just to fill gap: I find that /var/lib/dpkg/alternatives/ctags has > /usr/bin/ctags alternative defined via this acton. > > For actual alternative setting, you nee to look into: > /var/lib/dpkg/alternatives/editor > /var/lib/dpkg/alternatives/ctags > > Each file define alternative setting. That is how you find > alternative. > > Please read dpkg-query(1) manpage and update-alternatives(8) manpage. Ok, I'll know it for my next search into alternatives. Without this information I would have searched in /etc/alternatives or an update-alternatives command. > > Osamu Thomas Preud'homme -- Why Debian : http://www.debian.org/intro/why_debian
signature.asc
Description: This is a digitally signed message part.