OSDN Git Service

[update] : Fixed the problem that package check is not executed.
authorhayao <shun819.mail@gmail.com>
Wed, 20 May 2020 13:10:02 +0000 (22:10 +0900)
committerhayao <shun819.mail@gmail.com>
Wed, 20 May 2020 13:10:02 +0000 (22:10 +0900)
build.sh

index d055c40..b19cb86 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -485,8 +485,8 @@ prepare_build() {
     _msg_debug "Iso filename is ${iso_filename}"
 
 
-    # Check packages
-    if [[ ${arch} = $(uname -m) ]]; then
+     # Check packages
+    if [[ "${nodepend}" = false ]] && [[ "${arch}" = $(uname -r) ]] ; then
         local installed_pkg
         local installed_ver
         local check_pkg
@@ -513,11 +513,31 @@ prepare_build() {
                     fi
                 fi
             done
-
-            if [[ "${check_failed}" = true ]]; then
-                exit 1
-            fi
+            echo -n "not"
+            return 0
         }
+        echo
+        if [[ ${debug} = false ]]; then
+            _msg_info "Checking dependencies ..."
+        fi
+        for pkg in ${dependence[@]}; do
+            _msg_debug -n "Checking ${pkg} ..."
+            case $(check_pkg ${pkg}) in
+                "old") 
+                    [[ "${debug}" = true ]] && echo -ne " $(pacman -Q ${pkg} | awk '{print $2}')\n"
+                    _msg_warn "${pkg} is not the latest package."
+                    _msg_warn "Local: $(pacman -Q ${pkg} 2> /dev/null | awk '{print $2}') Latest: $(pacman -Sp --print-format '%v' --config ${build_pacman_conf} ${pkg} 2> /dev/null)"
+                    echo
+                    ;;
+                "not") _msg_error "${pkg} is not installed." ; check_failed=true ;;
+                "norepo") _msg_warn "${pkg} is not a repository package." ;;
+                "installed") [[ ${debug} = true ]] && echo -ne " $(pacman -Q ${pkg} | awk '{print $2}')\n" ;;
+            esac
+        done
+
+        if [[ "${check_failed}" = true ]]; then
+            exit 1
+        fi
     fi
 
     # Load loop kernel module