操作RPM和DEB包的PYTHON模块

来源:互联网 发布:凌虚剑淘宝 编辑:程序博客网 时间:2024/05/22 14:58


python-rpm:

https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-rpm-programming-python.html


python-apt:

http://stackoverflow.com/questions/11727011/dpkg-python-module

http://apt.alioth.debian.org/python-apt-doc/


Actually, python-apt allows you to work with these files directly. Here's an example:

from apt.debfile import DebPackagefrom pprint import pprintpkg = DebPackage('/tmp/wajig_2.7_all.deb')pprint(pkg.filelist)

Output:

$ ./script.py['./', 'etc/', 'etc/bash_completion.d/', ... 'usr/bin/', 'usr/bin/wajig']

It's not as complete as I would like sadly, but it has a bunch of functionality.


0 0
原创粉丝点击