diff --git a/scripts/default_feeds.sh b/scripts/default_feeds.sh index 0806539ac89a2d39fba8319f30bcd22bf05eb075..637ed26b42a13703b9ef7595b59de41fd9b83012 100644 --- a/scripts/default_feeds.sh +++ b/scripts/default_feeds.sh @@ -1,2 +1,5 @@ +#!/bin/sh + # list feeds which don't start with # DEFAULT_FEEDS="$(awk '!/^#/ {print $2}' openwrt/feeds.conf.default)" +export DEFAULT_FEEDS diff --git a/scripts/lint-sh.sh b/scripts/lint-sh.sh index 96335c7aa30e8006b1e04c0f5f6ecb5de1b2a656..93b3d09a49211eb8dbb00648109ead5144a8d40d 100755 --- a/scripts/lint-sh.sh +++ b/scripts/lint-sh.sh @@ -24,5 +24,5 @@ find scripts -type f | while read -r file; do is_scriptfile "$file" || continue echo "Checking $file" - shellcheck -f gcc -x -e SC2154,SC1090,SC2181,SC2155,SC2148,SC2034,SC2148 "$file" + shellcheck -f gcc -x "$file" done diff --git a/scripts/module_check.sh b/scripts/module_check.sh index 76e0e56af29f37e28063642b9e36169fe38fa137..8199f49caa83b6fd2ae0688ef508dfe48804b60b 100755 --- a/scripts/module_check.sh +++ b/scripts/module_check.sh @@ -14,8 +14,10 @@ fi need_sync=false for module in $GLUON_MODULES; do - var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_') - eval 'commit_expected=${'"${var}"'_COMMIT}' + echo "Checking module '$module'" + var=${module//\//_} + _remote_commit=${var^^}_COMMIT + commit_expected=${!_remote_commit} prefix=invalid cd "$GLUONDIR/$module" 2>/dev/null && prefix="$(git rev-parse --show-prefix 2>/dev/null)" diff --git a/scripts/modules.sh b/scripts/modules.sh index d28d845aa5555d056b8a079843240d6bba16baba..3d2df8495c0f0f3c99455313d7f248b31c013296 100644 --- a/scripts/modules.sh +++ b/scripts/modules.sh @@ -1,4 +1,8 @@ +#!/bin/sh + +# shellcheck source=./modules . ./modules + [ ! -f "$GLUON_SITEDIR"/modules ] || . "$GLUON_SITEDIR"/modules # shellcheck disable=SC2086 diff --git a/scripts/sha256sum.sh b/scripts/sha256sum.sh index 99d97acd0cb57430dec412cf76a0e58c072d531f..546634174060481ffb90863862487a6781b3d040 100755 --- a/scripts/sha256sum.sh +++ b/scripts/sha256sum.sh @@ -15,6 +15,7 @@ else exit 1 fi +# shellcheck disable=SC2181 [ "$?" -eq 0 ] || exit 1 echo "$ret" | awk '{ print $1 }' diff --git a/scripts/update.sh b/scripts/update.sh index a9f28b05fa343a2446c9c748723fad254ea75b9f..365e86c2e154659032e569c5f290d1ebfd3504fe 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -9,10 +9,14 @@ GLUONDIR="$(pwd)" for module in $GLUON_MODULES; do echo "--- Updating module '$module' ---" - var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_') - eval 'repo=${'"${var}"'_REPO}' - eval 'branch=${'"${var}"'_BRANCH}' - eval 'commit=${'"${var}"'_COMMIT}' + var=${module//\//_} + _remote_url=${var^^}_REPO + _remote_branch=${var^^}_BRANCH + _remote_commit=${var^^}_COMMIT + + repo=${!_remote_url} + branch=${!_remote_branch} + commit=${!_remote_commit} mkdir -p "$GLUONDIR/$module" cd "$GLUONDIR/$module"