diff options
Diffstat (limited to 'modules/sourceball.py')
| -rw-r--r-- | modules/sourceball.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/sourceball.py b/modules/sourceball.py index 38abf1f..17d6def 100644 --- a/modules/sourceball.py +++ b/modules/sourceball.py @@ -28,7 +28,7 @@ from tempfile import mkdtemp from base.base import log from base.dirfactory import DirFactory from base.exceptions import ExecutionException -from base.util import pwd, copy, move +from base.util import pwd, copy, move, base_dir from modules.packagesource import PackageSource @@ -39,16 +39,17 @@ class SourceBall(PackageSource): tmp_dir = mkdtemp() with pwd(tmp_dir): sourceball_name = copy(tarball, split(tarball)[1]) + log.debug('sourceball_name ' + sourceball_name) sourceball = tarfile.open(sourceball_name) - extract_dir = min([(x.name, x) for x in sourceball])[0] - extract_dir = basename(abspath(extract_dir)) + extract_dir = base_dir(sourceball) if name and not name == extract_dir: + log.debug('hahahahhaah') raise ExecutionException("tarball is not target directory") if not name: name = extract_dir super(SourceBall, self).__init__(name) if tarball: - with pwd(self.dir): + with pwd(self.parent): sourceball.extractall() with pwd(self.branch_dir): sourceball.extractall() |
