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 85EAD1384B4 for ; Sun, 13 Dec 2015 12:58:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9CC19E0893; Sun, 13 Dec 2015 12:58:05 +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 2A308E0893 for ; Sun, 13 Dec 2015 12:58:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EE9523408F9 for ; Sun, 13 Dec 2015 12:58:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 873B4CB0 for ; Sun, 13 Dec 2015 12:57:59 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1449992009.1cb9b4edd13d8958ea6efa1cb2ee34482266aaea.mgorny@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ebuild X-VCS-Directories: bin/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 1cb9b4edd13d8958ea6efa1cb2ee34482266aaea X-VCS-Branch: master Date: Sun, 13 Dec 2015 12:57:59 +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: 83c27379-1588-4de1-b72e-0818c2f0e1b6 X-Archives-Hash: bdd8c6b1e03c416cc746175573c8c884 commit: 1cb9b4edd13d8958ea6efa1cb2ee34482266aaea Author: Michał Górny gentoo org> AuthorDate: Sat Dec 12 15:31:31 2015 +0000 Commit: Michał Górny gentoo org> CommitDate: Sun Dec 13 07:33:29 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1cb9b4ed Revert "ebuild: Set PORTAGE_REPOSITORIES instead of deprecated PORTDIR_OVERLAY." This reverts commit 9e104c424ef08d543546eb4ae54724af97d11c0e. This was unreviewed and the PORTAGE_REPOSITORIES design is at least controversial. bin/ebuild | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index 2c42771..1f99177 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -50,7 +50,7 @@ from portage import _encodings from portage import _shell_quote from portage import _unicode_decode from portage import _unicode_encode -from portage.const import REPO_NAME_LOC, VDB_PATH +from portage.const import VDB_PATH from portage.exception import PermissionDenied, PortageKeyError, \ PortagePackageException, UnsupportedAPIException import portage.util @@ -146,23 +146,27 @@ ebuild_portdir = os.path.realpath( ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:]) vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH)) +# Make sure that portdb.findname() returns the correct ebuild. +if ebuild_portdir != vdb_path and \ + ebuild_portdir not in portage.portdb.porttrees: + portdir_overlay = portage.settings.get("PORTDIR_OVERLAY", "") + if sys.hexversion >= 0x3000000: + os.environ["PORTDIR_OVERLAY"] = \ + portdir_overlay + \ + " " + _shell_quote(ebuild_portdir) + else: + os.environ["PORTDIR_OVERLAY"] = \ + _unicode_encode(portdir_overlay, + encoding=_encodings['content'], errors='strict') + \ + " " + _unicode_encode(_shell_quote(ebuild_portdir), + encoding=_encodings['content'], errors='strict') + + print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir) + portage._reset_legacy_globals() + myrepo = None if ebuild_portdir != vdb_path: - myrepo = portage.repository.config._read_repo_name(ebuild_portdir) - if myrepo is None: - err("Repository located in %r has no repository name set in %r or in 'repo-name' attribute in %r" % - (ebuild_portdir, os.path.join(ebuild_portdir, REPO_NAME_LOC), os.path.join(ebuild_portdir, "metadata", "layout.conf"))) - - # Make sure that portdb.findname() returns the correct ebuild. - if ebuild_portdir not in portage.portdb.porttrees: - print("Appending repository '%s' located in '%s' to configuration of repositories" % (myrepo, ebuild_portdir)) - tmp_conf_file = io.StringIO(textwrap.dedent(""" - [%s] - location = %s - """ % (myrepo, ebuild_portdir))) - repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file]) - os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string() - portage._reset_legacy_globals() + myrepo = portage.portdb.getRepositoryName(ebuild_portdir) if not os.path.exists(ebuild): err('%s: does not exist' % (ebuild,)) @@ -194,7 +198,7 @@ else: portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo) if not portage_ebuild or portage_ebuild != ebuild: - err('%s: Invalid structure of repository' % (ebuild,)) + err('%s: does not seem to have a valid PORTDIR structure' % (ebuild,)) if len(pargs) > 1 and "config" in pargs: other_phases = set(pargs)