操作RPM和DEB包的PYTHON模块


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 DebPackage
from pprint import pprint
pkg = 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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值