diff options
Diffstat (limited to 'modules/package.py')
-rw-r--r-- | modules/package.py | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/modules/package.py b/modules/package.py index af0a48e..8fdeb93 100644 --- a/modules/package.py +++ b/modules/package.py @@ -21,15 +21,14 @@ from __future__ import with_statement from os.path import split from base.base import log +from base.dirfactory import DirFactory from base.exceptions import ExecutionException from base.util import pwd, copy, move from base.profiles import ver_rel, name from modules.directory import Directory - class Package(Directory): - _type = 'package' # These two methods are here as examples. def load_dir(self, dir): super(Package, self).load_dir(dir) @@ -79,17 +78,28 @@ class Package(Directory): ver, rel = ver_rel(self.spec_file, profile.dist_defines if profile else '') return ver - def source_dir(self, *args): - '''provides an absolute pathname for where the primary source is unpacked''' - return join(self.dir, self.source(*args)) + @property + def sources(self): + return self.cfg['sources'] + + def add_source(self, source_dir): + source = DirFactory(source_dir) + if not source.name in self.sources: + self.cfg['sources'].append(source.name) + +# These don't make sense anymore +# TODO: Figure out the API to iterate over PackageSources where *args should be diff for each one +# def source_dir(self, *args): +# '''provides an absolute pathname for where the primary source is unpacked''' +# return join(self.dir, self.source(*args)) - def source(self, *args): - '''base method that should return where the source is kept to some yet unknown criteria''' - raise NotImplementedError +# def source(self, *args): +# '''base method that should return where the source is kept to some yet unknown criteria''' +# raise NotImplementedError - @property - def sourceball(self): - '''the current sourceball in use, for building packages''' - return self.cfg['sourceball'] +# @property +# def sourceball(self): +# '''the current sourceball in use, for building packages''' +# return self.cfg['sourceball'] __all__ = ['Package'] |