aboutsummaryrefslogtreecommitdiff
path: root/src/cpt-lib.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpt-lib.in')
-rw-r--r--src/cpt-lib.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cpt-lib.in b/src/cpt-lib.in
index 4d81ffb..729b178 100644
--- a/src/cpt-lib.in
+++ b/src/cpt-lib.in
@@ -1830,9 +1830,13 @@ pkg_get_base() (
# cpt-base is an optional file, return with success if it doesn't exist.
[ -f "$CPT_ROOT/etc/cpt-base" ] || return 0
nonl=$1; set --
- while read -r pkg _; do
- [ "${pkg##\#*}" ] || continue
- set -- "$@" "$pkg"
+
+ # Older versions of shellcheck warns us that the variable is changing on the
+ # subshell. That is our purpose here, thank you very much.
+ # shellcheck disable=SC2030
+ while read -r pkgname _; do
+ [ "${pkgname##\#*}" ] || continue
+ set -- "$@" "$pkgname"
done < "$CPT_ROOT/etc/cpt-base"
if [ "$nonl" ]; then printf '%s ' "$@"; else printf '%s\n' "$@"; fi
)