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
1=== modified file 'scripts/publish_to_snapshots.py'
2--- scripts/publish_to_snapshots.py 2013-12-19 22:09:43 +0000
3+++ scripts/publish_to_snapshots.py 2013-12-24 08:40:11 +0000
4@@ -434,6 +434,16 @@
5 common_bi.splice(tmp_bi)
6
7
8+def rewrite_build_info(build_dir_path, target_dir_path, tmp_bi):
9+ bi_path = os.path.join(target_dir_path, BUILDINFO)
10+ if os.path.getsize(tmp_bi) > 0:
11+ shutil.copy(tmp_bi, bi_path)
12+
13+ append_open_buildinfo(target_dir_path)
14+ bi = SpliceBuildInfos([target_dir_path])
15+ bi.splice(bi_path)
16+
17+
18 def main():
19 global uploads_path
20 global target_path
21@@ -462,23 +472,30 @@
22 except BuildInfoException as e:
23 print e.value
24 return FAIL
25+
26 fd, tmp_bi = tempfile.mkstemp()
27 os.close(fd)
28 os.chmod(tmp_bi, 0644)
29- publisher.combine_buildinfo(build_dir_path, target_dir_path, tmp_bi)
30- ret = publisher.move_artifacts(args, build_dir_path, target_dir_path)
31- if ret != PASS:
32- print "Move Failed"
33- return FAIL
34- else:
35- if os.path.getsize(tmp_bi) > 0:
36- shutil.copy(tmp_bi, os.path.join(target_dir_path, BUILDINFO))
37+
38+ try:
39+ if args.job_type == 'android':
40+ publisher.combine_buildinfo(
41+ build_dir_path, target_dir_path, tmp_bi)
42+
43+ ret = publisher.move_artifacts(
44+ args, build_dir_path, target_dir_path)
45+
46+ if ret != PASS:
47+ print "Move Failed"
48+ return FAIL
49+ else:
50+ if args.job_type == 'android':
51+ rewrite_build_info(
52+ build_dir_path, target_dir_path, tmp_bi)
53+ print "Move succeeded"
54+ return PASS
55+ finally:
56 os.remove(tmp_bi)
57- append_open_buildinfo(target_dir_path)
58- bi = SpliceBuildInfos([target_dir_path])
59- bi.splice(os.path.join(target_dir_path, BUILDINFO))
60- print "Move succeeded"
61- return PASS
62 except Exception, details:
63 print "In main() Exception details:", details
64 return FAIL

Subscribers

People subscribed via source and target branches