summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh59
1 files changed, 5 insertions, 54 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 6bcc6b314..4dd29216a 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -127,30 +127,6 @@ esyslog() {
return 0
}
-# Return true if given package is installed. Otherwise return false.
-# Takes single depend-type atoms.
-has_version() {
- if [ "${EBUILD_PHASE}" == "depend" ]; then
- die "portageq calls (has_version calls portageq) are not allowed in the global scope"
- fi
-
- if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
- "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1"
- else
- PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1"
- fi
- local retval=$?
- case "${retval}" in
- 0|1)
- return ${retval}
- ;;
- *)
- die "unexpected portageq exit code: ${retval}"
- ;;
- esac
-}
-
portageq() {
if [ "${EBUILD_PHASE}" == "depend" ]; then
die "portageq calls are not allowed in the global scope"
@@ -160,36 +136,6 @@ portageq() {
"${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" "$@"
}
-
-# ----------------------------------------------------------------------------
-# ----------------------------------------------------------------------------
-# ----------------------------------------------------------------------------
-
-
-# Returns the best/most-current match.
-# Takes single depend-type atoms.
-best_version() {
- if [ "${EBUILD_PHASE}" == "depend" ]; then
- die "portageq calls (best_version calls portageq) are not allowed in the global scope"
- fi
-
- if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
- "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1"
- else
- PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
- fi
- local retval=$?
- case "${retval}" in
- 0|1)
- return ${retval}
- ;;
- *)
- die "unexpected portageq exit code: ${retval}"
- ;;
- esac
-}
-
register_die_hook() {
local x
for x in $* ; do
@@ -793,6 +739,11 @@ else
keepdir libopts use useq usev use_with use_enable ; do
eval "${x}() { : ; }"
done
+ # These functions die because calls to them during the "depend" phase
+ # are considered to be severe QA violations.
+ for x in best_version has_version ; do
+ eval "${x}() { die \"\${FUNCNAME} calls are not allowed in global scope\"; }"
+ done
unset x
fi