aur.sh: Use --asdeps for makepkg, Add package ignore list

master
Taeyeon Mori 9 years ago
parent 28ed02f497
commit 44e84ad7c1
  1. 28
      bin/aur.sh
  2. 2
      dotfiles/makepkg.conf
  3. 11
      etc/aur.conf
  4. 3
      git/config

@ -31,6 +31,8 @@ ADD_UPDATES=false
RECURSE_DEPS=false RECURSE_DEPS=false
NEED_COWER=false NEED_COWER=false
LIST_ONLY=false LIST_ONLY=false
EXCLUDE=
ASDEPS=true
add_makepkg_arg() { add_makepkg_arg() {
makepkg_args=("${makepkg_args[@]}" "$1") makepkg_args=("${makepkg_args[@]}" "$1")
@ -49,6 +51,8 @@ process_arg() {
case "$_next_arg" in case "$_next_arg" in
--aur-host) --aur-host)
AUR_HOST="$cx";; AUR_HOST="$cx";;
--exclude)
EXCLUDE=",$cx";;
esac esac
_next_arg= _next_arg=
continue continue
@ -63,7 +67,7 @@ process_arg() {
DL_ONLY=true;; DL_ONLY=true;;
--ask) --ask)
ASK=true;; ASK=true;;
--aur-host) # need more args --aur-host|--exclude) # need more args
_next_arg="$cx";; _next_arg="$cx";;
-u|--update) -u|--update)
[ -n "$MODE" ] && throw 255 "Can only use one flag from the 'aur.sh command' category" [ -n "$MODE" ] && throw 255 "Can only use one flag from the 'aur.sh command' category"
@ -96,6 +100,9 @@ process_arg() {
echo " --old-aur Use the old (non-git) AUR methods" echo " --old-aur Use the old (non-git) AUR methods"
echo " --ask Ask before installing packages (removes --noconfirm)" echo " --ask Ask before installing packages (removes --noconfirm)"
echo " --clean Clean up leaftover temporary files (of failed builds) and exit" echo " --clean Clean up leaftover temporary files (of failed builds) and exit"
echo " --exclude <pkgs>"
echo " Exclude packages from -u"
echo " --asexplicit Don't pass --asdeps to makepkg"
echo echo
echo "Useful makepkg options:" echo "Useful makepkg options:"
echo " -i Install package after building it" echo " -i Install package after building it"
@ -118,8 +125,10 @@ process_arg() {
done done
color 35 echo "Cleaned leftover temporary files." color 35 echo "Cleaned leftover temporary files."
exit 0;; exit 0;;
--asexplicit)
ASDEPS=false;;
# Makepkg args # Makepkg args
--pkg|--key|--config) # These take an additional value --pkg|--key|--config|-p) # These take an additional value
_proxy_args=1 _proxy_args=1
add_makepkg_arg "$cx";; add_makepkg_arg "$cx";;
-*) -*)
@ -143,6 +152,7 @@ for cx in "$@"; do
esac esac
done done
# Cower Detection # Cower Detection
USE_COWER=false USE_COWER=false
@ -203,11 +213,19 @@ if $ADD_UPDATES; then
packages=("${packages[@]}" "`echo $update | cut -d' ' -f2`") packages=("${packages[@]}" "`echo $update | cut -d' ' -f2`")
done done
IFS="$OFS" IFS="$OFS"
msg "[AUR] Updates available for: ${packages[*]}"
if [ -n "$EXCLUDE" -o -n "$AURSH_IGNORE_UPDATES" ]; then
packages=(`echo ${packages[@]} | sed -re "s/$(echo $EXCLUDE $AURSH_IGNORE_UPDATES | sed -e 's/[ ,]/|/g')//g"`)
fi
fi fi
if [ -z "$packages" ]; then if [ -z "$packages" ]; then
warn "[AUR] Nothing to do." warn "[AUR] Nothing to do."
exit 0 exit 0
else
msg "[AUR] Package set: ${packages[*]}"
fi fi
# Figure out build directory # Figure out build directory
@ -217,7 +235,7 @@ if ! $DL_ONLY && ! $LIST_ONLY; then
test -d "$build" || mkdir -p "$build" || throw 1 "Couldn't create build directory" test -d "$build" || mkdir -p "$build" || throw 1 "Couldn't create build directory"
clean_exit() { clean_exit() {
rm "$build/aur.sh.running" rm "$build/aur.sh.running" 2>/dev/null || true
exit ${1-0} exit ${1-0}
} }
trap clean_exit TERM trap clean_exit TERM
@ -234,6 +252,10 @@ if ! $DL_ONLY && ! $LIST_ONLY; then
add_makepkg_arg "--noconfirm" add_makepkg_arg "--noconfirm"
fi fi
$ASDEPS && add_makepkg_arg "--asdeps"
msg "[AUR] Makepkg args: ${makepkg_args[*]}"
fi fi

@ -16,7 +16,7 @@ CFLAGS="`fix_march $CFLAGS`"
CXXFLAGS="`fix_march $CXXFLAGS`" CXXFLAGS="`fix_march $CXXFLAGS`"
LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS"
MAKEFLAGS="-j`grep "cpu cores" /proc/cpuinfo | cut -d: -f2`" MAKEFLAGS="-j`nproc`"
# Store stuff # Store stuff
source "$DOTFILES/etc/aur.conf" source "$DOTFILES/etc/aur.conf"

@ -5,17 +5,25 @@ AURDIR="$HOME/aur"
AURDEST="$AURDIR/Pkgbuilds" AURDEST="$AURDIR/Pkgbuilds"
PKGDEST="$AURDIR/Packages" PKGDEST="$AURDIR/Packages"
SRCDEST="$AURDIR/Source" SRCDEST="$AURDIR/Source"
ABSDEST="$AURDIR/ABS"
GNUPGHOME="$AURDIR/gnupg"
# Local options
test -e "$DOTFILES/etc/aur.conf.local" &&
source "$DOTFILES/etc/aur.conf.local"
# Create directories
test -d "$AURDEST" || mkdir -p "$AURDEST" || exit 1 test -d "$AURDEST" || mkdir -p "$AURDEST" || exit 1
test -d "$PKGDEST" || mkdir -p "$PKGDEST" || exit 1 test -d "$PKGDEST" || mkdir -p "$PKGDEST" || exit 1
test -d "$SRCDEST" || mkdir -p "$SRCDEST" || exit 1 test -d "$SRCDEST" || mkdir -p "$SRCDEST" || exit 1
# GnuPG Signatures # GnuPG Signatures
export GNUPGHOME="$AURDIR/gnupg" export GNUPGHOME
test -d "$GNUPGHOME" || mkdir -p "$GNUPGHOME" && chmod go-w "$GNUPGHOME" || exit 1 test -d "$GNUPGHOME" || mkdir -p "$GNUPGHOME" && chmod go-w "$GNUPGHOME" || exit 1
if ! test -e "$GNUPGHOME/gpg.conf"; then if ! test -e "$GNUPGHOME/gpg.conf"; then
echo "[AUR] Initializing GnuPG keyring in $GNUPGHOME"
cat >"$GNUPGHOME/gpg.conf" <<EOF cat >"$GNUPGHOME/gpg.conf" <<EOF
no-greeting no-greeting
keyserver hkp://pool.sks-keyservers.net keyserver hkp://pool.sks-keyservers.net
@ -34,7 +42,6 @@ fi
# ABS # ABS
if which asp >/dev/null 2>&1; then if which asp >/dev/null 2>&1; then
ABSDEST="$AURDIR/ABS"
export ASPROOT="$ABSDEST/.asp" export ASPROOT="$ABSDEST/.asp"
test -d "$ABSDEST" || mkdir -p "$ABSDEST" || exit 1 test -d "$ABSDEST" || mkdir -p "$ABSDEST" || exit 1

@ -7,3 +7,6 @@
[url "git@github.com:"] [url "git@github.com:"]
insteadOf = git://github.com/ insteadOf = git://github.com/
insteadOf = https://github.com/ insteadOf = https://github.com/
[url "https://aur.archlinux.org/"]
insteadOf = https://aur4.archlinux.org/

Loading…
Cancel
Save