xbps-src: always create logs for configure/build/install stages in $wrksrc.

Fixed -C and install-destdir in the chroot, $# wasn't consistent :-)
This commit is contained in:
Juan RP 2010-05-07 12:25:24 +02:00
parent 9615930eb4
commit 22774084ab
7 changed files with 62 additions and 56 deletions

View file

@ -218,13 +218,14 @@ xbps_chroot_handler()
{
local action="$1"
local pkg="$2"
local only_destdir="$3"
local norm_builddir="$4"
local norm_builddir="$3"
local path="/tools/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
[ -z "$action" -o -z "$pkg" ] && return 1
[ "$action" != "configure" -a "$action" != "build" -a \
"$action" != "install" -a "$action" != "chroot" ] && return 1
"$action" != "install" -a "$action" != "chroot" -a \
"$action" != "install-destdir" ] && return 1
if [ ! -f $XBPS_MASTERDIR/.xbps_perms_done ]; then
echo -n "==> Preparing chroot on $XBPS_MASTERDIR... "
@ -236,8 +237,8 @@ xbps_chroot_handler()
create_busybox_links
install_xbps_utils
MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount
{ MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount; }
[ $? -ne 0 ] && return $?
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
@ -247,29 +248,26 @@ xbps_chroot_handler()
# Reinstall xbps-src in the chroot
if [ ! -f $XBPS_MASTERDIR/usr/local/sbin/xbps-src ]; then
msg_normal "Installing xbps-src in the masterdir..."
env in_chroot=yes LANG=C PATH=$path \
{ env in_chroot=yes LANG=C PATH=$path \
${chroot_cmd} $XBPS_MASTERDIR sh -c \
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
2>&1 >/dev/null
2>&1 >/dev/null; }
fi
if [ "$action" = "chroot" ]; then
env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \
${chroot_cmd} $XBPS_MASTERDIR /bin/sh
{ env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \
${chroot_cmd} $XBPS_MASTERDIR /bin/sh; }
else
local lenv
[ -n "$only_destdir" ] && \
lenv="install_destdir_target=yes"
[ -n "$norm_builddir" ] && \
[ "$norm_builddir" = "yes" ] && \
action="-C $action"
env in_chroot=yes LANG=C PATH=$path \
${lenv} ${chroot_cmd} $XBPS_MASTERDIR sh -c \
"cd /xbps/srcpkgs/$pkg && xbps-src $action"
{ env in_chroot=yes LANG=C PATH=$path \
${chroot_cmd} $XBPS_MASTERDIR sh -c \
"cd /xbps/srcpkgs/$pkg && xbps-src $action"; }
fi
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."
MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount
{ MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount; }
return $?
}