aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'portage_with_autodep/bin/ebuild-helpers/dohtml')
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dohtml11
1 files changed, 8 insertions, 3 deletions
diff --git a/portage_with_autodep/bin/ebuild-helpers/dohtml b/portage_with_autodep/bin/ebuild-helpers/dohtml
index 630629a..75d3d00 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dohtml
+++ b/portage_with_autodep/bin/ebuild-helpers/dohtml
@@ -1,14 +1,19 @@
#!/bin/bash
-# Copyright 2009-2010 Gentoo Foundation
+# Copyright 2009-2013 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}
-PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
+# Use safe cwd, avoiding unsafe import for bug #469338.
+export __PORTAGE_HELPER_CWD=${PWD}
+cd "${PORTAGE_PYM_PATH}"
+PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
"${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/dohtml.py" "$@"
ret=$?
-[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
+# Restore cwd for display by __helpers_die
+cd "${__PORTAGE_HELPER_CWD}"
+[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
exit $ret