diff mbox

lib/oe/package_manager: bail if createrepo can't be found

Message ID 1481822455-17217-1-git-send-email-ross.burton@intel.com
State Accepted
Commit c87361fc886432a9db584712bf3e41ecd0541960
Headers show

Commit Message

Ross Burton Dec. 15, 2016, 5:20 p.m. UTC
If createrepo isn't found then the errors later are mysterious, so explicitly
check and error out early if it isn't there.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/lib/oe/package_manager.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.8.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox

Patch

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index bb45869..e557473 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -164,7 +164,11 @@  class RpmIndexer(Indexer):
 
         archs = archs.union(set(sdk_pkg_archs))
 
-        rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo")
+        rpm_createrepo = bb.utils.which(os.environ['PATH'], "createrepo")
+        if not rpm_createrepo:
+            bb.error("Cannot rebuild index as createrepo was not found in %s" % os.environ['PATH'])
+            return
+
         if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
             signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
         else: