diff options
Diffstat (limited to 'src/pyfedpkg/__init__.py')
-rw-r--r-- | src/pyfedpkg/__init__.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index c130864..92bc7df 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1134,13 +1134,11 @@ class PackageModule: return subprocess.Popen(['rpm --eval %{_arch}'], shell=True, stdout=subprocess.PIPE).communicate()[0].strip('\n') - def __init__(self, path=None, dist=None): + def __init__(self, args): # Initiate a PackageModule object in a given path # Set some global variables used throughout - if not path: - path = os.getcwd() - log.debug('Creating module object from %s' % path) - self.path = path + log.debug('Creating module object from %s' % args.path) + self.path = args.path self.lookaside = LOOKASIDE self.lookasidehash = LOOKASIDEHASH self.spec = self.gimmespec() @@ -1153,13 +1151,13 @@ class PackageModule: self.anonkojisession = None # Setup the repo try: - self.repo = git.Repo(path) + self.repo = git.Repo(self.path) except git.errors.InvalidGitRepositoryError: - raise FedpkgError('%s is not a valid repo' % path) + raise FedpkgError('%s is not a valid repo' % self.path) # Find the branch and set things based from that # Still requires a 'branch' file in each branch - if dist: - self.branch = dist + if args.dist: + self.branch = args.dist else: self.branch = self._findbranch() if self.branch.startswith('f'): @@ -1192,11 +1190,11 @@ class PackageModule: self.target = 'dist-rawhide' self.mockconfig = 'fedora-devel-%s' % self.localarch self.override = None - self.rpmdefines = ["--define '_sourcedir %s'" % path, - "--define '_specdir %s'" % path, - "--define '_builddir %s'" % path, - "--define '_srcrpmdir %s'" % path, - "--define '_rpmdir %s'" % path, + self.rpmdefines = ["--define '_sourcedir %s'" % self.path, + "--define '_specdir %s'" % self.path, + "--define '_builddir %s'" % self.path, + "--define '_srcrpmdir %s'" % self.path, + "--define '_rpmdir %s'" % self.path, "--define 'dist .%s'" % self.dist, "--define '%s %s'" % (self.distvar, self.distval), "--define '%s 1'" % self.dist] |