Gentoo Archives: gentoo-catalyst

From: Rick Farina <sidhayn@×××××.com>
To: gentoo-catalyst@l.g.o
Cc: Rick Farina <sidhayn@×××××.com>
Subject: [gentoo-catalyst] [PATCH] Support snapshot.tar.xz
Date: Wed, 22 Aug 2012 03:03:36
Message-Id: 1345597124-28151-1-git-send-email-sidhayn@gmail.com
1 This patch adds in support for automatically detecting and decompressing
2 both formats gentoo currently ships portage snapshots in. To make the
3 change as minimal as possible I am using recent gnu tar ability to
4 automatically pick the correct format and decompress. This may not work
5 as expected on *bsd or MacOSX unless we already require gnu tar on those
6 platforms.
7
8 Signed-off-by: Rick Farina <sidhayn@×××××.com>
9 ---
10 modules/generic_stage_target.py | 13 ++++++++-----
11 1 files changed, 8 insertions(+), 5 deletions(-)
12
13 diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
14 index c4ef239..031d8bf 100644
15 --- a/modules/generic_stage_target.py
16 +++ b/modules/generic_stage_target.py
17 @@ -404,12 +404,15 @@ class generic_stage_target(generic_target):
18
19 def set_snapshot_path(self):
20 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
21 - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
22 + "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
23
24 if os.path.exists(self.settings["snapshot_path"]):
25 self.settings["snapshot_path_hash"]=\
26 generate_hash(self.settings["snapshot_path"],\
27 hash_function=self.settings["hash_function"],verbose=False)
28 + else:
29 + self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
30 + "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
31
32 def set_snapcache_path(self):
33 if self.settings.has_key("SNAPCACHE"):
34 @@ -635,7 +638,7 @@ class generic_stage_target(generic_target):
35 self.settings["source_path"]+"\nto "+\
36 self.settings["chroot_path"]+\
37 " (This may take some time) ...\n"
38 - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\
39 + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\
40 self.settings["chroot_path"]
41 error_msg="Tarball extraction of "+\
42 self.settings["source_path"]+" to "+\
43 @@ -646,7 +649,7 @@ class generic_stage_target(generic_target):
44 self.settings["source_path"]+"\nto "+\
45 self.settings["chroot_path"]+\
46 " (This may take some time) ...\n"
47 - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\
48 + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\
49 self.settings["chroot_path"]
50 error_msg="Tarball extraction of "+self.settings["source_path"]+\
51 " to "+self.settings["chroot_path"]+" failed."
52 @@ -744,7 +747,7 @@ class generic_stage_target(generic_target):
53 read_from_clst(self.settings["snapshot_cache_path"]+\
54 "catalyst-hash")
55 destdir=self.settings["snapshot_cache_path"]
56 - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+destdir
57 + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir
58 unpack_errmsg="Error unpacking snapshot"
59 cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\
60 self.settings["snapshot_cache_path"]+\
61 @@ -760,7 +763,7 @@ class generic_stage_target(generic_target):
62 cleanup_errmsg="Error removing existing snapshot directory."
63 cleanup_msg=\
64 "Cleaning up existing portage tree (This can take a long time)..."
65 - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+\
66 + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\
67 self.settings["chroot_path"]+"/usr"
68 unpack_errmsg="Error unpacking snapshot"
69
70 --
71 1.7.8.6

Replies

Subject Author
[gentoo-catalyst] Re: [PATCH] Support snapshot.tar.xz Richard Farina <sidhayn@×××××.com>
Re: [gentoo-catalyst] [PATCH] Support snapshot.tar.xz Matt Turner <mattst88@g.o>