diff --git a/build.sh b/build.sh index c4b79f7..6b49e29 100755 --- a/build.sh +++ b/build.sh @@ -71,6 +71,7 @@ mkdir -p "$tmpdir"; # Config cp -f "$confdir/defconf-$confvar.txt" "$tmpdir/defconf"; +# shellcheck source=./conf/dummy-defconf.txt . "$tmpdir/defconf" || abort "Config for $confvar cannot be executed"; echo " "; diff --git a/conf/resdl-download.txt b/conf/resdl-download.txt index 910ab0f..680d6d6 100644 --- a/conf/resdl-download.txt +++ b/conf/resdl-download.txt @@ -36,6 +36,7 @@ stuff_download=" pre_update_actions() { + # shellcheck source=./res/util/func-resdl.sh . "$resdir/util/func-resdl.sh"; return 0; diff --git a/res/util/script-addon.sh b/res/util/script-addon.sh index f74cd71..339cca6 100755 --- a/res/util/script-addon.sh +++ b/res/util/script-addon.sh @@ -35,6 +35,7 @@ for file in "/tmp/backuptool.functions" "/postinstall/tmp/backuptool.functions"; [ -f "$file" ] && { backuptool="$file"; break; } done; [ "$backuptool" ] || abort "could not find addon.d helper"; +# shellcheck source=/dev/null . "$backuptool" || abort "could not source addon.d helper ($backuptool)"; [ -f "$S/build.prop" ] || abort "could not find a ROM in $S"; diff --git a/src/META-INF/com/google/android/update-binary b/src/META-INF/com/google/android/update-binary index 9c7fb39..4230fe4 100644 --- a/src/META-INF/com/google/android/update-binary +++ b/src/META-INF/com/google/android/update-binary @@ -448,6 +448,7 @@ rm -rf "$filedir"; mkdir -p "$filedir"; unzip -o "$zipfile" "defconf" -d "$filedir/"; [ -f "$filedir/defconf" ] || abort "Could not find a default config"; +# shellcheck source=./conf/dummy-defconf.txt . "$filedir/defconf" || abort "Could not execute default config"; moddir="/data/media/0/$modname"; diff --git a/test.sh b/test.sh index e62ca6b..b690449 100755 --- a/test.sh +++ b/test.sh @@ -25,20 +25,12 @@ done; # These tests are only excluded in the command because they're pointless # We don't need to do them and they only cloud the output -# SC1087: braces for array expansion - # False positive from extended regex - # Arrays aren't in sh anyway -# SC1090: non-constant source -# SC1091: not specified as input # SC2034: assigned but not used -# SC2154: used but not assigned - # All three happen all the time due to sourcing - # Can't add directives because it's all dynamic for script in src/META-INF/com/google/android/update-binary build.sh bump.sh test.sh update.sh res/util/script-addon.sh res/util/script-init.sh; do echo " "; echo " - Linting script: $script"; - shellcheck -s sh -ax -W 0 -e 1087,1090,1091,2034,2154 "$@" -- "$workdir/$script"; + shellcheck -s sh -ax -W 0 -e 2034 "$@" -- "$workdir/$script"; done; echo " "; diff --git a/update.sh b/update.sh index 59fc19c..0ffd84c 100755 --- a/update.sh +++ b/update.sh @@ -59,6 +59,7 @@ mkdir -p "$tmpdir" "$tmpdir/repos" "$(dirname "$updatelog")"; # Config [ -f "$confdir/resdl-download.txt" ] || abort "No resdl-download.txt found"; +# shellcheck source=./conf/resdl-download.txt . "$confdir/resdl-download.txt" || abort "Cannot execute resdl-download.txt"; # Filter list by arguments if given