On Tue, Aug 21, 2012 at 5:58 PM, Rick Farina <[email protected]> wrote: > This patch adds in support for automatically detecting and decompressing > both formats gentoo currently ships portage snapshots in. To make the > change as minimal as possible I am using recent gnu tar ability to > automatically pick the correct format and decompress. This may not work > as expected on *bsd or MacOSX unless we already require gnu tar on those > platforms. > > Signed-off-by: Rick Farina <[email protected]> > --- > modules/generic_stage_target.py | 13 ++++++++----- > 1 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py > index c4ef239..031d8bf 100644 > --- a/modules/generic_stage_target.py > +++ b/modules/generic_stage_target.py > @@ -404,12 +404,15 @@ class generic_stage_target(generic_target): > > def set_snapshot_path(self): > > self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ > - > "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") > + > "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz") > > if os.path.exists(self.settings["snapshot_path"]): > self.settings["snapshot_path_hash"]=\ > generate_hash(self.settings["snapshot_path"],\ > > hash_function=self.settings["hash_function"],verbose=False) > + else: > + > self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ > + > "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") > > def set_snapcache_path(self): > if self.settings.has_key("SNAPCACHE"):
This bit looks for *.tar.xz and then falls back to *.tar.bz2? It looks like you don't check that the *.tar.bz2 file exists or that the hashing is done.
