7 # Email : hayao@fascode.net
9 # (c) 2019-2020 Fascode Network.
13 # Wfa is a multilingual AUR helper written in bash that is being developed to replace yaourt
17 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
18 # Version 2, December 2004
20 # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
22 # Everyone is permitted to copy and distribute verbatim or modified
23 # copies of this license document, and changing it is allowed as long
24 # as the name is changed.
26 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
27 # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
29 # 0. You just DO WHAT THE FUCK YOU WANT TO.
36 ######################################################################################
40 ["Undefined operation"]="未定義のオペレーションです"
41 ["only one operation may be used at a time"]="一度に使用できるオペレーションは1つだけです"
42 ["Failed to set the argument of %s"]="%sの引数の設定に失敗しました"
43 ["Setting that command is not currently supported"]="そのコマンドの設定は現在サポートされていません"
44 ["Install dependent packages..."]="依存パッケージをインストールします..."
45 ["Searching in AUR ..."]="AUR内を検索しています..."
46 ["No package with an exact name match was found"]="完全に一致する名前のパッケージが見つかりませんでした"
47 ["Select a package %s with an exact name match"]="名前が完全に一致するパッケージ %s を選択します"
48 ["Download PKGBUILD of %s"]="%s のPKGBUILDをダウンロード"
49 ["Get PKGBUILD from %s"]="%sからPKGBUILDを取得します"
50 ["PKGBUILD has already been downloaded"]="PKGBUILDは既にダウンロードされています"
51 ["Do you want to overwrite and download? [n] :"]="上書きダウンロードしますか? [n] :"
52 ["Unpacking the tarball of PKGBUILD ..."]="PKGBUILDを展開しています ..."
53 [".SRCINFO was not found.\nGenerating it using makepkg"]=".SCRINFOが見つかりませんでした。makepkgを使用して生成しています"
55 ["This is a feature that has not been implemented yet"]="まだ実装されていない機能です"
57 ######################################################################################
69 aururl="https://aur.archlinux.org/"
72 #-- options (bool) --#
86 makepkg_command="/usr/bin/makepkg"
88 makepkg_config="/etc/makepkg.conf"
94 pacman_command="/usr/bin/pacman"
96 pacman_config="/etc/pacman.conf"
102 git_command="/usr/bin/git"
108 gpg_command="/usr/bin/gpg"
114 sudo_command="/usr/bin/sudo"
120 ######################################################################################
125 # https://github.com/FascodeNet/alterlinux/blob/dev/tools/msg.sh の変数名にアンダーバーを追加し関数化
127 local OPTIND OPTARG arg
129 local _appname="msg.sh"
130 local _bash_debug=false
134 local _msg_type="info"
136 local _label_space="7"
137 local _adjust_chr=" "
138 local _customized_label=false
139 local _customized_label_color=false
141 local _noappname=false
142 local _noadjust=false
143 local _output="stdout"
146 echo "usage ${0} [option] [type] [message]"
148 echo "Display a message with a colored app name and message type label"
150 echo " General type:"
151 echo " info General message"
152 echo " warn Warning message"
153 echo " error Error message"
154 echo " debug Debug message"
156 echo " General options:"
157 echo " -a [name] Specify the app name"
158 echo " -c [character] Specify the character to adjust the label"
159 echo " -l [label] Specify the label."
160 echo " -n | --nocolor No output colored output"
161 echo " -o [option] Specify echo options"
162 echo " -r [color] Specify the color of label"
163 echo " -s [number] Specifies the label space."
164 echo " -x | --bash-debug Enables output bash debugging"
165 echo " -h | --help This help message"
167 echo " --nolabel Do not output label"
168 echo " --noappname Do not output app name"
169 echo " --noadjust Do not adjust the width of the label"
172 while getopts "a:c:l:no:r:s:xh-:" arg; do
178 _adjust_chr="${OPTARG}"
181 _customized_label=true
182 _msg_label="${OPTARG}"
188 _echo_opts="${OPTARG}"
191 _customized_label_color=true
223 _label_space="${OPTARG}"
264 shift $((OPTIND - 1))
289 # You can specify multiple decorations with ;.
290 # 0 => All attributs off (ノーマル)
292 # 4 => Underscore (下線)
294 # 7 => Reverse video on (色反転)
301 [[ "${_customized_label_color}" = false ]] && _labelcolor="32"
302 [[ "${_customized_label}" = false ]] && _msg_label="Info"
308 [[ "${_customized_label_color}" = false ]] && _labelcolor="33"
309 [[ "${_customized_label}" = false ]] && _msg_label="Warning"
315 [[ "${_customized_label_color}" = false ]] && _labelcolor="35"
316 [[ "${_customized_label}" = false ]] && _msg_label="Debug"
322 [[ "${_customized_label_color}" = false ]] && _labelcolor="31"
323 [[ "${_customized_label}" = false ]] && _msg_label="Error"
327 echo "Please specify the message type" >&2
331 echo "Unknown message type" >&2
336 _word_count="${#_msg_label}"
341 if [[ "${_nolabel}" = false ]]; then
342 if [[ "${_noadjust}" = false ]]; then
343 for __time in $( seq 1 $(( ${_label_space} - ${_word_count})) ); do
344 echo -ne "${_adjust_chr}"
347 if [[ "${_nocolor}" = false ]]; then
348 echo -ne "\e[$([[ -v _backcolor ]] && echo -n "${_backcolor}"; [[ -v _labelcolor ]] && echo -n ";${_labelcolor}"; [[ -v _decotypes ]] && echo -n ";${_decotypes}")m${_msg_label}\e[m "
350 echo -ne "${_msg_label} "
356 if [[ "${_noappname}" = false ]]; then
357 if [[ "${_nocolor}" = false ]]; then
358 echo -ne "\e[36m[${_appname}]\e[m "
360 echo -ne "[${_appname}] "
365 for _count in $(seq "1" "$(echo -ne "${_message}\n" | wc -l)"); do
366 _echo_message=$(echo -ne "${_message}\n" |head -n "${_count}" | tail -n 1 )
367 _full_message="$(echo_appname)$(echo_type)${_echo_message}"
370 echo ${_echo_opts} "${_full_message}" >&1
373 echo ${_echo_opts} "${_full_message}" >&2
376 echo ${_echo_opts} "${_full_message}" > ${_output}
388 local _locale="$(echo "${LANG}" | cut -d "." -f 1)"
392 local _translated_text="$(eval echo '$'{${_locale}[\"${*}\"]})"
394 if [[ -z "${_translated_text}" ]]; then
397 echo "${_translated_text}"
401 local _text _fulltext=() _main
403 if declare -p "${_locale}" 2> /dev/null 1>/dev/null; then
404 _main="$(_get_text ${1})"
409 echo "$(printf "${_main}" "${@}")"
411 _msg_translate "${@}"
416 # Show an INFO message
419 if [[ "${msgdebug}" = false ]]; then
422 local _msg_opts="-a ${wfa_name}"
423 if [[ "${1}" = "-n" ]]; then
424 _msg_opts="${_msg_opts} -o -n"
427 [[ "${msgdebug}" = true ]] && _msg_opts="${_msg_opts} -x"
428 [[ "${nocolor}" = true ]] && _msg_opts="${_msg_opts} -n"
429 msg ${_msg_opts} info "$(translate "${@}")"
430 if [[ "${bash_debug}" = true ]]; then
435 # Show an Warning message
438 if [[ "${msgdebug}" = false ]]; then
441 local _msg_opts="-a ${wfa_name}"
442 if [[ "${1}" = "-n" ]]; then
443 _msg_opts="${_msg_opts} -o -n"
446 [[ "${msgdebug}" = true ]] && _msg_opts="${_msg_opts} -x"
447 [[ "${nocolor}" = true ]] && _msg_opts="${_msg_opts} -n"
448 msg ${_msg_opts} warn "$(translate "${@}")"
449 if [[ "${bash_debug}" = true ]]; then
454 # Show an debug message
457 if [[ "${msgdebug}" = false ]]; then
460 if [[ "${debug}" = true ]]; then
461 local _msg_opts="-a ${wfa_name}"
462 if [[ "${1}" = "-n" ]]; then
463 _msg_opts="${_msg_opts} -o -n"
466 [[ "${msgdebug}" = true ]] && _msg_opts="${_msg_opts} -x"
467 [[ "${nocolor}" = true ]] && _msg_opts="${_msg_opts} -n"
468 msg ${_msg_opts} debug "$(translate "${@}")"
470 if [[ "${bash_debug}" = true ]]; then
475 # Show an ERROR message then exit with status
477 # $2: exit code number (with 0 does not exit)
479 if [[ "${msgdebug}" = false ]]; then
482 local _msg_opts="-a ${wfa_name}"
483 if [[ "${1}" = "-n" ]]; then
484 _msg_opts="${_msg_opts} -o -n"
487 [[ "${msgdebug}" = true ]] && _msg_opts="${_msg_opts} -x"
488 [[ "${nocolor}" = true ]] && _msg_opts="${_msg_opts} -n"
489 msg ${_msg_opts} error "$(translate "${@}")"
490 if [[ "${bash_debug}" = true ]]; then
495 ######################################################################################
500 # Delete the file if it exists.
501 # For directories, rm -rf is used.
502 # If the file does not exist, skip it.
503 # remove <file> <file> ...
505 local _list=($(echo "$@")) _file
506 for _file in "${_list[@]}"; do
507 msg_debug "Removing ${_file}"
508 if [[ -f "${_file}" ]]; then
510 elif [[ -d "${_file}" ]]; then
517 local _pacman_help=false
522 echo "${wfa_command}"
523 echo "${wfa_command} <operation> [...]"
526 echo " ${wfa_command} {-h --help}"
527 echo " ${wfa_command} {-V --version}"
528 #echo " ${wfa_command} {-D --database} <options> <package(s)>"
529 #echo " ${wfa_command} {-F --files} [options] [package(s)]"
530 echo " ${wfa_command} {-Q --query} [options] [package(s)]"
531 echo " ${wfa_command} {-R --remove} [options] <package(s)>"
532 echo " ${wfa_command} {-S --sync} [options] [package(s)]"
533 #echo " ${wfa_command} {-T --deptest} [options] [package(s)]"
534 #echo " ${wfa_command} {-U --upgrade} [options] <file(s)>"
536 #echo "New operations:"
537 #echo " ${wfa_command} {-P --show} [options]"
538 #echo " ${wfa_command} {-G --getpkgbuild} [package(s)]"
541 echo " --repo Assume targets are from the repositories"
542 echo " -a --aur Assume targets are from the AUR"
544 echo "Permanent configuration options:"
545 echo " --aururl <url> Set an alternative AUR URL"
546 echo " --makepkg <file> makepkg command to use"
547 echo " --mflags <flags> Pass arguments to makepkg"
548 echo " --pacman <file> pacman command to use"
549 echo " --git <file> git command to use"
550 echo " --gitflags <flags> Pass arguments to git"
551 echo " --gpg <file> gpg command to use"
552 echo " --gpgflags <flags> Pass arguments to gpg"
553 echo " --config <file> pacman.conf file to use"
554 echo " --makepkgconf <file> makepkg.conf file to use"
555 echo " --nomakepkgconf Use the default makepkg.conf"
559 local _wfa_usage_sync
561 echo "usage: ${wfa_command} {-S --sync} [options] [package(s)]"
563 echo " -b, --dbpath <path> set an alternate database location"
564 echo " --config <path> set an alternate configuration file"
565 echo " --noconfirm do not ask for any confirmation"
569 if [[ "${operation}" = "none" ]]; then
571 elif [[ "${_pacman_help}" = true ]]; then
572 "${pacman_command}" -h --${operation}
573 elif [[ "$(type -t "_wfa_usage_${operation}" )" = "function" ]]; then
574 _wfa_usage_${operation}
576 msg_error "Undefined operation"
582 if [[ "${operation}" = "none" ]]; then
584 add_args pacman "--${operation}"
586 msg_error "only one operation may be used at a time"
592 if (( ${UID} == 0 )); then
600 run_sudo "${pacman_command}" ${@}
604 # https://github.com/FascodeNet/aptpac/blob/master/aptpac のADD_OPTION関数を参考
605 # Usage: add_args [pacman/makepkg] <args1> <args2>...
613 _args_array=(${makepkg_args})
615 makepkg_args=${_args_array[@]}
616 msg_debug "makepkg ARGS: ${makepkg_args}"
620 _args_array=(${pacman_args})
622 pacman_args=${_args_array[@]}
623 msg_debug "pacman ARGS: ${pacman_args}"
626 _args_array=(${mpg_args})
628 git_args=${_args_array[@]}
629 msg_debug "git ARGS: ${git_args}"
632 _args_array=(${gpg_args})
634 gpg_args=${_args_array[@]}
635 msg_debug "gpg ARGS: ${gpg_args}"
638 _args_array=(${sudo_args})
640 sudo_args=${_args_array[@]}
641 msg_debug "sudo ARGS: ${sudo_args}"
644 msg_error "Failed to set the argument of %s" "${_target}"
645 msg_error "Setting that command is not currently supported"
651 # 引数で指定されたパッケージがAUR以外の場所に存在しない場合にのみ正常終了します(AURのパッケージの場合に正常終了)
652 check_aur_package() {
653 local _package="${1}"
654 # 参考: https://qiita.com/Hayao0819/items/a8740a17301fafa2fdab
655 if [[ -z "$(pacman -Ssq "${_package}" 2>/dev/null | grep -o ".*${_package}$")" ]]; then
664 # 引数で指定されたパッケージが既にインストールされている場合は正常終了します。
665 check_installed_package() {
666 local _package="${1}"
667 if "${pacman_command}" -Qq "${_package}" > /dev/null 2>&1; then
675 local _user_config_dir _cache_dir
676 if [[ -v XDG_CONFIG_HOME ]]; then
677 _user_config_dir="${XDG_CONFIG_HOME}"
679 _use_config_dir="${HOME}/.config"
681 if [[ -f "${_use_config_dir}/user-dirs.dirs" ]]; then
682 source "${_use_config_dir}/user-dirs.dirs"
684 if [[ -v XDG_CACHE_HOME ]]; then
685 _cache_dir="${XDG_CACHE_HOME}"
687 _cache_dir="${HOME}/.cache"
689 echo -n "${_cache_dir}"
692 # Usage: get_srcinfo_data <path> <var>
693 # 参考: https://qiita.com/withelmo/items/b0e1ffba639dd3ae18c0
695 local _srcinfo="${1}" _ver="${2}"
696 local _srcinfo_json=$(python << EOF
697 from srcinfo.parse import parse_srcinfo; import json
701 parsed, errors = parse_srcinfo(text)
702 print(json.dumps(parsed))
705 echo "${_srcinfo_json}" | jq -rc "${2}" | tr '\n' ' '
709 # AURからパッケージをビルドしてインストールします
710 # 現在1つのパッケージしか指定できません
711 install_aur_package() {
712 local _package="${1}"
715 if [[ ! -v wfa_cache_dir ]]; then
716 wfa_cache_dir="$(get_cache_dir)/wfa"
718 mkdir -p "${wfa_cache_dir}/archive"
719 mkdir -p "${wfa_cache_dir}/build/${_package}"
722 msg_info "Searching in AUR ..."
723 local _aur_json=$(curl -sL "https://aur.archlinux.org/rpc/?v=5&type=search&by=name&arg=${_package}" | jq -r)
724 if (( "$(echo "${_aur_json}" | jq -r ".resultcount")" == 0 )); then
725 msg_error "Could not find all required packages:\n ${_package}"
729 local _found_packages="$(echo "${_aur_json}" | jq -r --tab '.results[].Name')"
730 #msg_debug "Found package: $(echo ${_found_packages} | tr '\n' ' ')"
732 if [[ -n "$(echo "${_found_packages}" | grep -x "${_package}" )" ]]; then
733 msg_debug "Select a package %s with an exact name match" "${_package}"
735 msg_error "No package with an exact name match was found"
740 msg_info "Download PKGBUILD of %s" "${_package}"
741 _aur_json=$(echo "${_aur_json}" | jq -r ".results[] | select(.Name == \"${_package}\")" )
742 local _aur_snapshot_url="${aururl%/}$(echo "${_aur_json}" | jq -r ".URLPath")"
743 local _aur_version="$(echo "${_aur_json}" | jq -r ".Version")"
744 msg_debug "Get PKGBUILD from %s" "${_aur_snapshot_url}"
746 local _pkgbuild_archive_path="${wfa_cache_dir}/archive/${_package}-${_aur_version}"
747 local _download_pkgbuild=true
748 if [[ -f "${_pkgbuild_archive_path}" ]]; then
749 msg_warn "PKGBUILD has already been downloaded"
750 msg_warn -n "Do you want to overwrite and download? [n] :"
752 if [[ "${noconfirm}" = true ]]; then
758 case "${_yes_or_no}" in
759 "y" | "Y" | "yes" | "Yes" | "YES" ) _download_pkgbuild=true ;;
760 * ) _download_pkgbuild=false ;;
763 if [[ "${_download_pkgbuild}" = true ]]; then
764 remove "${_pkgbuild_archive_path}"
765 curl -L -C - -f -o "${_pkgbuild_archive_path}" "${_aur_snapshot_url}"
769 msg_info "Unpacking the tarball of PKGBUILD ..." #ここまで翻訳
770 tar -xv -f "${_pkgbuild_archive_path}" -C "${wfa_cache_dir}/build/" > /dev/null 2>&1
773 local _build_dir="${wfa_cache_dir}/build/${_package}"
774 if [[ ! -f "${_build_dir}/.SRCINFO" ]]; then
775 msg_warn ".SRCINFO was not found.\nGenerating it using makepkg"
778 "${makepkg_command}" --printsrcinfo > "${_build_dir}/.SRCINFO"
782 local _makedepends="$(get_srcinfo_data "${_build_dir}/.SRCINFO" ".makedepends[]?")"
783 local _depends="$(get_srcinfo_data "${_build_dir}/.SRCINFO" ".depends[]?")"
784 local _conflicts="$(get_srcinfo_data "${_build_dir}/.SRCINFO" ".conflicts[]?")"
785 msg_info "makedepends: %s" "${_makedepends}"
786 msg_info "depends: %s" "${_depends}"
787 msg_info "conflicts: %s " "${_conflicts}"
791 local _pkg _conflicts_found=false
792 for _pkg in ${_conflicts[@]}; do
793 if "${pacman_command}" -Qq "${_pkg}" > /dev/null 2>&1 ; then
794 _conflicts_found=true
795 msg_error "${_package} is colliding with ${_pkg}"
798 if "${pacman_command}" -Qq "${_package}" > /dev/null 2>&1 && [[ ! "$("${pacman_command}" -Qq "${_package}" 2> /dev/null)" = "${_package}" ]]; then
799 msg_error "${_package} is colliding with $("${pacman_command}" -Qq "${_package}")"
800 _conflicts_found=true
802 if [[ "${_conflicts_found}" = true ]]; then
803 msg_error "A conflict was found."
809 if [[ "${nodeps}" = false ]]; then
810 msg_info "Install dependent packages..."
811 local _force_aur="${force_aur}"
813 install_package "${_depends}"
814 force_aur="${_force_aur}"
820 if [[ -d "${_build_dir}/src" ]]; then
821 msg_info "Found ${_build_dir}/src"
822 msg_info -n "Packages to cleanBuild? [n] :"
825 if [[ "${noconfirm}" = true ]]; then
831 case "${_yes_or_no}" in
832 "y" | "Y" | "yes" | "Yes" | "YES" ) add_args makepkg "--clean" ;;
838 add_args "makepkg" "-sf"
841 "${makepkg_command}" "${makepkg_args}"
848 "${makepkg_command}" --printsrcinfo > "${_build_dir}/.SRCINFO"
850 local _pkgnames=($(get_srcinfo_data "${_build_dir}/.SRCINFO" ".packages | keys[]" | sed 's/ //g'))
851 local _pkgver="$(get_srcinfo_data "${_build_dir}/.SRCINFO" ".pkgver" | sed 's/ //g')"
852 local _pkgrel="$(get_srcinfo_data "${_build_dir}/.SRCINFO" ".pkgrel" | sed 's/ //g')"
853 local _arch_array=($(get_srcinfo_data "${_build_dir}/.SRCINFO" ".arch[]"))
855 if [[ "${_arch_array[*]}" = "any" ]]; then
861 source "${makepkg_config}"
864 local _pkgfilelist=()
865 for _pkgname in ${_pkgnames[@]}; do
866 _pkgfilelist+=("${_build_dir}/${_pkgname}-${_pkgver}-${_pkgrel}-${_arch}${_PKGEXT}")
870 run_pacman -U --noconfirm ${_pkgfilelist[@]}
874 search_aur_package() {
875 local _package="${1}"
876 msg_info "Searching in AUR ..."
877 local _aur_json=$(curl -sL "https://aur.archlinux.org/rpc/?v=5&type=search&by=name-desc&arg=${_package}" | jq -r )
878 local _found_result_count="$(echo "${_aur_json}" | jq -r ".resultcount")"
879 if (( "${_found_result_count}" == 0 )); then
880 msg_error "Could not find all required packages:\n ${_package}"
883 _aur_json=$(echo "${_aur_json}" | jq -r ".results[]")
887 local _found_pkgname=($(echo "${_aur_json}" | jq -r ".Name" ))
892 local _found_package __pkgver __popularity __vote __pkgdesc
893 for _found_package in ${_found_pkgname[@]}; do
894 _found_json="$(echo ${_aur_json} | jq "select(.Name == \"${_found_package}\")")"
895 __pkgver="$(echo "${_found_json}" | jq -r ".Version" )"
896 __popularity="$(echo "${_found_json}" | jq -r ".Popularity" )"
897 __vote="$(echo "${_found_json}" | jq -r ".NumVotes" )"
898 __pkgdesc="$(echo "${_found_json}" | jq -r ".Description" )"
900 echo "aur/${_found_package} ${__pkgver} (+${__vote} ${__popularity})"
902 unset __pkgver __popularity __vote __pkgdesc _found_json
907 operation_version() {
908 # Pyalpmからlibalpmの値を取得
909 # 参考: https://pyalpm.readthedocs.io/en/latest/pyalpm/pyalpm.html
910 local _libalpm_version="$(python3 -c 'import pyalpm; print(pyalpm.alpmversion())')"
911 local _pacman_version="$("${pacman_command}" -Q pacman | cut -d ' ' -f 2)"
912 echo "wfa v${wfa_version} - pacman v${_pacman_version} - libalpm v${_libalpm_version}"
916 run_pacman ${pacman_args} "${specified_packages[@]}"
919 # Usage: install_package <package1> <package2>...
922 for _package in ${@}; do
923 if ! check_installed_package "${_package}"; then
924 if ! check_aur_package "${_package}"; then
925 # 公式パッケージなのでpacmanでそのままインストール
926 run_pacman ${pacman_args} "${_package}"
929 install_aur_package "${_package}"
930 #msg_error "Getting the AUR package has not been implemented yet.
937 upgrade_aur_package() {
938 msg_error "This is a feature that has not been implemented yet"
943 if [[ "${sync_search}" = true ]]; then
944 for _package in ${specified_packages[@]}; do
945 search_aur_package "${_package}"
947 "${pacman_command}" ${pacman_args} ${specified_packages[@]}
949 if [[ "${sync_upgrade}" = true ]]; then
951 run_pacman ${pacman_args} --sysupgrade
953 for _package in ${specified_packages[@]}; do
954 if ! check_aur_package "${_package}" && [[ "${force_aur}" = false ]]; then
955 # 公式パッケージなのでpacmanでそのままインストール
956 run_pacman ${pacman_args} "${_package}"
959 install_aur_package "${_package}"
960 #msg_error "Getting the AUR package has not been implemented yet."
970 _opt_short="QRShVdb:aysu"
971 _opt_long="query,remove,sync,help,version,debug,dbpath:,aururl,aur,noconfirm,config:,makepkg:,mflags:,pacman:,git:,gitflags:,gpg:,gpgflags:,makepkgconf:,nomakepkgconf,nodeps,refresh,bash-debug,msg-debug,sysupgrade"
973 OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- ${ARGUMENT})
974 [[ ${?} != 0 ]] && exit 1
975 unset _opt_short _opt_long
978 msg_debug "Argument: ${OPT}"
983 set_operation "query"
987 set_operation "remove"
995 set_operation "version"
1008 eval set -- "${OPT}"
1014 msg_debug "Assume targets are from the AUR"
1019 add_args pacman "--debug"
1024 add_args pacman "--nodeps"
1028 add_args pacman "--dbpath '${2}'"
1032 option_y_count=$(( option_y_count + 1 ))
1036 add_args pacman "--search"
1049 add_args pacman "--noconfirm"
1054 pacman_config="${2}"
1055 add_args pacman "--config \"${2}\""
1059 makepkg_command="${2}"
1067 pacman_command="${2}"
1079 if [[ "${nomakepkgconf}" = false ]]; then
1080 makepkg_config="${2}"
1082 msg_warn "--nomakepkgconf is specified.\n--makepkgconf has been ignored."
1087 makepkg_config="/etc/makepkg.conf"
1115 specified_packages=(${@})
1117 # Run database update
1118 if (( "${option_y_count}" == 1 )); then
1120 elif (( "${option_y_count}" >= 2 )); then
1124 case "${operation}" in
1138 msg_error "Undefined operation"