aur.sh: Drop --old-aur and --aur-host

master
Taeyeon Mori 4 years ago
parent 9297304cfd
commit 2786987f57
  1. 35
      bin/aur.sh

@ -2,8 +2,6 @@
# (c) 2014-2018 Taeyeon Mori # (c) 2014-2018 Taeyeon Mori
# vim: ft=sh:ts=2:sw=2:et # vim: ft=sh:ts=2:sw=2:et
AUR_DEFAULT_HOST="https://aur.archlinux.org/"
# Load libraries and configuraion # Load libraries and configuraion
source "$DOTFILES/lib/libzsh-utils.zsh" source "$DOTFILES/lib/libzsh-utils.zsh"
source "$DOTFILES/etc/aur.conf" source "$DOTFILES/etc/aur.conf"
@ -56,10 +54,9 @@ PROG="$0"
packages=() packages=()
makepkg_args=() makepkg_args=()
aur_get=aur_get_aur4
DL_ONLY=false DL_ONLY=false
ASK=false ASK=false
AUR_HOST="$AUR_DEFAULT_HOST" AUR_HOST="https://aur.archlinux.org/"
ADD_UPDATES=false ADD_UPDATES=false
ADD_SCMPKGS=false ADD_SCMPKGS=false
ADD_PYTHON=false ADD_PYTHON=false
@ -91,10 +88,8 @@ process_arg() {
fi fi
if [ -n "$_next_arg" ]; then if [ -n "$_next_arg" ]; then
case "$_next_arg" in case "$_next_arg" in
--aur-host)
AUR_HOST="$cx";;
--exclude) --exclude)
EXCLUDE=",$cx";; EXCLUDE="$EXCLUDE,$cx";;
--threads) --threads)
if [ "${cx:0:1}" = "-" -o "${cx:0:1}" = "+" ]; then if [ "${cx:0:1}" = "-" -o "${cx:0:1}" = "+" ]; then
export MAKEPKG_MAKETHREADS=$[`nproc` + $cx] export MAKEPKG_MAKETHREADS=$[`nproc` + $cx]
@ -109,9 +104,6 @@ process_arg() {
fi fi
case "$cx" in case "$cx" in
# aur.sh options # aur.sh options
--old-aur)
warn "[AUR] Using old AUR methods (--old-aur)"
aur_get=aur_get_old;;
-X|--download-only) -X|--download-only)
warn "[AUR] Building was disabled (-X)" warn "[AUR] Building was disabled (-X)"
DL_ONLY=true;; DL_ONLY=true;;
@ -119,7 +111,7 @@ process_arg() {
ASK=true;; ASK=true;;
--offline) --offline)
LOCAL_ONLY=true;; LOCAL_ONLY=true;;
--aur-host|--exclude) # need more args --exclude) # need more args
_next_arg="$cx";; _next_arg="$cx";;
--no-custom) --no-custom)
USECUSTOM=false;; USECUSTOM=false;;
@ -184,11 +176,6 @@ process_arg() {
echo echo
echo " --clean Clean up leaftover temporary files (of previous (failed) builds) and exit" echo " --clean Clean up leaftover temporary files (of previous (failed) builds) and exit"
echo echo
echo "AUR backend options:"
echo " --aur-host <url>"
echo " Use a different AUR server. default: https://aur.archlinux.org/"
echo " --old-aur Use the old (non-git) AUR methods"
echo
echo "Makepkg/Pacman options:" echo "Makepkg/Pacman options:"
echo " -i Install package after building it (requires superuser)" echo " -i Install package after building it (requires superuser)"
echo " -s Install dependencies from official repos (requires superuser)" echo " -s Install dependencies from official repos (requires superuser)"
@ -287,13 +274,6 @@ else
warn "Could not detect auracle on the system." warn "Could not detect auracle on the system."
fi fi
if [ "$aur_get" != "aur_get_aur4" ] || [ "$AUR_HOST" != "$AUR_DEFAULT_HOST" ]; then
USE_AURACLE=false
$NEED_AURACLE &&
throw 31 "--old-aur and --aur-host are not supported with auracle features" ||
warn "--old-aur and --aur-host are no longer supported"
fi
if ! $USE_AURACLE; then if ! $USE_AURACLE; then
warn "Auracle will not be used. Not all features are available without it." warn "Auracle will not be used. Not all features are available without it."
warn "Specifically, split packages cannot be detected without auracle." warn "Specifically, split packages cannot be detected without auracle."
@ -302,16 +282,11 @@ fi
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# aur functions # aur functions
aur_get_old() {
[ -d "$1/.git" ] && throw 32 "Local copy of $1 is a Git clone from AUR v4. Don't use --old-aur with it!"
curl "$AUR_HOST/packages/${1:0:2}/$1/$1.tar.gz" | tar xz
}
[[ -z "$AUR_GIT_OPTIONS" ]] && AUR_GIT_OPTIONS=() [[ -z "$AUR_GIT_OPTIONS" ]] && AUR_GIT_OPTIONS=()
[[ -z "$AUR_GIT_PULL_OPTIONS" ]] && AUR_GIT_PULL_OPTIONS=(--rebase) [[ -z "$AUR_GIT_PULL_OPTIONS" ]] && AUR_GIT_PULL_OPTIONS=(--rebase)
[[ -z "$AUR_GIT_CLONE_OPTIONS" ]] && AUR_GIT_CLONE_OPTIONS=() [[ -z "$AUR_GIT_CLONE_OPTIONS" ]] && AUR_GIT_CLONE_OPTIONS=()
aur_get_aur4() { aur_get() {
if [ -d "$1/.git" ]; then ( if [ -d "$1/.git" ]; then (
cd "$1" cd "$1"
git "${AUR_GIT_OPTIONS[@]}" pull "${AUR_GIT_PULL_OPTIONS[@]}" git "${AUR_GIT_OPTIONS[@]}" pull "${AUR_GIT_PULL_OPTIONS[@]}"
@ -463,7 +438,7 @@ fetch_package() {
grep -q "#CUSTOMPKG" $p/PKGBUILD && \ grep -q "#CUSTOMPKG" $p/PKGBUILD && \
warn "[AUR] $p: Found #CUSTOMPKG; not updating PKGBUILD from AUR!" \ warn "[AUR] $p: Found #CUSTOMPKG; not updating PKGBUILD from AUR!" \
} || \ } || \
$aur_get "$p" || \ aur_get "$p" || \
warn "[AUR] $p: Couldn't download PKGBUILD from aur!" warn "[AUR] $p: Couldn't download PKGBUILD from aur!"
PKG_INFO[$p:From]="$AURDEST/$p" PKG_INFO[$p:From]="$AURDEST/$p"

Loading…
Cancel
Save