xbps-src: added -K flag to KEEP automatic installed deps, cleanups.

This commit is contained in:
Juan RP
2011-07-04 19:07:08 +02:00
parent 16b5107f61
commit 9b52e244c6
9 changed files with 57 additions and 42 deletions

View File

@@ -271,8 +271,7 @@ install_xbps_utils()
xbps_chroot_handler()
{
local action="$1" pkg="$2" keep_wrksrc="$3" rv=0
local path="/tools/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
local action="$1" pkg="$2" rv=0 arg
[ -z "$action" -o -z "$pkg" ] && return 1
@@ -302,7 +301,7 @@ xbps_chroot_handler()
# Reinstall xbps-src in the chroot
msg_normal "Installing xbps-src in the masterdir...\n"
env in_chroot=yes LANG=C PATH=$path \
env IN_CHROOT=yes LANG=C \
${chroot_cmd} $XBPS_MASTERDIR sh -c \
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
2>&1 >/dev/null || return $?
@@ -312,11 +311,13 @@ xbps_chroot_handler()
${chroot_cmd} $XBPS_MASTERDIR sh -c "ldconfig" || return $?
if [ "$action" = "chroot" ]; then
env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \
env IN_CHROOT=1 LANG=C \
${chroot_cmd} $XBPS_MASTERDIR /bin/sh || rv=$?
else
[ -n "$keep_wrksrc" ] && action="-C $action"
env in_chroot=yes LANG=C PATH=$path _ORIGINPKG="$pkg" \
[ -n "$3" ] && arg="-C"
[ -n "$4" ] && arg="$arg -K"
action="$arg $action"
env in_chroot=1 IN_CHROOT=1 LANG=C _ORIGINPKG="$pkg" \
${chroot_cmd} $XBPS_MASTERDIR sh -c \
"cd /xbps/srcpkgs/$pkg && xbps-src $action" || rv=$?
fi