Permalink
Browse files

Avoid redefining injail for tests.

Fixes #544
  • Loading branch information...
bdrewery committed Nov 13, 2017
1 parent e035480 commit e4036cb0c3239cd130f9d320b8a8b627a168f026
Showing with 5 additions and 16 deletions.
  1. +5 −12 src/share/poudriere/common.sh
  2. +0 −4 test/common.sh
@@ -500,10 +500,11 @@ do_confirm_delete() {
return ${ret}
}
# It may be defined as a NOP for tests
if ! type injail >/dev/null 2>&1; then
injail() {
if [ "${USE_JEXECD}" = "no" ]; then
if [ ${STATUS:-0} -eq 0 ]; then
# For test/
"$@"
elif [ "${USE_JEXECD}" = "no" ]; then
injail_tty "$@"
else
local name
@@ -514,7 +515,6 @@ injail() {
-u ${JUSER:-root} "$@"
fi
}
fi
injail_tty() {
local name
@@ -5231,13 +5231,6 @@ port_var_fetch() {
# Use invalid shell var character '!' to ensure we
# don't setvar it later.
local assign_var="!"
local injail
if [ ${STATUS:-0} -eq 1 ]; then
injail=injail
else
injail=
fi
if [ -n "${origin}" ]; then
_make_origin="-C${sep}${PORTSDIR}/${origin}"
@@ -5297,7 +5290,7 @@ port_var_fetch() {
shiftcnt=$((shiftcnt + 1))
fi
done <<-EOF
$(IFS="${sep}"; ${injail} /usr/bin/make ${_make_origin} ${_makeflags} || echo "${_errexit} $?")
$(IFS="${sep}"; injail /usr/bin/make ${_make_origin} ${_makeflags} || echo "${_errexit} $?")
EOF
# If the entire output was blank, then $() ate all of the excess
View
@@ -104,7 +104,3 @@ assert_ret() {
aecho() {
echo "$@" >&2
}
injail() {
"$@"
}

0 comments on commit e4036cb

Please sign in to comment.