diff options
author | Yaakov M. Nemoy <loupgaroublond@gmail.com> | 2009-01-16 17:26:39 -0500 |
---|---|---|
committer | Yaakov M. Nemoy <loupgaroublond@gmail.com> | 2009-01-16 17:26:39 -0500 |
commit | ad4446f7713b6a15433aacf26573eb60de04eed0 (patch) | |
tree | 773b3762bfbefaeaab4f5b701c9c5a70ff143b0a | |
parent | 12382700b221a1e29d539e36c241188d649885d6 (diff) | |
download | fedora-devshell-ad4446f7713b6a15433aacf26573eb60de04eed0.tar.gz fedora-devshell-ad4446f7713b6a15433aacf26573eb60de04eed0.tar.xz fedora-devshell-ad4446f7713b6a15433aacf26573eb60de04eed0.zip |
Miscellaneous fixes
-rw-r--r-- | modules/darcs.py | 38 | ||||
-rw-r--r-- | modules/packagesource.py | 2 |
2 files changed, 21 insertions, 19 deletions
diff --git a/modules/darcs.py b/modules/darcs.py index 5e3b352..b6a4d96 100644 --- a/modules/darcs.py +++ b/modules/darcs.py @@ -162,10 +162,10 @@ class Darcs(RevisionControl): log.debug('index dir should be ' + index_dir) self.get(self.source(), index_dir, *args) self.cfg['source'] = index_dir - self.set_current_src() if branch_name: with pwd(self.branch_dir): self.get(index, branch_name) + self.set_current_src() def set_cur_to_patch(self, hash): '''sets the current branch to fork off a particular hash''' @@ -206,25 +206,27 @@ class Darcs(RevisionControl): yield - def setup_sourceball(self, ver): + def setup_sourceball(self, ver, delete_old=False): '''gets darcs to spit out a sourceball to be used in rpm making by other modules''' log.debug('someone set us up the bomb') - with pwd(self.dir): - with pwd(self.source_dir()): - name = self.hackage_name - date = self.date - full_name = '%s-%s.%sdarcs' % (name, ver, date) - log.debug('full name is ' + full_name) - with log_file('darcs.log') as darcs_out: - log.debug('we get signal') - p = Popen(['darcs', 'dist', '-d', full_name], - stdout=darcs_out, stderr=darcs_out) - log.info('generating tarball %s.tar.gz, please wait...' - % full_name) - p.communicate() - sourceball = full_name + '.tar.gz' - with pwd(self.branch_dir) - move(join(self.source_dir(), sourceball), sourceball) + if delete_old: + with pwd(self.pkg_src_dir): + rm(self.sourceball) + name = self.hackage_name + date = self.date + full_name = '%s-%s.%sdarcs' % (name, ver, date) + log.debug('full name is ' + full_name) + sourceball = full_name + '.tar.gz' + with pwd(self.source_dir): + with log_file('darcs.log') as darcs_out: + log.debug('we get signal') + p = Popen(['darcs', 'dist', '-d', full_name], + stdout=darcs_out, stderr=darcs_out) + log.info('generating tarball %s.tar.gz, please wait...' + % full_name) + p.communicate() + with pwd(self.pkg_src_dir): + move(join(self.source_dir, sourceball), sourceball) self.cfg['sourceball'] = sourceball __all__ = ['Darcs'] diff --git a/modules/packagesource.py b/modules/packagesource.py index 389af27..bfead67 100644 --- a/modules/packagesource.py +++ b/modules/packagesource.py @@ -54,7 +54,7 @@ class PackageSource(Directory): @property def sourceball_loc(self): - return join(self.parent, self.sourceball) + return join(self.pkg_src_dir, self.sourceball) def setup_sourceball(self): raise NotImplementedError |