#-- options (int) --#
option_y_count=0
+sync_clean_count=0
#-- options (str) --#
aururl="https://aur.archlinux.org/"
fi
}
+# ~/.cacheに相当するディレクトリを返します
get_cache_dir() {
local _user_config_dir _cache_dir
if [[ -v XDG_CONFIG_HOME ]]; then
local _makedepends="$(get_srcinfo_data "${_build_dir}/.SRCINFO" ".makedepends[]?")"
local _depends="$(get_srcinfo_data "${_build_dir}/.SRCINFO" ".depends[]?")"
local _conflicts="$(get_srcinfo_data "${_build_dir}/.SRCINFO" ".conflicts[]?")"
- msg_info "makedepends: %s" "${_makedepends}"
- msg_info "depends: %s" "${_depends}"
- msg_info "conflicts: %s " "${_conflicts}"
+ msg_debug "makedepends: %s" "${_makedepends}"
+ msg_debug "depends: %s" "${_depends}"
+ msg_debug "conflicts: %s " "${_conflicts}"
# 衝突を確認
operation_sync(){
local _package
+ if (( "${sync_clean_count}" >= 1 )); then
+ remove "$(get_cache_dir)/wfa"
+ run_pacman ${pacman_args} $(
+ local _count
+ for _count in $(seq 1 ${sync_clean_count}); do
+ echo -n "-c "
+ done
+ )
+ fi
+
+
if [[ "${sync_search}" = true ]]; then
for _package in ${specified_packages[@]}; do
search_aur_package "${_package}"
# Parse options
ARGUMENT="${@}"
-_opt_short="QRShVdb:aysu"
-_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"
+_opt_short="QRShVdb:aysuc"
+_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,color:,nocolor.clean"
OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- ${ARGUMENT})
[[ ${?} != 0 ]] && exit 1
sync_upgrade=true
shift 1
;;
+ -c | --clean)
+ sync_clean_count=$(( sync_clean_count + 1 ))
+ shift 1
+ ;;
--aururl)
aururl="${2}"
shift 2
;;
--config)
pacman_config="${2}"
- add_args pacman "--config \"${2}\""
+ add_args pacman "--config ${2}"
shift 2
;;
--makepkg)
msgdebug=true
shift 1
;;
+ --color)
+ case "${2}" in
+ "never")
+ nocolor=true
+ add_args pacman "--color never"
+ ;;
+ "always")
+ nocolor=false
+ add_args pacman "--color always"
+ ;;
+ "auto")
+ msg_error "auto is not currently supported."
+ add_args pacman "--color auto"
+ ;;
+ esac
+ ;;
+ --nocolor)
+ nocolor=true
+ add_args pacman "--color never"
+ shift 1
+ ;;
-h | --help)
usage
shift 1