diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ebuild.sh | 18 | ||||
-rwxr-xr-x | bin/emerge | 7 | ||||
-rwxr-xr-x | bin/portageq | 7 |
3 files changed, 20 insertions, 12 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 5b9abd7a6..18c946840 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -190,11 +190,19 @@ has_version() { fi # return shell-true/shell-false if exists. # Takes single depend-type atoms. - if "${PORTAGE_BIN_PATH}/portageq" 'has_version' "${ROOT}" "$1"; then - return 0 - else - return 1 - fi + "${PORTAGE_BIN_PATH}"/portageq has_version "${ROOT}" "$1" + local retval=$? + case "${retval}" in + 0) + return 0 + ;; + 1) + return 1 + ;; + *) + die "unexpected portageq exit code: ${retval}" + ;; + esac } portageq() { diff --git a/bin/emerge b/bin/emerge index 8e43bb822..80b72e142 100755 --- a/bin/emerge +++ b/bin/emerge @@ -5582,5 +5582,10 @@ def emerge_main(): post_emerge(settings, mtimedb, 0) if __name__ == "__main__": - retval = emerge_main() + from portage_exception import PermissionDenied + try: + retval = emerge_main() + except PermissionDenied, e: + sys.stderr.write("Permission denied: '%s'\n" % str(e)) + sys.exit(e.errno) sys.exit(retval) diff --git a/bin/portageq b/bin/portageq index 6147e5627..1a59af8bc 100755 --- a/bin/portageq +++ b/bin/portageq @@ -133,12 +133,7 @@ def best_visible(argv): sys.exit(2) try: mylist=portage.db[argv[0]]["porttree"].dbapi.match(argv[1]) - visible=portage.best(mylist) - if visible: - print visible - sys.exit(0) - else: - sys.exit(1) + print portage.best(mylist) except KeyError: sys.exit(1) best_visible.uses_root = True |