1 |
Dnia 2014-10-10, o godz. 21:50:53 |
2 |
Zac Medico <zmedico@g.o> napisał(a): |
3 |
|
4 |
> Since commit 0cc4c1ac21a2ea94cfb1f6ff4b461a9e349d47df, |
5 |
> $PORTAGE_BIN_PATH/portageq no longer exists, which breaks |
6 |
> bin/ebuild-helpers/portageq. Note that has_version and best_version |
7 |
> rely on bin/ebuild-helpers/portageq if IPC is disabled, so breakage |
8 |
> extends beyond ebuilds that call portageq "illegally". Since |
9 |
> $PORTAGE_BIN_PATH no longer works, use PATH to locate the real |
10 |
> portageq python script. |
11 |
> |
12 |
> Fixes: 0cc4c1ac21a2 ("Install Portage using setup.py") |
13 |
> X-Gento-Bug: 524964 |
14 |
> X-Gentoo-URL: https://bugs.gentoo.org/show_bug.cgi?id=524964 |
15 |
> --- |
16 |
> bin/ebuild-helpers/portageq | 19 +++++++++++++++++-- |
17 |
> 1 file changed, 17 insertions(+), 2 deletions(-) |
18 |
> |
19 |
> diff --git a/bin/ebuild-helpers/portageq b/bin/ebuild-helpers/portageq |
20 |
> index b67b03f..9eb17fc 100755 |
21 |
> --- a/bin/ebuild-helpers/portageq |
22 |
> +++ b/bin/ebuild-helpers/portageq |
23 |
> @@ -2,9 +2,24 @@ |
24 |
> # Copyright 2009-2013 Gentoo Foundation |
25 |
> # Distributed under the terms of the GNU General Public License v2 |
26 |
> |
27 |
> +scriptpath=${BASH_SOURCE[0]} |
28 |
> +scriptname=${scriptpath##*/} |
29 |
> + |
30 |
> PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} |
31 |
> PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} |
32 |
> # Use safe cwd, avoiding unsafe import for bug #469338. |
33 |
> cd "${PORTAGE_PYM_PATH}" |
34 |
> -PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ |
35 |
> - exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/portageq" "$@" |
36 |
> + |
37 |
> +IFS=':' |
38 |
> + |
39 |
> +for path in ${PATH}; do |
40 |
|
41 |
This will trigger unwanted filename expansion. For example, |
42 |
|
43 |
PATH='/*/bin' |
44 |
|
45 |
will trigger '/usr/bin' rather than '/*/bin' :P. |
46 |
|
47 |
> + [[ -x ${path}/${scriptname} ]] || continue |
48 |
> + [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue |
49 |
> + PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ |
50 |
> + exec "${PORTAGE_PYTHON:-/usr/bin/python}" \ |
51 |
> + "${path}/${scriptname}" "$@" |
52 |
> +done |
53 |
> + |
54 |
> +unset IFS |
55 |
> +echo "${scriptname}: command not found" 1>&2 |
56 |
> +exit 127 |
57 |
|
58 |
|
59 |
|
60 |
-- |
61 |
Best regards, |
62 |
Michał Górny |