From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0E27E138010 for ; Wed, 22 Aug 2012 18:03:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9889AE06C0 for ; Wed, 22 Aug 2012 18:03:05 +0000 (UTC) Received: from mail-qa0-f46.google.com (mail-qa0-f46.google.com [209.85.216.46]) by pigeon.gentoo.org (Postfix) with ESMTP id 48F1FE0531 for ; Wed, 22 Aug 2012 16:11:34 +0000 (UTC) Received: by qaas11 with SMTP id s11so4610922qaa.19 for ; Wed, 22 Aug 2012 09:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=4yPlUaLSJCYo0b9UQbbmrsfRoTf+BwdTgYscHrNlrbM=; b=oyJx3pfrvikylQlaVC8x9I/KKCEv+cvxkNvrZPf2zbWQDVpR2Bct3uxfJHO2p+uuTL wJ7vox1kjxF3476H1XG5pZzvHT6SEwmHdx+gpKMz+7TPZR9tFo7uYEWoHkfvZY8IFz/2 k1v9acZ6MZNBN4O3Hc93JaTkUpwi543cXacmMjRWIEsrb6HwGItQYrvp9NrMpJzebt3U pK5qo2CN23rRjapTQooLOqZG7tdoLXnucqPUxzeroiZt3Z0TRCMmxnWWpXlv9Ndd0m4V P3BH20XYUy04CtJ57Wt6JZQh2D531Fs/GphR46MxOFOH6zCF8zfAWehxn20mtD+csyyH 9dRg== Received: by 10.224.173.82 with SMTP id o18mr1505665qaz.96.1345651893602; Wed, 22 Aug 2012 09:11:33 -0700 (PDT) Received: from [192.168.1.2] (pool-71-245-176-92.pitbpa.fios.verizon.net. [71.245.176.92]) by mx.google.com with ESMTPS id h8sm3446453qap.16.2012.08.22.09.11.32 (version=SSLv3 cipher=OTHER); Wed, 22 Aug 2012 09:11:33 -0700 (PDT) Message-ID: <50350534.2080508@gmail.com> Date: Wed, 22 Aug 2012 12:13:40 -0400 From: Richard Farina User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120815 Thunderbird/14.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org MIME-Version: 1.0 To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] Re: [PATCH] Support snapshot.tar.xz format References: <1345651927-17587-1-git-send-email-sidhayn@gmail.com> In-Reply-To: <1345651927-17587-1-git-send-email-sidhayn@gmail.com> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 9f40409c-1a51-45d1-8461-abac7758f715 X-Archives-Hash: 9c1d668e68a650ca5875b285b82327ad This version of the patch addresses the concerns from Matt (of me failing to copy and paste everything) as well as updates the commit message to show that I have no verified this should work on all gentoo supported platforms. Please accept. thanks, Zero On 08/22/2012 12:12 PM, Rick Farina 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/bsd tar ability to > automatically pick the correct format and decompress. This should work > on all gentoo supported platforms including linux, freebsd, and > prefix-macosx. > > Signed-off-by: Rick Farina > --- > modules/generic_stage_target.py | 18 +++++++++++++----- > 1 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py > index c4ef239..b971741 100644 > --- a/modules/generic_stage_target.py > +++ b/modules/generic_stage_target.py > @@ -404,12 +404,20 @@ 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") > + > + 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) > > def set_snapcache_path(self): > if self.settings.has_key("SNAPCACHE"): > @@ -635,7 +643,7 @@ class generic_stage_target(generic_target): > self.settings["source_path"]+"\nto "+\ > self.settings["chroot_path"]+\ > " (This may take some time) ...\n" > - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\ > + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ > self.settings["chroot_path"] > error_msg="Tarball extraction of "+\ > self.settings["source_path"]+" to "+\ > @@ -646,7 +654,7 @@ class generic_stage_target(generic_target): > self.settings["source_path"]+"\nto "+\ > self.settings["chroot_path"]+\ > " (This may take some time) ...\n" > - unpack_cmd="tar xjpf "+self.settings["source_path"]+" -C "+\ > + unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ > self.settings["chroot_path"] > error_msg="Tarball extraction of "+self.settings["source_path"]+\ > " to "+self.settings["chroot_path"]+" failed." > @@ -744,7 +752,7 @@ class generic_stage_target(generic_target): > read_from_clst(self.settings["snapshot_cache_path"]+\ > "catalyst-hash") > destdir=self.settings["snapshot_cache_path"] > - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+destdir > + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir > unpack_errmsg="Error unpacking snapshot" > cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ > self.settings["snapshot_cache_path"]+\ > @@ -760,7 +768,7 @@ class generic_stage_target(generic_target): > cleanup_errmsg="Error removing existing snapshot directory." > cleanup_msg=\ > "Cleaning up existing portage tree (This can take a long time)..." > - unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+\ > + unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\ > self.settings["chroot_path"]+"/usr" > unpack_errmsg="Error unpacking snapshot" > >