Gentoo Archives: gentoo-catalyst

From: Brian Dolbec <dolsen@g.o>
To: gentoo-catalyst@l.g.o
Cc: Brian Dolbec <dolsen@g.o>
Subject: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults
Date: Sat, 14 Dec 2013 03:07:49
Message-Id: 1386990436-9198-2-git-send-email-dolsen@gentoo.org
In Reply to: [gentoo-catalyst] rewrite-on-master patches by Brian Dolbec
1 Use the new configured snapshot_name and portdir settings
2 Use the portdir setting rather than hard-coded path
3 ---
4 catalyst | 14 +++++++++-----
5 modules/generic_stage_target.py | 6 ++++--
6 modules/snapshot_target.py | 14 +++++++++-----
7 modules/tinderbox_target.py | 4 ++--
8 4 files changed, 24 insertions(+), 14 deletions(-)
9
10 diff --git a/catalyst b/catalyst
11 index ba26f3c..19ec77e 100755
12 --- a/catalyst
13 +++ b/catalyst
14 @@ -61,11 +61,15 @@ def parse_config(myconfig):
15 myconf={}
16 config_file=""
17
18 - confdefaults={ "storedir":"/var/tmp/catalyst",\
19 - "sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\
20 - "portdir":"/usr/portage","options":"",\
21 - "snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\
22 - "hash_function":"crc32"}
23 + confdefaults={
24 + "hash_function": "crc32",
25 + "portdir": "/usr/portage",
26 + "repo_name": "portage",
27 + "sharedir": "/usr/lib/catalyst",
28 + "snapshot_name": "portage-",
29 + "snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
30 + "storedir": "/var/tmp/catalyst",
31 + }
32
33 # first, try the one passed (presumably from the cmdline)
34 if myconfig:
35 diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
36 index 848aca2..c2888b6 100644
37 --- a/modules/generic_stage_target.py
38 +++ b/modules/generic_stage_target.py
39 @@ -410,7 +410,8 @@ class generic_stage_target(generic_target):
40
41 def set_snapshot_path(self):
42 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
43 - "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz")
44 + "/snapshots/" + self.settings["snapshot_name"] +
45 + self.settings["snapshot"]+".tar.xz")
46
47 if os.path.exists(self.settings["snapshot_path"]):
48 self.settings["snapshot_path_hash"]=\
49 @@ -418,7 +419,8 @@ class generic_stage_target(generic_target):
50 hash_function=self.settings["hash_function"],verbose=False)
51 else:
52 self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\
53 - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2")
54 + "/snapshots/" + self.settings["snapshot_name"] +
55 + self.settings["snapshot"]+".tar.bz2")
56
57 if os.path.exists(self.settings["snapshot_path"]):
58 self.settings["snapshot_path_hash"]=\
59 diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py
60 index e93a86a..29d6e87 100644
61 --- a/modules/snapshot_target.py
62 +++ b/modules/snapshot_target.py
63 @@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target):
64 self.settings=myspec
65 self.settings["target_subpath"]="portage"
66 st=self.settings["storedir"]
67 - self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\
68 - +".tar.bz2")
69 + self.settings["snapshot_path"]=normpath(st + "/snapshots/"
70 + + self.settings["snapshot_name"]
71 + + self.settings["version_stamp"] + ".tar.bz2")
72 self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"])
73
74 def setup(self):
75 @@ -46,11 +47,14 @@ class snapshot_target(generic_stage_target):
76 if not os.path.exists(mytmp):
77 os.makedirs(mytmp)
78
79 - cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\
80 - self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env)
81 + cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " +
82 + "--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " +
83 + self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"],
84 + "Snapshot failure",env=self.env)
85
86 print "Compressing Portage snapshot tarball..."
87 - cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\
88 + cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " +
89 + mytmp + " %s" % self.settings["repo_name"],
90 "Snapshot creation failure",env=self.env)
91
92 self.gen_contents_file(self.settings["snapshot_path"])
93 diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py
94 index 46fe082..d6d3ea3 100644
95 --- a/modules/tinderbox_target.py
96 +++ b/modules/tinderbox_target.py
97 @@ -29,8 +29,8 @@ class tinderbox_target(generic_stage_target):
98 raise CatalystError,"Tinderbox aborting due to error."
99
100 def set_cleanables(self):
101 - self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
102 - "/usr/portage"]
103 + self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",
104 + self.settings['portdir']]
105
106 def set_action_sequence(self):
107 #Default action sequence for run method
108 --
109 1.8.3.2

Replies

Subject Author
Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults "Rick \\\"Zero_Chaos\\\" Farina" <zerochaos@g.o>
Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Matt Turner <mattst88@g.o>
Re: [gentoo-catalyst] [PATCH 1/4] Add more configured defaults Dylan Baker <baker.dylan.c@×××××.com>