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