1 |
commit: c059e969ff0e106823e0bed4729d4c04db02eee8 |
2 |
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 20 07:05:33 2021 +0000 |
4 |
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 20 07:05:33 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=c059e969 |
7 |
|
8 |
Support more then one Chaange USE |
9 |
|
10 |
Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org> |
11 |
|
12 |
buildbot_gentoo_ci/steps/builders.py | 48 ++++++++++++++++++++++++------------ |
13 |
1 file changed, 32 insertions(+), 16 deletions(-) |
14 |
|
15 |
diff --git a/buildbot_gentoo_ci/steps/builders.py b/buildbot_gentoo_ci/steps/builders.py |
16 |
index d9817d8..50f924d 100644 |
17 |
--- a/buildbot_gentoo_ci/steps/builders.py |
18 |
+++ b/buildbot_gentoo_ci/steps/builders.py |
19 |
@@ -86,21 +86,35 @@ def PersOutputOfEmerge(rc, stdout, stderr): |
20 |
# split the lines |
21 |
#FIXME: Handling of stderr output |
22 |
stderr_line_list = [] |
23 |
+ emerge_output['change_use'] = False |
24 |
for line in stderr.split('\n'): |
25 |
if 'Change USE:' in line: |
26 |
line_list = line.split(' ') |
27 |
change_use_list = [] |
28 |
# get cpv |
29 |
cpv_split = line_list[1].split(':') |
30 |
- change_use_list.append(cpv_split[0]) |
31 |
+ change_use = {} |
32 |
# add use flags |
33 |
if line_list[4].startswith('+') or line_list[4].startswith('-'): |
34 |
- # we only support one for now |
35 |
+ # we only support tre for now |
36 |
if line_list[4].endswith(')'): |
37 |
change_use_list.append(line_list[4].replace(')', '')) |
38 |
+ elif line_list[5].endswith(')'): |
39 |
+ change_use_list.append(line_list[4]) |
40 |
+ change_use_list.append(line_list[5].replace(')', '')) |
41 |
+ elif line_list[6].endswith(')'): |
42 |
+ change_use_list.append(line_list[4]) |
43 |
+ change_use_list.append(line_list[5]) |
44 |
+ change_use_list.append(line_list[6].replace(')', '')) |
45 |
+ elif not line_list[6].endswith(')'): |
46 |
+ change_use_list.append(line_list[4]) |
47 |
+ change_use_list.append(line_list[5]) |
48 |
+ change_use_list.append(line_list[6]) |
49 |
else: |
50 |
change_use_list = False |
51 |
- emerge_output['change_use'] = change_use_list |
52 |
+ if change_use_list: |
53 |
+ change_use[cpv_split[0]] = change_use_list |
54 |
+ emerge_output['change_use'] = change_use |
55 |
err_line_list = [] |
56 |
if line.startswith(' * '): |
57 |
if line.endswith('.log.gz'): |
58 |
@@ -226,7 +240,7 @@ class SetupPropertys(BuildStep): |
59 |
|
60 |
name = 'SetupPropertys' |
61 |
description = 'Running' |
62 |
- descriptionDone = 'Ran' |
63 |
+ #descriptionDone = 'Ran' |
64 |
descriptionSuffix = None |
65 |
haltOnFailure = True |
66 |
flunkOnFailure = True |
67 |
@@ -240,6 +254,7 @@ class SetupPropertys(BuildStep): |
68 |
def run(self): |
69 |
self.gentooci = self.master.namedServices['services'].namedServices['gentooci'] |
70 |
print('build this %s' % self.getProperty("cpv")) |
71 |
+ self.descriptionDone = 'Building this %s' % self.getProperty("cpv") |
72 |
self.setProperty('portage_repos_path', self.portage_repos_path, 'portage_repos_path') |
73 |
projectrepository_data = self.getProperty('projectrepository_data') |
74 |
print(projectrepository_data) |
75 |
@@ -550,6 +565,7 @@ class CheckEmergeLogs(BuildStep): |
76 |
# update package.* if needed and rerun pre-build max 3 times |
77 |
if self.step == 'pre-build': |
78 |
print(emerge_output) |
79 |
+ # this should be set in the config |
80 |
if self.getProperty('rerun') <= 3: |
81 |
# when we need to change use. we could rerun pre-build with |
82 |
# --autounmask-use=y --autounmask-write=y --autounmask-only=y |
83 |
@@ -560,21 +576,21 @@ class CheckEmergeLogs(BuildStep): |
84 |
separator = '\n' |
85 |
separator2 = ' ' |
86 |
change_use_list = [] |
87 |
- cpv = emerge_output['change_use'][0] |
88 |
- c = yield catpkgsplit(cpv)[0] |
89 |
- p = yield catpkgsplit(cpv)[1] |
90 |
- change_use_list.append(c + '/' + p) |
91 |
- # we only support one use |
92 |
- use_flag = emerge_output['change_use'][1] |
93 |
- if use_flag.startswith('+'): |
94 |
- change_use_list.append(use_flag.replace('+', '')) |
95 |
- else: |
96 |
- change_use_list.append(use_flag) |
97 |
+ for cpv, v in emerge_output['change_use'].items(): |
98 |
+ c = yield catpkgsplit(cpv)[0] |
99 |
+ p = yield catpkgsplit(cpv)[1] |
100 |
+ change_use_list.append(c + '/' + p) |
101 |
+ for use_flag in v: |
102 |
+ if use_flag.startswith('+'): |
103 |
+ change_use_list.append(use_flag.replace('+', '')) |
104 |
+ else: |
105 |
+ change_use_list.append(use_flag) |
106 |
change_use_string = separator2.join(change_use_list) |
107 |
self.aftersteps_list.append( |
108 |
steps.StringDownload(change_use_string + separator, |
109 |
- workerdest='zz_autouse' + str(self.getProperty('rerun')), |
110 |
- workdir='/etc/portage/package.use/') |
111 |
+ workerdest='zz_autouse' + str(self.getProperty('rerun')), |
112 |
+ workdir='/etc/portage/package.use/' |
113 |
+ ) |
114 |
) |
115 |
# rerun |
116 |
self.aftersteps_list.append(RunEmerge(step='pre-build')) |