Re: how to retrieve the pacakge URI and architecture from python-apt
A Mennucc <debdev@mennucci.sns.it> writes:
> 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.
This, with current released version of python-apt isn't
possible. Michael did a fix to allow in in his fixes branch and I'm
using it for a while.
To do this, you can use:
src_cache.Restart()
src_cache.Lookup(Package)
for path in src_cache[suite].Files:
print src_cache.Index.ArchiveURI()
I didn't test this code but should work.
p.s: his branch is available using bzr at:
http://people.debian.org/~mvo/bzr/python-apt/python-apt--debian-sid/
--
O T A V I O S A L V A D O R
---------------------------------------------
E-mail: otavio@debian.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://www.freedom.ind.br/otavio
---------------------------------------------
"Microsoft gives you Windows ... Linux gives
you the whole house."
Reply to: