Skip to content

Commit

Permalink
Merge pull request #3303 from grische/remove-scripts-wide-shellcheck-…
Browse files Browse the repository at this point in the history
…excludes

scripts: remove scripts-wide shellcheck excludes
  • Loading branch information
blocktrron authored Jul 27, 2024
2 parents e9acd52 + b6f7e4b commit f7d41c5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions scripts/default_feeds.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion scripts/lint-sh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions scripts/module_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
4 changes: 4 additions & 0 deletions scripts/modules.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/sh

# shellcheck source=./modules
. ./modules

[ ! -f "$GLUON_SITEDIR"/modules ] || . "$GLUON_SITEDIR"/modules

# shellcheck disable=SC2086
Expand Down
1 change: 1 addition & 0 deletions scripts/sha256sum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ else
exit 1
fi

# shellcheck disable=SC2181
[ "$?" -eq 0 ] || exit 1

echo "$ret" | awk '{ print $1 }'
12 changes: 8 additions & 4 deletions scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f7d41c5

Please sign in to comment.