xbps-src: exit properly if mktemp(1) fails, not from its subshell.
Thanks @huglovefan
This commit is contained in:
parent
8614cca7df
commit
7b7d7c13a1
10 changed files with 12 additions and 12 deletions
|
@ -131,7 +131,7 @@ fi
|
|||
# the bootstrap pkgs from scratch.
|
||||
if [ -z "$CHROOT_READY" -a "$PKGNAME" = "base-files" ]; then
|
||||
msg_normal "Installing $PKGNAME into masterdir...\n"
|
||||
_log=$(mktemp || exit 1)
|
||||
_log=$(mktemp) || exit 1
|
||||
XBPS_ARCH=$XBPS_MACHINE $XBPS_INSTALL_CMD -yf $PKGNAME >${_log} 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
msg_red "Failed to install $PKGNAME into masterdir, see below for errors:\n"
|
||||
|
|
|
@ -30,7 +30,7 @@ bulk_sortdeps() {
|
|||
fi
|
||||
done
|
||||
|
||||
tmpf=$(mktemp || exit 1)
|
||||
tmpf=$(mktemp) || exit 1
|
||||
# Now make the real dependency graph of all pkgs to build.
|
||||
# Perform a topological sort of all pkgs but only with build dependencies
|
||||
# that are found in previous step.
|
||||
|
|
|
@ -5,7 +5,7 @@ run_func() {
|
|||
|
||||
: ${funcname:=$func}
|
||||
|
||||
logpipe=$(mktemp -u -p ${XBPS_STATEDIR} ${pkgname}_${XBPS_CROSS_BUILD}_XXXXXXXX.logpipe || exit 1)
|
||||
logpipe=$(mktemp -u -p ${XBPS_STATEDIR} ${pkgname}_${XBPS_CROSS_BUILD}_XXXXXXXX.logpipe) || exit 1
|
||||
logfile=${XBPS_STATEDIR}/${pkgname}_${XBPS_CROSS_BUILD}_${funcname}.log
|
||||
|
||||
msg_normal "${pkgver:-xbps-src}: running ${desc:-${func}} ...\n"
|
||||
|
|
|
@ -6,7 +6,7 @@ remove_pkg_cross_deps() {
|
|||
|
||||
cd $XBPS_MASTERDIR || return 1
|
||||
msg_normal "${pkgver:-xbps-src}: removing autocrossdeps, please wait...\n"
|
||||
tmplogf=$(mktemp || exit 1)
|
||||
tmplogf=$(mktemp) || exit 1
|
||||
|
||||
if [ -z "$XBPS_REMOVE_XCMD" ]; then
|
||||
source_file $XBPS_CROSSPFDIR/${XBPS_CROSS_BUILD}.sh
|
||||
|
@ -37,7 +37,7 @@ prepare_cross_sysroot() {
|
|||
[ $? -eq 0 ] && return 0
|
||||
|
||||
msg_normal "Installing $cross cross pkg: cross-vpkg-dummy ...\n"
|
||||
errlog=$(mktemp || exit 1)
|
||||
errlog=$(mktemp) || exit 1
|
||||
$XBPS_INSTALL_XCMD -Syfd cross-vpkg-dummy &>$errlog
|
||||
rval=$?
|
||||
if [ $rval -ne 0 -a $rval -ne 17 ]; then
|
||||
|
@ -71,7 +71,7 @@ install_cross_pkg() {
|
|||
check_installed_pkg cross-${XBPS_CROSS_TRIPLET}-0.1_1
|
||||
[ $? -eq 0 ] && return 0
|
||||
|
||||
errlog=$(mktemp || exit 1)
|
||||
errlog=$(mktemp) || exit 1
|
||||
msg_normal "Installing $cross cross compiler: cross-${XBPS_CROSS_TRIPLET} ...\n"
|
||||
$XBPS_INSTALL_CMD -Syfd cross-${XBPS_CROSS_TRIPLET} &>$errlog
|
||||
rval=$?
|
||||
|
|
|
@ -48,7 +48,7 @@ remove_pkg_autodeps() {
|
|||
|
||||
cd $XBPS_MASTERDIR || return 1
|
||||
msg_normal "${pkgver:-xbps-src}: removing autodeps, please wait...\n"
|
||||
tmplogf=$(mktemp || exit 1)
|
||||
tmplogf=$(mktemp) || exit 1
|
||||
|
||||
remove_pkg_cross_deps
|
||||
$XBPS_RECONFIGURE_CMD -a >> $tmplogf 2>&1
|
||||
|
|
|
@ -64,7 +64,7 @@ show_pkg_build_depends() {
|
|||
local f x _pkgname _srcpkg _dep found result
|
||||
local _deps="$1"
|
||||
|
||||
result=$(mktemp || exit 1)
|
||||
result=$(mktemp) || exit 1
|
||||
|
||||
# build time deps
|
||||
for f in ${_deps}; do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue