xbps-src: use install_pkg() for configure and build targets too.

This commit is contained in:
Juan RP 2011-11-18 09:33:29 +01:00
parent 6208fd759d
commit bc5f57f274
2 changed files with 9 additions and 37 deletions

View file

@ -117,10 +117,16 @@ install_pkg()
if [ ! -f "$XBPS_CONFIGURE_DONE" ]; then
configure_src_phase || return $?
if [ "$INSTALL_TARGET" = "configure" ]; then
return 0
fi
fi
if [ ! -f "$XBPS_BUILD_DONE" ]; then
build_src_phase || return $?
if [ "$INSTALL_TARGET" = "build" ]; then
return 0
fi
fi
# Install pkg into destdir.

View file

@ -23,7 +23,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#-
readonly XBPS_SRC_BUILD_VERSION=20111117-2
readonly XBPS_SRC_BUILD_VERSION=20111118
XBPS_CONFIG_FILE=@@XBPS_INSTALL_ETCDIR@@/xbps-src.conf
PROGNAME=$(basename $0)
@ -368,40 +368,6 @@ bootstrap-update)
${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} ${XBPS_BIN_CMD} -y autoupdate
fi
;;
build|configure)
if [ -z "${_pkgname}" ]; then
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
. ./template
_pkgname=$(basename_cwd)
fi
if [ -z "$bootstrap" -a -z "$IN_CHROOT" ]; then
xbps_chroot_handler $target ${_pkgname}
else
_ORIGINPKG="${_pkgname}"
setup_tmpl ${_ORIGINPKG}
# If pkg has dependencies, install them first.
install_dependencies_pkg "$pkgname-$version"
if [ $? -ne 0 ]; then
msg_red "cannot install required deps for $pkgname.\n"
exit 1
fi
# All deps were installed, continue with the origin pkg...
setup_tmpl ${_ORIGINPKG}
fetch_distfiles || exit $?
if [ ! -f "$XBPS_EXTRACT_DONE" ]; then
extract_distfiles || exit $?
fi
if [ "$target" = "configure" ]; then
configure_src_phase || exit $?
else
if [ ! -f "$XBPS_CONFIGURE_DONE" ]; then
configure_src_phase || exit $?
fi
build_src_phase || exit $?
fi
fi
;;
build-pkg)
if [ -n "${_PACKAGEDIR}" ]; then
export XBPS_PACKAGESDIR=${_PACKAGEDIR}
@ -458,7 +424,7 @@ extract|fetch)
fetch_distfiles $update_checksum
[ "$target" = "extract" ] && extract_distfiles
;;
install)
build|configure|install)
if [ -z "${_pkgname}" ]; then
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
_pkgname=$(basename_cwd)
@ -468,7 +434,7 @@ install)
if [ -z "$IN_CHROOT" -a -z "$bootstrap" ]; then
xbps_chroot_handler $target ${_ORIGINPKG} || exit $?
else
install_pkg $pkgname || exit $?
INSTALL_TARGET=$target install_pkg $pkgname || exit $?
fi
;;
list)