Skip to content

Commit

Permalink
tools/parse-pkgs.sh: Fix unbound variable error
Browse files Browse the repository at this point in the history
In order to reduce noise while investigating
build issues, let's modify the code of the
resolve_tags() function in such a way that
it doesn't print the error:

./tools/parse-pkgs.sh: line 54: $1: unbound variable

While it's being executed.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
  • Loading branch information
lmr authored and eriknordmark committed Jun 16, 2022
1 parent 5dd8cf5 commit 8b9463e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/parse-pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ synthetic_tag() {
}

resolve_tags() {
local tags="$1"
local file="$2"
local sedcmd
sedcmd=$(echo "$tags" | sed -e "s/^/s#/g" -e "s/$/#g/g" -e "s/=/#/g")
sed -e "$sedcmd" "${file:-}"
local tags="${1:-default}"
local file="${2:-default}"
if [ "$tags" != "default" ]; then
local sedcmd
sedcmd=$(echo "$tags" | sed -e "s/^/s#/g" -e "s/$/#g/g" -e "s/=/#/g")
sed -e "$sedcmd" "${file:-}"
fi
}

gen_tags() {
Expand Down

0 comments on commit 8b9463e

Please sign in to comment.