Gentoo Archives: gentoo-commits

From: "Jorge Manuel B. S. Vicetto" <jmbsvicetto@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:master commit in: modules/
Date: Sun, 26 Aug 2012 19:31:05
Message-Id: 1346009409.dc0d2984d5788e2a8e9e6024e9d62bdd5834c6d5.jmbsvicetto@gentoo
1 commit: dc0d2984d5788e2a8e9e6024e9d62bdd5834c6d5
2 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 26 19:30:09 2012 +0000
4 Commit: Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 26 19:30:09 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=dc0d2984
7
8 This patch adds in support for automatically detecting and decompressing
9 both formats gentoo currently ships portage snapshots in. To make the
10 change as minimal as possible I am using recent gnu/bsd tar ability to
11 automatically pick the correct format and decompress. This should work
12 on all gentoo supported platforms including linux, freebsd, and
13 prefix-macosx.
14
15 Signed-off-by: Rick Farina <sidhayn <AT> gmail.com>
16 Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo.org>
17
18 ---
19 modules/generic_stage_target.py | 18 +++++++++++++-----
20 1 files changed, 13 insertions(+), 5 deletions(-)
21
22 diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
23 index 24bf846..4bb51c2 100644
24 --- a/modules/generic_stage_target.py
25 +++ b/modules/generic_stage_target.py
26 @@ -404,12 +404,20 @@ class generic_stage_target(generic_target):
27
28 def set_snapshot_path(self):
29 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
30 - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
31 + "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
32
33 if os.path.exists(self.settings["snapshot_path"]):
34 self.settings["snapshot_path_hash"]=\
35 generate_hash(self.settings["snapshot_path"],\
36 hash_function=self.settings["hash_function"],verbose=False)
37 + else:
38 + self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
39 + "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
40 +
41 + if os.path.exists(self.settings["snapshot_path"]):
42 + self.settings["snapshot_path_hash"]=\
43 + generate_hash(self.settings["snapshot_path"],\
44 + hash_function=self.settings["hash_function"],verbose=False)
45
46 def set_snapcache_path(self):
47 if self.settings.has_key("SNAPCACHE"):
48 @@ -635,7 +643,7 @@ class generic_stage_target(generic_target):
49 self.settings["source_path"]+"\nto "+\
50 self.settings["chroot_path"]+\
51 " (This may take some time) ...\n"
52 - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\
53 + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\
54 self.settings["chroot_path"]
55 error_msg="Tarball extraction of "+\
56 self.settings["source_path"]+" to "+\
57 @@ -646,7 +654,7 @@ class generic_stage_target(generic_target):
58 self.settings["source_path"]+"\nto "+\
59 self.settings["chroot_path"]+\
60 " (This may take some time) ...\n"
61 - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\
62 + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\
63 self.settings["chroot_path"]
64 error_msg="Tarball extraction of "+self.settings["source_path"]+\
65 " to "+self.settings["chroot_path"]+" failed."
66 @@ -744,7 +752,7 @@ class generic_stage_target(generic_target):
67 read_from_clst(self.settings["snapshot_cache_path"]+\
68 "catalyst-hash")
69 destdir=self.settings["snapshot_cache_path"]
70 - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+destdir
71 + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir
72 unpack_errmsg="Error unpacking snapshot"
73 cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\
74 self.settings["snapshot_cache_path"]+\
75 @@ -760,7 +768,7 @@ class generic_stage_target(generic_target):
76 cleanup_errmsg="Error removing existing snapshot directory."
77 cleanup_msg=\
78 "Cleaning up existing portage tree (This can take a long time)..."
79 - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+\
80 + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\
81 self.settings["chroot_path"]+"/usr"
82 unpack_errmsg="Error unpacking snapshot"