summaryrefslogtreecommitdiffstats
path: root/modules/package.py
diff options
context:
space:
mode:
authorYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-08 15:27:45 -0500
committerYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-08 15:27:45 -0500
commit3bcae770792afe5d5fff2af127cad2c1d0d59d57 (patch)
treeb89e5835589ebd222d42c46943e38452f9faa6c6 /modules/package.py
parent84211749a73cbff248192519c0f458806b1fb065 (diff)
downloadfedora-devshell-3bcae770792afe5d5fff2af127cad2c1d0d59d57.tar.gz
fedora-devshell-3bcae770792afe5d5fff2af127cad2c1d0d59d57.tar.xz
fedora-devshell-3bcae770792afe5d5fff2af127cad2c1d0d59d57.zip
Got rid of non absolute _dir properties.
In effect, anything that ends in dir shoud usually return an absolute path. The absolute path is dynamically determined using utility functions based on the load time settings of a directory object. This both reduces the number of path ambiguities based on the cwd, and yet removes as many absolute paths from config files, so directory objects can be shared between workspaces and developers.
Diffstat (limited to 'modules/package.py')
-rw-r--r--modules/package.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/modules/package.py b/modules/package.py
index 983a2aa..c697067 100644
--- a/modules/package.py
+++ b/modules/package.py
@@ -43,7 +43,7 @@ class Package(Directory):
#TODO: get the spec file name, copy
# Then get the actual package name and set pkg_name to the right one
spec_fname = split(spec_file)[1]
- with pwd(self.code_dir):
+ with pwd(self.dir):
try:
copy(spec_file, spec_fname)
self.cfg['pkg_name'] = name(spec_fname)
@@ -58,17 +58,11 @@ class Package(Directory):
return self.pkg_name + '.spec'
@property
- def code_dir(self):
- # this is a hack for some refactoring backwards compatibility
- #TODO: replace code_dir with just dir
- return self.cfg['dir']
-
- @property
def pkg_name(self):
return self.cfg['pkg_name']
def get_srpm_name(self, profile):
- with pwd(self.code_dir):
+ with pwd(self.dir):
ver, rel = ver_rel(self.spec_file, profile.dist_defines)
return '%s-%s-%s.src.rpm' % (self.pkg_name, ver, rel)
@@ -78,6 +72,9 @@ class Package(Directory):
return ver
def source_dir(self, *args):
+ return join(self.dir, self.source(*args)
+
+ def source(self, *args):
raise NotImplementedError
@property