xbps-src: multiple improvements for -B and run_func.

* run_func now errors out by itself if the function returned any error.
* if -B flag is enabled and binpkg already exists, skip updating local
  repo pkg-index.
This commit is contained in:
Juan RP 2011-07-18 13:43:22 +02:00
parent e22c565811
commit 110aede193
7 changed files with 74 additions and 78 deletions

View file

@ -70,10 +70,8 @@ install_src_phase()
# Run pre_install func.
if [ ! -f $XBPS_PRE_INSTALL_DONE ]; then
run_func pre_install
if [ $? -eq 0 ]; then
msg_normal "'$pkgname-$lver': pre_install (destdir) phase done.\n"
touch -f $XBPS_PRE_INSTALL_DONE
fi
msg_normal "'$pkgname-$lver': pre_install (destdir) phase done.\n"
touch -f $XBPS_PRE_INSTALL_DONE
fi
# Type of installation: custom, make or python.
@ -92,10 +90,8 @@ install_src_phase()
# Run post_install func.
if [ ! -f $XBPS_POST_INSTALL_DONE ]; then
run_func post_install
if [ $? -eq 0 ]; then
msg_normal "'$pkgname-$lver': post_install (destdir) phase done.\n"
touch -f $XBPS_POST_INSTALL_DONE
fi
msg_normal "'$pkgname-$lver': post_install (destdir) phase done.\n"
touch -f $XBPS_POST_INSTALL_DONE
fi
# Remove libtool archives by default.
@ -141,9 +137,7 @@ install_src_phase()
set_tmpl_common_vars
if [ ! -f ${wrksrc}/.xbps_do_install_${pkgname}_done ]; then
run_func do_install
if [ $? -eq 0 ]; then
touch -f ${wrksrc}/.xbps_do_install_${pkgname}_done
fi
touch -f ${wrksrc}/.xbps_do_install_${pkgname}_done
else
msg_warn "'$sourcepkg-$lver': skipping '$pkgname' subpkg, already installed into destdir.\n"
fi