cpt

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

commit 837550da2f052a57850cc1d09484e8d4190d3c1b
parent 188e1ee22302bd4006d01ed91587f4753f2fa92f
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Sat, 14 Sep 2019 07:48:58 +0300

kiss: simpler install checks

Diffstat:
Mkiss | 22+++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/kiss b/kiss @@ -397,32 +397,24 @@ pkg_build() { # Install any pre-built dependencies if they exist in the binary # directory and are up to date. for pkg; do - # Don't check for a pre-built package if it was passed to KISS - # directly. - contains "$explicit_build" "$pkg" && { - shift - set -- "$@" "$pkg" - continue - } + # Don't check for a pre-built package if it was passed + # to KISS directly. + contains "$explicit_build" "$pkg" && continue # Figure out the version and release. read -r version release < "$(pkg_find "$pkg")/version" - # Remove the current package from the package list. - shift - # Install any pre-built binaries if they exist. # This calls 'args' to inherit a root check and call # to 'sudo' to elevate permissions. [ -f "$bin_dir/$pkg#$version-$release.tar.gz" ] && { log "[$pkg] Found pre-built binary, installing" args i "$bin_dir/$pkg#$version-$release.tar.gz" - continue - } - # Add the removed package back to the list if it doesn't - # have a pre-built binary. - set -- "$@" "$pkg" + # Remove the now installed package from the build + # list. No better way than using 'sed' in POSIX 'sh'. + set -- $(echo " $* " | sed "s/ $pkg / /") + } done for pkg; do pkg_lint "$pkg"; done