2 [[ -v AUR_DEBUG
]] && set -o xtrace
3 PS4
='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
5 # parent of PKGBUILD directories (relative or absolute)
9 # https://github.com/ninja-build/ninja/blob/master/misc/ninja_syntax.py
10 srcdir
=${srcdir//\$ /\$\$} srcdir=${srcdir// /\$ } srcdir=${srcdir//:/\$:}
14 # use quoted expansion (@Q) - heredocs are expanded like double-quoted strings
15 # shellcheck disable=SC2154
18 command = env -C \${directory} ${@@Q} && date --rfc-3339=ns > \${out}
22 # input is assumed to be ordered by pkgbase (e.g. aur-depends --graph)
24 while read -r pkgbase depends_pkgbase _
; do
25 if [[ $pkgbase != "$current_package" ]] && [[ $current_package ]]; then
26 printf '\n%-4sdirectory = %s\n' ' ' "$srcdir/$current_package"
28 if [[ $pkgbase != "$current_package" ]] ||
[[ ! $current_package ]]; then
29 # TODO: take input file (monitored for changes by ninja) as argument
30 printf 'build %s.stamp: aurbuild %s/PKGBUILD | ' "$pkgbase" "$srcdir/$pkgbase"
32 current_package
=$pkgbase
34 # don't add dependency to self
35 if [[ $pkgbase != "$depends_pkgbase" ]]; then
36 printf '%s.stamp ' "$depends_pkgbase"
39 printf '\n%-4sdirectory = %s\n' ' ' "$srcdir/$current_package"
41 # vim: set et sw=4 sts=4 ft=sh: