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

44
kiss
View File

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