Skip to contentSkip to conversation

package_manager.py: check the result of create_index

PATCH New Hongxu Jia 1 participant 2 messages Nov 21, 2014

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover package_manager.py: check the result of create_index

The following changes since commit c09e56168ea5a9e4ff3e7f38d7da79e5d883021b:

bitbake: bitbake-worker: exit normally when SIGHUP (2014-11-20 14:15:32 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-package_manager
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-package_manager

Hongxu Jia (1):
package_manager.py: check the result of create_index

 meta/lib/oe/package_manager.py | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 package_manager.py: check the result of create_index

While invoking create_index failed, there was no error output and didn't break the build until the package installation.
...
|ERROR: run-postinsts not found in the base feeds (qemux86 i586 x86 noarch any all).
...

The reason is we used multiprocessing to execute create_index, and did not check its invoking result.

---
 meta/lib/oe/package_manager.py | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
meta/lib/oe/package_manager.py +16 -4
index e18e071..3c1e74f 100644
@@ -16,11 +16,14 @@ def create_index(arg):
 
     try:
         bb.note("Executing '%s' ..." % index_cmd)
-        subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True)
+        result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True)
     except subprocess.CalledProcessError as e:
         return("Index creation command '%s' failed with return code %d:\n%s" %
                (e.cmd, e.returncode, e.output))
 
+    if result:
+        bb.note(result)
+
     return None
 
 
@@ -120,7 +123,10 @@ class RpmIndexer(Indexer):
             bb.note("There are no packages in %s" % self.deploy_dir)
             return
 
-        oe.utils.multiprocess_exec(index_cmds, create_index)
+        result = oe.utils.multiprocess_exec(index_cmds, create_index)
+        if result:
+            bb.fatal('%s' % ('\n'.join(result)))
+
 
 class OpkgIndexer(Indexer):
     def write_index(self):
@@ -156,7 +162,10 @@ class OpkgIndexer(Indexer):
             bb.note("There are no packages in %s!" % self.deploy_dir)
             return
 
-        oe.utils.multiprocess_exec(index_cmds, create_index)
+        result = oe.utils.multiprocess_exec(index_cmds, create_index)
+        if result:
+            bb.fatal('%s' % ('\n'.join(result)))
+
 
 
 class DpkgIndexer(Indexer):
@@ -200,7 +209,10 @@ class DpkgIndexer(Indexer):
             bb.note("There are no packages in %s" % self.deploy_dir)
             return
 
-        oe.utils.multiprocess_exec(index_cmds, create_index)
+        result = oe.utils.multiprocess_exec(index_cmds, create_index)
+        if result:
+            bb.fatal('%s' % ('\n'.join(result)))
+
 
 
 class PkgsList(object):
Signature · 1 line
1.9.1