2 [[ -v AUR_DEBUG
]] && set -o xtrace
4 PS4
='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
10 printf >&2 'usage: %s [--srcinfo] [--lint] [--config <file>]' "$argv0"
14 # mollyguard for sourcing PKGBUILDs
15 if (( UID
== 0 )) && [[ ! -v AUR_ASROOT
]]; then
16 printf >&2 'warning: aur-%s is not meant to be run as root.\n' "$argv0"
17 printf >&2 'warning: To proceed anyway, set the %s variable.\n' 'AUR_ASROOT'
21 source /usr
/share
/makepkg
/util
/option.sh
22 source /usr
/share
/makepkg
/util
/parseopts.sh
23 source /usr
/share
/makepkg
/util
/config.sh
24 source /usr
/share
/makepkg
/util
/util.sh
28 opt_long
=('buildscript:' 'config:' 'lint' 'srcinfo')
29 opt_hidden
=('dump-options')
31 if ! parseopts
"$opt_short" "${opt_long[@]}" "${opt_hidden[@]}" -- "$@"; then
36 unset buildscript build_user makepkg_conf
40 shift; buildscript
=$1 ;;
42 shift; makepkg_conf
=$1 ;;
48 printf -- '--%s\n' "${opt_long[@]}" ${AUR_DEBUG+"${opt_hidden[@]}"}
49 printf -- '%s' "${opt_short}" | sed 's/.:\?/-&\n/g'
56 # Sourcing the PKGBUILD should be done without set -e or other modes
57 # to match makepkg behavior (e.g. aur/cemu, aur/nicotine-plus-git)
58 # shellcheck disable=SC1090
59 source_safe "${buildscript-PKGBUILD}"
60 PKGDEST=${PKGDEST:-$PWD}
61 pkgbase=${pkgbase:-${pkgname[0]}}
63 # PKGEXT (packagelist), CARCH (lint)
64 load_makepkg_config "${makepkg_conf-}"
67 source /usr/share/makepkg/lint_pkgbuild.sh
73 source /usr/share/makepkg/util/pkgbuild.sh
74 print_all_package_names
77 source /usr/share/makepkg/srcinfo.sh