]> code.ossystems Code Review - openembedded-core.git/commitdiff
opkg-utils: if Python support is disabled, delete the Python scripts
authorRoss Burton <ross.burton@intel.com>
Thu, 8 Jun 2017 12:57:31 +0000 (13:57 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 12 Jun 2017 14:04:08 +0000 (15:04 +0100)
To make it obvious what is lost when python is disabled, actually delete the
scripts so the user can't attempt to use them.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb

index 06710b596b62b4c481234f5e498d28048a606ce7..ed5980b8586491032cdcc196b557c164b1f80ee2 100644 (file)
@@ -19,6 +19,7 @@ S = "${WORKDIR}/git"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
+# For native builds we use the host Python
 PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-subprocess python3-pickle python3-compression python3-textutils python3-stringold"
 PYTHONRDEPS_class-native = ""
 
@@ -31,6 +32,10 @@ do_install() {
        if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
                rm -f "${D}${bindir}/update-alternatives"
        fi
+
+    if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+        grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm
+    fi
 }
 
 do_install_append_class-target() {