OSDN Git Service

[update] : Install yay only install list is not 0
authorhayao <hayao@fascode.net>
Mon, 22 Mar 2021 07:30:01 +0000 (16:30 +0900)
committerhayao <hayao@fascode.net>
Mon, 22 Mar 2021 07:30:01 +0000 (16:30 +0900)
system/aur.sh
system/pkgbuild.sh

index 7592cb6..397654b 100755 (executable)
@@ -55,7 +55,7 @@ pacman-key --init
 ls "/usr/share/pacman/keyrings/"*".gpg" | sed "s|.gpg||g" | xargs | pacman-key --populate
 
 # Un comment the mirror list.
-sed -i "s/#Server/Server/g" "/etc/pacman.d/mirrorlist"
+#sed -i "s/#Server/Server/g" "/etc/pacman.d/mirrorlist"
 
 # Install yay
 if ! pacman -Qq yay 1> /dev/null 2>&1; then
index 633c4d9..b1513dd 100755 (executable)
@@ -82,34 +82,34 @@ pacman-key --init
 ls "/usr/share/pacman/keyrings/"*".gpg" | sed "s|.gpg||g" | xargs | pacman-key --populate
 
 # Un comment the mirror list.
-sed -i "s/#Server/Server/g" "/etc/pacman.d/mirrorlist"
-
-# Install yay
-if ! pacman -Qq yay 1> /dev/null 2>&1; then
-    (
-        _oldpwd="$(pwd)"
-        pacman -Syy --noconfirm --config "/etc/alteriso-pacman.conf"
-        pacman --noconfirm -S --asdeps --needed go --config "/etc/alteriso-pacman.conf"
-        sudo -u "${build_username}" git clone "https://aur.archlinux.org/yay.git" "/tmp/yay"
-        cd "/tmp/yay"
-        sudo -u "${build_username}" makepkg --ignorearch --clean --cleanbuild --force --skippgpcheck --noconfirm
-        pacman --noconfirm --config "/etc/alteriso-pacman.conf" -U $(sudo -u "${build_username}" makepkg --packagelist)
-        cd ..
-        rm -rf "/tmp/yay"
-        cd "${_oldpwd}"
-    )
-fi
-
-if ! type -p yay > /dev/null; then
-    echo "Failed to install yay"
-    exit 1
-fi
+#sed -i "s/#Server/Server/g" "/etc/pacman.d/mirrorlist"
 
 
 # Parse SRCINFO
 cd "${pkgbuild_dir}"
 makedepends=() depends=() pkgbuild_dirs=($(ls "${pkgbuild_dir}" 2> /dev/null))
 if (( "${#pkgbuild_dirs[@]}" != 0 )); then
+    # Install yay
+    if ! pacman -Qq yay 1> /dev/null 2>&1; then
+        (
+            _oldpwd="$(pwd)"
+            pacman -Syy --noconfirm --config "/etc/alteriso-pacman.conf"
+            pacman --noconfirm -S --asdeps --needed go --config "/etc/alteriso-pacman.conf"
+            sudo -u "${build_username}" git clone "https://aur.archlinux.org/yay.git" "/tmp/yay"
+            cd "/tmp/yay"
+            sudo -u "${build_username}" makepkg --ignorearch --clean --cleanbuild --force --skippgpcheck --noconfirm
+            pacman --noconfirm --config "/etc/alteriso-pacman.conf" -U $(sudo -u "${build_username}" makepkg --packagelist)
+            cd ..
+            rm -rf "/tmp/yay"
+            cd "${_oldpwd}"
+        )
+    fi
+
+    if ! type -p yay > /dev/null; then
+        echo "Failed to install yay"
+        exit 1
+    fi
+
     for _dir in ${pkgbuild_dirs[@]}; do
         cd "${_dir}"
         run_user bash -c "makepkg --printsrcinfo > .SRCINFO"