summaryrefslogtreecommitdiff
path: root/morphlib/plugins
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-10-09 09:56:37 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-10-09 13:12:39 +0000
commitcaa574e146ebd09555b717b8aa456fdde0a0d32a (patch)
treeec6fdd6b2c54ba8bcf3828f89a4bc06e1ba7b704 /morphlib/plugins
parent9a906c35aefe1e4a6d7ea9b4fb0ca6233728f497 (diff)
downloadmorph-caa574e146ebd09555b717b8aa456fdde0a0d32a.tar.gz
Use os.path.relpath for fixing paths in tarball system builder
Diffstat (limited to 'morphlib/plugins')
-rw-r--r--morphlib/plugins/tarball-systembuilder_plugin.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/morphlib/plugins/tarball-systembuilder_plugin.py b/morphlib/plugins/tarball-systembuilder_plugin.py
index 9f805cde..ca218ac0 100644
--- a/morphlib/plugins/tarball-systembuilder_plugin.py
+++ b/morphlib/plugins/tarball-systembuilder_plugin.py
@@ -17,6 +17,7 @@
import json
import logging
import os
+from os.path import relpath
import shutil
import time
from collections import defaultdict
@@ -52,10 +53,7 @@ class RootfsTarballBuilder(SystemKindBuilder): # pragma: no cover
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):]
+ info.name = relpath(info.name, unslashy_root)
return info
artiname = self.artifact.source.morphology['name']
tar = tarfile.TarFile.gzopen(fileobj=handle, mode="w",