1 |
commit: f37553c47eef08bf064e7923ff11b4ec154db895 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 30 06:14:48 2013 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Sat Mar 22 18:01:21 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=f37553c4 |
7 |
|
8 |
Fix autoresume file paths to only be configured once. |
9 |
|
10 |
Use: pjoin as a shorter alias to os.path.join() |
11 |
|
12 |
--- |
13 |
catalyst/targets/generic_stage_target.py | 175 +++++++++++++++++-------------- |
14 |
1 file changed, 95 insertions(+), 80 deletions(-) |
15 |
|
16 |
diff --git a/catalyst/targets/generic_stage_target.py b/catalyst/targets/generic_stage_target.py |
17 |
index 2b3d7ce..9c39d00 100644 |
18 |
--- a/catalyst/targets/generic_stage_target.py |
19 |
+++ b/catalyst/targets/generic_stage_target.py |
20 |
@@ -33,6 +33,9 @@ SOURCE_MOUNTS_DEFAULTS = { |
21 |
"shm": "shmfs", |
22 |
} |
23 |
|
24 |
+# for convienience |
25 |
+pjoin = os.path.join |
26 |
+ |
27 |
|
28 |
class generic_stage_target(generic_target): |
29 |
""" |
30 |
@@ -334,9 +337,10 @@ class generic_stage_target(generic_target): |
31 |
def set_target_path(self): |
32 |
self.settings["target_path"]=normpath(self.settings["storedir"]+\ |
33 |
"/builds/"+self.settings["target_subpath"]+".tar.bz2") |
34 |
- if "AUTORESUME" in self.settings\ |
35 |
- and os.path.exists(self.settings["autoresume_path"]+\ |
36 |
- "setup_target_path"): |
37 |
+ setup_target_path_resume = pjoin(self.settings["autoresume_path"], |
38 |
+ "setup_target_path") |
39 |
+ if "AUTORESUME" in self.settings and \ |
40 |
+ os.path.exists(setup_target_path_resume): |
41 |
print \ |
42 |
"Resume point detected, skipping target path setup operation..." |
43 |
else: |
44 |
@@ -348,7 +352,7 @@ class generic_stage_target(generic_target): |
45 |
# cmd("rm -f "+self.settings["target_path"],\ |
46 |
# "Could not remove existing file: "\ |
47 |
# +self.settings["target_path"],env=self.env) |
48 |
- touch(self.settings["autoresume_path"]+"setup_target_path") |
49 |
+ touch(setup_target_path_resume) |
50 |
|
51 |
if not os.path.exists(self.settings["storedir"]+"/builds/"): |
52 |
os.makedirs(self.settings["storedir"]+"/builds/") |
53 |
@@ -484,10 +488,12 @@ class generic_stage_target(generic_target): |
54 |
self.chroot_lock=LockDir(self.settings["chroot_path"]) |
55 |
|
56 |
def set_autoresume_path(self): |
57 |
- self.settings["autoresume_path"]=normpath(self.settings["storedir"]+\ |
58 |
- "/tmp/"+self.settings["rel_type"]+"/"+".autoresume-"+\ |
59 |
- self.settings["target"]+"-"+self.settings["subarch"]+"-"+\ |
60 |
- self.settings["version_stamp"]+"/") |
61 |
+ self.settings["autoresume_path"] = normpath(pjoin( |
62 |
+ self.settings["storedir"], "tmp", self.settings["rel_type"], |
63 |
+ ".autoresume-%s-%s-%s" |
64 |
+ %(self.settings["target"], self.settings["subarch"], |
65 |
+ self.settings["version_stamp"]) |
66 |
+ )) |
67 |
if "AUTORESUME" in self.settings: |
68 |
print "The autoresume path is " + self.settings["autoresume_path"] |
69 |
if not os.path.exists(self.settings["autoresume_path"]): |
70 |
@@ -673,8 +679,8 @@ class generic_stage_target(generic_target): |
71 |
def unpack(self): |
72 |
unpack=True |
73 |
|
74 |
- clst_unpack_hash=read_from_clst(self.settings["autoresume_path"]+\ |
75 |
- "unpack") |
76 |
+ unpack_resume = pjoin(self.settings["autoresume_path"], "unpack") |
77 |
+ clst_unpack_hash=read_from_clst(unpack_resume) |
78 |
|
79 |
if "SEEDCACHE" in self.settings: |
80 |
if os.path.isdir(self.settings["source_path"]): |
81 |
@@ -720,7 +726,7 @@ class generic_stage_target(generic_target): |
82 |
|
83 |
if "AUTORESUME" in self.settings: |
84 |
if os.path.isdir(self.settings["source_path"]) \ |
85 |
- and os.path.exists(self.settings["autoresume_path"]+"unpack"): |
86 |
+ and os.path.exists(unpack_resume): |
87 |
""" Autoresume is valid, SEEDCACHE is valid """ |
88 |
unpack=False |
89 |
invalid_snapshot=False |
90 |
@@ -732,8 +738,7 @@ class generic_stage_target(generic_target): |
91 |
invalid_snapshot=True |
92 |
|
93 |
elif os.path.isdir(self.settings["source_path"]) \ |
94 |
- and not os.path.exists(self.settings["autoresume_path"]+\ |
95 |
- "unpack"): |
96 |
+ and not os.path.exists(unpack_resume): |
97 |
""" Autoresume is invalid, SEEDCACHE """ |
98 |
unpack=True |
99 |
invalid_snapshot=False |
100 |
@@ -793,18 +798,19 @@ class generic_stage_target(generic_target): |
101 |
cmd(unpack_cmd,error_msg,env=self.env) |
102 |
|
103 |
if "source_path_hash" in self.settings: |
104 |
- myf=open(self.settings["autoresume_path"]+"unpack","w") |
105 |
+ myf=open(unpack_resume,"w") |
106 |
myf.write(self.settings["source_path_hash"]) |
107 |
myf.close() |
108 |
else: |
109 |
- touch(self.settings["autoresume_path"]+"unpack") |
110 |
+ touch(unpack_resume) |
111 |
else: |
112 |
print "Resume point detected, skipping unpack operation..." |
113 |
|
114 |
def unpack_snapshot(self): |
115 |
unpack=True |
116 |
- snapshot_hash=read_from_clst(self.settings["autoresume_path"]+\ |
117 |
+ unpack_portage_resume = pjoin(self.settings["autoresume_path"], |
118 |
"unpack_portage") |
119 |
+ snapshot_hash=read_from_clst(unpack_portage_resume) |
120 |
|
121 |
if "SNAPCACHE" in self.settings: |
122 |
snapshot_cache_hash=\ |
123 |
@@ -841,8 +847,7 @@ class generic_stage_target(generic_target): |
124 |
if "AUTORESUME" in self.settings \ |
125 |
and os.path.exists(self.settings["chroot_path"]+\ |
126 |
self.settings["portdir"]) \ |
127 |
- and os.path.exists(self.settings["autoresume_path"]\ |
128 |
- +"unpack_portage") \ |
129 |
+ and os.path.exists(unpack_portage_resume) \ |
130 |
and self.settings["snapshot_path_hash"] == snapshot_hash: |
131 |
print \ |
132 |
"Valid Resume point detected, skipping unpack of portage tree..." |
133 |
@@ -868,7 +873,7 @@ class generic_stage_target(generic_target): |
134 |
myf.close() |
135 |
else: |
136 |
print "Setting snapshot autoresume point" |
137 |
- myf=open(self.settings["autoresume_path"]+"unpack_portage","w") |
138 |
+ myf=open(unpack_portage_resume,"w") |
139 |
myf.write(self.settings["snapshot_path_hash"]) |
140 |
myf.close() |
141 |
|
142 |
@@ -876,9 +881,10 @@ class generic_stage_target(generic_target): |
143 |
self.snapshot_lock_object.unlock() |
144 |
|
145 |
def config_profile_link(self): |
146 |
+ config_protect_link_resume = pjoin(self.settings["autoresume_path"], |
147 |
+ "config_profile_link") |
148 |
if "AUTORESUME" in self.settings \ |
149 |
- and os.path.exists(self.settings["autoresume_path"]+\ |
150 |
- "config_profile_link"): |
151 |
+ and os.path.exists(config_protect_link_resume): |
152 |
print \ |
153 |
"Resume point detected, skipping config_profile_link operation..." |
154 |
else: |
155 |
@@ -892,12 +898,13 @@ class generic_stage_target(generic_target): |
156 |
self.settings["target_profile"]+" "+\ |
157 |
self.settings["chroot_path"]+"/etc/portage/make.profile",\ |
158 |
"Error creating profile link",env=self.env) |
159 |
- touch(self.settings["autoresume_path"]+"config_profile_link") |
160 |
+ touch(config_protect_link_resume) |
161 |
|
162 |
def setup_confdir(self): |
163 |
+ setup_confdir_resume = pjoin(self.settings["autoresume_path"], |
164 |
+ "setup_confdir") |
165 |
if "AUTORESUME" in self.settings \ |
166 |
- and os.path.exists(self.settings["autoresume_path"]+\ |
167 |
- "setup_confdir"): |
168 |
+ and os.path.exists(setup_confdir_resume): |
169 |
print "Resume point detected, skipping setup_confdir operation..." |
170 |
else: |
171 |
if "portage_confdir" in self.settings: |
172 |
@@ -905,7 +912,7 @@ class generic_stage_target(generic_target): |
173 |
cmd("rsync -a "+self.settings["portage_confdir"]+"/ "+\ |
174 |
self.settings["chroot_path"]+"/etc/portage/",\ |
175 |
"Error copying /etc/portage",env=self.env) |
176 |
- touch(self.settings["autoresume_path"]+"setup_confdir") |
177 |
+ touch(setup_confdir_resume) |
178 |
|
179 |
def portage_overlay(self): |
180 |
""" We copy the contents of our overlays to /usr/local/portage """ |
181 |
@@ -1029,8 +1036,9 @@ class generic_stage_target(generic_target): |
182 |
self.override_cflags() |
183 |
self.override_cxxflags() |
184 |
self.override_ldflags() |
185 |
- if "AUTORESUME" in self.settings \ |
186 |
- and os.path.exists(self.settings["autoresume_path"]+"chroot_setup"): |
187 |
+ chroot_setup_resume = pjoin(self.settings["autoresume_path"], |
188 |
+ "chroot_setup") |
189 |
+ if "AUTORESUME" in self.settings and os.path.exists(chroot_setup_resume): |
190 |
print "Resume point detected, skipping chroot_setup operation..." |
191 |
else: |
192 |
print "Setting up chroot..." |
193 |
@@ -1126,32 +1134,34 @@ class generic_stage_target(generic_target): |
194 |
cmd("cp "+self.settings["chroot_path"]+"/etc/portage/make.conf "+\ |
195 |
self.settings["chroot_path"]+"/etc/portage/make.conf.catalyst",\ |
196 |
"Could not backup /etc/portage/make.conf",env=self.env) |
197 |
- touch(self.settings["autoresume_path"]+"chroot_setup") |
198 |
+ touch(chroot_setup_resume) |
199 |
|
200 |
def fsscript(self): |
201 |
- if "AUTORESUME" in self.settings \ |
202 |
- and os.path.exists(self.settings["autoresume_path"]+"fsscript"): |
203 |
+ fsscript_resume = pjoin(self.settings["autoresume_path"], "fsscript") |
204 |
+ if "AUTORESUME" in self.settings and os.path.exists(fsscript_resume): |
205 |
print "Resume point detected, skipping fsscript operation..." |
206 |
else: |
207 |
if "fsscript" in self.settings: |
208 |
if os.path.exists(self.settings["controller_file"]): |
209 |
cmd("/bin/bash "+self.settings["controller_file"]+\ |
210 |
" fsscript","fsscript script failed.",env=self.env) |
211 |
- touch(self.settings["autoresume_path"]+"fsscript") |
212 |
+ touch(fsscript_resume) |
213 |
|
214 |
def rcupdate(self): |
215 |
+ rcupdate_resume = pjoin(self.settings["autoresume_path"], "rcupdate") |
216 |
if "AUTORESUME" in self.settings \ |
217 |
- and os.path.exists(self.settings["autoresume_path"]+"rcupdate"): |
218 |
+ and os.path.exists(rcupdate_resume): |
219 |
print "Resume point detected, skipping rcupdate operation..." |
220 |
else: |
221 |
if os.path.exists(self.settings["controller_file"]): |
222 |
cmd("/bin/bash "+self.settings["controller_file"]+" rc-update",\ |
223 |
"rc-update script failed.",env=self.env) |
224 |
- touch(self.settings["autoresume_path"]+"rcupdate") |
225 |
+ touch(rcupdate_resume) |
226 |
|
227 |
def clean(self): |
228 |
+ clean_resume = pjoin(self.settings["autoresume_path"], "clean") |
229 |
if "AUTORESUME" in self.settings \ |
230 |
- and os.path.exists(self.settings["autoresume_path"]+"clean"): |
231 |
+ and os.path.exists(clean_resume): |
232 |
print "Resume point detected, skipping clean operation..." |
233 |
else: |
234 |
for x in self.settings["cleanables"]: |
235 |
@@ -1182,11 +1192,11 @@ class generic_stage_target(generic_target): |
236 |
if os.path.exists(self.settings["controller_file"]): |
237 |
cmd("/bin/bash "+self.settings["controller_file"]+" clean",\ |
238 |
"clean script failed.",env=self.env) |
239 |
- touch(self.settings["autoresume_path"]+"clean") |
240 |
+ touch(clean_resume) |
241 |
|
242 |
def empty(self): |
243 |
- if "AUTORESUME" in self.settings \ |
244 |
- and os.path.exists(self.settings["autoresume_path"]+"empty"): |
245 |
+ empty_resume = pjoin(self.settings["autoresume_path"], "empty") |
246 |
+ if "AUTORESUME" in self.settings and os.path.exists(empty_resume): |
247 |
print "Resume point detected, skipping empty operation..." |
248 |
else: |
249 |
if self.settings["spec_prefix"]+"/empty" in self.settings: |
250 |
@@ -1210,11 +1220,11 @@ class generic_stage_target(generic_target): |
251 |
os.makedirs(myemp,0755) |
252 |
os.chown(myemp,mystat[ST_UID],mystat[ST_GID]) |
253 |
os.chmod(myemp,mystat[ST_MODE]) |
254 |
- touch(self.settings["autoresume_path"]+"empty") |
255 |
+ touch(empty_resume) |
256 |
|
257 |
def remove(self): |
258 |
- if "AUTORESUME" in self.settings \ |
259 |
- and os.path.exists(self.settings["autoresume_path"]+"remove"): |
260 |
+ remove_resume = pjoin(self.settings["autoresume_path"], "remove") |
261 |
+ if "AUTORESUME" in self.settings and os.path.exists(remove_resume): |
262 |
print "Resume point detected, skipping remove operation..." |
263 |
else: |
264 |
if self.settings["spec_prefix"]+"/rm" in self.settings: |
265 |
@@ -1229,29 +1239,29 @@ class generic_stage_target(generic_target): |
266 |
if os.path.exists(self.settings["controller_file"]): |
267 |
cmd("/bin/bash "+self.settings["controller_file"]+\ |
268 |
" clean","Clean failed.",env=self.env) |
269 |
- touch(self.settings["autoresume_path"]+"remove") |
270 |
+ touch(remove_resume) |
271 |
except: |
272 |
self.unbind() |
273 |
raise |
274 |
|
275 |
def preclean(self): |
276 |
- if "AUTORESUME" in self.settings \ |
277 |
- and os.path.exists(self.settings["autoresume_path"]+"preclean"): |
278 |
+ preclean_resume = pjoin(self.settings["autoresume_path"], "preclean") |
279 |
+ if "AUTORESUME" in self.settings and os.path.exists(preclean_resume): |
280 |
print "Resume point detected, skipping preclean operation..." |
281 |
else: |
282 |
try: |
283 |
if os.path.exists(self.settings["controller_file"]): |
284 |
cmd("/bin/bash "+self.settings["controller_file"]+\ |
285 |
" preclean","preclean script failed.",env=self.env) |
286 |
- touch(self.settings["autoresume_path"]+"preclean") |
287 |
+ touch(preclean_resume) |
288 |
|
289 |
except: |
290 |
self.unbind() |
291 |
raise CatalystError, "Build failed, could not execute preclean" |
292 |
|
293 |
def capture(self): |
294 |
- if "AUTORESUME" in self.settings \ |
295 |
- and os.path.exists(self.settings["autoresume_path"]+"capture"): |
296 |
+ capture_resume = pjoin(self.settings["autoresume_path"], "capture") |
297 |
+ if "AUTORESUME" in self.settings and os.path.exists(capture_resume): |
298 |
print "Resume point detected, skipping capture operation..." |
299 |
else: |
300 |
""" Capture target in a tarball """ |
301 |
@@ -1272,18 +1282,18 @@ class generic_stage_target(generic_target): |
302 |
self.gen_contents_file(self.settings["target_path"]) |
303 |
self.gen_digest_file(self.settings["target_path"]) |
304 |
|
305 |
- touch(self.settings["autoresume_path"]+"capture") |
306 |
+ touch(capture_resume) |
307 |
|
308 |
def run_local(self): |
309 |
- if "AUTORESUME" in self.settings \ |
310 |
- and os.path.exists(self.settings["autoresume_path"]+"run_local"): |
311 |
+ run_local_resume = pjoin(self.settings["autoresume_path"], "run_local") |
312 |
+ if "AUTORESUME" in self.settings and os.path.exists(run_local_resume): |
313 |
print "Resume point detected, skipping run_local operation..." |
314 |
else: |
315 |
try: |
316 |
if os.path.exists(self.settings["controller_file"]): |
317 |
cmd("/bin/bash "+self.settings["controller_file"]+" run",\ |
318 |
"run script failed.",env=self.env) |
319 |
- touch(self.settings["autoresume_path"]+"run_local") |
320 |
+ touch(run_local_resume) |
321 |
|
322 |
except CatalystError: |
323 |
self.unbind() |
324 |
@@ -1350,8 +1360,8 @@ class generic_stage_target(generic_target): |
325 |
self.chroot_lock.unlock() |
326 |
|
327 |
def unmerge(self): |
328 |
- if "AUTORESUME" in self.settings \ |
329 |
- and os.path.exists(self.settings["autoresume_path"]+"unmerge"): |
330 |
+ unmerge_resume = pjoin(self.settings["autoresume_path"], "unmerge") |
331 |
+ if "AUTORESUME" in self.settings and os.path.exists(unmerge_resume): |
332 |
print "Resume point detected, skipping unmerge operation..." |
333 |
else: |
334 |
if self.settings["spec_prefix"]+"/unmerge" in self.settings: |
335 |
@@ -1379,22 +1389,25 @@ class generic_stage_target(generic_target): |
336 |
except CatalystError: |
337 |
self.unbind() |
338 |
raise |
339 |
- touch(self.settings["autoresume_path"]+"unmerge") |
340 |
+ touch(unmerge_resume) |
341 |
|
342 |
def target_setup(self): |
343 |
- if "AUTORESUME" in self.settings \ |
344 |
- and os.path.exists(self.settings["autoresume_path"]+"target_setup"): |
345 |
+ target_setup_resume = pjoin(self.settings["autoresume_path"], |
346 |
+ "target_setup") |
347 |
+ if "AUTORESUME" in self.settings and os.path.exists(target_setup_resume): |
348 |
print "Resume point detected, skipping target_setup operation..." |
349 |
else: |
350 |
print "Setting up filesystems per filesystem type" |
351 |
cmd("/bin/bash "+self.settings["controller_file"]+\ |
352 |
" target_image_setup "+ self.settings["target_path"],\ |
353 |
"target_image_setup script failed.",env=self.env) |
354 |
- touch(self.settings["autoresume_path"]+"target_setup") |
355 |
+ touch(target_setup_resume) |
356 |
|
357 |
def setup_overlay(self): |
358 |
- if "AUTORESUME" in self.settings \ |
359 |
- and os.path.exists(self.settings["autoresume_path"]+"setup_overlay"): |
360 |
+ setup_overlay_resume = pjoin(self.settings["autoresume_path"], |
361 |
+ "setup_overlay") |
362 |
+ if "AUTORESUME" in self.settings and \ |
363 |
+ os.path.exists(setup_overlay_resume): |
364 |
print "Resume point detected, skipping setup_overlay operation..." |
365 |
else: |
366 |
if self.settings["spec_prefix"]+"/overlay" in self.settings: |
367 |
@@ -1404,11 +1417,11 @@ class generic_stage_target(generic_target): |
368 |
self.settings["target_path"],\ |
369 |
self.settings["spec_prefix"]+"overlay: "+x+\ |
370 |
" copy failed.",env=self.env) |
371 |
- touch(self.settings["autoresume_path"]+"setup_overlay") |
372 |
+ touch(setup_overlay_resume) |
373 |
|
374 |
def create_iso(self): |
375 |
- if "AUTORESUME" in self.settings \ |
376 |
- and os.path.exists(self.settings["autoresume_path"]+"create_iso"): |
377 |
+ create_iso_resume = pjoin(self.settings["autoresume_path"], "create_iso") |
378 |
+ if "AUTORESUME" in self.settings and os.path.exists(create_iso_resume): |
379 |
print "Resume point detected, skipping create_iso operation..." |
380 |
else: |
381 |
""" Create the ISO """ |
382 |
@@ -1418,15 +1431,16 @@ class generic_stage_target(generic_target): |
383 |
env=self.env) |
384 |
self.gen_contents_file(self.settings["iso"]) |
385 |
self.gen_digest_file(self.settings["iso"]) |
386 |
- touch(self.settings["autoresume_path"]+"create_iso") |
387 |
+ touch(create_iso_resume) |
388 |
else: |
389 |
print "WARNING: livecd/iso was not defined." |
390 |
print "An ISO Image will not be created." |
391 |
|
392 |
def build_packages(self): |
393 |
- if "AUTORESUME" in self.settings \ |
394 |
- and os.path.exists(self.settings["autoresume_path"]+\ |
395 |
- "build_packages"): |
396 |
+ build_packages_resume = pjoin(self.settings["autoresume_path"], |
397 |
+ "build_packages") |
398 |
+ if "AUTORESUME" in self.settings and \ |
399 |
+ os.path.exists(build_packages_resume): |
400 |
print "Resume point detected, skipping build_packages operation..." |
401 |
else: |
402 |
if self.settings["spec_prefix"]+"/packages" in self.settings: |
403 |
@@ -1442,7 +1456,7 @@ class generic_stage_target(generic_target): |
404 |
cmd("/bin/bash "+self.settings["controller_file"]+\ |
405 |
" build_packages "+mypack,\ |
406 |
"Error in attempt to build packages",env=self.env) |
407 |
- touch(self.settings["autoresume_path"]+"build_packages") |
408 |
+ touch(build_packages_resume) |
409 |
except CatalystError: |
410 |
self.unbind() |
411 |
raise CatalystError,self.settings["spec_prefix"]+\ |
412 |
@@ -1450,8 +1464,9 @@ class generic_stage_target(generic_target): |
413 |
|
414 |
def build_kernel(self): |
415 |
"Build all configured kernels" |
416 |
- if "AUTORESUME" in self.settings \ |
417 |
- and os.path.exists(self.settings["autoresume_path"]+"build_kernel"): |
418 |
+ build_kernel_resume = pjoin(self.settings["autoresume_path"], |
419 |
+ "build_kernel") |
420 |
+ if "AUTORESUME" in self.settings and os.path.exists(build_kernel_resume): |
421 |
print "Resume point detected, skipping build_kernel operation..." |
422 |
else: |
423 |
if "boot/kernel" in self.settings: |
424 |
@@ -1467,7 +1482,7 @@ class generic_stage_target(generic_target): |
425 |
env=self.env) |
426 |
for kname in mynames: |
427 |
self._build_kernel(kname=kname) |
428 |
- touch(self.settings["autoresume_path"]+"build_kernel") |
429 |
+ touch(build_kernel_resume) |
430 |
except CatalystError: |
431 |
self.unbind() |
432 |
raise CatalystError,\ |
433 |
@@ -1475,9 +1490,9 @@ class generic_stage_target(generic_target): |
434 |
|
435 |
def _build_kernel(self, kname): |
436 |
"Build a single configured kernel by name" |
437 |
- if "AUTORESUME" in self.settings \ |
438 |
- and os.path.exists(self.settings["autoresume_path"]\ |
439 |
- +"build_kernel_"+kname): |
440 |
+ kname_resume = pjoin(self.settings["autoresume_path"], |
441 |
+ "build_kernel_" + kname) |
442 |
+ if "AUTORESUME" in self.settings and os.path.exists(kname_resume): |
443 |
print "Resume point detected, skipping build_kernel for "+kname+" operation..." |
444 |
return |
445 |
self._copy_kernel_config(kname=kname) |
446 |
@@ -1519,8 +1534,7 @@ class generic_stage_target(generic_target): |
447 |
cmd("rm -R "+self.settings["chroot_path"]+\ |
448 |
"/tmp/initramfs_overlay/",env=self.env) |
449 |
|
450 |
- touch(self.settings["autoresume_path"]+\ |
451 |
- "build_kernel_"+kname) |
452 |
+ touch(kname_resume) |
453 |
|
454 |
""" |
455 |
Execute the script that cleans up the kernel build |
456 |
@@ -1573,29 +1587,30 @@ class generic_stage_target(generic_target): |
457 |
"/initramfs_overlay"],env=self.env) |
458 |
|
459 |
def bootloader(self): |
460 |
- if "AUTORESUME" in self.settings \ |
461 |
- and os.path.exists(self.settings["autoresume_path"]+"bootloader"): |
462 |
+ bootloader_resume = pjoin(self.settings["autoresume_path"], "bootloader") |
463 |
+ if "AUTORESUME" in self.settings and os.path.exists(bootloader_resume): |
464 |
print "Resume point detected, skipping bootloader operation..." |
465 |
else: |
466 |
try: |
467 |
cmd("/bin/bash "+self.settings["controller_file"]+\ |
468 |
" bootloader " + self.settings["target_path"],\ |
469 |
"Bootloader script failed.",env=self.env) |
470 |
- touch(self.settings["autoresume_path"]+"bootloader") |
471 |
+ touch(bootloader_resume) |
472 |
except CatalystError: |
473 |
self.unbind() |
474 |
raise CatalystError,"Script aborting due to error." |
475 |
|
476 |
def livecd_update(self): |
477 |
+ livecd_update_resume = pjoin(self.settings["autoresume_path"], |
478 |
+ "livecd_update") |
479 |
if "AUTORESUME" in self.settings \ |
480 |
- and os.path.exists(self.settings["autoresume_path"]+\ |
481 |
- "livecd_update"): |
482 |
+ and os.path.exists(livecd_update_resume): |
483 |
print "Resume point detected, skipping build_packages operation..." |
484 |
else: |
485 |
try: |
486 |
cmd("/bin/bash "+self.settings["controller_file"]+\ |
487 |
" livecd-update","livecd-update failed.",env=self.env) |
488 |
- touch(self.settings["autoresume_path"]+"livecd_update") |
489 |
+ touch(livecd_update_resume) |
490 |
|
491 |
except CatalystError: |
492 |
self.unbind() |