3 # vim: set ts=4 sw=4 et:
6 # $1 - pkgname [REQUIRED]
7 # $2 - cross target [OPTIONAL]
9 if [ $# -lt 1 -o $# -gt 2 ]; then
10 echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
17 for f
in $XBPS_SHUTILSDIR/*.sh
; do
21 setup_pkg
"$PKGNAME" $XBPS_CROSS_BUILD
23 for f
in $XBPS_COMMONDIR/environment
/fetch
/*.sh
; do
27 XBPS_FETCH_DONE
="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_fetch_done"
29 if [ -f "$XBPS_FETCH_DONE" ]; then
33 # Run pre-fetch hooks.
34 run_pkg_hooks pre-fetch
36 # If template defines pre_fetch(), use it.
37 if declare -f pre_fetch
>/dev
/null
; then
41 # If template defines do_fetch(), use it rather than the hooks.
42 if declare -f do_fetch
>/dev
/null
; then
44 [ -n "$build_wrksrc" ] && mkdir
-p "$wrksrc"
48 run_pkg_hooks
"do-fetch"
51 cd ${XBPS_BUILDDIR} || msg_error
"$pkgver: cannot access wrksrc directory [$wrksrc]\n"
52 # if templates defines post_fetch(), use it.
53 if declare -f post_fetch
>/dev
/null
; then
57 # Run post-fetch hooks.
58 run_pkg_hooks post-fetch
60 touch -f $XBPS_FETCH_DONE