Fix parsing errors with shellcheck.

Fixes shellcheck parsing errors by using safer quoting practices with
    eval.

    Line 217:
        for FILE in $SBOPKG_REPOS_D/*.repo; do
        ^-- SC1009: The mentioned syntax error was in this for loop.

    Line 219:
            while read LINE; do
            ^-- SC1073: Couldn't parse this while loop. Fix to allow more checks.
                             ^-- SC1061: Couldn't find 'done' for this 'do'.

    Line 221:
                eval TMPARRAY=( "$LINE" )
                              ^-- SC1036: '(' is invalid here. Did you forget to escape it?
                              ^-- SC1062: Expected 'done' matching previously mentioned 'do'.
                              ^-- SC1072: Expected 'done'. Fix any mentioned problems and try again.
                              ^-- SC1098: Quote/escape special characters when using eval, e.g. eval "a=(b)".

    Line 3054:
        for i in ${!MD5SUM[@]}; do
        ^-- SC1009: The mentioned syntax error was in this for loop.

    Line 3056:
            while :; do
            ^-- SC1073: Couldn't parse this while loop. Fix to allow more checks.
                     ^-- SC1061: Couldn't find 'done' for this 'do'.

    Line 3065:
                eval SRCNAME=( $(
                             ^-- SC1036: '(' is invalid here. Did you forget to escape it?
                             ^-- SC1062: Expected 'done' matching previously mentioned 'do'.
                             ^-- SC1072: Expected 'done'. Fix any mentioned problems and try again.
                             ^-- SC1098: Quote/escape special characters when using eval, e.g. eval "a=(b)".

Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
orbea 2018-04-26 21:55:15 -07:00 committed by Willy Sudiarto Raharjo
parent c24c2dd5d6
commit 836c067774
No known key found for this signature in database
GPG Key ID: 887B8374D7333381
3 changed files with 9 additions and 6 deletions

View File

@ -93,3 +93,4 @@ We moved to github, so revision number no longer used
Alan
Erich Ritz
arcctgx
orbea

View File

@ -218,7 +218,7 @@ load_repositories() {
# Reading from $FILE...
while read LINE; do
grep -q '#' <<< "$LINE" && continue
eval TMPARRAY=( "$LINE" )
eval "TMPARRAY=( $LINE )"
[[ ${#TMPARRAY[@]} -eq 0 ]] && continue;
# Sanity checks
# these two assignments work around a bash3-4 incompatibility
@ -3062,11 +3062,11 @@ get_source() {
# inside file names.
# We know that we could obtain the same result faster by mangling
# with IFS, but the resulting code was a bit too hacky.
eval SRCNAME=( $(
eval "SRCNAME=( $(
while read LINE; do
printf '%q ' "$LINE"
done <<< "$SRCNAME"
) )
printf '%q ' $LINE
done <<< $SRCNAME
) )"
check_source $PKG ${MD5SUM[$i]} "${SRCNAME[$i]}"
case $? in

View File

@ -1,6 +1,6 @@
SBOPKG NEWS
sbopkg-dev (2018-04-26 00:253:36 UTC)
sbopkg-dev (2018-04-27 15:36:23 UTC)
FEATURES
* sqg: Parallelize building of single and all packages by option -j.
Patch by Marcel Saegebarth.
@ -37,6 +37,8 @@ sbopkg-dev (2018-04-26 00:253:36 UTC)
Patch by Erich Ritz
* Fix bug in updates_compare_versions()
Patch by arcctgx (#41)
* Fix parsing errors with shellcheck.
Patch by orbea (#42)
sbopkg 0.38.1 (2016-09-01 13:42 UTC)
FEATURES