OSDN Git Service

[update] : Added aur_helper config
authorhayao <hayao@fascode.net>
Sat, 6 Nov 2021 08:40:44 +0000 (17:40 +0900)
committerhayao <hayao@fascode.net>
Sat, 6 Nov 2021 08:40:44 +0000 (17:40 +0900)
build.sh
default.conf
system/aur.sh

index ebace74..742d305 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -440,6 +440,7 @@ prepare_build() {
     pkglist_args+=("${modules[@]}")
 
     # Set argument of aur.sh and pkgbuild.sh
+    makepkg_script_args+=("-a" "${aur_helper}" "-p" "$(printf "%s\n" "${aur_helper_depends[@]}" | tr "\n" ",")" )
     [[ "${bash_debug}"   = true ]] && makepkg_script_args+=("-x")
     [[ "${pacman_debug}" = true ]] && makepkg_script_args+=("-d")
 
@@ -531,10 +532,10 @@ make_packages_aur() {
 
     # prepare for aur helper
     _cp "${script_path}/system/aur.sh" "${airootfs_dir}/root/aur.sh"
-    _pacstrap --asdeps --needed "go"
+    _pacstrap --asdeps --needed "${aur_helper_depend[@]}"
 
     # Run aur script
-    _run_with_pacmanconf _chroot_run "bash" "/root/aur.sh" "${makepkg_script_args[@]}" "${_pkglist_aur[@]}"
+    _run_with_pacmanconf _chroot_run "bash" "/root/aur.sh" -a "${aur_helper}"  "${makepkg_script_args[@]}" "${_pkglist_aur[@]}"
 
     # Remove script
     remove "${airootfs_dir}/root/aur.sh"
index 9c56fe7..55b769d 100644 (file)
@@ -133,6 +133,10 @@ norescue_entry=false
 # Use this array only in the configuration files in the channel.
 #modules=("share")
 
+# AUR Helper config
+aur_helper="yay"
+aur_helper_depends=("go")
+
 #-- kernel config --#
 # Set the kernel that live session use.
 # Please don't set anything if you want to use normal kernel.
index ff0d96c..255458b 100755 (executable)
@@ -19,22 +19,26 @@ aur_helper="yay"
 trap 'exit 1' 1 2 3 15
 
 _help() {
-    echo "usage ${0} [option]"
+    echo "usage ${0} [option] [package1] [package2] ..."
     echo
     echo "Install aur packages with ${aur_helper}" 
     echo
     echo " General options:"
+    echo "    -a [command]             Set the command of aur helper"
+    echo "    -p [pkg1,pkg2...]        Set the oackage of the depends of aur helper"
     echo "    -d                       Enable pacman debug message"
     echo "    -u [user]                Set the user name to build packages"
     echo "    -x                       Enable bash debug message"
     echo "    -h                       This help message"
 }
 
-while getopts "du:xh" arg; do
+while getopts "a:p:du:xh" arg; do
     case "${arg}" in
+        a) aur_helper="${OPTARG}" ;;
         d) pacman_debug=true ;;
         u) aur_username="${OPTARG}" ;;
         x) set -xv ;;
+        p) readarray -t aur_helper_depends < <(tr "," "\n" <<< "${OPTARG}") ;;
         h) 
             _help
             exit 0