cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 42b71ab2df0b6205d7ef0b287eefe04e59d3e687
parent 3a55232e277aec604c2b4f332fd30be6d136f516
Author: black <dylan.araps@gmail.com>
Date:   Sun, 15 Sep 2019 10:38:32 +0300

Merge pull request #54 from kisslinux/lax_deps

Lax deps
Diffstat:
Mkiss | 23++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)

diff --git 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.