2 [[ -v AUR_DEBUG
]] && set -o xtrace
5 PS4
='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
11 printf >&2 'usage: %s [--srcinfo] [--lint] [--config <file>]' "$argv0"
15 source /usr
/share
/makepkg
/util
/option.sh
16 source /usr
/share
/makepkg
/util
/parseopts.sh
17 source /usr
/share
/makepkg
/util
/config.sh
21 opt_long
=('buildscript:' 'user:' 'config:' 'lint' 'srcinfo' 'full')
22 opt_hidden
=('dump-options')
24 if ! parseopts
"$opt_short" "${opt_long[@]}" "${opt_hidden[@]}" -- "$@"; then
27 orig_argv
=("$@") # original arguments for setpriv(1)
30 unset buildscript build_user makepkg_conf
34 shift; buildscript
=$1 ;;
36 shift; build_user
=$1 ;;
38 shift; makepkg_conf
=$1 ;;
46 printf -- '--%s\n' "${opt_long[@]}" ${AUR_DEBUG+"${opt_hidden[@]}"}
47 printf -- '%s' "${opt_short}" | sed 's/.:\?/-&\n/g'
54 # drop permissions for sourcing PKGBUILDs
55 if (( UID == 0 )) && (( $(id -u "$build_user") != 0 )); then
56 exec setpriv --reuid "$build_user" --regid "$build_user" --init-groups --reset-env \
57 env PKGDEST="$PKGDEST" "${BASH_SOURCE[0]}" "${orig_argv[@]}"
59 elif (( UID == 0 )); then
60 printf >&2 '%s: unprivileged --user required\n' "$argv0"
64 # shellcheck disable=SC1090
65 source "${buildscript-PKGBUILD}"
66 pkgbase=${pkgbase:-$pkgname}
67 PKGDEST=${PKGDEST:-$PWD}
69 # PKGEXT (packagelist), CARCH (lint)
70 load_makepkg_config "${makepkg_conf-}"
73 source /usr/share/makepkg/lint_pkgbuild.sh
79 source /usr/share/makepkg/util/pkgbuild.sh
80 print_all_package_names
83 source /usr/share/makepkg/util/pkgbuild.sh
84 print_all_package_names | while IFS= read -r; do
85 printf '%s:%s\n' "$pkgbase" "$REPLY"
88 source /usr/share/makepkg/srcinfo.sh