OSDN Git Service

[fix] : Fixed package verification.
authorhayao <shun819.mail@gmail.com>
Fri, 17 Apr 2020 06:49:30 +0000 (15:49 +0900)
committerhayao <shun819.mail@gmail.com>
Fri, 17 Apr 2020 06:49:30 +0000 (15:49 +0900)
Only the top of the list of installed packages was not correctly determined.

build.sh
wizard.sh

index 64d20b5..9112ea8 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -265,8 +265,8 @@ prepare_build() {
 
     check_pkg() {
         local i
-        for i in $(seq 1 ${#installed_pkg[@]}); do
-            if [[ ${installed_pkg[${i}]} = ${1} ]]; then
+        for i in $(seq 0 $(( ${#installed_pkg[@]} - 1 ))); do
+            if [[ "${installed_pkg[${i}]}" = ${1} ]]; then
                 if [[ ${installed_ver[${i}]} = $(pacman -Sp --print-format '%v' ${1}) ]]; then
                     echo -n "installed"
                     return 0
index c6227d6..3415b8b 100755 (executable)
--- a/wizard.sh
+++ b/wizard.sh
@@ -47,7 +47,7 @@ function install_dependencies () {
 
     check_pkg() {
         local i
-        for i in $(seq 1 ${#installed_pkg[@]}); do
+        for i in $(seq 0 $(( ${#installed_pkg[@]} - 1 ))); do
             if [[ ${installed_pkg[${i}]} = ${1} ]]; then
                 if [[ ${installed_ver[${i}]} = $(pacman -Sp --print-format '%v' ${1}) ]]; then
                     echo -n "true"