kiss: initial depends clean up

This commit is contained in:
Dylan Araps 2021-07-27 20:42:43 +03:00
parent 354bc63cc3
commit 8ee6a3948d
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

14
kiss
View File

@ -542,10 +542,11 @@ pkg_extract() {
pkg_depends() {
# Resolve all dependencies and generate an ordered list. The deepest
# dependencies are listed first and then the parents in reverse order.
contains "$deps" "$1" || {
! contains "$deps" "$1" || return 0
# Filter out non-explicit, already installed packages.
null "$3" || ok "$2" || contains "$explicit" "$1" ||
! [ -d "$sys_db/$1" ] || return
! [ -d "$sys_db/$1" ] || return 0
# Detect circular dependencies and bail out.
# Looks for multiple repeating patterns of (dep dep_parent) (5 is max).
@ -554,25 +555,22 @@ pkg_depends() {
*" ${4##* } "*" $1 "\
*" ${4##* } "*" $1 "\
*" ${4##* } "*" $1 "\
*" ${4##* } "*" $1 "\
*)
*" ${4##* } "*" $1 "*)
die "Circular dependency detected $1 <> ${4##* }"
esac
# Packages which exist and have depends.
! _pkg_find "$1" || ! [ -e "$repo_dir/depends" ] ||
# Recurse through the dependencies of the child packages.
while read -r dep dep_type || ok "$dep"; do
ok "${dep##\#*}" || continue
pkg_depends "$dep" '' "$3" "$4 $1" "$dep_type"
! ok "${dep##\#*}" || pkg_depends "$dep" '' "$3" "$4 $1" "$dep_type"
done < "$repo_dir/depends" || :
# Add parent to dependencies list.
if ! equ "$2" expl || { equ "$5" make && ! pkg_cache "$1"; }; then
deps="$deps $1"
fi
}
}
pkg_order() {