summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-19 17:19:20 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-21 10:33:36 +0200
commitda5daecccc31697ff9338024cb55a2bf25bb9aab (patch)
tree2b0e85d5d2f72a8fb57a574497157f767a232dd5 /gbp
parent4d6fbbbe2a87cc0943ff231d7b2ff8d74f468c92 (diff)
downloadgit-buildpackage-da5daecccc31697ff9338024cb55a2bf25bb9aab.tar.gz
git-buildpackage-da5daecccc31697ff9338024cb55a2bf25bb9aab.tar.bz2
git-buildpackage-da5daecccc31697ff9338024cb55a2bf25bb9aab.zip
buildpackage-rpm: look for remote upstream branches
Consider remote branches, too, while looking for the upstream branch when trying to guess if a package is native or not. Change-Id: I3dbbb49816d1d294d81209ea5ab5870e053fd66a Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp')
-rwxr-xr-xgbp/scripts/buildpackage_rpm.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py
index dcfa3ace..4b24723a 100755
--- a/gbp/scripts/buildpackage_rpm.py
+++ b/gbp/scripts/buildpackage_rpm.py
@@ -288,7 +288,17 @@ def export_patches(repo, spec, export_treeish, options):
def is_native(repo, options):
"""Determine whether a package is native or non-native"""
if options.native.is_auto():
- return not repo.has_branch(options.upstream_branch)
+ if repo.has_branch(options.upstream_branch):
+ return False
+ # Check remotes, too
+ for remote_branch in repo.get_remote_branches():
+ remote, branch = remote_branch.split('/', 1)
+ if branch == options.upstream_branch:
+ gbp.log.debug("Found upstream branch '%s' from remote '%s'" %
+ (remote, branch))
+ return False
+ return True
+
return options.native.is_on()