dev image: change python detection
Older Python versions would force /usr/bin/python creation, but newer
ones do not. Change the logic from detecting python itself to whether
the wrappers are available.
BUG=b:187795220
TEST=CQ passes
Change-Id: I03be3b2bcc1465c28cf5aeea28c70dfcc45fd5cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/3588984
Tested-by: Mike Frysinger <vapier@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Cindy Lin <xcl@google.com>
Commit-Queue: Cindy Lin <xcl@google.com>
diff --git a/build_library/dev_image_util.sh b/build_library/dev_image_util.sh
index 09c4723..9b5953d 100755
--- a/build_library/dev_image_util.sh
+++ b/build_library/dev_image_util.sh
@@ -37,8 +37,8 @@
# If Python is installed in the dev image, make sure the latest is the
# default. If we have multiple versions, there's no guarantee as to which
# was selected.
- if [[ -e "${root_dev_dir}/usr/bin/python" ]]; then
- sudo env ROOT="${root_dev_dir}" eselect python update
+ if [[ -e "${root_dev_dir}/usr/bin/python-wrapper" ]]; then
+ info_run sudo env ROOT="${root_dev_dir}" eselect python update
fi
# Run depmod to recalculate the kernel module dependencies.