Merge lp:~milo/linaro-license-protection/bug1262261 into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Milo Casagrande
Status: Superseded
Proposed branch: lp:~milo/linaro-license-protection/bug1262261
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 64 lines (+30/-13)
1 file modified
scripts/publish_to_snapshots.py (+30/-13)
To merge this branch: bzr merge lp:~milo/linaro-license-protection/bug1262261
Reviewer Review Type Date Requested Status
Fathi Boudra Disapprove
Linaro Automation & Validation Pending
Review via email: mp+199956@code.launchpad.net

Description of the change

Fix for the BUILD-INFO rewrite problem. This targets only the "prebuilt" job type that appears to be affected by the problem.

To post a comment you must log in.
Revision history for this message
Fathi Boudra (fboudra) wrote :

Only the prebuilt job type is used on ci.linaro.org.I argue that we don't want to touch the BUILD-INFO.txt file sent from ci.linaro.org _at all_: append_open_buildinfo/combine_build_info might be used on android job_type only (at best)

review: Disapprove
228. By Milo Casagrande

Make the B-I rewrite happen only for android jobs.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/publish_to_snapshots.py'
--- scripts/publish_to_snapshots.py 2013-12-19 22:09:43 +0000
+++ scripts/publish_to_snapshots.py 2013-12-24 08:40:11 +0000
@@ -434,6 +434,16 @@
434 common_bi.splice(tmp_bi)434 common_bi.splice(tmp_bi)
435435
436436
437def rewrite_build_info(build_dir_path, target_dir_path, tmp_bi):
438 bi_path = os.path.join(target_dir_path, BUILDINFO)
439 if os.path.getsize(tmp_bi) > 0:
440 shutil.copy(tmp_bi, bi_path)
441
442 append_open_buildinfo(target_dir_path)
443 bi = SpliceBuildInfos([target_dir_path])
444 bi.splice(bi_path)
445
446
437def main():447def main():
438 global uploads_path448 global uploads_path
439 global target_path449 global target_path
@@ -462,23 +472,30 @@
462 except BuildInfoException as e:472 except BuildInfoException as e:
463 print e.value473 print e.value
464 return FAIL474 return FAIL
475
465 fd, tmp_bi = tempfile.mkstemp()476 fd, tmp_bi = tempfile.mkstemp()
466 os.close(fd)477 os.close(fd)
467 os.chmod(tmp_bi, 0644)478 os.chmod(tmp_bi, 0644)
468 publisher.combine_buildinfo(build_dir_path, target_dir_path, tmp_bi)479
469 ret = publisher.move_artifacts(args, build_dir_path, target_dir_path)480 try:
470 if ret != PASS:481 if args.job_type == 'android':
471 print "Move Failed"482 publisher.combine_buildinfo(
472 return FAIL483 build_dir_path, target_dir_path, tmp_bi)
473 else:484
474 if os.path.getsize(tmp_bi) > 0:485 ret = publisher.move_artifacts(
475 shutil.copy(tmp_bi, os.path.join(target_dir_path, BUILDINFO))486 args, build_dir_path, target_dir_path)
487
488 if ret != PASS:
489 print "Move Failed"
490 return FAIL
491 else:
492 if args.job_type == 'android':
493 rewrite_build_info(
494 build_dir_path, target_dir_path, tmp_bi)
495 print "Move succeeded"
496 return PASS
497 finally:
476 os.remove(tmp_bi)498 os.remove(tmp_bi)
477 append_open_buildinfo(target_dir_path)
478 bi = SpliceBuildInfos([target_dir_path])
479 bi.splice(os.path.join(target_dir_path, BUILDINFO))
480 print "Move succeeded"
481 return PASS
482 except Exception, details:499 except Exception, details:
483 print "In main() Exception details:", details500 print "In main() Exception details:", details
484 return FAIL501 return FAIL

Subscribers

People subscribed via source and target branches