xbps-src: make -K and -C really work.
This commit is contained in:
parent
0ffa09c1b4
commit
24bad5c713
5 changed files with 14 additions and 18 deletions
|
@ -48,7 +48,7 @@ install_pkglist_from_repos()
|
|||
# ENODEV (19): package depends on missing dependencies.
|
||||
#
|
||||
# Any other returned is criticial.
|
||||
autoremove_pkg_dependencies
|
||||
autoremove_pkg_dependencies $KEEP_AUTODEPS
|
||||
msg_red "'${pkgname}': failed to install required dependencies! (error $rval)\n"
|
||||
msg_error "'${pkgname}': please take a look the logs in \$wrksrc.\n"
|
||||
fi
|
||||
|
@ -82,7 +82,7 @@ install_pkg_from_repos()
|
|||
# ENODEV (19): package depends on missing dependencies.
|
||||
#
|
||||
# Any other returned is criticial.
|
||||
autoremove_pkg_dependencies
|
||||
autoremove_pkg_dependencies $KEEP_AUTODEPS
|
||||
msg_red "'${pkgname}': failed to install '${pkg}' dependency! (error $rval)\n"
|
||||
msg_error "Please see ${wrksrc}/.xbps_install_${pkgdepname}.log to see what went wrong!\n"
|
||||
fi
|
||||
|
@ -94,7 +94,7 @@ autoremove_pkg_dependencies()
|
|||
{
|
||||
local cmd saved_pkgname x f found
|
||||
|
||||
[ -n "$KEEP_AUTODEPS" ] && return 0
|
||||
[ -n "$1" ] && return 0
|
||||
|
||||
cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD}"
|
||||
|
||||
|
|
|
@ -314,8 +314,8 @@ xbps_chroot_handler()
|
|||
env IN_CHROOT=1 LANG=C \
|
||||
${chroot_cmd} $XBPS_MASTERDIR /bin/sh || rv=$?
|
||||
else
|
||||
[ -n "$3" ] && arg="-C"
|
||||
[ -n "$4" ] && arg="$arg -K"
|
||||
[ -n "$KEEP_WRKSRC" ] && arg="-C"
|
||||
[ -n "$KEEP_AUTODEPS" ] && arg="$arg -K"
|
||||
action="$arg $action"
|
||||
env in_chroot=1 IN_CHROOT=1 LANG=C _ORIGINPKG="$pkg" \
|
||||
${chroot_cmd} $XBPS_MASTERDIR sh -c \
|
||||
|
|
|
@ -43,7 +43,7 @@ run_func_error()
|
|||
|
||||
remove_pkgdestdir_sighandler()
|
||||
{
|
||||
local lver subpkg _pkgname="$1"
|
||||
local lver subpkg _pkgname="$1" _kwrksrc="$2"
|
||||
|
||||
setup_tmpl ${_pkgname}
|
||||
[ -z "$sourcepkg" ] && return 0
|
||||
|
@ -71,8 +71,7 @@ remove_pkgdestdir_sighandler()
|
|||
msg_red "'${sourcepkg}-${lver}': removed files from DESTDIR...\n"
|
||||
fi
|
||||
|
||||
[ -n "$2" ] && KEEP_AUTODEPS=1
|
||||
autoremove_pkg_dependencies
|
||||
autoremove_pkg_dependencies ${_kwrksrc}
|
||||
}
|
||||
|
||||
var_is_a_function()
|
||||
|
|
|
@ -40,7 +40,7 @@ install_pkg()
|
|||
fi
|
||||
|
||||
# Remove automatic package dependencies if set.
|
||||
autoremove_pkg_dependencies
|
||||
autoremove_pkg_dependencies $KEEP_AUTODEPS
|
||||
|
||||
pkg="$curpkgn-$version"
|
||||
[ -n "$INSTALLING_DEPS" ] && setup_tmpl $curpkgn
|
||||
|
@ -167,7 +167,7 @@ install_pkg()
|
|||
# Autoremove packages installed as dependencies if
|
||||
# XBPS_PREFER_BINPKG_DEPS is set.
|
||||
#
|
||||
autoremove_pkg_dependencies
|
||||
autoremove_pkg_dependencies $KEEP_AUTODEPS
|
||||
|
||||
return $?
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
: ${sudo_cmd:=sudo}
|
||||
: ${chroot_cmd:=chroot}
|
||||
: ${xbps_machine:=$(uname -m)}
|
||||
: ${XBPS_UTILS_REQVER:=20100511}
|
||||
|
||||
# Required utilities in host system.
|
||||
REQHOST_UTILS="gawk bash sed gcc msgfmt patch makeinfo perl fakeroot tar xz"
|
||||
|
@ -175,10 +174,10 @@ check_config_vars()
|
|||
#
|
||||
while getopts "Cc:hKm:p:Ss:" opt; do
|
||||
case $opt in
|
||||
C) KEEP_WRKSRC=1;;
|
||||
C) export KEEP_WRKSRC=1;;
|
||||
c) XBPS_CONFIG_FILE="$OPTARG";;
|
||||
h) usage && exit 0;;
|
||||
K) KEEP_AUTODEPS=1;;
|
||||
K) export KEEP_AUTODEPS=1;;
|
||||
m)
|
||||
_MASTERDIR_FLAG=1
|
||||
_MASTERDIR="$OPTARG"
|
||||
|
@ -291,7 +290,7 @@ build|configure)
|
|||
|
||||
if [ -z "$base_chroot" -a -z "$IN_CHROOT" ]; then
|
||||
. $XBPS_SHUTILSDIR/chroot.sh
|
||||
xbps_chroot_handler $target ${_pkgname} $KEEP_WRKSRC $KEEP_AUTODEPS
|
||||
xbps_chroot_handler $target ${_pkgname}
|
||||
else
|
||||
_ORIGINPKG="${_pkgname}"
|
||||
setup_tmpl ${_ORIGINPKG}
|
||||
|
@ -377,8 +376,7 @@ install|install-destdir)
|
|||
_ORIGINPKG="${_pkgname}"
|
||||
if [ -z "$IN_CHROOT" -a -z "$base_chroot" ]; then
|
||||
. $XBPS_SHUTILSDIR/chroot.sh
|
||||
xbps_chroot_handler $target ${_ORIGINPKG} \
|
||||
$KEEP_WRKSRC $KEEP_AUTODEPS
|
||||
xbps_chroot_handler $target ${_ORIGINPKG}
|
||||
else
|
||||
setup_tmpl ${_ORIGINPKG}
|
||||
install_pkg $pkgname
|
||||
|
@ -410,8 +408,7 @@ remove)
|
|||
setup_tmpl ${_pkgname}
|
||||
if [ -z "$IN_CHROOT" -a -z "$base_chroot" ]; then
|
||||
. $XBPS_SHUTILSDIR/chroot.sh
|
||||
xbps_chroot_handler $target ${_pkgname} \
|
||||
$KEEP_WRKSRC $KEEP_AUTODEPS
|
||||
xbps_chroot_handler $target ${_pkgname}
|
||||
else
|
||||
remove_pkg
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue