From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 94CA013881B for ; Sun, 19 Oct 2014 17:33:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 22991E08E8; Sun, 19 Oct 2014 17:33:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C6D6DE08E8 for ; Sun, 19 Oct 2014 17:33:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C41E13403B3 for ; Sun, 19 Oct 2014 17:33:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 71089843E for ; Sun, 19 Oct 2014 17:33:12 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1413739943.03cbe2762903601fe679ccd766456f6f6cba8ea2.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ebuild-helpers/portageq X-VCS-Directories: bin/ebuild-helpers/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 03cbe2762903601fe679ccd766456f6f6cba8ea2 X-VCS-Branch: master Date: Sun, 19 Oct 2014 17:33:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 5caa10de-50c4-4804-9e01-c5aceb158468 X-Archives-Hash: d586b591bb9a01e1adbf0eee01482b07 commit: 03cbe2762903601fe679ccd766456f6f6cba8ea2 Author: Zac Medico gentoo org> AuthorDate: Sat Oct 11 04:32:54 2014 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Oct 19 17:32:23 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=03cbe276 bin/ebuild-helpers/portageq: fix bug #524964 Since commit 0cc4c1ac21a2ea94cfb1f6ff4b461a9e349d47df, $PORTAGE_BIN_PATH/portageq no longer exists, which breaks bin/ebuild-helpers/portageq. Note that has_version and best_version rely on bin/ebuild-helpers/portageq if IPC is disabled, so breakage extends beyond ebuilds that call portageq "illegally". Since $PORTAGE_BIN_PATH no longer works, use PATH to locate the real portageq python script. Fixes: 0cc4c1ac21a2 ("Install Portage using setup.py") X-Gento-Bug: 524964 X-Gentoo-URL: https://bugs.gentoo.org/show_bug.cgi?id=524964 --- bin/ebuild-helpers/portageq | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/bin/ebuild-helpers/portageq b/bin/ebuild-helpers/portageq index b67b03f..4151bac 100755 --- a/bin/ebuild-helpers/portageq +++ b/bin/ebuild-helpers/portageq @@ -2,9 +2,25 @@ # Copyright 2009-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +scriptpath=${BASH_SOURCE[0]} +scriptname=${scriptpath##*/} + PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin} PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym} # Use safe cwd, avoiding unsafe import for bug #469338. cd "${PORTAGE_PYM_PATH}" -PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ - exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/portageq" "$@" + +IFS=':' +set -f # in case ${PATH} contains any shell glob characters + +for path in ${PATH}; do + [[ -x ${path}/${scriptname} ]] || continue + [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue + PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ + exec "${PORTAGE_PYTHON:-/usr/bin/python}" \ + "${path}/${scriptname}" "$@" +done + +unset IFS +echo "${scriptname}: command not found" 1>&2 +exit 127