Common functionality of the Debian/RPM package helpers

Module pristinetar Handle checkin and checkout of archives from the pristine-tar branch

From the __init__.py module:

Class PkgPolicy Common helpers for packaging policy.
Class UpstreamSource Upstream source. Can be either an unpacked dir, a tarball or another type of archive
Variable archive_ext_aliases Undocumented
Variable archive_formats Undocumented
Variable compressor_aliases Undocumented
Variable compressor_opts Undocumented
Function parse_archive_filename Given an filename return the basename (i.e. filename without the archive and compression extensions), archive format and compression method used.
compressor_opts =
Undocumented
(type: Dict[str, List])
compressor_aliases =
Undocumented
(type: Dict[str, str])
archive_formats =
Undocumented
(type: List[str])
archive_ext_aliases =
Undocumented
(type: Dict)
def parse_archive_filename(filename):

Given an filename return the basename (i.e. filename without the archive and compression extensions), archive format and compression method used.

Parametersfilenamethe name of the file (type: string)
Returnstuple containing basename, archive format and compression method (type: tuple of str
>>> parse_archive_filename("abc.tar.gz")
('abc', 'tar', 'gzip')
>>> parse_archive_filename("abc.tar.bz2")
('abc', 'tar', 'bzip2')
>>> parse_archive_filename("abc.def.tbz2")
('abc.def', 'tar', 'bzip2')
>>> parse_archive_filename("abc.def.tar.xz")
('abc.def', 'tar', 'xz')
>>> parse_archive_filename("abc.zip")
('abc', 'zip', None)
>>> parse_archive_filename("abc.lzma")
('abc', None, 'lzma')
>>> parse_archive_filename("abc.tar.foo")
('abc.tar.foo', None, None)
>>> parse_archive_filename("abc")
('abc', None, None)
)
API Documentation for git-buildpackage, generated by pydoctor at 2021-05-14 08:50:00.