5 # __ _____\ \ ,_\ _____ __ ___
6 # /'__`\ /\ '__`\ \ \//\ '__`\ /'__`\ /'___\
7 #/\ \L\.\\ \ \L\ \ \ \\ \ \L\ /\ \L\.\_/\ \__/
8 #\ \__/.\_\ \ ,__/\ \__\ \ ,__\ \__/.\_\ \____\
9 # \/__/\/_/\ \ \/ \/__/\ \ \/ \/__/\/_/\/____/
12 # a pacman wrapper with syntax based on debian's apt
13 # (c) 2019-2020 Fascode Network.
14 # maintained by Yamada Hayao
30 if [[ ! "${UID}" = 0 ]]; then
31 if [[ -z ${AURHELP} ]]; then
32 for AURHELP in ${HELPERS[@]}; do
33 if [[ -f $(which ${AURHELP} 2> /dev/null) ]]; then
34 pacman=$(which ${AURHELP})
39 if [[ -f $(which ${AURHELP} 2> /dev/null) ]]; then
42 echo "${AURHELP} is not installed." >&2
49 if [[ ! "${UID}" = 0 ]]; then
58 echo "usage ${0} [options] [command] [packages]"
60 echo " install Install the specified package."
61 echo " remove Remove the specified package."
62 echo " purge Permanently remove the package."
63 echo " update Update the package database."
64 echo " upgrade Update the package."
65 echo " search Search for a package."
66 echo " autoremove Remove unnecessary packages."
67 echo " clean Remove the package cache."
68 echo " list Displays a list of packages."
70 echo " general options: "
71 echo " -y | --yes | --assume-yes Do not check."
72 echo " -d | --download-only Only download the package."
73 echo " -c <file> Config file for pacman."
74 echo " -h | --help Display this help."
75 echo " -v Displays the version of pacman."
76 echo " --purge Delete the entire configuration file."
88 OPTIONS="${OPTIONS} ${@}"
91 while getopts 'ydf-:c:hv' arg; do
93 y) ADD_OPTION "--noconfirm" ;;
96 c) ADD_OPTION "--config ${OPTARG}" ;;
98 v) _version; _exit 0 ;;
101 download-only) ADD_OPTION "-w" ;;
103 yes) ADD_OPTION "--noconfirm" ;;
104 assume-yes) ADD_OPTION "--noconfirm" ;;
105 installed) installed=true;;
106 purge) ADD_OPTION "-n" ;;
108 help) _usage; _exit 0 ;;
113 shift $((OPTIND - 1))
115 if [[ $# -lt 1 ]]; then
116 _msg_error "No command specified"
127 install) ADD_OPTION "-S" ;;
128 remove) ADD_OPTION "-Rsc" ;;
129 purge) ADD_OPTION "-Rsnc" ;;
130 update) ADD_OPTION "-Syy" ;;
131 upgrade) ADD_OPTION "-Syu" ;;
132 search) ADD_OPTION "-Ss" ;;
133 full-upgrade) ADD_OPTION "-Syu" ;;
134 edit-sources) sudo nano /etc/pacman.conf; _exit 0 ;;
135 dist-upgrade) ADD_OPTION "-Syu" ;;
137 if [[ "${LANG}" = "ja_JP.UTF-8" ]]; then
138 echo "(ง •ᴗ•)ว ⁾⁾ファーウェイでウェイウェイ"
150 ...."Have you mooed today?"...
157 autoremove) if [[ -n $(${pacman} -Qttdq) ]]; then
159 PACKAGE="$(${pacman} -Qttdq)"
161 echo "No packages to remove."
166 if ${installed}; then
167 ADD_OPTION "-Q | grep"
173 _msg_error "Invalid comman '${COMMAND}'"
178 if [[ ! "${pacman}" = "pacman" ]]; then
179 echo "Use AUR helper ${pacman}."
182 # echo "${pacman} ${OPTIONS} ${PACKAGE}"
183 ${pacman} ${OPTIONS} ${PACKAGE}