From cda6081ad56a792fd116ec2350653b3e0ede3ea9 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Sun, 30 Jan 2011 15:40:39 -0700 Subject: Add an argument to override the "distribution" This allows developers to force fedpkg into not discovering the distribution based on branch name, and instead just take what the developer says it is. --- src/pyfedpkg/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/pyfedpkg') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 073169f..5ac11a0 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1067,7 +1067,7 @@ class PackageModule: return subprocess.Popen(['rpm --eval %{_arch}'], shell=True, stdout=subprocess.PIPE).communicate()[0].strip('\n') - def __init__(self, path=None): + def __init__(self, path=None, dist=None): # Initiate a PackageModule object in a given path # Set some global variables used throughout if not path: @@ -1091,7 +1091,10 @@ class PackageModule: raise FedpkgError('%s is not a valid repo' % path) # Find the branch and set things based from that # Still requires a 'branch' file in each branch - self.branch = self._findbranch() + if dist: + self.branch = dist + else: + self.branch = self._findbranch() if self.branch.startswith('f'): self.distval = self.branch.split('f')[1] self.distvar = 'fedora' -- cgit