source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then
- install -d "${ED}${DESTTREE}/bin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/bin"; exit 2; }
+ install -d "${ED}${DESTTREE}/bin" || { __helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/bin"; exit 2; }
fi
ret=0
((ret|=$?))
done
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit ${ret}
if [[ $# -lt 1 ]] ; then
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
install -d ${DIROPTIONS} "${@/#/${ED}/}"
ret=$?
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [ $# -lt 1 ] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
fi
done
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit ${ret}
if [[ $# -lt 1 ]] ; then
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
- helpers_die "${0##*/}: at least one argument needed"
+ __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
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
cp "$x" "$TMP"
mysrc=$TMP/${x##*/}
elif [ -d "${x}" ] ; then
- vecho "doexe: warning, skipping directory ${x}"
+ __vecho "doexe: warning, skipping directory ${x}"
continue
else
mysrc="${x}"
rm -rf "$TMP"
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
esac
if [[ $# -lt 1 ]] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
"${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/dohtml.py" "$@"
ret=$?
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ -z $1 ]] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}usr/share/info ]] ; then
- install -d "${ED}usr/share/info" || { helpers_die "${0##*/}: failed to install ${ED}usr/share/info"; exit 1; }
+ install -d "${ED}usr/share/info" || { __helpers_die "${0##*/}: failed to install ${ED}usr/share/info"; exit 1; }
fi
install -m0644 "$@" "${ED}usr/share/info"
for x in "$@" ; do
[ -e "$x" ] || echo "!!! ${0##*/}: $x does not exist" 1>&2
done
- helpers_die "${0##*/} failed"
+ __helpers_die "${0##*/} failed"
fi
exit $rval
if [[ $# -lt 1 ]] ; then
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
fi
if [ $# -lt 1 ] ; then
- helpers_die "${helper}: at least one argument needed"
+ __helpers_die "${helper}: at least one argument needed"
exit 1
fi
case "$EAPI" in 0|1|2) export ED="${D}" ;; esac
if [[ ${INSDESTTREE#${ED}} != "${INSDESTTREE}" ]]; then
- vecho "-------------------------------------------------------" 1>&2
- vecho "You should not use \${D} or \${ED} with helpers." 1>&2
- vecho " --> ${INSDESTTREE}" 1>&2
- vecho "-------------------------------------------------------" 1>&2
- helpers_die "${helper} used with \${D} or \${ED}"
+ __vecho "-------------------------------------------------------" 1>&2
+ __vecho "You should not use \${D} or \${ED} with helpers." 1>&2
+ __vecho " --> ${INSDESTTREE}" 1>&2
+ __vecho "-------------------------------------------------------" 1>&2
+ __helpers_die "${helper} used with \${D} or \${ED}"
exit 1
fi
fi
done
rm -rf "$TMP"
-[[ $failed -ne 0 || $success -eq 0 ]] && { helpers_die "${helper} failed"; exit 1; } || exit 0
+[[ $failed -ne 0 || $success -eq 0 ]] && { __helpers_die "${helper} failed"; exit 1; } || exit 0
if [[ $# -lt 1 ]] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
if [[ ! -d ${libdir} ]] ; then
- install -d "${libdir}" || { helpers_die "${0##*/}: failed to install ${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"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit ${ret}
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
((ret|=1))
fi
else
- vecho "doman: '${x}' is probably not a man page; skipping" 1>&2
+ __vecho "doman: '${x}' is probably not a man page; skipping" 1>&2
((ret|=1))
fi
done
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit ${ret}
mynum=${#}
if [ ${mynum} -lt 1 ] ; then
- helpers_die "${0}: at least one argument needed"
+ __helpers_die "${0}: at least one argument needed"
exit 1
fi
((ret|=$?))
done
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
case "$EAPI" in 0|1|2) ED=${D} ;; esac
if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then
- install -d "${ED}${DESTTREE}/sbin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/sbin"; exit 2; }
+ install -d "${ED}${DESTTREE}/sbin" || { __helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/sbin"; exit 2; }
fi
ret=0
((ret|=$?))
done
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit ${ret}
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ $# -ne 2 ]] ; then
- helpers_die "${0##*/}: two arguments needed"
+ __helpers_die "${0##*/}: two arguments needed"
exit 1
fi
ln -snf "${target}" "${ED}${2}"
ret=$?
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [[ -z $1 ]] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
case $1 in
--suffix)
- [[ -n $2 ]] && vecho "${0##*/}: --suffix takes no additional arguments" 1>&2
+ [[ -n $2 ]] && __vecho "${0##*/}: --suffix takes no additional arguments" 1>&2
if [[ ! -e ${T}/.ecompress.suffix ]] ; then
set -e
cat "${T}/.ecompress.suffix"
;;
--bin)
- [[ -n $2 ]] && vecho "${0##*/}: --bin takes no additional arguments" 1>&2
+ [[ -n $2 ]] && __vecho "${0##*/}: --bin takes no additional arguments" 1>&2
echo "${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS}"
;;
>> "$x"
((ret|=$?))
done
- [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+ [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
;;
--dequeue)
- [[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
+ [[ -n $2 ]] && __vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
find "${D}" -name '*.ecompress.file' -print0 \
| sed -e 's:\.ecompress\.file::g' \
| ${XARGS} -0 ecompress
find "${D}" -name '*.ecompress.file' -print0 | ${XARGS} -0 rm -f
;;
--*)
- helpers_die "${0##*/}: unknown arguments '$*'"
+ __helpers_die "${0##*/}: unknown arguments '$*'"
exit 1
;;
*)
# Finally, let's actually do some real work
"${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
ret=$?
- [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+ [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
;;
esac
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
if [[ -z $1 ]] ; then
- helpers_die "${0##*/}: at least one argument needed"
+ __helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
>> "$x"
((ret|=$?))
done
- [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+ [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
;;
--dequeue)
- [[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
+ [[ -n $2 ]] && __vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
find "${ED}" -name '*.ecompress.dir' -print0 \
| sed -e 's:\.ecompress\.dir::g' -e "s:${ED}:/:g" \
| ${XARGS} -0 ecompressdir
exit 0
;;
--*)
- helpers_die "${0##*/}: unknown arguments '$*'"
+ __helpers_die "${0##*/}: unknown arguments '$*'"
exit 1
;;
esac
dir=${dir#/}
dir="${ED}${dir}"
if [[ ! -d ${dir} ]] ; then
- vecho "${0##*/}: /${dir#${ED}} does not exist!"
+ __vecho "${0##*/}: /${dir#${ED}} does not exist!"
continue
fi
cd "${dir}"
# now lets do our work
if [[ -n ${suffix} ]] ; then
- vecho "${0##*/}: $(ecompress --bin) /${actual_dir#${ED}}"
+ __vecho "${0##*/}: $(ecompress --bin) /${actual_dir#${ED}}"
funk_up_dir "compress" "${suffix}" "ecompress"
: $(( ret |= $? ))
fi
restore_skip_dirs
done
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit ${ret}
${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
ret=$?
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
exit 0
fi
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
slash="/"
chmod "${@/#${slash}/${ED}${slash}}"
ret=$?
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret
helper=${0##*/}
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
- helpers_die "${helper}: Need two arguments, old file and new file"
+ __helpers_die "${helper}: Need two arguments, old file and new file"
exit 1
fi
if [[ ${stdin} ]] ; then
if [[ -t 0 ]] ; then
- helpers_die "!!! ${helper}: Input is from a terminal"
+ __helpers_die "!!! ${helper}: Input is from a terminal"
exit 1
fi
cat > "${T}/$2"
ret=$?
else
if [[ ! -e $1 ]] ; then
- helpers_die "!!! ${helper}: $1 does not exist"
+ __helpers_die "!!! ${helper}: $1 does not exist"
exit 1
fi
fi
if [[ ${ret} -ne 0 ]] ; then
- helpers_die "${0##*/} failed"
+ __helpers_die "${0##*/} failed"
exit ${ret}
fi
do${helper#new} "${T}/$2"
ret=$?
rm -rf "${T}/${2}"
-[[ $ret -ne 0 ]] && helpers_die "${helper} failed"
+[[ $ret -ne 0 ]] && __helpers_die "${helper} failed"
exit $ret
esac
if [[ -n $1 ]] ; then
- vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
+ __vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
fi
[[ " ${FEATURES} " == *" force-prefix "* ]] || \
if [[ ! -d ${ED}${infodir} ]] ; then
if [[ -n $1 ]] ; then
- vecho "${0##*/}: '${infodir}' does not exist!"
+ __vecho "${0##*/}: '${infodir}' does not exist!"
exit 1
else
exit 0
process_elf() {
local x=$1 strip_flags=${*:2}
- vecho " ${x:${#ED}}"
+ __vecho " ${x:${#ED}}"
# If two processes try to debugedit or strip the same hardlink at the
# same time, it may corrupt files or cause loss of splitdebug info.
fi
sed -e "/^\$/d" -e "s#^#/#" -i "${log}"
if [[ -s ${log} ]] ; then
- vecho -e "\n"
+ __vecho -e "\n"
eqawarn "QA Notice: Pre-stripped files found:"
eqawarn "$(<"${log}")"
else
$(find "$@" -type f -name '*.a')
do
if ! ${banner} ; then
- vecho "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}"
+ __vecho "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}"
banner=true
fi
buildid=
if [[ ${f} == *"current ar archive"* ]] ; then
- vecho " ${x:${#ED}}"
+ __vecho " ${x:${#ED}}"
if ${strip_this} ; then
# hmm, can we split debug/sources for .a ?
${STRIP} -g "${x}"
! ${RESTRICT_installsources} && \
${debugedit_found}
then
- vecho "installsources: rsyncing source files"
+ __vecho "installsources: rsyncing source files"
[[ -d ${D}${prepstrip_sources_dir} ]] || mkdir -p "${D}${prepstrip_sources_dir}"
grep -zv '/<[^/>]*>$' "${tmpdir}"/debug.sources | \
(cd "${WORKDIR}"; LANG=C sort -z -u | \
rm -f "${FILE}"
fi
- vecho "Fetching file ${FILE} ..."
+ __vecho "Fetching file ${FILE} ..."
# already set DISTDIR=
eval "${FETCHCOMMAND}" ${opts}
[ -s "${DISTDIR}/${FILE}" ]
local file="$2"
local r=1
- vecho "Checking digest ..."
+ __vecho "Checking digest ..."
if type -P md5sum > /dev/null; then
local md5sum_output=$(md5sum "${file}")
if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 ]; then
- vecho "Checking signature ..."
+ __vecho "Checking signature ..."
if type -P gpg > /dev/null; then
gpg --homedir "${PORTAGE_GPG_DIR}" --verify "$signature" "$file" && r=0
sync_local() {
local file="$1"
- vecho "Syncing local tree ..."
+ __vecho "Syncing local tree ..."
local ownership="portage:portage"
if has usersync ${FEATURES} ; then
rsync ${PORTAGE_RSYNC_OPTS} ${PORTAGE_RSYNC_EXTRA_OPTS} . "${PORTDIR%%/}"
cd ..
- vecho "Cleaning up ..."
+ __vecho "Cleaning up ..."
rm -fr portage
fi
if has metadata-transfer ${FEATURES} ; then
- vecho "Updating cache ..."
+ __vecho "Updating cache ..."
"${PORTAGE_BIN_PATH}/emerge" --metadata
fi
local post_sync=${PORTAGE_CONFIGROOT}etc/portage/bin/post_sync
for mirror in ${GENTOO_MIRRORS} ; do
mirror=${mirror%/}
- vecho "Trying to retrieve ${date} snapshot from ${mirror} ..."
+ __vecho "Trying to retrieve ${date} snapshot from ${mirror} ..."
for compression in ${compressions} ; do
local file="portage-${date}.tar.${compression}"
#
if [ ${have_files} -eq 1 ]; then
- vecho "Getting snapshot timestamp ..."
+ __vecho "Getting snapshot timestamp ..."
local snapshot_timestamp=$(get_snapshot_timestamp "${DISTDIR}/${file}")
if [ ${ignore_timestamp} == 0 ]; then
if [ ${have_files} -eq 1 ]; then
sync_local "${DISTDIR}/${file}" && r=0
else
- vecho "${date} snapshot was not found"
+ __vecho "${date} snapshot was not found"
fi
${keep} || rm -f "${DISTDIR}/${file}" "${DISTDIR}/${digest}" "${DISTDIR}/${signature}"
local attempts=0
local r=1
- vecho "Fetching most recent snapshot ..."
+ __vecho "Fetching most recent snapshot ..."
# The snapshot for a given day is generated at 00:45 UTC on the following
# day, so the current day's snapshot (going by UTC time) hasn't been
done
}
-assert_sigpipe_ok() {
+__assert_sigpipe_ok() {
# When extracting a tar file like this:
#
# bzip2 -dc foo.tar.bz2 | tar xof -
shopt -s extdebug
-# dump_trace([number of funcs on stack to skip],
+# __dump_trace([number of funcs on stack to skip],
# [whitespacing for filenames],
# [whitespacing for line numbers])
-dump_trace() {
+__dump_trace() {
local funcname="" sourcefile="" lineno="" s="yes" n p
declare -i strip=${1:-1}
local filespacing=$2 linespacing=$3
PORTAGE_NONFATAL=1 "$@"
}
-helpers_die() {
+__helpers_die() {
case "${EAPI:-0}" in
0|1|2|3)
echo -e "$@" >&2
eerror "ERROR: $CATEGORY/$PF failed${phase_str}:"
eerror " ${*:-(no error message)}"
eerror
- # dump_trace is useless when the main script is a helper binary
+ # __dump_trace is useless when the main script is a helper binary
local main_index
(( main_index = ${#BASH_SOURCE[@]} - 1 ))
if has ${BASH_SOURCE[$main_index]##*/} ebuild.sh misc-functions.sh ; then
- dump_trace 2 ${filespacing} ${linespacing}
+ __dump_trace 2 ${filespacing} ${linespacing}
eerror " $(printf "%${filespacing}s" "${BASH_SOURCE[1]##*/}"), line $(printf "%${linespacing}s" "${BASH_LINENO[0]}"): Called die"
eerror "The specific snippet of code:"
# This scans the file that called die and prints out the logic that
# Only call die hooks here if we are executed via ebuild.sh or
# misc-functions.sh, since those are the only cases where the environment
- # contains the hook functions. When necessary (like for helpers_die), die
+ # contains the hook functions. When necessary (like for __helpers_die), die
# hooks are automatically called later by a misc-functions.sh invocation.
if has ${BASH_SOURCE[$main_index]##*/} ebuild.sh misc-functions.sh && \
[[ ${EBUILD_PHASE} != depend ]] ; then
exit 1
}
-quiet_mode() {
+__quiet_mode() {
[[ ${PORTAGE_QUIET} -eq 1 ]]
}
-vecho() {
- quiet_mode || echo "$@"
+__vecho() {
+ __quiet_mode || echo "$@"
}
# Internal logging function, don't use this in ebuilds
-elog_base() {
+__elog_base() {
local messagetype
[ -z "${1}" -o -z "${T}" -o ! -d "${T}/logging" ] && return 1
case "${1}" in
shift
;;
*)
- vecho -e " ${BAD}*${NORMAL} Invalid use of internal function elog_base(), next message will not be logged"
+ __vecho -e " ${BAD}*${NORMAL} Invalid use of internal function __elog_base(), next message will not be logged"
return 1
;;
esac
}
eqawarn() {
- elog_base QA "$*"
+ __elog_base QA "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
echo -e "$@" | while read -r ; do
- vecho " $WARN*$NORMAL $REPLY" >&2
+ __vecho " $WARN*$NORMAL $REPLY" >&2
done
LAST_E_CMD="eqawarn"
return 0
}
elog() {
- elog_base LOG "$*"
+ __elog_base LOG "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
echo -e "$@" | while read -r ; do
echo " $GOOD*$NORMAL $REPLY"
}
einfo() {
- elog_base INFO "$*"
+ __elog_base INFO "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
echo -e "$@" | while read -r ; do
echo " $GOOD*$NORMAL $REPLY"
}
einfon() {
- elog_base INFO "$*"
+ __elog_base INFO "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
echo -ne " ${GOOD}*${NORMAL} $*"
LAST_E_CMD="einfon"
}
ewarn() {
- elog_base WARN "$*"
+ __elog_base WARN "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
echo -e "$@" | while read -r ; do
echo " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2
}
eerror() {
- elog_base ERROR "$*"
+ __elog_base ERROR "$*"
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
echo -e "$@" | while read -r ; do
echo " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2
return 0
}
-_eend() {
+__eend() {
local retval=${1:-0} efunc=${2:-eerror} msg
shift 2
local retval=${1:-0}
shift
- _eend ${retval} eerror "$*"
+ __eend ${retval} eerror "$*"
LAST_E_CMD="eend"
return ${retval}
}
-unset_colors() {
+__unset_colors() {
COLS=80
ENDCOL=
BRACKET=
}
-set_colors() {
+__set_colors() {
COLS=${COLUMNS:-0} # bash's internal COLUMNS variable
# Avoid wasteful stty calls during the "depend" phases.
# If stdout is a pipe, the parent process can export COLUMNS
case "${NOCOLOR:-false}" in
yes|true)
- unset_colors
+ __unset_colors
;;
no|false)
- set_colors
+ __set_colors
;;
esac
-i "${T}"/scanelf-ignored-CFLAGS.log
f=$(<"${T}"/scanelf-ignored-CFLAGS.log)
if [[ -n ${f} ]] ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "${BAD}QA Notice: Files built without respecting CFLAGS have been detected${NORMAL}"
eqawarn " Please include the following list of files in your report:"
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
sleep 1
else
rm -f "${T}"/scanelf-ignored-CFLAGS.log
# Now we look for all world writable files.
local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${ED}:- :")
if [[ -n ${unsafe_files} ]] ; then
- vecho "QA Security Notice: world writable file(s):"
- vecho "${unsafe_files}"
- vecho "- This may or may not be a security problem, most of the time it is one."
- vecho "- Please double check that $PF really needs a world writeable bit and file bugs accordingly."
+ __vecho "QA Security Notice: world writable file(s):"
+ __vecho "${unsafe_files}"
+ __vecho "- This may or may not be a security problem, most of the time it is one."
+ __vecho "- Please double check that $PF really needs a world writeable bit and file bugs accordingly."
sleep 1
fi
for l in $(echo "${rpath_files}" | grep -E ":${dir}|::|: "); do
f+=" ${l%%:*}\n"
if ! has stricter ${FEATURES}; then
- vecho "Auto fixing rpaths for ${l%%:*}"
+ __vecho "Auto fixing rpaths for ${l%%:*}"
TMPDIR="${dir}" scanelf -BXr "${l%%:*}" -o /dev/null
fi
done
# Print QA notice.
if [[ -n ${f}${x} ]] ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: The following files contain insecure RUNPATHs"
eqawarn " Please file a bug about this at http://bugs.gentoo.org/"
eqawarn " with the maintaining herd of the package."
eqawarn "${f}${f:+${x:+\n}}${x}"
- vecho -ne '\n'
+ __vecho -ne '\n'
if [[ -n ${x} ]] || has stricter ${FEATURES} ; then
insecure_rpath=1
fi
f=$(scanelf -qyRF '%t %p' "${ED}" | grep -v 'usr/lib/debug/')
if [[ -n ${f} ]] ; then
scanelf -qyRAF '%T %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-textrel.log
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: The following files contain runtime text relocations"
eqawarn " Text relocations force the dynamic linker to perform extra"
eqawarn " work at startup, waste system resources, and may pose a security"
eqawarn " For more information, see http://hardened.gentoo.org/pic-fix-guide.xml"
eqawarn " Please include the following list of files in your report:"
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
die_msg="${die_msg} textrels,"
sleep 1
fi
if [[ -n ${f} ]] ; then
# One more pass to help devs track down the source
scanelf -qyRAF '%e %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-execstack.log
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: The following files contain writable and executable sections"
eqawarn " Files with such sections will not work properly (or at all!) on some"
eqawarn " architectures/operating systems. A bug should be filed at"
eqawarn " Note: Bugs should be filed for the respective maintainers"
eqawarn " of the package in question and not hardened@g.o."
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
die_msg="${die_msg} execstacks"
sleep 1
fi
-i "${T}"/scanelf-ignored-LDFLAGS.log
f=$(<"${T}"/scanelf-ignored-LDFLAGS.log)
if [[ -n ${f} ]] ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "${BAD}QA Notice: Files built without respecting LDFLAGS have been detected${NORMAL}"
eqawarn " Please include the following list of files in your report:"
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
sleep 1
else
rm -f "${T}"/scanelf-ignored-LDFLAGS.log
sed -e "/^\$/d" -i "${T}"/scanelf-missing-SONAME.log
f=$(<"${T}"/scanelf-missing-SONAME.log)
if [[ -n ${f} ]] ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: The following shared libraries lack a SONAME"
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
sleep 1
else
rm -f "${T}"/scanelf-missing-SONAME.log
sed -e "/^\$/d" -i "${T}"/scanelf-missing-NEEDED.log
f=$(<"${T}"/scanelf-missing-NEEDED.log)
if [[ -n ${f} ]] ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: The following shared libraries lack NEEDED entries"
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
sleep 1
else
rm -f "${T}"/scanelf-missing-NEEDED.log
[[ ! -e ${j} ]] && continue
[[ -L ${j} ]] && continue
[[ -x ${j} ]] && continue
- vecho "making executable: ${j#${ED}}"
+ __vecho "making executable: ${j#${ED}}"
chmod +x "${j}"
done
[[ ! -e ${j} ]] && continue
[[ -L ${j} ]] && continue
[[ ! -x ${j} ]] && continue
- vecho "removing executable bit: ${j#${ED}}"
+ __vecho "removing executable bit: ${j#${ED}}"
chmod -x "${j}"
done
[[ ! -L ${j} ]] && continue
linkdest=$(readlink "${j}")
if [[ ${linkdest} == /* ]] ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: Found an absolute symlink in a library directory:"
eqawarn " ${j#${D}} -> ${linkdest}"
eqawarn " It should be a relative symlink if in the same directory"
if [[ ! -e ${s} ]] ; then
s=${s%usr/*}${s##*/usr/}
if [[ -e ${s} ]] ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: Missing gen_usr_ldscript for ${s##*/}"
abort="yes"
fi
# Make sure people don't store libtool files or static libs in /lib
f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null)
if [[ -n ${f} ]] ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: Excessive files found in the / partition"
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
die "static archives (*.a) and libtool library files (*.la) do not belong in /"
fi
for a in "${ED}"usr/lib*/*.la ; do
s=${a##*/}
if grep -qs "${ED}" "${a}" ; then
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: ${s} appears to contain PORTAGE_TMPDIR paths"
abort="yes"
fi
eerror " with the maintaining herd of the package."
eerror
else
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: Package triggers severe warnings which indicate that it"
eqawarn " may exhibit random runtime failures."
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
fi
fi
done
eerror " with the maintaining herd of the package."
eerror
else
- vecho -ne '\n'
+ __vecho -ne '\n'
eqawarn "QA Notice: Package triggers severe warnings which indicate that it"
eqawarn " will almost certainly crash on 64bit architectures."
eqawarn "${f}"
- vecho -ne '\n'
+ __vecho -ne '\n'
fi
fi
local no_inst
for no_inst in ${install_mask}; do
set +o noglob
- quiet_mode || einfo "Removing ${no_inst}"
+ __quiet_mode || einfo "Removing ${no_inst}"
# normal stuff
rm -Rf "${root}"/${no_inst} >&/dev/null
# to files outside of the sandbox, but this
# can easly be bypassed using the addwrite() function
addwrite "${sfconf}"
- vecho ">>> Performing suid scan in ${ED}"
+ __vecho ">>> Performing suid scan in ${ED}"
for i in $(find "${ED}" -type f \( -perm -4000 -o -perm -2000 \) ); do
if [ -s "${sfconf}" ]; then
install_path=/${i#${ED}}
if grep -q "^${install_path}\$" "${sfconf}" ; then
- vecho "- ${install_path} is an approved suid file"
+ __vecho "- ${install_path} is an approved suid file"
else
- vecho ">>> Removing sbit on non registered ${install_path}"
+ __vecho ">>> Removing sbit on non registered ${install_path}"
for x in 5 4 3 2 1 0; do sleep 0.25 ; done
ls_ret=$(ls -ldh "${i}")
chmod ugo-s "${i}"
grep "^#${install_path}$" "${sfconf}" > /dev/null || {
- vecho ">>> Appending commented out entry to ${sfconf} for ${PF}"
+ __vecho ">>> Appending commented out entry to ${sfconf} for ${PF}"
echo "## ${ls_ret%${ED}*}${install_path}" >> "${sfconf}"
echo "#${install_path}" >> "${sfconf}"
# no delwrite() eh?
}
fi
else
- vecho "suidctl feature set but you are lacking a ${sfconf}"
+ __vecho "suidctl feature set but you are lacking a ${sfconf}"
fi
done
fi
# and 'context' is available on selinuxfs.
if [ -f /selinux/context -o -f /sys/fs/selinux/context ] && \
[ -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
- vecho ">>> Setting SELinux security labels"
+ __vecho ">>> Setting SELinux security labels"
(
eval "$(/usr/sbin/selinuxconfig)" || \
die "Failed to determine SELinux policy paths.";
else
# nonfatal, since merging can happen outside a SE kernel
# like during a recovery situation
- vecho "!!! Unable to set SELinux security labels"
+ __vecho "!!! Unable to set SELinux security labels"
fi
fi
}
fi
[ -n "${md5_hash}" ] && \
echo ${md5_hash} > "${PORTAGE_BUILDDIR}"/build-info/BINPKGMD5
- vecho ">>> Done."
+ __vecho ">>> Done."
# cleanup our temp tree
[[ -n ${PKG_INSTALL_MASK} ]] && rm -rf "${PROOT}"
dyn_pretend() {
if [[ -e $PORTAGE_BUILDDIR/.pretended ]] ; then
- vecho ">>> It appears that '$PF' is already pretended; skipping."
- vecho ">>> Remove '$PORTAGE_BUILDDIR/.pretended' to force pretend."
+ __vecho ">>> It appears that '$PF' is already pretended; skipping."
+ __vecho ">>> Remove '$PORTAGE_BUILDDIR/.pretended' to force pretend."
return 0
fi
ebuild_phase pre_pkg_pretend
dyn_setup() {
if [[ -e $PORTAGE_BUILDDIR/.setuped ]] ; then
- vecho ">>> It appears that '$PF' is already setup; skipping."
- vecho ">>> Remove '$PORTAGE_BUILDDIR/.setuped' to force setup."
+ __vecho ">>> It appears that '$PF' is already setup; skipping."
+ __vecho ">>> Remove '$PORTAGE_BUILDDIR/.setuped' to force setup."
return 0
fi
ebuild_phase pre_pkg_setup
dyn_unpack() {
if [[ -f ${PORTAGE_BUILDDIR}/.unpacked ]] ; then
- vecho ">>> WORKDIR is up-to-date, keeping..."
+ __vecho ">>> WORKDIR is up-to-date, keeping..."
return 0
fi
if [ ! -d "${WORKDIR}" ]; then
fi
cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"
ebuild_phase pre_src_unpack
- vecho ">>> Unpacking source..."
+ __vecho ">>> Unpacking source..."
ebuild_phase src_unpack
>> "$PORTAGE_BUILDDIR/.unpacked" || \
die "Failed to create $PORTAGE_BUILDDIR/.unpacked"
- vecho ">>> Source unpacked in ${WORKDIR}"
+ __vecho ">>> Source unpacked in ${WORKDIR}"
ebuild_phase post_src_unpack
}
dyn_prepare() {
if [[ -e $PORTAGE_BUILDDIR/.prepared ]] ; then
- vecho ">>> It appears that '$PF' is already prepared; skipping."
- vecho ">>> Remove '$PORTAGE_BUILDDIR/.prepared' to force prepare."
+ __vecho ">>> It appears that '$PF' is already prepared; skipping."
+ __vecho ">>> Remove '$PORTAGE_BUILDDIR/.prepared' to force prepare."
return 0
fi
trap abort_prepare SIGINT SIGQUIT
ebuild_phase pre_src_prepare
- vecho ">>> Preparing source in $PWD ..."
+ __vecho ">>> Preparing source in $PWD ..."
ebuild_phase src_prepare
>> "$PORTAGE_BUILDDIR/.prepared" || \
die "Failed to create $PORTAGE_BUILDDIR/.prepared"
- vecho ">>> Source prepared."
+ __vecho ">>> Source prepared."
ebuild_phase post_src_prepare
trap - SIGINT SIGQUIT
dyn_configure() {
if [[ -e $PORTAGE_BUILDDIR/.configured ]] ; then
- vecho ">>> It appears that '$PF' is already configured; skipping."
- vecho ">>> Remove '$PORTAGE_BUILDDIR/.configured' to force configuration."
+ __vecho ">>> It appears that '$PF' is already configured; skipping."
+ __vecho ">>> Remove '$PORTAGE_BUILDDIR/.configured' to force configuration."
return 0
fi
ebuild_phase pre_src_configure
- vecho ">>> Configuring source in $PWD ..."
+ __vecho ">>> Configuring source in $PWD ..."
ebuild_phase src_configure
>> "$PORTAGE_BUILDDIR/.configured" || \
die "Failed to create $PORTAGE_BUILDDIR/.configured"
- vecho ">>> Source configured."
+ __vecho ">>> Source configured."
ebuild_phase post_src_configure
dyn_compile() {
if [[ -e $PORTAGE_BUILDDIR/.compiled ]] ; then
- vecho ">>> It appears that '${PF}' is already compiled; skipping."
- vecho ">>> Remove '$PORTAGE_BUILDDIR/.compiled' to force compilation."
+ __vecho ">>> It appears that '${PF}' is already compiled; skipping."
+ __vecho ">>> Remove '$PORTAGE_BUILDDIR/.compiled' to force compilation."
return 0
fi
ebuild_phase pre_src_compile
- vecho ">>> Compiling source in $PWD ..."
+ __vecho ">>> Compiling source in $PWD ..."
ebuild_phase src_compile
>> "$PORTAGE_BUILDDIR/.compiled" || \
die "Failed to create $PORTAGE_BUILDDIR/.compiled"
- vecho ">>> Source compiled."
+ __vecho ">>> Source compiled."
ebuild_phase post_src_compile
dyn_test() {
if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then
- vecho ">>> It appears that ${PN} has already been tested; skipping."
- vecho ">>> Remove '${PORTAGE_BUILDDIR}/.tested' to force test."
+ __vecho ">>> It appears that ${PN} has already been tested; skipping."
+ __vecho ">>> Remove '${PORTAGE_BUILDDIR}/.tested' to force test."
return
fi
fi
if ! has test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
- vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
+ __vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
elif has test $RESTRICT; then
einfo "Skipping make test/check due to ebuild restriction."
- vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}"
+ __vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}"
else
local save_sp=${SANDBOX_PREDICT}
addpredict /
if has noauto $FEATURES ; then
rm -f "${PORTAGE_BUILDDIR}/.installed"
elif [[ -e $PORTAGE_BUILDDIR/.installed ]] ; then
- vecho ">>> It appears that '${PF}' is already installed; skipping."
- vecho ">>> Remove '${PORTAGE_BUILDDIR}/.installed' to force install."
+ __vecho ">>> It appears that '${PF}' is already installed; skipping."
+ __vecho ">>> Remove '${PORTAGE_BUILDDIR}/.installed' to force install."
return 0
fi
trap "abort_install" SIGINT SIGQUIT
die "The source directory '${S}' doesn't exist"
fi
- vecho
- vecho ">>> Install ${PF} into ${D} category ${CATEGORY}"
+ __vecho
+ __vecho ">>> Install ${PF} into ${D} category ${CATEGORY}"
#our custom version of libtool uses $S and $D to fix
#invalid paths in .la files
export S D
ebuild_phase src_install
>> "$PORTAGE_BUILDDIR/.installed" || \
die "Failed to create $PORTAGE_BUILDDIR/.installed"
- vecho ">>> Completed installing ${PF} into ${D}"
- vecho
+ __vecho ">>> Completed installing ${PF} into ${D}"
+ __vecho
ebuild_phase post_src_install
cd "${PORTAGE_BUILDDIR}"/build-info
install -d "${ED}${DESTTREE}"
local ret=$?
if [[ $ret -ne 0 ]] ; then
- helpers_die "${FUNCNAME[0]} failed"
+ __helpers_die "${FUNCNAME[0]} failed"
return $ret
fi
fi
install -d "${ED}${INSDESTTREE}"
local ret=$?
if [[ $ret -ne 0 ]] ; then
- helpers_die "${FUNCNAME[0]} failed"
+ __helpers_die "${FUNCNAME[0]} failed"
return $ret
fi
fi
install -d "${ED}${_E_EXEDESTTREE_}"
local ret=$?
if [[ $ret -ne 0 ]] ; then
- helpers_die "${FUNCNAME[0]} failed"
+ __helpers_die "${FUNCNAME[0]} failed"
return $ret
fi
fi
install -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
local ret=$?
if [[ $ret -ne 0 ]] ; then
- helpers_die "${FUNCNAME[0]} failed"
+ __helpers_die "${FUNCNAME[0]} failed"
return $ret
fi
fi
[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
for x in "$@"; do
- vecho ">>> Unpacking ${x} to ${PWD}"
+ __vecho ">>> Unpacking ${x} to ${PWD}"
y=${x%.*}
y=${y##*.}
_unpack_tar() {
if [ "${y}" == "tar" ]; then
$1 -c -- "$srcdir$x" | tar xof -
- assert_sigpipe_ok "$myfail"
+ __assert_sigpipe_ok "$myfail"
else
local cwd_dest=${x##*/}
cwd_dest=${cwd_dest%.*}
;;
tbz|tbz2)
${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
- assert_sigpipe_ok "$myfail"
+ __assert_sigpipe_ok "$myfail"
;;
ZIP|zip|jar)
# unzip will interactively prompt under some error conditions,
;;
xz)
if has $eapi 0 1 2 ; then
- vecho "unpack ${x}: file format not recognized. Ignoring."
+ __vecho "unpack ${x}: file format not recognized. Ignoring."
else
_unpack_tar "xz -d"
fi
;;
*)
- vecho "unpack ${x}: file format not recognized. Ignoring."
+ __vecho "unpack ${x}: file format not recognized. Ignoring."
;;
esac
done
find "${WORKDIR}" -type f '(' \
-name config.guess -o -name config.sub ')' -print0 | \
while read -r -d $'\0' x ; do
- vecho " * econf: updating ${x/${WORKDIR}\/} with ${EPREFIX}/usr/share/gnuconfig/${x##*/}"
+ __vecho " * econf: updating ${x/${WORKDIR}\/} with ${EPREFIX}/usr/share/gnuconfig/${x##*/}"
cp -f "${EPREFIX}"/usr/share/gnuconfig/"${x##*/}" "${x}"
done
fi
--localstatedir="${EPREFIX}"/var/lib \
"$@" \
${EXTRA_ECONF}
- vecho "${ECONF_SOURCE}/configure" "$@"
+ __vecho "${ECONF_SOURCE}/configure" "$@"
if ! "${ECONF_SOURCE}/configure" "$@" ; then
;;
esac
if $emake_cmd ${internal_opts} check -n &> /dev/null; then
- vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
+ __vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
$emake_cmd ${internal_opts} check || \
die "Make check failed. See above for details."
elif $emake_cmd ${internal_opts} test -n &> /dev/null; then
- vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
+ __vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
$emake_cmd ${internal_opts} test || \
die "Make test failed. See above for details."
else
- vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
+ __vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
fi
}
done
unset x
- unset -f assert assert_sigpipe_ok \
- dump_trace die \
- quiet_mode vecho elog_base eqawarn elog \
- einfo einfon ewarn eerror ebegin _eend eend KV_major \
- KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
+ unset -f assert __assert_sigpipe_ok \
+ __dump_trace die \
+ __quiet_mode __vecho __elog_base eqawarn elog \
+ einfo einfon ewarn eerror ebegin __eend eend KV_major \
+ KV_minor KV_micro KV_to_int get_KV __1 __1 has \
has_phase_defined_up_to \
hasv hasq qa_source qa_call \
addread addwrite adddeny addpredict _sb_append_var \
abort_test abort_install dyn_prepare dyn_configure \
dyn_compile dyn_test dyn_install \
dyn_preinst dyn_pretend dyn_help debug-print debug-print-function \
- debug-print-section helpers_die inherit EXPORT_FUNCTIONS \
+ debug-print-section __helpers_die inherit EXPORT_FUNCTIONS \
nonfatal register_success_hook \
save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
source_all_bashrcs \