commit:     2fea87234ffc48c3dd96f1204b27f667f5ade3a3
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo 
<DOT> org>
AuthorDate: Sat Dec  6 16:48:27 2014 +0000
Commit:     Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
CommitDate: Sat Dec  6 16:48:27 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=2fea8723

Add --xattrs and --acls to the tar calls so we don't lose file properties while 
building the stages - should fix bug 531788.

Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> 
gentoo.org>

---
 modules/catalyst_support.py     |  6 +++---
 modules/generic_stage_target.py | 18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py
index 8112ed0..0e9faac 100644
--- a/modules/catalyst_support.py
+++ b/modules/catalyst_support.py
@@ -108,9 +108,9 @@ contents_map={
        # 'find' is disabled because it requires the source path, which is not
        # always available
        #"find"         :[calc_contents,"find %(path)s"],
-       "tar-tv":[calc_contents,"tar tvf %(file)s"],
-       "tar-tvz":[calc_contents,"tar tvzf %(file)s"],
-       "tar-tvj":[calc_contents,"tar -I lbzip2 -tvf %(file)s"],
+       "tar-tv":[calc_contents,"tar --xattrs --acls tvf %(file)s"],
+       "tar-tvz":[calc_contents,"tar --xattrs --acls tvzf %(file)s"],
+       "tar-tvj":[calc_contents,"tar --xattrs --acls -I lbzip2 -tvf %(file)s"],
        "isoinfo-l":[calc_contents,"isoinfo -l -i %(file)s"],
        # isoinfo-f should be a last resort only
        "isoinfo-f":[calc_contents,"isoinfo -f -i %(file)s"],

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 6852b7e..62f532b 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -660,10 +660,10 @@ class generic_stage_target(generic_target):
                                        self.settings["chroot_path"]+\
                                                " (This may take some time) 
...\n"
                                if "bz2" == self.settings["chroot_path"][-3:]:
-                                       unpack_cmd="tar -I lbzip2 -xpf 
"+self.settings["source_path"]+" -C "+\
+                                       unpack_cmd="tar --xattrs --acls -I 
lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
                                                self.settings["chroot_path"]
                                else:
-                                       unpack_cmd="tar -I lbzip2 -xpf 
"+self.settings["source_path"]+" -C "+\
+                                       unpack_cmd="tar --xattrs --acls -I 
lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
                                                self.settings["chroot_path"]
                                error_msg="Tarball extraction of "+\
                                        self.settings["source_path"]+" to "+\
@@ -675,10 +675,10 @@ class generic_stage_target(generic_target):
                                self.settings["chroot_path"]+\
                                " (This may take some time) ...\n"
                        if "bz2" == self.settings["chroot_path"][-3:]:
-                               unpack_cmd="tar -I lbzip2 -xpf 
"+self.settings["source_path"]+" -C "+\
+                               unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf 
"+self.settings["source_path"]+" -C "+\
                                        self.settings["chroot_path"]
                        else:
-                               unpack_cmd="tar -I lbzip2 -xpf 
"+self.settings["source_path"]+" -C "+\
+                               unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf 
"+self.settings["source_path"]+" -C "+\
                                        self.settings["chroot_path"]
                        error_msg="Tarball extraction of 
"+self.settings["source_path"]+\
                                " to "+self.settings["chroot_path"]+" failed."
@@ -777,9 +777,9 @@ class generic_stage_target(generic_target):
                                "catalyst-hash")
                        destdir=self.settings["snapshot_cache_path"]
                        if "bz2" == self.settings["chroot_path"][-3:]:
-                               unpack_cmd="tar -I lbzip2 -xpf 
"+self.settings["snapshot_path"]+" -C "+destdir
+                               unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf 
"+self.settings["snapshot_path"]+" -C "+destdir
                        else:
-                               unpack_cmd="tar xpf 
"+self.settings["snapshot_path"]+" -C "+destdir
+                               unpack_cmd="tar --xattrs --acls xpf 
"+self.settings["snapshot_path"]+" -C "+destdir
                        unpack_errmsg="Error unpacking snapshot"
                        cleanup_msg="Cleaning up invalid snapshot cache at 
\n\t"+\
                                self.settings["snapshot_cache_path"]+\
@@ -796,10 +796,10 @@ class generic_stage_target(generic_target):
                        cleanup_msg=\
                                "Cleaning up existing portage tree (This can 
take a long time)..."
                        if "bz2" == self.settings["chroot_path"][-3:]:
-                               unpack_cmd="tar -I lbzip2 -xpf 
"+self.settings["snapshot_path"]+" -C "+\
+                               unpack_cmd="tar --xattrs --acls -I lbzip2 -xpf 
"+self.settings["snapshot_path"]+" -C "+\
                                        self.settings["chroot_path"]+"/usr"
                        else:
-                               unpack_cmd="tar xpf 
"+self.settings["snapshot_path"]+" -C "+\
+                               unpack_cmd="tar --xattrs --acls xpf 
"+self.settings["snapshot_path"]+" -C "+\
                                        self.settings["chroot_path"]+"/usr"
                        unpack_errmsg="Error unpacking snapshot"
 
@@ -1224,7 +1224,7 @@ class generic_stage_target(generic_target):
 
                        print "Creating stage tarball..."
 
-                       cmd("tar -I lbzip2 -cpf 
"+self.settings["target_path"]+" -C "+\
+                       cmd("tar --xattrs --acls -I lbzip2 -cpf 
"+self.settings["target_path"]+" -C "+\
                                self.settings["stage_path"]+" .",\
                                "Couldn't create stage tarball",env=self.env)
 

Reply via email to