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

Re: Update the dpkg's status database

Hello Slavko,

Slavko <linux@slavino.sk> wrote:
> Ah, yes. It is my misunderstanding (or my outdated knowledge?), because i
> never see the problem with uninstalled packages before now. But i don't
> used it for some months.

Uninstalled, but not purged, packages are shown. Try apt-get install
jarwrapper; apt-get remove jarwrapper; dpkg --purge jarwrapper and
compare the different output of dpkg -l.

> I am using it in my personal script for querying the package description
> for translation by email interface of the DDTP. It is used for checking
> that the package exist, to prevent typo in package name (and querying
> nonexistent package) by checking the existence of the package in database.
> I am using the query of the available database now for this.

Using dpkg-query also has the advantage that you can specify the
output format:

0 17:34 0 claudius@ares: ~/Desktop $ dpkg-query --load-avail -f '${binary:Summary}\n' -W pidgin2
No packages found matching pidgin2.
1 17:34 0 claudius@ares: ~/Desktop $ dpkg-query --load-avail -f '${binary:Summary}\n' -W jarwrapper
(no description available)
0 17:34 0 claudius@ares: ~/Desktop $ dpkg-query --load-avail -f '${binary:Summary}\n' -W pidgin
graphical multi-protocol instant messaging client for X
0 17:34 0 claudius@ares: ~/Desktop $ dpkg-query -f '${binary:Summary}\n' -W jarwrapper
No packages found matching jarwrapper.
1 17:35 0 claudius@ares: ~/Desktop $ 

Note the return code of 1 when no packages are found.

Best regards,

              A board is the planck unit of boredom.                
http://chubig.net                          telnet nightfall.org 4242

Attachment: signature.asc
Description: PGP signature

Reply to: