aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-05-14 10:37:25 +0000
committermerakor <cem@ckyln.com>2020-05-14 10:37:25 +0000
commit77c35536707fab0de48070cf028f7d0a3a5eeb1e (patch)
tree2da20ee64cc4b7701eabebb281ea98ac5090fe8c
parent50c2211fa1cd2f7624b8ccee48c891f80514026d (diff)
downloadcpt-77c35536707fab0de48070cf028f7d0a3a5eeb1e.tar.gz
kiss: make pop easier to read and understand
FossilOrigin-Name: e57368410658ef7270fb518f342b4942f365572775da3d589579cf84e20160c4
-rwxr-xr-xkiss8
1 files changed, 4 insertions, 4 deletions
diff --git a/kiss b/kiss
index ecee601..9875c53 100755
--- a/kiss
+++ b/kiss
@@ -75,7 +75,7 @@ pop() {
# Remove an item from a "string list". This allows us
# to remove a 'sed' call and reuse this code throughout.
del=$1
- shift
+ shift 2
for i do [ "$i" = "$del" ] || printf %s " $i "; done
}
@@ -619,7 +619,7 @@ pkg_build() {
# installed as a dependency.
# shellcheck disable=2086
for pkg do
- contains "$deps" "$pkg" && explicit=$(pop "$pkg" $explicit)
+ contains "$deps" "$pkg" && explicit=$(pop "$pkg" from $explicit)
done
# See [1] at top of script.
@@ -644,7 +644,7 @@ pkg_build() {
# Remove the now installed package from the build list.
# See [1] at top of script.
# shellcheck disable=2046,2086
- set -- $(pop "$pkg" "$@")
+ set -- $(pop "$pkg" from "$@")
} done
for pkg do pkg_sources "$pkg"; done
@@ -811,7 +811,7 @@ pkg_conflicts() {
# Generate a list of all installed package manifests
# and remove the current package from the list.
# shellcheck disable=2046,2086
- set -- $(set +f; pop "$sys_db/$p_name/manifest" "$sys_db"/*/manifest)
+ set -- $(set +f; pop "$sys_db/$p_name/manifest" from "$sys_db"/*/manifest)
[ -s "$KISS_TMPDIR/$pid-m" ] || return 0