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

how to retrieve the pacakge URI and architecture from python-apt



hi

I need some help in using python-apt

I am preparing a program (*) that uses python-apt ; I need to list
all packages that need upgrading, so I do this:

  import  apt, apt_pkg
  apt_pkg.init()
  cache=apt.Cache()
  cache.upgrade()

  for p in cache :
    if p.isInstalled and  p.markedUpgrade \
           and p.candidateOrigin[0].origin == 'Debian':
	   (work)

and it works fine; then I would need to know where the candidate for 'p'
is located, that is, the URL and the HTTP server where 'p' is supposed
to be downloaded from... but I could not find a way to do that
using 'python-apt'.... 

Currently I parse the output of 
	  os.popen('env -i dpkg -p '+p.name)
but this is very time consuming.

Since  python-apt does not have documentation AFAICT, I am lost.

Any help is appreciated.

a.


ps (*): the program in question is 'debdelta', and is available at
  http://tonelli.sns.it/pub/mennucc1/debdelta/etch

-- 
Andrea Mennucc
 "E' un mondo difficile. Che vita intensa!" (Tonino Carotone)

Attachment: signature.asc
Description: Digital signature


Reply to: