aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-09-13 18:25:33 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-09-13 18:25:33 +0000
commit20f3f66ec8207da6eba70d749495a1f8a172cae6 (patch)
tree140b29bfbbd8386eb00e707293e8b68f5244830d /kiss
parent55ae576dfa747a985e777ab09da62ec971f8aa22 (diff)
downloadcpt-20f3f66ec8207da6eba70d749495a1f8a172cae6.tar.gz
kiss: handle dependencies 'smarter'
FossilOrigin-Name: 8fbe60ea5fd04526e7fe405b9fcf1731a51396e33510ef4b0e631aea4435bdc1
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss23
1 files changed, 15 insertions, 8 deletions
diff --git a/kiss b/kiss
index 0142d9b..abb553c 100755
--- a/kiss
+++ b/kiss
@@ -187,7 +187,7 @@ pkg_depends() {
# After child dependencies are added to the list,
# add the package which depends on them.
- deps="$deps $1 "
+ [ "$2" ] || deps="$deps $1 "
;;
esac
}
@@ -341,23 +341,30 @@ pkg_build() {
# also checks checksums, downloads sources and ensure all dependencies
# are installed.
- log "Resolving dependencies"
- for pkg; do pkg_depends "$pkg"; done
-
# Store the explicit packages so we can handle them differently
# below. Dependencies are automatically installed but packages
# passed to KISS aren't.
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 -- $deps
+ set -- $deps $explicit
# The dependency solver always lists all dependencies regardless of
# whether or not they are installed. Ensure that all explicit packages
# are included and ensure that all installed packages are excluded.
for pkg; do
- case $explicit in
- *" $pkg "*) ;;
+ case $explicit_build in
+ *" $pkg "*|-) ;;
*) pkg_list "$pkg" >/dev/null && continue ;;
esac
@@ -387,7 +394,7 @@ pkg_build() {
for pkg; do
# Don't check for a pre-built package if it was passed to KISS
# directly.
- case $explicit in
+ case $explicit_build in
*" $pkg "*)
shift
set -- "$@" "$pkg"