kiss: made fixdeps() aware of dependency chain

This commit is contained in:
Dylan Araps 2020-09-25 20:27:32 +03:00
parent a1de34d781
commit e76b71521c
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

30
kiss
View File

@ -367,10 +367,18 @@ pkg_depends() {
while read -r dep _ || [ "$dep" ]; do while read -r dep _ || [ "$dep" ]; do
case $dep in case $dep in
[!#]*) [!#]*)
case $2 in
show-installed)
pkg_depends "$dep" "$2"
;;
*)
pkg_list "$dep" >/dev/null 2>&1 || pkg_list "$dep" >/dev/null 2>&1 ||
pkg_depends "$dep" pkg_depends "$dep"
;; ;;
esac esac
;;
esac
done < "$repo_dir/depends" done < "$repo_dir/depends"
# After child dependencies are added to the list, # After child dependencies are added to the list,
@ -436,6 +444,11 @@ pkg_fixdeps() {
: >> depends : >> depends
# Generate list of all dependencies.
deps="gcc llvm"
pkg_depends "$pkg" show-installed
deps="$deps $pkg ${pkg%%-bin} ${pkg%%-git}"
find "$pkg_dir/${PWD##*/}/" -type f 2>/dev/null | find "$pkg_dir/${PWD##*/}/" -type f 2>/dev/null |
while read -r file; do while read -r file; do
@ -464,21 +477,8 @@ pkg_fixdeps() {
dep=${dep%/*} dep=${dep%/*}
dep=${dep##*/} dep=${dep##*/}
# Skip listing some packages as dependencies. # Only list dependencies not mentioned in any (nested) depends file.
case $dep in contains "$deps" "$dep" || printf '%s\n' "$dep"
gcc |\
llvm |\
"${pkg%%-bin}" |\
"${pkg%%-esr}" |\
"${pkg%%-esr-bin}" |\
"")
continue
;;
*)
printf '%s\n' "$dep"
;;
esac
done ||: done ||:
done | done |