webplot: fix execution
Our python libraries have shifted, and the execution wrapper was
now faulting over an empty folder in the lookup path; make it
silently skip over an empty folder.
BUG=b:171795683
TEST=Manual, confirm original failure, workaround, then fix.
Change-Id: I990f4507d9625505637470a2ba0bd8520b70b08e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/touch_firmware_test/+/2529602
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sean O'Brien <seobrien@chromium.org>
Reviewed-by: Harry Cutts <hcutts@chromium.org>
Tested-by: Kenneth Albanowski <kenalba@google.com>
Commit-Queue: Kenneth Albanowski <kenalba@google.com>
Auto-Submit: Kenneth Albanowski <kenalba@google.com>
diff --git a/webplot/chromeos_wrapper.sh b/webplot/chromeos_wrapper.sh
index d907d11..3bb94aa 100755
--- a/webplot/chromeos_wrapper.sh
+++ b/webplot/chromeos_wrapper.sh
@@ -52,17 +52,13 @@
exit 0
fi
-# Search the webplot directory.
-# Stop at the first found python3 webplot directory.
+# Search for the first python3 webplot directory.
# Priority is given to /usr/lib*.
-DIRS="/usr/lib*/python3* /usr/local/lib*/python3*"
-for d in $DIRS; do
- PROG_DIR="$(find $d -name $PROG -type d -print -quit)"
- if [ -n "$PROG_DIR" ]; then
- echo "Found webplot path in $PROG_DIR"
- break
- fi
-done
+PROG_DIR="$(find /usr/lib*/python3* /usr/local/lib*/python3* \
+ -name "$PROG" -type d -print -quit 2> /dev/null || true)"
+if [ -n "$PROG_DIR" ]; then
+ echo "Found webplot path in $PROG_DIR"
+fi
if [ -z "$PROG_DIR" ]; then
die "Fail to find the path of $PROG."