public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] opkg-utils: if Python support is disabled, delete the Python scripts
@ 2017-06-08 12:58 Ross Burton
  0 siblings, 0 replies; only message in thread
From: Ross Burton @ 2017-06-08 12:58 UTC (permalink / raw)
  To: openembedded-core

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 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
index 06710b5..ed5980b 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -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() {
-- 
2.8.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-08 12:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08 12:58 [PATCH] opkg-utils: if Python support is disabled, delete the Python scripts Ross Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox