diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-05-15 10:02:40 +0300 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-07-24 19:41:29 +0200 |
commit | 7f6b72e039efa5e2c3517b9336f9b29b4cb65c71 (patch) | |
tree | d50d9136847892a9de5fbdf7614a731ad4e8a380 /gbp/scripts | |
parent | 36c8e5cd00fd600be63160b0ef9427a70ab45870 (diff) |
Move get_compression() out of pkg.PkgPolicy class
Renames the function to parse_archive_filename() and changes it's
return values. Filename parsing is merely generic functionality, not
tied to any packaging policy.
The function now returns the base name of the file (that is, filename
without, archive and compression extensions), archive format and
compression method. Adds supported archive formats 'tar' and 'zip' and
file extension aliases, e.g. 'tgz'.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/scripts')
-rwxr-xr-x | gbp/scripts/buildpackage.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 0ef6e9c..8d79e8b 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -37,7 +37,8 @@ from gbp.scripts.common.buildpackage import (index_name, wc_name, git_archive_submodules, git_archive_single, dump_tree, write_wc, drop_index) -from gbp.pkg import (UpstreamSource, compressor_opts, compressor_aliases) +from gbp.pkg import (UpstreamSource, compressor_opts, compressor_aliases, + parse_archive_filename) def git_archive(repo, cp, output_dir, treeish, comp_type, comp_level, with_submodules): "create a compressed orig tarball in output_dir using git_archive" @@ -318,7 +319,7 @@ def guess_comp_type(repo, comp_type, cp, tarball_dir): else: commit = repo.pristine_tar_branch tarball = repo.get_commit_info(commit)['subject'] - comp_type = du.DebianPkgPolicy.get_compression(tarball) + (base_name, archive_fmt, comp_type) = parse_archive_filename(tarball) gbp.log.debug("Determined compression type '%s'" % comp_type) if not comp_type: comp_type = 'gzip' |