Reading files from .ar / .deb archives
Ben Finney
ben+python at benfinney.id.au
Wed Nov 25 01:48:55 EST 2015
Кисик Мурысик <kisik2010 at live.ru> writes:
> Hello!
> I'm new to Python, so I decided to learn it
Congratulations! Python is a fine language to learn, and this is the
place to discuss general Python topics.
You may also want to join the ‘tutor’ forum
<URL:https://mail.python.org/mailman/listinfo/tutor>, which is
specifically focussed on collaborative mentoring of Python newcomers.
> and write simple apt alternative (apt is somewhat broken for me).
> But I can't decide - can I read just one file (/DEBIAN/control) from
> archive without unpacking it, or do I need to unpack? And what module
> I can use to handle .ar files? (I read in Wikipedia that .deb is just
> .ar archive with specific structure)
You're right. The ‘ar’ archive format was IIUC chosen by the early
Debian project because it is very simple.
Unfortunately it is not widely supported; there is no standard library
support in Python for ‘ar’ archives.
You can use the third-party ‘python-debian’ library for reading Debian
archive files <URL:https://pypi.python.org/pypi/python-debian/>.
--
\ “I know when I'm going to die, because my birth certificate has |
`\ an expiration date.” —Steven Wright |
_o__) |
Ben Finney
More information about the Python-list
mailing list