1 |
On 08/21/2012 09:05 PM, Matt Turner wrote: |
2 |
> On Tue, Aug 21, 2012 at 5:58 PM, Rick Farina <sidhayn@×××××.com> wrote: |
3 |
>> This patch adds in support for automatically detecting and decompressing |
4 |
>> both formats gentoo currently ships portage snapshots in. To make the |
5 |
>> change as minimal as possible I am using recent gnu tar ability to |
6 |
>> automatically pick the correct format and decompress. This may not work |
7 |
>> as expected on *bsd or MacOSX unless we already require gnu tar on those |
8 |
>> platforms. |
9 |
>> |
10 |
>> Signed-off-by: Rick Farina <sidhayn@×××××.com> |
11 |
>> --- |
12 |
>> modules/generic_stage_target.py | 13 ++++++++----- |
13 |
>> 1 files changed, 8 insertions(+), 5 deletions(-) |
14 |
>> |
15 |
>> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py |
16 |
>> index c4ef239..031d8bf 100644 |
17 |
>> --- a/modules/generic_stage_target.py |
18 |
>> +++ b/modules/generic_stage_target.py |
19 |
>> @@ -404,12 +404,15 @@ class generic_stage_target(generic_target): |
20 |
>> |
21 |
>> def set_snapshot_path(self): |
22 |
>> self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
23 |
>> - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") |
24 |
>> + "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz") |
25 |
>> |
26 |
>> if os.path.exists(self.settings["snapshot_path"]): |
27 |
>> self.settings["snapshot_path_hash"]=\ |
28 |
>> generate_hash(self.settings["snapshot_path"],\ |
29 |
>> hash_function=self.settings["hash_function"],verbose=False) |
30 |
>> + else: |
31 |
>> + self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
32 |
>> + "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") |
33 |
>> |
34 |
>> def set_snapcache_path(self): |
35 |
>> if self.settings.has_key("SNAPCACHE"): |
36 |
> |
37 |
> This bit looks for *.tar.xz and then falls back to *.tar.bz2? |
38 |
yes, .xz is smaller and faster to decompress hence first. |
39 |
> |
40 |
> It looks like you don't check that the *.tar.bz2 file exists or that |
41 |
> the hashing is done. |
42 |
> |
43 |
I forgot to copy and repeat that block, easy fix. I tested and it |
44 |
didn't appear needed for cleanly failing, but I completely miss the |
45 |
hash_function and that obviously is bad. |
46 |
|
47 |
I'll respin on the next flight. |
48 |
|
49 |
Any comments on the gnu tar requirement? is that an issue or is okay? |
50 |
|
51 |
thanks, |
52 |
Zero |