xbps-src: cleaned up usage of mktemp(1).

This one was on my TODO for a long while... fixes unportable
arguments (checked with the NetBSD's manual page).
This commit is contained in:
Juan RP 2019-06-17 15:10:16 +02:00
parent ea7a6e858d
commit f59b295903
9 changed files with 11 additions and 11 deletions

View file

@ -18,7 +18,7 @@ if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
fi
# proot does not properly return the resultcode. Workaround this
RESULT=$(mktemp /tmp/proot_result.XXXXXXXXXX)
RESULT=$(mktemp || exit 1)
PROOT_NO_SECCOMP=1 proot -r $MASTERDIR -w / -b "$RESULT:/.result" -b $DISTDIR:/void-packages \
${HOSTDIR:+-b $HOSTDIR:/host} -b /proc:/proc -b /dev:/dev \

View file

@ -12,7 +12,7 @@ _add_trigger() {
process_metadata_scripts() {
local action="$1"
local action_file="$2"
local tmpf=$(mktemp)
local tmpf=$(mktemp || exit 1)
local fpattern="s|${PKGDESTDIR}||g;s|^\./$||g;/^$/d"
local targets= f= _f= info_files= home= shell= descr= groups=
local found= triggers_found= _icondirs= _schemas= _mods= _tmpfiles=

View file

@ -61,7 +61,7 @@ hook() {
return 0
fi
depsftmp=$(mktemp -t xbps_src_depstmp.XXXXXXXXXX) || return 1
depsftmp=$(mktemp || exit 1)
find ${PKGDESTDIR} -type f -perm -u+w > $depsftmp 2>/dev/null
exec 3<&0 # save stdin

View file

@ -5,7 +5,7 @@ collect_sonames() {
local _destdir="$1" f _soname _fname _pattern
local _pattern="^[[:alnum:]]+(.*)+\.so(\.[0-9]+)*$"
local _versioned_pattern="^[[:alnum:]]+(.*)+\.so(\.[0-9]+)+$"
local _tmpfile="$(mktemp)"
local _tmpfile="$(mktemp || exit 1)"
if [ ! -d ${_destdir} ]; then
rm -f ${_tmpfile}

View file

@ -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 --tmpdir || 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"

View file

@ -30,7 +30,7 @@ bulk_sortdeps() {
fi
done
tmpf=$(mktemp)
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.

View file

@ -5,7 +5,7 @@ run_func() {
: ${funcname:=$func}
logpipe=$(mktemp -u --tmpdir=${XBPS_STATEDIR} ${pkgname}_${XBPS_CROSS_BUILD}_XXXXXXXX.logpipe)
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"

View file

@ -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)
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)
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)
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=$?

View file

@ -48,7 +48,7 @@ remove_pkg_autodeps() {
cd $XBPS_MASTERDIR || return 1
msg_normal "${pkgver:-xbps-src}: removing autodeps, please wait...\n"
tmplogf=$(mktemp)
tmplogf=$(mktemp || exit 1)
remove_pkg_cross_deps
$XBPS_RECONFIGURE_CMD -a >> $tmplogf 2>&1