cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 7ccd59977d9ad324ddae6da4382f412933d07a0f
parent 51c92cf2c7358f6548eccf36b6e7a5d75a5e6d1b
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Thu,  6 Feb 2020 13:42:57 +0200

kiss: avoid creating argument list

Diffstat:
Mkiss | 14+++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/kiss b/kiss @@ -1234,19 +1234,15 @@ args() { pkg_swap "$@" else - log "Alternatives:" - - # Go to the choices directory and hide errors - # as there is nothing to list if the directory - # doesn't exist. - cd "$sys_db/../choices" 2>/dev/null set +f # Go over each alternative and format the file # name for listing. (pkg_name>usr>bin>ls) - for pkg in *; do - [ "$pkg" = '*' ] || printf '%s\n' "$pkg" - done | sed 's|>| /|;s|>|/|g' + for pkg in "$sys_db/../choices"/*; do + printf '%s\n' "${pkg##*/}" + done | + + sed 's|>| /|; s|>|/|g; /\*/d' fi ;;