Re: Re: Update the dpkg's status database

2012-08-05 Thread Slavko
Hi,

sorry, if ugly format, i lost your message, then this is reply from archive

 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 hope, that i understand now from where was my mistake coming:

LANG=C dpkg -l aspell-hi
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version  Description
+++---
un  aspell-hinone   (no desc available)

First i think, that there is info about this package in status file, but i
was wrong, because there is only item for aspell package, which points to
the aspell-hi:

grep aspell-hi /var/lib/dpkg/status
Replaces: aspell-bin ( 0.60.3-2), aspell-hi (= 0.01-1), ...
^

This was my confusion and misunderstanding, thanks for pointing :-)

 Using dpkg-query also has the advantage that you can specify the
 output format:
 ...
 Note the return code of 1 when no packages are found.

This is only one, what i am using for my purpose, because i am redirecting
whole output to /dev/null in my script (now changed to dpkg-query):

if dpkg-query --load-avail -l $NAM_PACK /dev/null 21; then
...

But thanks for nice examples.

regards

-- 
s pozdravom

Slavko
http://slavino.sk


signature.asc
Description: PGP signature


Update the dpkg's status database

2012-08-04 Thread Slavko
Hi,

i am using the Debian testing some years. And sometime i am using the dpkg
command to brief look of the packages. I observed that, the database of
the available packages is not automatically updated, then i create simple
weekly cron job to update the available database by the sync-available
tool.

But in a last days i see, that the simple dpkg -l command cannot find
some packages, which are in debian:

LANG=C dpkg --list jarwrapper
No packages found matching jarwrapper.

After some investigation, i see that the status database is
outdated/incomplete, because after i did search in available too, then
package was found:

LANG=C dpkg-query --load-avail --list jarwrapper
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version  Description
+++---
un  jarwrapper   none   (no description available)

Please, is here simple way to update the status database?

regards

-- 
Slavko
http://slavino.sk


signature.asc
Description: PGP signature


Re: Update the dpkg's status database

2012-08-04 Thread Claudius Hubig
Hello Slavko,

Slavko li...@slavino.sk wrote:
 LANG=C dpkg --list jarwrapper
 No packages found matching jarwrapper.

 LANG=C dpkg-query --load-avail --list jarwrapper
[jarwrapper is shown]

 Please, is here simple way to update the status database?

How about using it? dpkg-query(1) clearly states:

   --load-avail
  Also load the available file when using the --show and
  --list commands, which now default to only querying the
  status file.

So to use --list on uninstalled packages, you need --load-avail
(which is only understood by dpkg-query, but not dpkg). Since
dpkg is normally meant as tool for _local_ package administration
(installation of .deb, removal of packages etc.), which does not know
about package files available elsewhere but not locally installed,
this makes perfect sense.

You can also use -p (--print-avail) which is more-or-less identical
to apt-cache show.

Maybe you can refine for what exactly you’re looking?

Best regards,

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


signature.asc
Description: PGP signature


Re: Update the dpkg's status database

2012-08-04 Thread Slavko
Hi,

Dňa Sat, 4 Aug 2012 13:01:26 +0200 Claudius Hubig debian_1...@chubig.net
napísal:

 How about using it? dpkg-query(1) clearly states:
 
--load-avail
   Also load the available file when using the --show and
   --list commands, which now default to only querying the
   status file.
 
 So to use --list on uninstalled packages, you need --load-avail
 (which is only understood by dpkg-query, but not dpkg). Since

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.

 Maybe you can refine for what exactly you’re looking?

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.

Thanks

-- 
Slavko
http://slavino.sk


signature.asc
Description: PGP signature


Re: Update the dpkg's status database

2012-08-04 Thread Claudius Hubig
Hello Slavko,

Slavko li...@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,

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


signature.asc
Description: PGP signature