forked from kiss-community/kiss
kiss: handle dependencies 'smarter'
This commit is contained in:
parent
5d7b55fa72
commit
519acc14f8
23
kiss
23
kiss
@ -187,7 +187,7 @@ pkg_depends() {
|
|||||||
|
|
||||||
# After child dependencies are added to the list,
|
# After child dependencies are added to the list,
|
||||||
# add the package which depends on them.
|
# add the package which depends on them.
|
||||||
deps="$deps $1 "
|
[ "$2" ] || deps="$deps $1 "
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@ -341,23 +341,30 @@ pkg_build() {
|
|||||||
# also checks checksums, downloads sources and ensure all dependencies
|
# also checks checksums, downloads sources and ensure all dependencies
|
||||||
# are installed.
|
# are installed.
|
||||||
|
|
||||||
log "Resolving dependencies"
|
|
||||||
for pkg; do pkg_depends "$pkg"; done
|
|
||||||
|
|
||||||
# Store the explicit packages so we can handle them differently
|
# Store the explicit packages so we can handle them differently
|
||||||
# below. Dependencies are automatically installed but packages
|
# below. Dependencies are automatically installed but packages
|
||||||
# passed to KISS aren't.
|
# passed to KISS aren't.
|
||||||
explicit=" $* "
|
explicit=" $* "
|
||||||
|
explicit_build=" $* "
|
||||||
|
|
||||||
|
log "Resolving dependencies"
|
||||||
|
for pkg; do pkg_depends "$pkg" explicit; done
|
||||||
|
|
||||||
|
for pkg; do
|
||||||
|
case $deps in
|
||||||
|
*" $pkg "*) explicit=$(echo "$explicit" | sed "s/ $pkg / /g")
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# Set the resolved dependency list as the function's arguments.
|
# Set the resolved dependency list as the function's arguments.
|
||||||
set -- $deps
|
set -- $deps $explicit
|
||||||
|
|
||||||
# The dependency solver always lists all dependencies regardless of
|
# The dependency solver always lists all dependencies regardless of
|
||||||
# whether or not they are installed. Ensure that all explicit packages
|
# whether or not they are installed. Ensure that all explicit packages
|
||||||
# are included and ensure that all installed packages are excluded.
|
# are included and ensure that all installed packages are excluded.
|
||||||
for pkg; do
|
for pkg; do
|
||||||
case $explicit in
|
case $explicit_build in
|
||||||
*" $pkg "*) ;;
|
*" $pkg "*|-) ;;
|
||||||
*) pkg_list "$pkg" >/dev/null && continue ;;
|
*) pkg_list "$pkg" >/dev/null && continue ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -387,7 +394,7 @@ pkg_build() {
|
|||||||
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 to KISS
|
||||||
# directly.
|
# directly.
|
||||||
case $explicit in
|
case $explicit_build in
|
||||||
*" $pkg "*)
|
*" $pkg "*)
|
||||||
shift
|
shift
|
||||||
set -- "$@" "$pkg"
|
set -- "$@" "$pkg"
|
||||||
|
Loading…
Reference in New Issue
Block a user