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 DF9EA13827E for ; Sat, 14 Dec 2013 04:10:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 92024E0BDA; Sat, 14 Dec 2013 04:10:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 03832E0BDA for ; Sat, 14 Dec 2013 04:10:31 +0000 (UTC) Received: from [192.168.1.13] (pool-72-95-221-222.pitbpa.fios.verizon.net [72.95.221.222]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: zerochaos) by smtp.gentoo.org (Postfix) with ESMTPSA id F269333EECA for ; Sat, 14 Dec 2013 04:10:30 +0000 (UTC) Message-ID: <52ABDA9F.9090304@gentoo.org> Date: Fri, 13 Dec 2013 23:12:15 -0500 From: "Rick \"Zero_Chaos\" Farina" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 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: Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults References: <1386990436-9198-1-git-send-email-dolsen@gentoo.org> <1386990436-9198-2-git-send-email-dolsen@gentoo.org> In-Reply-To: <1386990436-9198-2-git-send-email-dolsen@gentoo.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 4b6413bf-42df-45d1-ba1e-087e5692a492 X-Archives-Hash: 7e995df4d7d6afb5a52095b646d9f115 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/13/2013 10:07 PM, Brian Dolbec wrote: > Use the new configured snapshot_name and portdir settings > Use the portdir setting rather than hard-coded path > --- > catalyst | 14 +++++++++----- > modules/generic_stage_target.py | 6 ++++-- > modules/snapshot_target.py | 14 +++++++++----- > modules/tinderbox_target.py | 4 ++-- > 4 files changed, 24 insertions(+), 14 deletions(-) > > diff --git a/catalyst b/catalyst > index ba26f3c..19ec77e 100755 > --- a/catalyst > +++ b/catalyst > @@ -61,11 +61,15 @@ def parse_config(myconfig): > myconf={} > config_file="" > > - confdefaults={ "storedir":"/var/tmp/catalyst",\ > - "sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\ > - "portdir":"/usr/portage","options":"",\ > - "snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\ > - "hash_function":"crc32"} > + confdefaults={ > + "hash_function": "crc32", > + "portdir": "/usr/portage", > + "repo_name": "portage", > + "sharedir": "/usr/lib/catalyst", > + "snapshot_name": "portage-", > + "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", > + "storedir": "/var/tmp/catalyst", > + } > > # first, try the one passed (presumably from the cmdline) > if myconfig: > diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py > index 848aca2..c2888b6 100644 > --- a/modules/generic_stage_target.py > +++ b/modules/generic_stage_target.py > @@ -410,7 +410,8 @@ 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.xz") > + "/snapshots/" + self.settings["snapshot_name"] + Do we really need a "snapshot_name" variable to store "portage-" for the part before the date? Are so many people complaining about calling the portage snapshots "portage-$DATE.tar.xz" ? > + self.settings["snapshot"]+".tar.xz") > > if os.path.exists(self.settings["snapshot_path"]): > self.settings["snapshot_path_hash"]=\ > @@ -418,7 +419,8 @@ class generic_stage_target(generic_target): > hash_function=self.settings["hash_function"],verbose=False) > else: > self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ > - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") > + "/snapshots/" + self.settings["snapshot_name"] + same as above > + self.settings["snapshot"]+".tar.bz2") > > if os.path.exists(self.settings["snapshot_path"]): > self.settings["snapshot_path_hash"]=\ > diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py > index e93a86a..29d6e87 100644 > --- a/modules/snapshot_target.py > +++ b/modules/snapshot_target.py > @@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target): > self.settings=myspec > self.settings["target_subpath"]="portage" > st=self.settings["storedir"] > - self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\ > - +".tar.bz2") > + self.settings["snapshot_path"]=normpath(st + "/snapshots/" > + + self.settings["snapshot_name"] > + + self.settings["version_stamp"] + ".tar.bz2") > self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"]) > > def setup(self): > @@ -46,11 +47,14 @@ class snapshot_target(generic_stage_target): > if not os.path.exists(mytmp): > os.makedirs(mytmp) > > - cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\ > - self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env) > + cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " + > + "--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " + > + self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"], > + "Snapshot failure",env=self.env) > > print "Compressing Portage snapshot tarball..." > - cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\ > + cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " + > + mytmp + " %s" % self.settings["repo_name"], > "Snapshot creation failure",env=self.env) > > self.gen_contents_file(self.settings["snapshot_path"]) > diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py > index 46fe082..d6d3ea3 100644 > --- a/modules/tinderbox_target.py > +++ b/modules/tinderbox_target.py > @@ -29,8 +29,8 @@ class tinderbox_target(generic_stage_target): > raise CatalystError,"Tinderbox aborting due to error." > > def set_cleanables(self): > - self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\ > - "/usr/portage"] > + self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*", > + self.settings['portdir']] > > def set_action_sequence(self): > #Default action sequence for run method > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSq9qfAAoJEKXdFCfdEflK8ksP/AxrW/r+czmWFR2Ve2QLWqwT em+AqJMsmaPFXSCas0aiTwEb5K/Ef63shx02NmvDILU08zKtTeAbbw5aD0hkmFfe MADN22MCz4ohFkKL3SJUKVFa87EiveCh2s6L1YMR35zb1egVmGUTyyrrwY+MELsq 1/TV5w8388DmLAvG+pBQTZZO5rrueZ/bOTzS9BJT3OcIYPy92mxHBGLWsHKKuTgH 2/k42r6PFe8G99PpnL6B6W9ThZAq1hQZP/Wkx7tCtsLtXZOPcU7IdzpTj1m6095d RzkmmTuAKDjTWdslMYQzjUGSe3WGQjMkspz+EMaFNk0e71OzYGyW8im1u02jhL9n zforS/3ztXceLnjsUHd5+Cu+caIJnzLEdOjCbpdq84WvBBGGJ7BkeFMUu0NNQNSG q24srI0qXXhiNOH32ExJ1rwlP5zy9FFz4B3IydVT+3bf51Nt33zehglmpR+BAEml FfI+3txIaXhRSI7uRGXG8SLGsRm4062f1eE/lr1cTW63kNoWut5U7VJ0BHW5y33G pu5IzADjIaWnNOY8+3FldAUrBtXxEi+M5lbVk86xsK5FLS1RFsBLrLgDD3W+6w7A YyQayTBVXRTGw8VowLzvqvjQzJHufSDwhDeau2UpjNrP3PmcVp+DMWbl7qbr2DS/ TCgv4XUmkgFdmcuHPLgD =eQmL -----END PGP SIGNATURE-----