forked from kiss-community/kiss
kiss: add KISS_BUILD_INSTALL
This option defaults to '1' and controls the installation prompt at the end of the build process. Setting this to '0' will disable the installation of packages post-build. Closes #265
This commit is contained in:
parent
7a53298241
commit
d58eb983bf
13
kiss
13
kiss
@ -868,6 +868,7 @@ pkg_tar() {
|
|||||||
pkg_build_all() {
|
pkg_build_all() {
|
||||||
# Build packages and turn them into packaged tarballs.
|
# Build packages and turn them into packaged tarballs.
|
||||||
# Order the argument list and filter out duplicates.
|
# Order the argument list and filter out duplicates.
|
||||||
|
export KISS_BUILD_INSTALL=${KISS_BUILD_INSTALL:=1}
|
||||||
|
|
||||||
# Mark packages passed on the command-line explicit.
|
# Mark packages passed on the command-line explicit.
|
||||||
# Also resolve dependencies for all explicit packages.
|
# Also resolve dependencies for all explicit packages.
|
||||||
@ -878,7 +879,7 @@ pkg_build_all() {
|
|||||||
|
|
||||||
# If this is an update, don't always build explicitly passsed packages
|
# If this is an update, don't always build explicitly passsed packages
|
||||||
# and instead install pre-built binaries if they exist.
|
# and instead install pre-built binaries if they exist.
|
||||||
ok "$pkg_update" || explicit_build=$explicit
|
ok "$prefer_cache" || explicit_build=$explicit
|
||||||
|
|
||||||
set --
|
set --
|
||||||
|
|
||||||
@ -948,7 +949,7 @@ pkg_build_all() {
|
|||||||
pkg_etcsums
|
pkg_etcsums
|
||||||
pkg_tar "$pkg"
|
pkg_tar "$pkg"
|
||||||
|
|
||||||
if ok "$pkg_update" || ! contains "$explicit" "$pkg"; then
|
if equ "$KISS_BUILD_INSTALL" 1 || ! contains "$explicit" "$pkg"; then
|
||||||
log "$pkg" "Needed as a dependency or has an update, installing"
|
log "$pkg" "Needed as a dependency or has an update, installing"
|
||||||
|
|
||||||
# Intended behavior.
|
# Intended behavior.
|
||||||
@ -957,7 +958,7 @@ pkg_build_all() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
case $pkg_update in '')
|
case $KISS_BUILD_INSTALL in 1)
|
||||||
# Intentional, globbing disabled.
|
# Intentional, globbing disabled.
|
||||||
# shellcheck disable=2046,2086
|
# shellcheck disable=2046,2086
|
||||||
! prompt "Install built packages? [$explicit]" || (args i $explicit)
|
! prompt "Install built packages? [$explicit]" || (args i $explicit)
|
||||||
@ -1675,7 +1676,8 @@ pkg_upgrade() {
|
|||||||
war "Packages without repository$_repo_orp"
|
war "Packages without repository$_repo_orp"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
pkg_update=1
|
export KISS_BUILD_INSTALL=0
|
||||||
|
prefer_cache=1
|
||||||
|
|
||||||
! contains "$*" kiss || {
|
! contains "$*" kiss || {
|
||||||
log "Detected package manager update"
|
log "Detected package manager update"
|
||||||
@ -1696,8 +1698,7 @@ pkg_upgrade() {
|
|||||||
# shellcheck disable=2046,2086
|
# shellcheck disable=2046,2086
|
||||||
set -- $order
|
set -- $order
|
||||||
|
|
||||||
log "Packages to update ($#): $*"
|
prompt "Packages to update ($#): $*"
|
||||||
prompt
|
|
||||||
pkg_build_all "$@"
|
pkg_build_all "$@"
|
||||||
log "Updated all packages"
|
log "Updated all packages"
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user