aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-04-20 14:05:38 +0000
committermerakor <cem@ckyln.com>2020-04-20 14:05:38 +0000
commit59c8a313f94ff1ccfa8e0ecaeb47381eb9ecd6f2 (patch)
tree9c7ded448e1d1af248ba15f3dc511b4403d13e5e
parent55fa26cdb7c4b25e6ddceec0d3bd630013efbbd7 (diff)
downloadcpt-59c8a313f94ff1ccfa8e0ecaeb47381eb9ecd6f2.tar.gz
Revert "kiss: don't use old_ifs"
This reverts commit 3f455b5f40f7741e30e0e6ade74437b1daa22e63. FossilOrigin-Name: 0f011c28a8c9d56f0b9697749c897ce75514165b63e2a00e3c4eaa6f17c3e534
-rwxr-xr-xkiss16
1 files changed, 10 insertions, 6 deletions
diff --git a/kiss b/kiss
index 138698f..f38e923 100755
--- a/kiss
+++ b/kiss
@@ -120,13 +120,11 @@ pkg_find() {
# Figure out which repository a package belongs to by
# searching for directories matching the package name
# in $KISS_PATH/*.
- query=$1 match=$2
+ query=$1 match=$2 IFS=:; set --
# Word splitting is intentional here.
# shellcheck disable=2086
- IFS=: set -- $KISS_PATH "$sys_db"; searchpath="$*" ; set --
-
- for path in $searchpath; do
+ for path in $KISS_PATH "$sys_db" ; do
set +f
for path2 in "$path/"$query; do
@@ -134,6 +132,8 @@ pkg_find() {
done
done
+ IFS=$old_ifs
+
# A package may also not be found due to a repository not being
# readable by the current user. Either way, we need to die here.
[ "$1" ] || die "Package '$query' not in any repository"
@@ -1072,8 +1072,8 @@ pkg_fetch() {
# Create a list of all repositories.
# See [1] at top of script.
- # shellcheck disable=2086
- { IFS=: set -- $KISS_PATH; }
+ # shellcheck disable=2046,2086
+ { IFS=:; set -- $KISS_PATH; IFS=$old_ifs; }
# Update each repository in '$KISS_PATH'. It is assumed that
# each repository is 'git' tracked.
@@ -1389,6 +1389,10 @@ main() {
# that it doesn't change beneath us.
pid=${KISS_PID:-$$}
+ # Store the original value of IFS so we can revert back to it if the
+ # variable is ever changed.
+ old_ifs=$IFS
+
# Force the C locale to speed up things like 'grep' which disable unicode
# etc when this is set. We don't need unicode and a speed up is always
# welcome.