import rpm, sys
ts = rpm.TransactionSet()
file = ts.dbMatch('name', sys.argv[1])
for h in file:
print "%s-%s-%s.%s" % (h['name'], h['version'], h['release'], h['arch'])
Сейчас надо реализовать нечто подобное, но для Debian.
Какой модуль нужен для доступа к deb и... если такой вообще?
Гугл говорит, что было нечто известное как python-dpkg, но на странце проекта линк никуда меня не привел
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” (Brian Kernighan)
Пакет: python-debian
Описание: Python modules to work with Debian-related data formats
This package provides Python modules that abstract many formats of Debian related files. Currently handled are:
* Debtags information (debian.debtags module)
* debian/changelog (debian.changelog module)
* Packages files, pdiffs (debian.debian_support module)
* Control files of single or multiple RFC822-style paragraphs, e.g. debian/control, .changes, .dsc, Packages, Sources, Release, etc. (debian.deb822 module)
* Raw .deb and .ar files, with (read-only) access to contained files and meta-information