scripts: fix ./install dying silently after the first module (#install)
- Commit
e06086c3d9f04a6c837b16bd74f0eca460d14162- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-16 16:14 UTC (19 days ago)
- Parents
b91b624
device_version_code piped adb through head -1. The script runs with set -euo pipefail, so when head closed the pipe after the matched line, adb took SIGPIPE, the pipeline returned 141, and the failing command assignment aborted the script with no message -- ./install dev all stopped right after printing the appstore versionCodeOverride info, before ever running Gradle. Drop head (the anchored sed pattern can only match the one package) and note why. Verified: bash -n; the version-check loop now walks all 69 modules and reaches the Gradle invocation.
Diff
install
diff --git a/install b/installindex 5aa8764705..d028baa537 100755--- a/install+++ b/install@@ -514,8 +514,10 @@ built_apk() { # on-device versionCode for a package, empty when not installed. device_version_code() {+ # No `head -1` here: with pipefail, head closing the pipe SIGPIPEs adb and+ # the failing assignment kills the script (set -e) after the first module. "$ADB_BIN" -s "$TARGET_SERIAL" shell pm list packages --show-versioncode "$1" 2>/dev/null \- | sed -nE "s/^package:${1//./\\.}[[:space:]]+versionCode:([0-9]+).*/\\1/p" | head -1+ | sed -nE "s/^package:${1//./\\.}[[:space:]]+versionCode:([0-9]+).*/\\1/p" } # exit 0 when the package is installed as a system app.