summaryrefslogtreecommitdiffstats
path: root/modules/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/package.py')
-rw-r--r--modules/package.py32
1 files changed, 1 insertions, 31 deletions
diff --git a/modules/package.py b/modules/package.py
index a47d965..b548c58 100644
--- a/modules/package.py
+++ b/modules/package.py
@@ -19,8 +19,7 @@
from __future__ import with_statement
import tarfile
-from os import makedirs, getcwd, chdir, listdir
-from shutil import copyfileobj, copytree
+from os import makedirs, getcwd
from os.path import abspath, join, split, splitext, basename, exists
from configobj import ConfigObj
from subprocess import Popen, PIPE
@@ -97,35 +96,6 @@ class Package(Module):
log.error(str(e))
raise ExecutionException(e, 'spec-file could not be added')
- def orig_dir(self, dir):
- return dir + '_orig'
-
- def add_sourceball(self, sourceball_name, extract_dir=None):
- log.debug('addincg sourceball with code_dir ' + self.code_dir)
- with pwd(self.code_dir):
- try:
- sourceball_name = urlretrieve(sourceball_name,
- split(sourceball_name)[1])[0]
-
- self.cfg['sourceball'] = sourceball_name
- sourceball = tarfile.open(sourceball_name)
- if not extract_dir:
- extract_dir = min([(x.name, x) for x in sourceball])[0]
- extract_dir = basename(abspath(extract_dir))
- log.debug('extract_dir is %s' % extract_dir)
- log.debug('config is of ' + str(self.cfg))
- self.cfg['source'] = extract_dir
- log.debug('cfg[\'source\'] is ' + self.cfg['source'])
- log.debug('set source')
- orig_extract_dir = self.orig_dir(extract_dir)
- sourceball.extractall()
- copytree(abspath(extract_dir), abspath(orig_extract_dir))
- except OSError, e:
- #TODO: Fill this in with something better
- #Chances are the _orig dir already exists
- raise ExecutionException(e, 'something went wrong')
- #TODO: figure out what exceptions TarFile will throw
-
def close(self):
log.debug('writing self.cfg for package')
with pwd(self.code_dir):