1 |
Is the gnu tar requirement too much? I can rewrite it without but this |
2 |
way is just so clean... |
3 |
|
4 |
Thanks, |
5 |
Zero |
6 |
|
7 |
On 08/21/2012 08:58 PM, Rick Farina wrote: |
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 tar ability to |
11 |
> automatically pick the correct format and decompress. This may not work |
12 |
> as expected on *bsd or MacOSX unless we already require gnu tar on those |
13 |
> platforms. |
14 |
> |
15 |
> Signed-off-by: Rick Farina <sidhayn@×××××.com> |
16 |
> --- |
17 |
> modules/generic_stage_target.py | 13 ++++++++----- |
18 |
> 1 files changed, 8 insertions(+), 5 deletions(-) |
19 |
> |
20 |
> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py |
21 |
> index c4ef239..031d8bf 100644 |
22 |
> --- a/modules/generic_stage_target.py |
23 |
> +++ b/modules/generic_stage_target.py |
24 |
> @@ -404,12 +404,15 @@ class generic_stage_target(generic_target): |
25 |
> |
26 |
> def set_snapshot_path(self): |
27 |
> self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
28 |
> - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") |
29 |
> + "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz") |
30 |
> |
31 |
> if os.path.exists(self.settings["snapshot_path"]): |
32 |
> self.settings["snapshot_path_hash"]=\ |
33 |
> generate_hash(self.settings["snapshot_path"],\ |
34 |
> hash_function=self.settings["hash_function"],verbose=False) |
35 |
> + else: |
36 |
> + self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
37 |
> + "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") |
38 |
> |
39 |
> def set_snapcache_path(self): |
40 |
> if self.settings.has_key("SNAPCACHE"): |
41 |
> @@ -635,7 +638,7 @@ class generic_stage_target(generic_target): |
42 |
> self.settings["source_path"]+"\nto "+\ |
43 |
> self.settings["chroot_path"]+\ |
44 |
> " (This may take some time) ...\n" |
45 |
> - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\ |
46 |
> + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ |
47 |
> self.settings["chroot_path"] |
48 |
> error_msg="Tarball extraction of "+\ |
49 |
> self.settings["source_path"]+" to "+\ |
50 |
> @@ -646,7 +649,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 "+self.settings["source_path"]+\ |
58 |
> " to "+self.settings["chroot_path"]+" failed." |
59 |
> @@ -744,7 +747,7 @@ class generic_stage_target(generic_target): |
60 |
> read_from_clst(self.settings["snapshot_cache_path"]+\ |
61 |
> "catalyst-hash") |
62 |
> destdir=self.settings["snapshot_cache_path"] |
63 |
> - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+destdir |
64 |
> + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir |
65 |
> unpack_errmsg="Error unpacking snapshot" |
66 |
> cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ |
67 |
> self.settings["snapshot_cache_path"]+\ |
68 |
> @@ -760,7 +763,7 @@ class generic_stage_target(generic_target): |
69 |
> cleanup_errmsg="Error removing existing snapshot directory." |
70 |
> cleanup_msg=\ |
71 |
> "Cleaning up existing portage tree (This can take a long time)..." |
72 |
> - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+\ |
73 |
> + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\ |
74 |
> self.settings["chroot_path"]+"/usr" |
75 |
> unpack_errmsg="Error unpacking snapshot" |
76 |
> |
77 |
> |