diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-09-15 10:29:07 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-09-15 12:50:11 +0200 |
commit | 6abb9e8bf06dfc582fa38b1895a47b25b02c55da (patch) | |
tree | a60fb54bdbba0f22e73166024cabf2bea4f4f9ac /gbp/scripts/buildpackage.py | |
parent | 65a043dbf8662e465365543711510d02e0c87c21 (diff) |
buildpackage: don't require debian/ prefix for --git-dist=DEP14 to work
Diffstat (limited to 'gbp/scripts/buildpackage.py')
-rwxr-xr-x | gbp/scripts/buildpackage.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 1517b4b3..78d32941 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -199,6 +199,7 @@ def get_pbuilder_dist(options, repo, native=False): """ Determin the dist to build for with pbuilder/cowbuilder """ + dist = None if options.pbuilder_dist == 'DEP14': vendor = du.get_vendor().lower() branch = repo.branch @@ -206,15 +207,20 @@ def get_pbuilder_dist(options, repo, native=False): raise GbpError("Failed to setup DIST for %s. " "Can't determine current branch." % options.builder) parts = branch.rsplit('/') - if len(parts) == 2: + if len(parts) == 2: # e.g. debian/stretch suite = parts[1] if vendor == parts[0]: dist = '' if suite in ['sid', 'master'] else suite else: dist = '%s_%s' % (parts[0], suite) - elif len(parts) == 1 and native and branch in ['master', 'sid']: - dist = '' - else: + # Branches in Debian often omit the debian/ prefix + elif len(parts) == 1 and vendor.lower() == "debian": + if branch in ['master', 'sid']: + dist = '' + elif branch in du.Releases: + dist = branch + + if dist is None: raise GbpError("DEP14 DIST: Current branch '%s' does not match vendor/suite" % branch) else: dist = options.pbuilder_dist |