OSDN Git Service

[update] : Support for packages that do not exist in the repository.
authorhayao <shun819.mail@gmail.com>
Sun, 19 Apr 2020 05:11:52 +0000 (14:11 +0900)
committerhayao <shun819.mail@gmail.com>
Sun, 19 Apr 2020 05:11:52 +0000 (14:11 +0900)
Dockerfile
build.sh

index 96dbafd..62ca921 100644 (file)
@@ -6,4 +6,4 @@ RUN git clone https://github.com/SereneTeam/alterlinux.git alterlinux/
 WORKDIR /alterlinux
 RUN git checkout dev-stable
 RUN ./keyring.sh -ca
-CMD ["./build.sh", "-b" , "--noconfirm"]
+CMD ["./build.sh", "-b"]
index 0aa3bb0..d61955b 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -412,11 +412,15 @@ prepare_build() {
 
     check_pkg() {
         local i
+        local ver
         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
+                ver=$(pacman -Sp --print-format '%v' --config ${build_pacman_conf} ${1} 2> /dev/null)
+                if [[ "${installed_ver[${i}]}" = "${ver}" ]]; then
                     echo -n "installed"
                     return 0
+                elif [[ -z ${ver} ]]; then
+                    echo "norepo"
                 else
                     echo -n "old"
                     return 0
@@ -432,6 +436,7 @@ prepare_build() {
         case $(check_pkg ${pkg}) in
             "old") _msg_warn "${pkg} is not the latest package." ;;
             "not") _msg_error "${pkg} is not installed." 1       ;;
+            "norepo") _msg_warn "${pkg} is not a repository package."
         esac
         _msg_debug "Installed $(pacman -Q ${pkg})"
     done