mirror of
https://codeberg.org/kiss-community/kiss
synced 2025-01-12 22:00:09 -07:00
Merge pull request #44 from kisslinux/pkg_update
kiss: install on update, closes #43
This commit is contained in:
commit
4eb33e424a
19
kiss
19
kiss
@ -453,7 +453,7 @@ pkg_build() {
|
|||||||
log "Building: $*"
|
log "Building: $*"
|
||||||
|
|
||||||
# Only ask for confirmation if more than one package needs to be built.
|
# 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"
|
log "Continue?: Press Enter to continue or Ctrl+C to abort here"
|
||||||
|
|
||||||
# POSIX 'read' has none of the "nice" options like '-n', '-p'
|
# POSIX 'read' has none of the "nice" options like '-n', '-p'
|
||||||
@ -566,16 +566,18 @@ pkg_build() {
|
|||||||
pkg_tar "$pkg"
|
pkg_tar "$pkg"
|
||||||
|
|
||||||
# Install only dependencies of passed packages.
|
# Install only dependencies of passed packages.
|
||||||
|
# Skip this check if this is a package update.
|
||||||
case $explicit_packages in
|
case $explicit_packages in
|
||||||
*" $pkg "*) continue ;;
|
*" $pkg "*) [ "$pkg_update" ] || continue ;;
|
||||||
|
|
||||||
*)
|
|
||||||
log "[$pkg] Needed as a dependency, installing"
|
|
||||||
args i "$pkg"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
log "[$pkg] Needed as a dependency or has an update, installing"
|
||||||
|
args i "$pkg"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# End here as this was a system update and all packages have been installed.
|
||||||
|
[ "$pkg_update" ] && return
|
||||||
|
|
||||||
log "Successfully built package(s)"
|
log "Successfully built package(s)"
|
||||||
|
|
||||||
# Turn the explicit packages into a 'list'.
|
# Turn the explicit packages into a 'list'.
|
||||||
@ -937,10 +939,11 @@ pkg_updates() {
|
|||||||
log "Packages to update: $*"
|
log "Packages to update: $*"
|
||||||
|
|
||||||
# Tell 'pkg_build' to always prompt before build.
|
# Tell 'pkg_build' to always prompt before build.
|
||||||
build_prompt=1
|
pkg_update=1
|
||||||
|
|
||||||
# Build all packages requiring an update.
|
# Build all packages requiring an update.
|
||||||
pkg_build "$@"
|
pkg_build "$@"
|
||||||
|
log "Updated all packages"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_clean() {
|
pkg_clean() {
|
||||||
|
Loading…
Reference in New Issue
Block a user