aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-06 11:31:47 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-06 11:31:47 +0000
commita94667d38a4d78f6e645bf0a138d77a4867923a9 (patch)
tree3f7458956f9f120647f63beccb4e62d7ac2d78d2 /kiss
parent04ced018883e09cb712e4bf45aacecea38f87b0f (diff)
downloadcpt-a94667d38a4d78f6e645bf0a138d77a4867923a9.tar.gz
kiss: kiss b, simpler
FossilOrigin-Name: ada8d4f07c327ed214d383d3bcdf4ce197457ae0f82ce18b4c4bb8ec483d8f55
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss17
1 files changed, 4 insertions, 13 deletions
diff --git a/kiss b/kiss
index 47a17e4..1d2c00a 100755
--- a/kiss
+++ b/kiss
@@ -1252,18 +1252,9 @@ args() {
b|build)
# If no arguments were passed, rebuild all packages.
- [ "$1" ] || {
- cd "$sys_db" || die "Failed to find package db"
+ [ "$1" ] || { cd "$sys_db" && { set +f; set -f -- *; } }
- # Use a glob after 'cd' to generate a list of all installed
- # packages based on directory names.
- set +f; set -f -- *
-
- # Undo the above 'cd' to ensure we stay in the same location.
- cd - >/dev/null
- }
-
- pkg_build "$@"
+ pkg_build "${@:?No packages installed}"
;;
c|checksum)
@@ -1332,13 +1323,13 @@ main() {
# Prefer GNU grep if installed as it is much much faster than busybox's
# implementation. Very much worth it if you value performance over
- # POSIX correctness.
+ # POSIX correctness (grep quoted to avoid shellcheck false-positive).
grep=$(command -v ggrep) || grep='grep'
# Prefer libarchive tar or GNU tar if installed as they are much
# much faster than busybox's implementation. Very much worth it if
# you value performance.
- tar=$(command -v bsdtar || command -v gtar) || tar='tar'
+ tar=$(command -v bsdtar || command -v gtar) || tar=tar
# Figure out which 'sudo' command to use based on the user's choice or
# what is available on the system.