aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2014-06-23 08:01:34 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2014-06-23 08:01:34 -0700
commiteff0dd022fe886f6c58d477d56d117161ba4574c (patch)
tree09adb6cd545f644543d31729952338263cce4cdb
parentgeneric_stage_target: Add a trailing / to the cp /etc/reolv.conf command (diff)
downloadcatalyst-old/tar-volume-label.tar.gz
catalyst-old/tar-volume-label.tar.bz2
catalyst-old/tar-volume-label.zip
generic_stage_target, snapshot_target: tarball handlingold/tar-volume-label
- add a volume label for easier recognition of renamed tarballs - Use posix-format tar files explicitly Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--catalyst/targets/generic_stage_target.py10
-rw-r--r--catalyst/targets/snapshot_target.py6
2 files changed, 12 insertions, 4 deletions
diff --git a/catalyst/targets/generic_stage_target.py b/catalyst/targets/generic_stage_target.py
index 1f26e65..275416c 100644
--- a/catalyst/targets/generic_stage_target.py
+++ b/catalyst/targets/generic_stage_target.py
@@ -1246,6 +1246,8 @@ class generic_stage_target(generic_target):
else:
""" Capture target in a tarball """
mypath=self.settings["target_path"].split("/")
+ """ Capture filename for use in label """
+ filename=mypath[-1]
""" Remove filename from path """
mypath=string.join(mypath[:-1],"/")
@@ -1255,9 +1257,11 @@ class generic_stage_target(generic_target):
print "Creating stage tarball..."
- cmd("tar -I lbzip2 -cpf "+self.settings["target_path"]+" -C "+\
- self.settings["stage_path"]+" .",\
- "Couldn't create stage tarball",env=self.env)
+ cmd("tar -I lbzip2 -cpf "+self.settings["target_path"]+" -C "+
+ self.settings["stage_path"]+" ." +
+ " --posix -V "+filename,
+ "Couldn't create stage tarball",
+ env=self.env)
self.gen_contents_file(self.settings["target_path"])
self.gen_digest_file(self.settings["target_path"])
diff --git a/catalyst/targets/snapshot_target.py b/catalyst/targets/snapshot_target.py
index d1b9e40..845bc05 100644
--- a/catalyst/targets/snapshot_target.py
+++ b/catalyst/targets/snapshot_target.py
@@ -52,9 +52,13 @@ class snapshot_target(generic_stage_target):
self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
"Snapshot failure", env=self.env)
+ mypath=self.settings["snapshot_path"].split("/")
+ filename=mypath[-1]
+
print "Compressing Portage snapshot tarball..."
cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
- mytmp + " " + self.settings["repo_name"],
+ mytmp + " " + self.settings["repo_name"] +
+ " --posix -V "+filename,
"Snapshot creation failure",env=self.env)
self.gen_contents_file(self.settings["snapshot_path"])