aboutsummaryrefslogtreecommitdiff
blob: 047d1d826c20cbf385e2626aea412924a480fc4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
# Copyright 2009-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Use safe cwd, avoiding unsafe import for bug #469338.
cd "${PORTAGE_PYM_PATH}" || exit 1

IFS=":"
set -f # in case ${PATH} contains any shell glob characters

for path in "${PORTAGE_BIN_PATH}" ${PATH}; do
	[[ -x ${path}/portageq ]] || continue
	PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
		exec "${PORTAGE_PYTHON:-/usr/bin/python}" "${path}/portageq" "$@"
done

echo "portageq: command not found" >&2
exit 127