diff options
author | Jesse Keating <jkeating@redhat.com> | 2011-01-30 15:40:39 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2011-01-30 15:48:50 -0700 |
commit | cda6081ad56a792fd116ec2350653b3e0ede3ea9 (patch) | |
tree | eb6c10dc2a3a1cc0066e31e4d8bdd2fbf97f56a7 /src/pyfedpkg | |
parent | a13b9ac7617e43a0e9f685cec994bc8ec750b75d (diff) | |
download | fedora-packager-cda6081ad56a792fd116ec2350653b3e0ede3ea9.tar.gz fedora-packager-cda6081ad56a792fd116ec2350653b3e0ede3ea9.tar.xz fedora-packager-cda6081ad56a792fd116ec2350653b3e0ede3ea9.zip |
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.
Diffstat (limited to 'src/pyfedpkg')
-rw-r--r-- | src/pyfedpkg/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
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' |