From ea3d68258b3e34ed241c2623a82a9991c001dff5 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Fri, 14 Jun 2019 23:47:21 +0700 Subject: [PATCH 1/3] install: add dependency check In case of a package already exist in $bin_dir if it isn't built in that system (e.g. by copying the tar file manually from another kiss instance), don't blindly install it but check if the depends are properly installed. Otherwise the binaries won't run properly. --- kiss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kiss b/kiss index 0990a1b..3231869 100755 --- a/kiss +++ b/kiss @@ -200,7 +200,9 @@ args() { pkg_checksum log "Generated checksums." ;; - i*) pkg_install ;; + i*) pkg_depends + pkg_install ;; + l*) pkg_list "$2" ;; r*) pkg_remove || die "Package '$name' not installed" ;; u*) pkg_updates ;; From 694e4a60639427abd0e2f5bf4c2fbee8b67824af Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 15 Jun 2019 09:19:20 +0300 Subject: [PATCH 2/3] depends: Add make depends. --- kiss | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kiss b/kiss index 0990a1b..8924101 100755 --- a/kiss +++ b/kiss @@ -41,14 +41,17 @@ pkg_setup() { } pkg_depends() { - while read -r dep; do - pkg_list "$dep" || + while read -r dep opt; do + pkg_list "$dep" || { + [ "$1" = install ] && [ "$opt" = make ] && return + case $missing in - *" $dep,"*) ;; - *) missing="$missing $dep," + *" $dep${opt:+ ($opt)},"*) ;; + *) missing="$missing $dep${opt:+ ($opt)}," pkg_setup "$dep" pkg_depends ;; esac + } done 2>/dev/null < depends } @@ -200,7 +203,9 @@ args() { pkg_checksum log "Generated checksums." ;; - i*) pkg_install ;; + i*) pkg_depends install + pkg_install ;; + l*) pkg_list "$2" ;; r*) pkg_remove || die "Package '$name' not installed" ;; u*) pkg_updates ;; From aabaa1aed0c7bf9388a6c5e02957d521e28a0d36 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 15 Jun 2019 09:22:17 +0300 Subject: [PATCH 3/3] depends: Use continue --- kiss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiss b/kiss index 8924101..d7f154a 100755 --- a/kiss +++ b/kiss @@ -43,7 +43,7 @@ pkg_setup() { pkg_depends() { while read -r dep opt; do pkg_list "$dep" || { - [ "$1" = install ] && [ "$opt" = make ] && return + [ "$1" = install ] && [ "$opt" = make ] && continue case $missing in *" $dep${opt:+ ($opt)},"*) ;;