kiss: lint all arguments early. lint all dependencies during pkg_depends

This commit is contained in:
Dylan Araps 2021-07-06 21:12:19 +03:00
parent 0c1d4cbcf5
commit 08199f6977
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

12
kiss
View File

@ -422,7 +422,7 @@ pkg_depends() {
die "Circular dependency detected $1 <> ${4##* }" die "Circular dependency detected $1 <> ${4##* }"
esac esac
pkg_find "$1" "${6:-pkg_find}" "$1"
! [ -e "$repo_dir/depends" ] || ! [ -e "$repo_dir/depends" ] ||
@ -430,7 +430,7 @@ pkg_depends() {
while read -r dep dep_type || [ "$dep" ]; do while read -r dep dep_type || [ "$dep" ]; do
[ "${dep##\#*}" ] || continue [ "${dep##\#*}" ] || continue
pkg_depends "$dep" '' "$3" "$4 $1" "$dep_type" pkg_depends "$dep" '' "$3" "$4 $1" "$dep_type" "$6"
done < "$repo_dir/depends" || : done < "$repo_dir/depends" || :
# Add parent to dependencies list. # Add parent to dependencies list.
@ -455,6 +455,7 @@ pkg_order() {
# Filter the list, only keeping explicit packages. The purpose of these # Filter the list, only keeping explicit packages. The purpose of these
# two loops is to order the argument list based on dependence. # two loops is to order the argument list based on dependence.
for pkg in $deps; do case " $* " in *" $pkg "* | *" ${pkg##"$ppwd/"} "*) for pkg in $deps; do case " $* " in *" $pkg "* | *" ${pkg##"$ppwd/"} "*)
pkg_lint "$pkg"
order="$order $pkg" order="$order $pkg"
redro="$pkg $redro" redro="$pkg $redro"
esac done esac done
@ -666,7 +667,7 @@ pkg_build() {
# #
# This also resolves all dependencies and stores the result in '$deps'. # This also resolves all dependencies and stores the result in '$deps'.
for pkg do for pkg do
pkg_depends "$pkg" expl filter pkg_depends "$pkg" expl filter '' '' pkg_lint
explicit="$explicit $pkg " explicit="$explicit $pkg "
done done
@ -694,10 +695,6 @@ pkg_build() {
# Ask for confirmation if extra packages need to be built. # Ask for confirmation if extra packages need to be built.
[ "$#" -ne "$explicit_cnt" ] || [ "$pkg_update" ] && prompt [ "$#" -ne "$explicit_cnt" ] || [ "$pkg_update" ] && prompt
for pkg do
pkg_lint "$pkg"
done
log "Checking for pre-built dependencies" log "Checking for pre-built dependencies"
# Install any pre-built dependencies if they exist in the binary # Install any pre-built dependencies if they exist in the binary
@ -1585,7 +1582,6 @@ args() {
;; ;;
c|checksum) c|checksum)
for pkg do pkg_lint "$pkg"; done
for pkg do pkg_source "$pkg" c; done for pkg do pkg_source "$pkg" c; done
for pkg do for pkg do
pkg_find "$pkg" pkg_find "$pkg"