diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-10-17 20:50:58 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-10-17 20:50:58 +0100 |
commit | 98507401bd5e3d52b448c7890f952f1a5ff01567 (patch) | |
tree | f96de8a09bc4639e4106f3ff117cb3f8f87a66d4 /morphlib/builder.py | |
parent | ac699d56f600ff7109af0bf1c7a3744c49ebc4b5 (diff) | |
download | morph-98507401bd5e3d52b448c7890f952f1a5ff01567.tar.gz |
Start a git module for abstracting away git operations.
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r-- | morphlib/builder.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py index c5d1cb8c..6faa72b1 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -19,6 +19,7 @@ import logging import os import shutil import StringIO +import tarfile import urlparse import morphlib @@ -92,13 +93,12 @@ class Builder(object): '''Export sources from git into the ``self._build`` directory.''' logging.debug('Creating build tree at %s' % self._build) + tarball = self.tempdir.join('sources.tar.gz') + morphlib.git.export_sources(repo, ref, tarball) os.mkdir(self._build) - tarball = self.tempdir.join('sources.tar') - self.ex.runv(['git', 'archive', - '--output', tarball, - '--remote', repo, - ref]) - self.ex.runv(['tar', '-C', self._build, '-xf', tarball]) + f = tarfile.open(tarball) + f.extractall(path=self._build) + f.close() os.remove(tarball) def create_chunk(self, morph, repo, ref): |