1 |
This version of the patch addresses the concerns from Matt (of me |
2 |
failing to copy and paste everything) as well as updates the commit |
3 |
message to show that I have no verified this should work on all gentoo |
4 |
supported platforms. |
5 |
|
6 |
Please accept. |
7 |
|
8 |
thanks, |
9 |
Zero |
10 |
|
11 |
On 08/22/2012 12:12 PM, Rick Farina wrote: |
12 |
> This patch adds in support for automatically detecting and decompressing |
13 |
> both formats gentoo currently ships portage snapshots in. To make the |
14 |
> change as minimal as possible I am using recent gnu/bsd tar ability to |
15 |
> automatically pick the correct format and decompress. This should work |
16 |
> on all gentoo supported platforms including linux, freebsd, and |
17 |
> prefix-macosx. |
18 |
> |
19 |
> Signed-off-by: Rick Farina <sidhayn@×××××.com> |
20 |
> --- |
21 |
> modules/generic_stage_target.py | 18 +++++++++++++----- |
22 |
> 1 files changed, 13 insertions(+), 5 deletions(-) |
23 |
> |
24 |
> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py |
25 |
> index c4ef239..b971741 100644 |
26 |
> --- a/modules/generic_stage_target.py |
27 |
> +++ b/modules/generic_stage_target.py |
28 |
> @@ -404,12 +404,20 @@ class generic_stage_target(generic_target): |
29 |
> |
30 |
> def set_snapshot_path(self): |
31 |
> self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
32 |
> - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") |
33 |
> + "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz") |
34 |
> |
35 |
> if os.path.exists(self.settings["snapshot_path"]): |
36 |
> self.settings["snapshot_path_hash"]=\ |
37 |
> generate_hash(self.settings["snapshot_path"],\ |
38 |
> hash_function=self.settings["hash_function"],verbose=False) |
39 |
> + else: |
40 |
> + self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
41 |
> + "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") |
42 |
> + |
43 |
> + if os.path.exists(self.settings["snapshot_path"]): |
44 |
> + self.settings["snapshot_path_hash"]=\ |
45 |
> + generate_hash(self.settings["snapshot_path"],\ |
46 |
> + hash_function=self.settings["hash_function"],verbose=False) |
47 |
> |
48 |
> def set_snapcache_path(self): |
49 |
> if self.settings.has_key("SNAPCACHE"): |
50 |
> @@ -635,7 +643,7 @@ class generic_stage_target(generic_target): |
51 |
> self.settings["source_path"]+"\nto "+\ |
52 |
> self.settings["chroot_path"]+\ |
53 |
> " (This may take some time) ...\n" |
54 |
> - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\ |
55 |
> + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ |
56 |
> self.settings["chroot_path"] |
57 |
> error_msg="Tarball extraction of "+\ |
58 |
> self.settings["source_path"]+" to "+\ |
59 |
> @@ -646,7 +654,7 @@ class generic_stage_target(generic_target): |
60 |
> self.settings["source_path"]+"\nto "+\ |
61 |
> self.settings["chroot_path"]+\ |
62 |
> " (This may take some time) ...\n" |
63 |
> - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\ |
64 |
> + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ |
65 |
> self.settings["chroot_path"] |
66 |
> error_msg="Tarball extraction of "+self.settings["source_path"]+\ |
67 |
> " to "+self.settings["chroot_path"]+" failed." |
68 |
> @@ -744,7 +752,7 @@ class generic_stage_target(generic_target): |
69 |
> read_from_clst(self.settings["snapshot_cache_path"]+\ |
70 |
> "catalyst-hash") |
71 |
> destdir=self.settings["snapshot_cache_path"] |
72 |
> - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+destdir |
73 |
> + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir |
74 |
> unpack_errmsg="Error unpacking snapshot" |
75 |
> cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ |
76 |
> self.settings["snapshot_cache_path"]+\ |
77 |
> @@ -760,7 +768,7 @@ class generic_stage_target(generic_target): |
78 |
> cleanup_errmsg="Error removing existing snapshot directory." |
79 |
> cleanup_msg=\ |
80 |
> "Cleaning up existing portage tree (This can take a long time)..." |
81 |
> - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+\ |
82 |
> + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\ |
83 |
> self.settings["chroot_path"]+"/usr" |
84 |
> unpack_errmsg="Error unpacking snapshot" |
85 |
> |
86 |
> |