summaryrefslogtreecommitdiffstats
path: root/modules/package.py
diff options
context:
space:
mode:
authorYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-08 16:43:14 -0500
committerYaakov M. Nemoy <loupgaroublond@gmail.com>2009-01-08 16:43:14 -0500
commitc27ff3ce07de79215b58f5fd10ff175424cba7cb (patch)
treed7ab5511655050adf4905468b2b7e9ff15afde47 /modules/package.py
parent3bcae770792afe5d5fff2af127cad2c1d0d59d57 (diff)
downloadfedora-devshell-c27ff3ce07de79215b58f5fd10ff175424cba7cb.tar.gz
fedora-devshell-c27ff3ce07de79215b58f5fd10ff175424cba7cb.tar.xz
fedora-devshell-c27ff3ce07de79215b58f5fd10ff175424cba7cb.zip
adds 135 kilocraps of documentation
135 kilocraps = 1 metric craptonne
Diffstat (limited to 'modules/package.py')
-rw-r--r--modules/package.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/package.py b/modules/package.py
index c697067..af0a48e 100644
--- a/modules/package.py
+++ b/modules/package.py
@@ -38,6 +38,9 @@ class Package(Directory):
super(Package, self).make_dir(dir)
def add_spec(self, spec_file):
+ '''add's a spec file to the package, and sets the canonical package
+ name based on the spec file, possibly renaming the spec file to match
+ within fedora guidelines'''
log.debug('spec_file is %s' % spec_file)
log.debug('spec_file_name is %s' % self.name + '.spec')
#TODO: get the spec file name, copy
@@ -55,30 +58,38 @@ class Package(Directory):
@property
def spec_file(self):
+ '''returns the name of the spec file as it should be accordingto
+ fedora guidelines, good for double checking'''
return self.pkg_name + '.spec'
@property
def pkg_name(self):
+ '''canonical name of the package in a source repository'''
return self.cfg['pkg_name']
def get_srpm_name(self, profile):
+ '''given a profile, determines that the source rpm should be called'''
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)
def ver(self, profile=None):
+ '''given a profile, determines the version of the current spec file'''
with pwd(self.dir):
ver, rel = ver_rel(self.spec_file, profile.dist_defines if profile else '')
return ver
def source_dir(self, *args):
- return join(self.dir, self.source(*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
@property
def sourceball(self):
+ '''the current sourceball in use, for building packages'''
return self.cfg['sourceball']
__all__ = ['Package']