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

python-apt: How do I know which source a package is coming from in a cache ?



I’m trying to figure out how to identify the actual source in which a package version is coming from using python-apt library.

 

I’ll start the initial part of it, if you can help me finish it that would be great.

 

 

Import apt_pkg

from apt.progress.text import AcquireProgress

 

apt_pkg.init()

 

sources = apt_pkg.SourceList()

sources.read_main_list()

 

cache = apt_pkg.Cache()

 

for rawpkg in cache.packages:

  if rawpkg.version_list:

     ver = rawpkg.version_list[0]

     # identify the source of the given version

 

….

 

 

 

Thanks for helping out.

 

Sreeraj


Reply to: