source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [ $# -lt 1 ] ; then
- vecho "${0##*/}: at least one argument needed" 1>&2
+ die "${0##*/}: at least one argument needed"
exit 1
fi
done
+[[ $ret -ne 0 ]] && die "$0 failed"
exit ${ret}
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- vecho "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
if [[ ! -d ${D}${DESTTREE}/bin ]] ; then
- install -d "${D}${DESTTREE}/bin" || exit 2
+ install -d "${D}${DESTTREE}/bin" || { helpers_die "$0: failed to install ${D}${DESTTREE}/bin"; exit 2; }
fi
ret=0
((ret|=$?))
done
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit ${ret}
# Distributed under the terms of the GNU General Public License v2
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+ helpers_die "$0: at least one argument needed"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-exec install -d ${DIROPTIONS} "${@/#/${D}/}"
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
+install -d ${DIROPTIONS} "${@/#/${D}/}"
+ret=$?
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
+exit $ret
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [ $# -lt 1 ] ; then
- source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
- vecho "${0##*/}: at least one argument needed" 1>&2
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
fi
done
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit ${ret}
# Distributed under the terms of the GNU General Public License v2
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+ helpers_die "$0: at least one argument needed"
exit 1
fi
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
rm -rf "$TMP"
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit $ret
# Copyright 2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
# Set EPYTHON variable as empty so that dohtml doesn't try
# to use potentially unsupported version of Python.
EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- exec "$PORTAGE_BIN_PATH/dohtml.py" "$@"
+ "$PORTAGE_BIN_PATH/dohtml.py" "$@"
+
+ret=$?
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
+exit $ret
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ -z $1 ]] ; then
- vecho "${0##*/}: at least one argument needed"
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
if [[ ! -d ${D}usr/share/info ]] ; then
- install -d "${D}usr/share/info" || exit 1
+ install -d "${D}usr/share/info" || { helpers_die "$0: failed to install ${D}usr/share/info"; exit 1; }
fi
install -m0644 "$@" "${D}usr/share/info"
for x in "$@" ; do
[ -e "$x" ] || echo "!!! ${0##*/}: $x does not exist" 1>&2
done
+ helpers_die "$0 failed"
fi
exit $rval
# Distributed under the terms of the GNU General Public License v2
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+ helpers_die "$0: at least one argument needed"
exit 1
fi
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [ $# -lt 1 ] ; then
- echo "${0##*/}: at least one argument needed" 1>&2
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
vecho "You should not use \${D} with helpers." 1>&2
vecho " --> ${INSDESTTREE}" 1>&2
vecho "-------------------------------------------------------" 1>&2
+ helpers_die "$0 used with \${D}"
exit 1
fi
fi
done
rm -rf "$TMP"
-[[ $failed -ne 0 || $success -eq 0 ]] && exit 1 || exit 0
+[[ $failed -ne 0 || $success -eq 0 ]] && { helpers_die "$0 failed"; exit 1; } || exit 0
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
# Setup ABI cruft
LIBDIR_VAR="LIBDIR_${ABI}"
if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
if [[ ! -d ${libdir} ]] ; then
- install -d "${libdir}" || exit 1
+ install -d "${libdir}" || { helpers_die "$0: failed to install ${libdir}"; exit 1; }
fi
ret=0
((ret|=$?))
done
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit ${ret}
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
fi
done
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit ${ret}
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
mynum=${#}
if [ ${mynum} -lt 1 ] ; then
- echo "${0}: at least one argument needed"
+ helpers_die "${0}: at least one argument needed"
exit 1
fi
if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then
((ret|=$?))
done
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit $ret
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then
- install -d "${D}${DESTTREE}/sbin" || exit 2
+ install -d "${D}${DESTTREE}/sbin" || { helpers_die "$0: failed to install ${D}${DESTTREE}/sbin"; exit 2; }
fi
ret=0
((ret|=$?))
done
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit ${ret}
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ $# -ne 2 ]] ; then
- echo "$0: two arguments needed" 1>&2
+ helpers_die "$0: two arguments needed"
exit 1
fi
destdir=${2%/*}
[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
-exec ln -snf "$1" "${D}$2"
+ln -snf "$1" "${D}$2"
+ret=$?
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
+exit $ret
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ -z $1 ]] ; then
- vecho "${0##*/}: at least one argument needed" 1>&2
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
;;
--queue)
shift
- exec touch "${@/%/.ecompress.file}"
+ touch "${@/%/.ecompress.file}"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
;;
--dequeue)
[[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
find "${D}" -name '*.ecompress.file' -print0 | ${XARGS} -0 rm -f
;;
--*)
- vecho "${0##*/}: unknown arguments '$*'" 1>&2
+ helpers_die "${0##*/}: unknown arguments '$*'"
exit 1
;;
*)
[[ -n ${suffix} ]] && echo -n "${@/%/${suffix}$'\001'}" | \
tr '\001' '\000' | ${XARGS} -0 rm -f
# Finally, let's actually do some real work
- exec "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
+ "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
;;
esac
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ -z $1 ]] ; then
- vecho "${0##*/}: at least one argument needed" 1>&2
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
shift
set -- "${@/%/.ecompress.dir}"
set -- "${@/#/${D}}"
- exec touch "$@"
+ touch "$@"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $?
;;
--dequeue)
[[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
exit 0
;;
--*)
- vecho "${0##*/}: unknown arguments '$*'"
+ helpers_die "${0##*/}: unknown arguments '$*'"
exit 1
;;
esac
restore_skip_dirs
done
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit ${ret}
) >&2
fi
-exec ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
+${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
+ret=$?
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
+exit $ret
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
# we can't prefix all arguments because
# chown takes random options
slash="/"
-exec chown "${@/#${slash}/${D}${slash}}"
+chown "${@/#${slash}/${D}${slash}}"
+ret=$?
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
+exit $ret
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
# we can't prefix all arguments because
# chmod takes random options
slash="/"
-exec chmod "${@/#${slash}/${D}${slash}}"
+chmod "${@/#${slash}/${D}${slash}}"
+ret=$?
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
+exit $ret
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
cp "$1" "$T/$2" || exit $?
;;
*)
- cp -P "$1" "$T/$2" || exit $?
+ cp -P "$1" "$T/$2"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
;;
esac
doins "${T}/${2}"
ret=$?
rm -rf "${T}/${2}"
+[[ $ret -ne 0 ]] && helpers_die "$0 failed"
exit $ret
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- echo "$0: Need two arguments, old file and new file" 1>&2
+ helpers_die "$0: Need two arguments, old file and new file"
exit 1
fi
if [ ! -e "$1" ] ; then
- echo "!!! ${0##*/}: $1 does not exist" 1>&2
+ helpers_die "!!! ${0##*/}: $1 does not exist"
exit 1
fi
else
export DESTTREE=$1
if [ ! -d "${D}${DESTTREE}" ]; then
- install -d "${D}${DESTTREE}"
+ if ! install -d "${D}${DESTTREE}"; then
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ return $ret
+ fi
fi
fi
}
else
export INSDESTTREE=$1
if [ ! -d "${D}${INSDESTTREE}" ]; then
- install -d "${D}${INSDESTTREE}"
+ if ! install -d "${D}${INSDESTTREE}"; then
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ return $ret
+ fi
fi
fi
}
else
export _E_EXEDESTTREE_="$1"
if [ ! -d "${D}${_E_EXEDESTTREE_}" ]; then
- install -d "${D}${_E_EXEDESTTREE_}"
+ if ! install -d "${D}${_E_EXEDESTTREE_}"; then
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ return $ret
+ fi
fi
fi
}
else
export _E_DOCDESTTREE_="$1"
if [ ! -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
- install -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
+ if ! install -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"; then
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ return $ret
+ fi
fi
fi
}
PORTAGE_NONFATAL=1 "$@"
}
+helpers_die() {
+ case "${EAPI:-0}" in
+ 0|1|2|3)
+ echo -e "$@" >&2
+ ;;
+ *)
+ die "$@"
+ ;;
+ esac
+}
+
die() {
if [[ $PORTAGE_NONFATAL -eq 1 ]]; then
echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2