commit:     f4ee7748cdd77534ace36b6bd957f27229fbd748
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 29 00:24:46 2021 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Mon Mar 29 00:24:46 2021 +0000
URL:        
https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=f4ee7748

Change code for the PersOutputOfEbuildSH so we may fix *deps to long lines

Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>

 buildbot_gentoo_ci/steps/portage.py | 32 +++++++++++++++++++-------------
 buildbot_gentoo_ci/steps/version.py | 10 ++++++----
 2 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/buildbot_gentoo_ci/steps/portage.py 
b/buildbot_gentoo_ci/steps/portage.py
index e2315cb..293b862 100644
--- a/buildbot_gentoo_ci/steps/portage.py
+++ b/buildbot_gentoo_ci/steps/portage.py
@@ -32,27 +32,33 @@ def WriteTextToFile(path, text_list):
 
 def PersOutputOfEbuildSH(rc, stdout, stderr):
     metadata = None
-    metadata_lines = stdout.splitlines()
-    metadata_valid = True
     NoSplit = []
     NoSplit.append('DESCRIPTION')
-    if len(auxdbkeys) != len(metadata_lines):
-        # Don't trust bash's returncode if the
+    #make dict of the stout
+    index = 1
+    metadata_line_dict = {}
+    for text_line in stdout.splitlines():
+        metadata_line_dict[index] = text_line
+        index = index + 1
+    # should have 22 lines
+    if len(auxdbkeys) != index -1:
         # number of lines is incorrect.
         return {
             'auxdb' : metadata
             }
-    else:
-        metadata_tmp = dict(zip(auxdbkeys, metadata_lines))
+    # split all keys to list instead of speces
     metadata = {}
-    for k, v in metadata_tmp.items():
-        if v == '':
-            metadata[k] = None
+    i = 1
+    for key in auxdbkeys:
+        if metadata_line_dict[i] == '':
+            metadata[key] = None
         else:
-            if ' ' in v and k not in NoSplit:
-                metadata[k] = v.split(' ')
+            if ' ' in metadata_line_dict[i] and key not in NoSplit:
+                metadata[key] = metadata_line_dict[i].split(' ')
             else:
-                metadata[k] = v
+                metadata[key] = []
+                metadata[key].append(metadata_line_dict[i])
+        i = i + 1
     return {
         'auxdb' : metadata
         }
@@ -519,7 +525,7 @@ class SetEnvForEbuildSH(BuildStep):
                                                             
command=ebuild_commands,
                                                             env=ebuild_env,
                                                             
workdir=self.getProperty("builddir"),
-                                                            strip=True,
+                                                            strip=False,
                                                             
extract_fn=PersOutputOfEbuildSH
                                                             ))
         yield self.build.addStepsAfterCurrentStep(addStepEbuildSH)

diff --git a/buildbot_gentoo_ci/steps/version.py 
b/buildbot_gentoo_ci/steps/version.py
index 143a758..4c35914 100644
--- a/buildbot_gentoo_ci/steps/version.py
+++ b/buildbot_gentoo_ci/steps/version.py
@@ -125,9 +125,13 @@ class AddVersionKeyword(BuildStep):
         self.gentooci = 
self.master.namedServices['services'].namedServices['gentooci']
         self.version_keyword_dict = {}
         auxdb = self.getProperty("auxdb")['KEYWORDS']
-        if auxdb is None:
-            auxdb = []
+        if auxdb is None or not isinstance(auxdb, list):
+            self.version_keyword_dict = None
+            self.setProperty('version_keyword_dict', 
self.version_keyword_dict, 'version_keyword_dict')
+            return SUCCESS
+        print(auxdb)
         for keyword in auxdb:
+            print(keyword)
             status = 'stable'
             if keyword[0] in ["~"]:
                 keyword = keyword[1:]
@@ -147,8 +151,6 @@ class AddVersionKeyword(BuildStep):
                                                 
version_keyword_data['keyword_id'],
                                                 version_keyword_data['status'])
             self.version_keyword_dict[keyword] = version_keyword_data
-        if self.version_keyword_dict == {}:
-            self.version_keyword_dict = None
         self.setProperty('version_keyword_dict', self.version_keyword_dict, 
'version_keyword_dict')
         return SUCCESS
 

Reply via email to