Skip to contentSkip to conversation

classes/chrpath: improve chrpath failure handling

PATCH New Paul Eggleton 1 participant 1 message Aug 17, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 classes/chrpath: improve chrpath failure handling

When chrpath fails, prefix the error message with the name of the recipe that is being processed, and include the the output from chrpath, as well as making the calling task actually fail.

---
 meta/classes/chrpath.bbclass |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/classes/chrpath.bbclass +5 -3
index ad61fe0..8922248 100644
@@ -74,9 +74,11 @@ def process_dir (directory, d):
             if len(new_rpaths):
                 args = ":".join(new_rpaths)
                 #bb.note("Setting rpath for %s to %s" %(fpath, args))
-                ret = sub.call([cmd, '-r', args, fpath])
-                if ret != 0:
-                    bb.error("chrpath command failed with exit code %d" % ret)
+                p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+                out, err = p.communicate()
+                if p.returncode != 0:
+                    bb.error("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err))
+                    raise bb.build.FuncFailed
 
             if perms:
                 os.chmod(fpath, perms)
Signature · 1 line
1.7.9.5