diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-10-08 14:57:54 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-10-08 14:57:54 +0100 |
commit | a04884d9a79c296023a555279f727a4dc17b5523 (patch) | |
tree | aa9d49ad23bd82fac47411df6368272f12c69727 | |
parent | 4019372195cf50a00ff13e3a2dfa1b2781ea15e7 (diff) | |
parent | 8e11f8f59d59c0d9f9a2cc517eeef47a1a200fb1 (diff) | |
download | morph-a04884d9a79c296023a555279f727a4dc17b5523.tar.gz |
Merge branch 'master' of git://git.baserock.org/baserock/morph
-rw-r--r-- | morphlib/cachedrepo.py | 6 | ||||
-rw-r--r-- | morphlib/plugins/tarball-systembuilder_plugin.py | 15 |
2 files changed, 20 insertions, 1 deletions
diff --git a/morphlib/cachedrepo.py b/morphlib/cachedrepo.py index f0ca627b..c40cb657 100644 --- a/morphlib/cachedrepo.py +++ b/morphlib/cachedrepo.py @@ -271,7 +271,11 @@ class CachedRepo(object): raise CheckoutError(self, ref, target_dir) def _update(self): # pragma: no cover - self._runcmd(['git', 'remote', 'update', 'origin', '--prune']) + try: + self._runcmd(['git', 'remote', 'update', 'origin', '--prune']) + except cliapp.AppException, ae: + self._runcmd(['git', 'remote', 'prune', 'origin']) + self._runcmd(['git', 'remote', 'update', 'origin']) def __str__(self): # pragma: no cover return self.url diff --git a/morphlib/plugins/tarball-systembuilder_plugin.py b/morphlib/plugins/tarball-systembuilder_plugin.py index fd70fcd9..9f805cde 100644 --- a/morphlib/plugins/tarball-systembuilder_plugin.py +++ b/morphlib/plugins/tarball-systembuilder_plugin.py @@ -50,6 +50,21 @@ class RootfsTarballBuilder(SystemKindBuilder): # pragma: no cover self.unpack_strata(fs_root) self.create_fstab(fs_root) self.copy_kernel_into_artifact_cache(fs_root) + unslashy_root = fs_root[1:] + def uproot_info(info): + if info.name == unslashy_root: + info.name = "." + elif info.name.startswith(unslashy_root): + info.name = "." + info.name[len(unslashy_root):] + return info + artiname = self.artifact.source.morphology['name'] + tar = tarfile.TarFile.gzopen(fileobj=handle, mode="w", + compresslevel=1, + name=artiname) + self.app.status(msg='Constructing tarball of root filesystem', + chatty=True) + tar.add(fs_root, recursive=True, filter=uproot_info) + tar.close() except BaseException, e: logging.error(traceback.format_exc()) self.app.status(msg='Error while building system', |