cpt

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

commit 1e4f9e89b2db56e61589139f84d504237fdfe8d9
parent ea9dc1278ae3916ad1efe72c6afb873060879e09
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Tue, 28 Jan 2020 23:32:39 +0200

kiss: Support POSIX find in pkg_find

Diffstat:
Mkiss | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/kiss b/kiss @@ -182,13 +182,19 @@ pkg_find() { query=$1 match=$2 + # This ugly mess appends '/.' to the end of each path in + # '$KISS_PATH' as POSIX 'find' has no '-mindepth'/'-maxdepth'. + # See: https://unix.stackexchange.com/a/330372 + IFS=:; set -- + for path in $KISS_PATH; do set "$@" "$path/."; done + IFS=$old_ifs + # Find the repository containing a package. # Searches installed packages if the package is absent # from the repositories. # See [1] at top of script. # shellcheck disable=2046,2086 - set -- $(IFS=: - find $KISS_PATH "$sys_db" -mindepth 1 -maxdepth 1 -name "$1") + set -- $(find "$@" "$sys_db/." \( ! -name . -prune \) -name "$query") # 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.