mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-09-28 12:22:39 -06:00
kiss: order argument list in pkg_build based on dependence
This makes input to pkg_build identical when using 'kiss b'/'kiss u' and fixes issues with the former.
This commit is contained in:
parent
31362a7713
commit
dde00196d8
24
kiss
24
kiss
@ -411,7 +411,7 @@ pkg_depends() {
|
|||||||
pkg_order() {
|
pkg_order() {
|
||||||
# Order a list of packages based on dependence and take into account
|
# Order a list of packages based on dependence and take into account
|
||||||
# pre-built tarballs if this is to be called from 'kiss i'.
|
# pre-built tarballs if this is to be called from 'kiss i'.
|
||||||
order=; redro=; deps=
|
unset order redro deps
|
||||||
|
|
||||||
for pkg do case $pkg in
|
for pkg do case $pkg in
|
||||||
/*.tar.*) deps="$deps $pkg" ;;
|
/*.tar.*) deps="$deps $pkg" ;;
|
||||||
@ -421,12 +421,12 @@ pkg_order() {
|
|||||||
|
|
||||||
# Filter the list, only keeping explicit packages. The purpose of these
|
# Filter the list, only keeping explicit packages. The purpose of these
|
||||||
# two loops is to order the argument list based on dependence.
|
# two loops is to order the argument list based on dependence.
|
||||||
for pkg in $deps; do
|
for pkg in $deps; do case " $* " in *" $pkg "* | *" ${pkg##"$ppwd/"} "*)
|
||||||
contains "$*" "$pkg" || contains "$*" "${pkg##"$ppwd/"}" &&
|
order="$order $pkg"
|
||||||
order="$order $pkg " redro=" $pkg $redro"
|
redro="$pkg $redro"
|
||||||
done
|
esac done
|
||||||
|
|
||||||
deps=
|
unset deps
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_strip() {
|
pkg_strip() {
|
||||||
@ -624,6 +624,12 @@ pkg_tar() (
|
|||||||
|
|
||||||
pkg_build() {
|
pkg_build() {
|
||||||
# Build packages and turn them into packaged tarballs.
|
# Build packages and turn them into packaged tarballs.
|
||||||
|
# Order the argument list and filter out duplicates.
|
||||||
|
pkg_order "$@"
|
||||||
|
|
||||||
|
# See [1] at top of script.
|
||||||
|
# shellcheck disable=2046,2086
|
||||||
|
set -- $order
|
||||||
|
|
||||||
log "Resolving dependencies"
|
log "Resolving dependencies"
|
||||||
|
|
||||||
@ -632,12 +638,9 @@ pkg_build() {
|
|||||||
# differently from those pulled in as dependencies.
|
# differently from those pulled in as dependencies.
|
||||||
#
|
#
|
||||||
# This also resolves all dependencies and stores the result in '$deps'.
|
# This also resolves all dependencies and stores the result in '$deps'.
|
||||||
# Any duplicates are also filtered out.
|
|
||||||
for pkg do
|
for pkg do
|
||||||
contains "$explicit" "$pkg" || {
|
|
||||||
pkg_depends "$pkg" explicit filter
|
pkg_depends "$pkg" explicit filter
|
||||||
explicit="$explicit $pkg "
|
explicit="$explicit $pkg "
|
||||||
}
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# If this is an update, don't always build explicitly passsed packages
|
# If this is an update, don't always build explicitly passsed packages
|
||||||
@ -1449,8 +1452,7 @@ pkg_updates() {
|
|||||||
# shellcheck disable=2046,2086
|
# shellcheck disable=2046,2086
|
||||||
{
|
{
|
||||||
pkg_update=1
|
pkg_update=1
|
||||||
pkg_order "$@"
|
pkg_build "$@"
|
||||||
pkg_build $order
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log "Updated all packages"
|
log "Updated all packages"
|
||||||
|
Loading…
Reference in New Issue
Block a user