diff options
author | Guido Günther <agx@sigxcpu.org> | 2019-10-07 11:23:13 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2019-10-07 13:49:11 +0200 |
commit | 11f9f31d52bf894e41728b25c0994f88ead3fedd (patch) | |
tree | e930c58089991a6640ec0a501d56900b6e2a7966 /gbp | |
parent | fb26fd9229f8a836e8ddef643e6e9c4c128dd2af (diff) |
export-orig: Check 'origin/pristine-tar' as well for compression type
Closes: #941894
Diffstat (limited to 'gbp')
-rwxr-xr-x | gbp/scripts/export_orig.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gbp/scripts/export_orig.py b/gbp/scripts/export_orig.py index 6a48502d..c2885014 100755 --- a/gbp/scripts/export_orig.py +++ b/gbp/scripts/export_orig.py @@ -235,14 +235,20 @@ def guess_comp_type(comp_type, source, repo, tarball_dir): comp_type = 'auto' if comp_type == 'auto': - if repo and repo.has_pristine_tar_branch(): + branch = None + if repo.has_branch('pristine-tar'): + branch = 'pristine-tar' + elif repo.has_branch('origin/pristine-tar', remote=True): + branch = 'origin/pristine-tar' + + if branch: regex = r'pristine-tar .* %s_%s\.orig.tar\.' % (source.name, source.upstream_version) - commits = repo.grep_log(regex, repo.pristine_tar_branch, merges=False) + commits = repo.grep_log(regex, branch, merges=False) if commits: commit = commits[-1] gbp.log.debug("Found pristine-tar commit at '%s'" % commit) else: - commit = repo.pristine_tar_branch + commit = branch tarball = repo.get_commit_info(commit)['subject'] (base_name, archive_fmt, comp_type) = Archive.parse_filename(tarball) gbp.log.debug("Determined compression type '%s'" % comp_type) @@ -250,8 +256,7 @@ def guess_comp_type(comp_type, source, repo, tarball_dir): comp_type = 'gzip' gbp.log.warn("Unknown compression type of %s, assuming %s" % (tarball, comp_type)) else: - if not tarball_dir: - tarball_dir = '..' + tarball_dir = tarball_dir or '..' detected = None for comp in Compressor.Opts.keys(): if du.DebianPkgPolicy.has_orig(source.upstream_tarball_name(comp), tarball_dir): |