From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Cc: Brian Dolbec <dolsen@gentoo.org>
Subject: [gentoo-catalyst] [PATCH 2/4] Add more configured defaults
Date: Wed, 27 Feb 2013 17:46:59 -0800 [thread overview]
Message-ID: <1362016021-8338-3-git-send-email-dolsen@gentoo.org> (raw)
In-Reply-To: <1362016021-8338-1-git-send-email-dolsen@gentoo.org>
Use the new configured snapshot_name and portdir settings
Use the portdir setting rather than hard-coded path
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
---
catalyst | 18 +++++++++++++-----
modules/generic_stage_target.py | 6 ++++--
modules/snapshot_target.py | 14 +++++++++-----
modules/tinderbox_target.py | 4 ++--
4 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/catalyst b/catalyst
index c29c814..0878ce4 100755
--- a/catalyst
+++ b/catalyst
@@ -61,11 +61,19 @@ 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={
+ "storedir": "/var/tmp/catalyst",
+ "sharedir": "/usr/lib/catalyst",
+ "distdir": "/usr/portage/distfiles",
+ "repo_name": "portage",
+ "portdir": "/usr/portage",
+ "packagedir": "/usr/portage/packages",
+ "port_tmpdir": "/var/tmp/portage",
+ "options": "",
+ "snapshot_name": "portage-",
+ "snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
+ "hash_function": "crc32",
+ }
# 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 31cb025..c79f8ae 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"] +
+ 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"] +
+ 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..79c1f03 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
--
1.8.1.4
next prev parent reply other threads:[~2013-02-28 1:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-28 1:46 [gentoo-catalyst] [PATCH 0/4] Some general cleanup, remove some hardcoding of paths Brian Dolbec
2013-02-28 1:46 ` [gentoo-catalyst] [PATCH 1/4] Whitespace cleanup Brian Dolbec
2013-02-28 11:46 ` W. Trevor King
2013-02-28 23:44 ` Matt Turner
2013-03-09 2:36 ` Matt Turner
2013-02-28 1:46 ` Brian Dolbec [this message]
2013-02-28 11:51 ` [gentoo-catalyst] [PATCH 2/4] Add more configured defaults W. Trevor King
2013-02-28 1:47 ` [gentoo-catalyst] [PATCH 3/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Brian Dolbec
2013-02-28 3:01 ` Brian Dolbec
2013-02-28 1:47 ` [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve useage() output formatting slightly Brian Dolbec
2013-02-28 13:17 ` [gentoo-catalyst] [PATCH 0/4] Some general cleanup, remove some hardcoding of paths W. Trevor King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362016021-8338-3-git-send-email-dolsen@gentoo.org \
--to=dolsen@gentoo.org \
--cc=gentoo-catalyst@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox