1 |
Again this will apply cleanly to current master. |
2 |
|
3 |
============================================== |
4 |
|
5 |
diff --git a/catalyst b/catalyst |
6 |
index c29c814..0878ce4 100755 |
7 |
@@ -61,11 +61,19 @@ def parse_config(myconfig): |
8 |
myconf={} |
9 |
config_file="" |
10 |
|
11 |
- confdefaults={ "storedir":"/var/tmp/catalyst",\ |
12 |
- "sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",\ |
13 |
- "portdir":"/usr/portage","options":"",\ |
14 |
- "snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\ |
15 |
- "hash_function":"crc32"} |
16 |
+ confdefaults={ |
17 |
+ "storedir": "/var/tmp/catalyst", |
18 |
+ "sharedir": "/usr/lib/catalyst", |
19 |
+ "distdir": "/usr/portage/distfiles", |
20 |
+ "repo_name": "portage", |
21 |
+ "portdir": "/usr/portage", |
22 |
+ "packagedir": "/usr/portage/packages", |
23 |
+ "port_tmpdir": "/var/tmp/portage", |
24 |
+ "options": "", |
25 |
+ "snapshot_name": "portage-", |
26 |
+ "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", |
27 |
+ "hash_function": "crc32", |
28 |
+ } |
29 |
|
30 |
# first, try the one passed (presumably from the cmdline) |
31 |
if myconfig: |
32 |
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py |
33 |
index 31cb025..c79f8ae 100644 |
34 |
@@ -410,7 +410,8 @@ class generic_stage_target(generic_target): |
35 |
|
36 |
def set_snapshot_path(self): |
37 |
self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
38 |
- "/snapshots/portage-"+self.settings["snapshot"]+".tar.xz") |
39 |
+ "/snapshots/" + self.settings["snapshot_name"] + |
40 |
+ self.settings["snapshot"]+".tar.xz") |
41 |
|
42 |
if os.path.exists(self.settings["snapshot_path"]): |
43 |
self.settings["snapshot_path_hash"]=\ |
44 |
@@ -418,7 +419,8 @@ class generic_stage_target(generic_target): |
45 |
hash_function=self.settings["hash_function"],verbose=False) |
46 |
else: |
47 |
self.settings["snapshot_path"]=normpath(self.settings["storedir"]+\ |
48 |
- "/snapshots/portage-"+self.settings["snapshot"]+".tar.bz2") |
49 |
+ "/snapshots/" + self.settings["snapshot_name"] + |
50 |
+ self.settings["snapshot"]+".tar.bz2") |
51 |
|
52 |
if os.path.exists(self.settings["snapshot_path"]): |
53 |
self.settings["snapshot_path_hash"]=\ |
54 |
diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py |
55 |
index e93a86a..79c1f03 100644 |
56 |
@@ -18,8 +18,9 @@ class snapshot_target(generic_stage_target): |
57 |
self.settings=myspec |
58 |
self.settings["target_subpath"]="portage" |
59 |
st=self.settings["storedir"] |
60 |
- self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\ |
61 |
- +".tar.bz2") |
62 |
+ self.settings["snapshot_path"]=normpath(st + "/snapshots/" |
63 |
+ + self.settings["snapshot_name"] |
64 |
+ + self.settings["version_stamp"] + ".tar.bz2") |
65 |
self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"]) |
66 |
|
67 |
def setup(self): |
68 |
@@ -46,11 +47,14 @@ class snapshot_target(generic_stage_target): |
69 |
if not os.path.exists(mytmp): |
70 |
os.makedirs(mytmp) |
71 |
|
72 |
- cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\ |
73 |
- self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env) |
74 |
+ cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ " + \ |
75 |
+ "--exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\ |
76 |
+ self.settings["portdir"] + "/ " + mytmp + "/%s/" % self.settings["repo_name"], |
77 |
+ "Snapshot failure",env=self.env) |
78 |
|
79 |
print "Compressing Portage snapshot tarball..." |
80 |
- cmd("tar -I lbzip2 -cf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\ |
81 |
+ cmd("tar -I lbzip2 -cf " + self.settings["snapshot_path"] + " -C " + |
82 |
+ mytmp + " %s" % self.settings["repo_name"], |
83 |
"Snapshot creation failure",env=self.env) |
84 |
|
85 |
self.gen_contents_file(self.settings["snapshot_path"]) |
86 |
diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py |
87 |
index 46fe082..d6d3ea3 100644 |
88 |
@@ -29,8 +29,8 @@ class tinderbox_target(generic_stage_target): |
89 |
raise CatalystError,"Tinderbox aborting due to error." |
90 |
|
91 |
def set_cleanables(self): |
92 |
- self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\ |
93 |
- "/usr/portage"] |
94 |
+ self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*", |
95 |
+ self.settings['portdir']] |
96 |
|
97 |
def set_action_sequence(self): |
98 |
#Default action sequence for run method |