echo -e "${@}" >&2
}
+_msg_warn () {
+ echo -e "${@}" >&2
+}
+
_msg_debug () {
if "${DEBUG}"; then
echo -e "${@}" >&1
echo " --aur-helper <command> Specifies the command to use as the AUR helper"
echo " Ignored if pacapt is run as root"
echo " Specify AUR helper that supports common command line options with pacman"
+ echo " --pflags <flags> Pass arguments to pacman"
echo
echo " Notes:"
echo " - aptpac supports not only above options but also options of pacman"
}
ADD_OPTION () {
+ _msg_debug "Added pacman option '${*}'"
PACMAN_OPTIONS+=("${@}")
}
_sudo(){
if "${RUN_WITH_SUDO}"; then
+ _msg_debug "Run sudo ${*}"
eval sudo "${@}"
else
+ _msg_debug "Run ${*}"
eval "${@}"
fi
}
}
_run_debtap(){
+ _msg_warn "It is not recommended to install deb package"
+ _msg_warn "The package conversion is not perfect and can lead to errors in some cases"
+
if (( "${#DEB_PACKAGE_FILE[@]}" != 0 )) && ! hash "debtap"; then
_msg_error "debtap was not found"
exit 1
fi
if [[ -z "$(find "/var/cache/pkgfile" -maxdepth 1 -mindepth 1 -name "*.files" 2> /dev/null)" ]] || [[ -z "$(find "/var/cache/debtap" -maxdepth 1 -mindepth 1 -name "*-packages" 2> /dev/null)" ]] || [[ -z "$(find "/var/cache/debtap" -maxdepth 1 -mindepth 1 -name "*-files" 2> /dev/null)" ]]; then
+ _msg_debug "Updating debtap datebase"
sudo debtap -u
fi
for pkg in "${DEB_PACKAGE_FILE[@]}"; do
work="${DEBTAP_WORK}/$(basename "${pkg}")/"
file="${work}/$(basename "${pkg}")"
+ _msg_debug "Work dir: ${work}"
+ _msg_debug "Deb file:${work}"
sudo mkdir -p "${work}"
- cd "${work}"
sudo cp "${pkg}" "${file}"
+ cd "${work}"
sudo debtap --Quiet "${file}"
while read -r archpkg; do
+ _msg_debug "Install ${archpkg} with pacman"
_pacman -U "${archpkg}"
done < <(find "${work}" -maxdepth 1 -mindepth 1 -type f -name "*.pkg.tar.*")
done
_exit 0
;;
huawei)
+ # shellcheck disable=SC1091
if [[ "$(source "/etc/locale.conf" 2> /dev/null; echo -n "${LANG}")" = "ja_JP.UTF-8" ]]; then
echo "(ง •ᴗ•)ว ⁾⁾ファーウェイでウェイウェイ"
_exit 0