diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-09 21:51:37 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-09 21:51:37 -0700 |
commit | 26434ee1b77dbff8f1904dd12204a93e87c8b6d3 (patch) | |
tree | 859cc85575ca4e6e7a7d7711ec56ee96a8b1e5d9 /bin/ebuild.sh | |
parent | 34cd7af0911547d0d58b76f0309e744f6184da78 (diff) | |
download | portage-26434ee1b77dbff8f1904dd12204a93e87c8b6d3.tar.gz portage-26434ee1b77dbff8f1904dd12204a93e87c8b6d3.tar.bz2 portage-26434ee1b77dbff8f1904dd12204a93e87c8b6d3.zip |
Bug #336644 - Make ebuild-ipc.py use array.fromfile() to read pickles
in single atomic non-blocking read() calls, similar to how
AbstractPollTask._read_buf() does it. If the read fails, exit with
status 2 so that best_version() and has_version() can detect the
error and die when necessary.
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-x | bin/ebuild.sh | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index cc3b4a142..a742eae62 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -180,13 +180,13 @@ has_version() { die "portageq calls (has_version calls portageq) are not allowed in the global scope" fi + local retval if [[ -n $PORTAGE_IPC_DAEMON ]] ; then "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1" - return $? + else + PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ + "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1" fi - - PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1" local retval=$? case "${retval}" in 0) @@ -225,11 +225,10 @@ best_version() { if [[ -n $PORTAGE_IPC_DAEMON ]] ; then "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1" - return $? + else + PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ + "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1" fi - - PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1" local retval=$? case "${retval}" in 0) |