1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-25 00:20:05 -07:00

Merge pull request #44 from kisslinux/pkg_update

kiss: install on update, closes #43
This commit is contained in:
black 2019-08-25 05:19:40 +00:00 committed by GitHub
commit 4eb33e424a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

19
kiss
View File

@ -453,7 +453,7 @@ pkg_build() {
log "Building: $*"
# Only ask for confirmation if more than one package needs to be built.
[ $# -gt 1 ] || [ "$build_prompt" ] && {
[ $# -gt 1 ] || [ "$pkg_update" ] && {
log "Continue?: Press Enter to continue or Ctrl+C to abort here"
# POSIX 'read' has none of the "nice" options like '-n', '-p'
@ -566,16 +566,18 @@ pkg_build() {
pkg_tar "$pkg"
# Install only dependencies of passed packages.
# Skip this check if this is a package update.
case $explicit_packages in
*" $pkg "*) continue ;;
*)
log "[$pkg] Needed as a dependency, installing"
args i "$pkg"
;;
*" $pkg "*) [ "$pkg_update" ] || continue ;;
esac
log "[$pkg] Needed as a dependency or has an update, installing"
args i "$pkg"
done
# End here as this was a system update and all packages have been installed.
[ "$pkg_update" ] && return
log "Successfully built package(s)"
# Turn the explicit packages into a 'list'.
@ -937,10 +939,11 @@ pkg_updates() {
log "Packages to update: $*"
# Tell 'pkg_build' to always prompt before build.
build_prompt=1
pkg_update=1
# Build all packages requiring an update.
pkg_build "$@"
log "Updated all packages"
}
pkg_clean() {