PDA

View Full Version : Python : how to handle .deb files ?



pef
August 3rd, 2005, 05:10 PM
Hello,

Does a module for python which handle .deb files exists ?

I'd like listing files, get the control file, etc from a deb file.

I've found python-apt and python-dpkg, but it doesn't suits me needs.


Thank you;)

LordHunter317
August 3rd, 2005, 05:16 PM
What do you need to do that python-apt and python-dpkg don't do?

I suppose you could always call dpkg-deb directly.

pef
August 3rd, 2005, 05:21 PM
What do you need to do that python-apt and python-dpkg don't do?

I suppose you could always call dpkg-deb directly.

Listing files installed by the package like dpkg -c foo.deb

I know I can use popen or so, but I would like to know if a more "pythonic" way exists ;-)

LordHunter317
August 3rd, 2005, 06:48 PM
Well, like I said, you could always call dpkg-deb directly. I don't know any better way if those two addons don't support that functionality.

Quest-Master
August 3rd, 2005, 09:21 PM
Or you could just use os.popen("dpkg something") and it would run the "dpkg something" command. If you needed to grab the output, just append a .read() onto it to make: os.poen("dpkg something").read()

LordHunter317
August 3rd, 2005, 09:30 PM
That is what I'm telling him to do, in so many words.