1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA1 |
3 |
|
4 |
On 12/13/2013 10:07 PM, Brian Dolbec wrote: |
5 |
> Use the new configured snapshot_name and portdir settings |
6 |
> Use the portdir setting rather than hard-coded path |
7 |
> --- |
8 |
> catalyst | 14 +++++++++----- |
9 |
> modules/generic_stage_target.py | 6 ++++-- |
10 |
> modules/snapshot_target.py | 14 +++++++++----- |
11 |
> modules/tinderbox_target.py | 4 ++-- |
12 |
> 4 files changed, 24 insertions(+), 14 deletions(-) |
13 |
> |
14 |
> diff --git a/catalyst b/catalyst |
15 |
> index ba26f3c..19ec77e 100755 |
16 |
> --- a/catalyst |
17 |
> +++ b/catalyst |
18 |
> @@ -61,11 +61,15 @@ def parse_config(myconfig): |
19 |
> myconf={} |
20 |
> config_file="" |
21 |
> |
22 |
> - confdefaults={ "storedir":"/var/tmp/catalyst",\ |
23 |
> - "sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\ |
24 |
> - "portdir":"/usr/portage","options":"",\ |
25 |
> - "snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\ |
26 |
> - "hash_function":"crc32"} |
27 |
> + confdefaults={ |
28 |
> + "hash_function": "crc32", |
29 |
> + "portdir": "/usr/portage", |
30 |
> + "repo_name": "portage", |
31 |
> + "sharedir": "/usr/lib/catalyst", |
32 |
> + "snapshot_name": "portage-", |
33 |
> + "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", |
34 |
> + "storedir": "/var/tmp/catalyst", |
35 |
> + } |
36 |
> |
37 |
> # first, try the one passed (presumably from the cmdline) |
38 |
> if myconfig: |
39 |
> diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py |
40 |
> index 848aca2..c2888b6 100644 |
41 |
> --- a/modules/generic_stage_target.py |
42 |
> +++ b/modules/generic_stage_target.py |
43 |
> @@ -410,7 +410,8 @@ class generic_stage_target(generic_target): |
44 |
> |
45 |
> def set_snapshot_path(self): |
46 |
> self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
47 |
> - "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz") |
48 |
> + "/snapshots/" + self.settings["snapshot_name"] + |
49 |
Do we really need a "snapshot_name" variable to store "portage-" for the |
50 |
part before the date? Are so many people complaining about calling the |
51 |
portage snapshots "portage-$DATE.tar.xz" ? |
52 |
> + self.settings["snapshot"]+".tar.xz") |
53 |
> |
54 |
> if os.path.exists(self.settings["snapshot_path"]): |
55 |
> self.settings["snapshot_path_hash"]=\ |
56 |
> @@ -418,7 +419,8 @@ class generic_stage_target(generic_target): |
57 |
> hash_function=self.settings["hash_function"],verbose=False) |
58 |
> else: |
59 |
> self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
60 |
> - "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") |
61 |
> + "/snapshots/" + self.settings["snapshot_name"] + |
62 |
same as above |
63 |
> + self.settings["snapshot"]+".tar.bz2") |
64 |
> |
65 |
> if os.path.exists(self.settings["snapshot_path"]): |
66 |
> self.settings["snapshot_path_hash"]=\ |
67 |
> diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py |
68 |
> index e93a86a..29d6e87 100644 |
69 |
> --- a/modules/snapshot_target.py |
70 |
> +++ b/modules/snapshot_target.py |
71 |
> @@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target): |
72 |
> self.settings=myspec |
73 |
> self.settings["target_subpath"]="portage" |
74 |
> st=self.settings["storedir"] |
75 |
> - self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\ |
76 |
> - +".tar.bz2") |
77 |
> + self.settings["snapshot_path"]=normpath(st + "/snapshots/" |
78 |
> + + self.settings["snapshot_name"] |
79 |
> + + self.settings["version_stamp"] + ".tar.bz2") |
80 |
> self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"]) |
81 |
> |
82 |
> def setup(self): |
83 |
> @@ -46,11 +47,14 @@ class snapshot_target(generic_stage_target): |
84 |
> if not os.path.exists(mytmp): |
85 |
> os.makedirs(mytmp) |
86 |
> |
87 |
> - cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\ |
88 |
> - self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env) |
89 |
> + cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " + |
90 |
> + "--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* " + |
91 |
> + self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"], |
92 |
> + "Snapshot failure",env=self.env) |
93 |
> |
94 |
> print "Compressing Portage snapshot tarball..." |
95 |
> - cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\ |
96 |
> + cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " + |
97 |
> + mytmp + " %s" % self.settings["repo_name"], |
98 |
> "Snapshot creation failure",env=self.env) |
99 |
> |
100 |
> self.gen_contents_file(self.settings["snapshot_path"]) |
101 |
> diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py |
102 |
> index 46fe082..d6d3ea3 100644 |
103 |
> --- a/modules/tinderbox_target.py |
104 |
> +++ b/modules/tinderbox_target.py |
105 |
> @@ -29,8 +29,8 @@ class tinderbox_target(generic_stage_target): |
106 |
> raise CatalystError,"Tinderbox aborting due to error." |
107 |
> |
108 |
> def set_cleanables(self): |
109 |
> - self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\ |
110 |
> - "/usr/portage"] |
111 |
> + self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*", |
112 |
> + self.settings['portdir']] |
113 |
> |
114 |
> def set_action_sequence(self): |
115 |
> #Default action sequence for run method |
116 |
> |
117 |
|
118 |
-----BEGIN PGP SIGNATURE----- |
119 |
Version: GnuPG v2.0.22 (GNU/Linux) |
120 |
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ |
121 |
|
122 |
iQIcBAEBAgAGBQJSq9qfAAoJEKXdFCfdEflK8ksP/AxrW/r+czmWFR2Ve2QLWqwT |
123 |
em+AqJMsmaPFXSCas0aiTwEb5K/Ef63shx02NmvDILU08zKtTeAbbw5aD0hkmFfe |
124 |
MADN22MCz4ohFkKL3SJUKVFa87EiveCh2s6L1YMR35zb1egVmGUTyyrrwY+MELsq |
125 |
1/TV5w8388DmLAvG+pBQTZZO5rrueZ/bOTzS9BJT3OcIYPy92mxHBGLWsHKKuTgH |
126 |
2/k42r6PFe8G99PpnL6B6W9ThZAq1hQZP/Wkx7tCtsLtXZOPcU7IdzpTj1m6095d |
127 |
RzkmmTuAKDjTWdslMYQzjUGSe3WGQjMkspz+EMaFNk0e71OzYGyW8im1u02jhL9n |
128 |
zforS/3ztXceLnjsUHd5+Cu+caIJnzLEdOjCbpdq84WvBBGGJ7BkeFMUu0NNQNSG |
129 |
q24srI0qXXhiNOH32ExJ1rwlP5zy9FFz4B3IydVT+3bf51Nt33zehglmpR+BAEml |
130 |
FfI+3txIaXhRSI7uRGXG8SLGsRm4062f1eE/lr1cTW63kNoWut5U7VJ0BHW5y33G |
131 |
pu5IzADjIaWnNOY8+3FldAUrBtXxEi+M5lbVk86xsK5FLS1RFsBLrLgDD3W+6w7A |
132 |
YyQayTBVXRTGw8VowLzvqvjQzJHufSDwhDeau2UpjNrP3PmcVp+DMWbl7qbr2DS/ |
133 |
TCgv4XUmkgFdmcuHPLgD |
134 |
=eQmL |
135 |
-----END PGP SIGNATURE----- |