summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-16 16:54:57 -0500
committerYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-16 16:54:57 -0500
commit12382700b221a1e29d539e36c241188d649885d6 (patch)
tree189d533018fad5d22ee00d72887fece2d9293e96
parent36786eb21aba788b54c85abdc3020dbec49ced50 (diff)
downloadfedora-devshell-12382700b221a1e29d539e36c241188d649885d6.tar.gz
fedora-devshell-12382700b221a1e29d539e36c241188d649885d6.tar.xz
fedora-devshell-12382700b221a1e29d539e36c241188d649885d6.zip
Two for one: removes args on getting source dir, turns it to a property, and puts the sourceball inside the packagesource dir.
I mean three for one, and snappy red uniforms. Damn!
-rw-r--r--modules/darcs.py9
-rw-r--r--modules/packagesource.py14
-rw-r--r--modules/sourceball.py13
3 files changed, 17 insertions, 19 deletions
diff --git a/modules/darcs.py b/modules/darcs.py
index ac1f013..5e3b352 100644
--- a/modules/darcs.py
+++ b/modules/darcs.py
@@ -95,14 +95,6 @@ class Darcs(RevisionControl):
'''
return self.cfg['hackage_name']
- def source(self, *args):
- '''the name of the directory where the source is being kept currently
-
- hackage_name is the canonical name of the package, this is
- just for handling branching and other nasty devilish tricks
- '''
- return self.cfg['source']
-
@contextmanager
def src_dir(self, *args):
'''executes a code block inside a specific branch and or checkout
@@ -231,6 +223,7 @@ class Darcs(RevisionControl):
% full_name)
p.communicate()
sourceball = full_name + '.tar.gz'
+ with pwd(self.branch_dir)
move(join(self.source_dir(), sourceball), sourceball)
self.cfg['sourceball'] = sourceball
diff --git a/modules/packagesource.py b/modules/packagesource.py
index 874483c..389af27 100644
--- a/modules/packagesource.py
+++ b/modules/packagesource.py
@@ -62,9 +62,15 @@ class PackageSource(Directory):
def setup_sourceball_w_patches(self):
raise NotImplementedError
- def source(self, *args):
- raise NotImplementedError
+ @property
+ def source(self):
+ '''the name of the directory where the source is being kept currently
+ '''
+ return self.cfg['source']
- def source_dir(self, *args):
- return join(self.dir, self.source(*args))
+ @property
+ def source_dir(self):
+ '''the absolute pathname of the directory where the source is being kept currently
+ '''
+ return join(self.dir, self.source)
diff --git a/modules/sourceball.py b/modules/sourceball.py
index a84a110..07a29e5 100644
--- a/modules/sourceball.py
+++ b/modules/sourceball.py
@@ -53,7 +53,7 @@ class SourceBall(PackageSource):
with pwd(self.branch_dir):
sourceball.extractall()
move(self.name, self.orig_dir(self.name))
- with pwd(self.parent):
+ with pwd(self.pkg_src_dir):
move(join(tmp_dir, sourceball_name), sourceball_name)
self.cfg['sourceball'] = sourceball_name
@@ -63,16 +63,15 @@ class SourceBall(PackageSource):
use for making patches against modified source'''
return dir + '_orig'
- def source(self, *args):
+ def set_cur_to(self, *args):
'''gives source directory
first parameter, if 'orig' gives the original source, otherwise
you get the modified source
'''
- if args[0] == 'orig':
- return join(self.branch, self.orig_dir(self.name))
- else:
- return self.name
-
+ if len(args) == 1 and args[0] == 'head':
+ self.cfg['source'] = '.'
+ elif len(args) == 1 and args[0] == 'orig':
+ self.cfg['source'] = join(self.branch, self.orig_dir(self.name))
__all__ = ['SourceBall']