aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authornoreply@github.com <noreply@github.com>2019-09-15 07:38:31 +0000
committernoreply@github.com <noreply@github.com>2019-09-15 07:38:31 +0000
commitf50d8f78a3517d324718ba339a2a200fd5431525 (patch)
tree4ae9c1330b22a3de58743cf8be20bd2095069ad8 /kiss
parentd10e723548b88c91c133ac81a9ecfd5594f35510 (diff)
parent9deed25d2efe6b698c976329690bde72f5fd8dff (diff)
downloadcpt-f50d8f78a3517d324718ba339a2a200fd5431525.tar.gz
Merge pull request #54 from kisslinux/lax_deps
Lax deps FossilOrigin-Name: bf85a5d805be6b698109b20f762d50fc25be5066080699556a461944e3318cf0
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss23
1 files changed, 8 insertions, 15 deletions
diff --git a/kiss b/kiss
index 3d8226d..ab66e23 100755
--- a/kiss
+++ b/kiss
@@ -172,13 +172,16 @@ pkg_extract() {
}
pkg_depends() {
- # Resolve all dependencies and install them in the right order.
+ # Resolve all dependencies and generate an ordered list.
repo_dir=$(pkg_find "$1")
# This does a depth-first search. The deepest dependencies are
# listed first and then the parents in reverse order.
contains "$deps" "$1" || {
+ # Filter out non-explicit, aleady installed dependencies.
+ [ -z "$2" ] && (pkg_list "$1" >/dev/null) && return
+
# Recurse through the dependencies of the child
# packages. Keep doing this.
while read -r dep _; do
@@ -187,7 +190,7 @@ pkg_depends() {
# After child dependencies are added to the list,
# add the package which depends on them.
- [ "$2" ] || deps="$deps $1 "
+ [ "$2" = explicit ] || deps="$deps $1 "
}
}
@@ -364,17 +367,7 @@ pkg_build() {
explicit=$(echo "$explicit" | sed "s/ $pkg / /g")
done
- # The dependency solver always lists all dependencies regardless of
- # whether or not they are installed. Filter out installed dependencies.
- for pkg in $deps $explicit; do
- contains "$explicit_build" "$pkg" || {
- pkg_list "$pkg" >/dev/null && continue
- }
-
- build="$build$pkg "
- done
-
- set -- $build
+ set -- $deps $explicit
log "Building: $*"
@@ -912,7 +905,7 @@ args() {
for pkg; do
case $pkg in
*.tar.gz) deps="$deps $pkg " ;;
- *) pkg_depends "$pkg"
+ *) pkg_depends "$pkg" install
esac
done
@@ -928,7 +921,7 @@ args() {
log "Removing packages"
# Create a list of each package's dependencies.
- for pkg; do pkg_depends "$pkg"; done
+ for pkg; do pkg_depends "$pkg" remove; done
# Reverse the list of dependencies filtering out anything
# not explicitly set for removal.