cpt

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

commit ab632329ab2e95177074b320a4a7163e0e402917
parent c5ecd7c16c6bbc95df25f0e4d37c88a6b74cc575
Author: Cem Keylan <cem@ckyln.com>
Date:   Sun, 19 Apr 2020 21:47:40 +0300

kiss: implement user scripts from upstream

Diffstat:
Mkiss | 45+++++++++++++++++++++++++++++++++------------
1 file changed, 33 insertions(+), 12 deletions(-)

diff --git a/kiss b/kiss @@ -128,7 +128,7 @@ pkg_find() { set +f for path2 in "$path/"$query; do - [ -d "$path2" ] && set -f -- "$@" "$path2" + [ -e "$path2" ] && set -f -- "$@" "$path2" done done @@ -1338,19 +1338,40 @@ args() { h|help|-h|--help|'') log 'kiss [a|b|c|f|i|l|r|s|u|v] [pkg] [pkg] [pkg]' - log 'alternatives: List and swap to alternatives' - log 'build: Build a package' - log 'checksum: Generate checksums' - log 'fetch: Fetch repositories' - log 'install: Install a package' - log 'list: List installed packages' - log 'remove: Remove a package' - log 'search: Search for a package' - log 'update: Check for updates' - log 'version: Package manager version' + log 'alternatives List and swap to alternatives' + log 'build Build a package' + log 'checksum Generate checksums' + log 'fetch Fetch repositories' + log 'install Install a package' + log 'list List installed packages' + log 'remove Remove a package' + log 'search Search for a package' + log 'update Check for updates' + log 'version Package manager version + ' + log "Installed extensions (kiss-* in \$PATH)" + + set -- + + for path in $(KISS_PATH=$PATH pkg_find kiss-* all); do + set -- "${path#*/kiss-}" "$@" + max=$((${#1} > max ? ${#1} : max)) + done + + for path do + printf '\033[31;1m->\033[m %-*s ' "$max" "${path#*/kiss-}" + sed -n 's/^# *//;2p' "$(command -v "kiss-$path")" + done | sort -uk1 >&2 + ;; - *) die "'kiss $action' is not a valid command" ;; + *) + util=$(KISS_PATH=$PATH pkg_find "kiss-$action"* 2>/dev/null) || + die "'kiss $action' is not a valid command" + + "$util" "$@" + ;; + esac }