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 0172F1384B4 for ; Tue, 8 Dec 2015 10:32:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A887921C06A; Tue, 8 Dec 2015 10:32:41 +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 3C04321C06A for ; Tue, 8 Dec 2015 10:32:41 +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 BB4EC3409A4 for ; Tue, 8 Dec 2015 10:32:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E0B579A1 for ; Tue, 8 Dec 2015 10:32:33 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" Message-ID: <1449570500.9e104c424ef08d543546eb4ae54724af97d11c0e.arfrever@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: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis X-VCS-Revision: 9e104c424ef08d543546eb4ae54724af97d11c0e X-VCS-Branch: master Date: Tue, 8 Dec 2015 10:32:33 +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: 689e76a5-2cea-4fae-86c7-74517de4a8ff X-Archives-Hash: 947c84af2ec1083faca8db97113cd490 commit: 9e104c424ef08d543546eb4ae54724af97d11c0e Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 10:28:20 2015 +0000 Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 10:28:20 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9e104c42 ebuild: Set PORTAGE_REPOSITORIES instead of deprecated PORTDIR_OVERLAY. bin/ebuild | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index 1f99177..2c42771 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 VDB_PATH +from portage.const import REPO_NAME_LOC, VDB_PATH from portage.exception import PermissionDenied, PortageKeyError, \ PortagePackageException, UnsupportedAPIException import portage.util @@ -146,27 +146,23 @@ 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.portdb.getRepositoryName(ebuild_portdir) + 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() if not os.path.exists(ebuild): err('%s: does not exist' % (ebuild,)) @@ -198,7 +194,7 @@ else: portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo) if not portage_ebuild or portage_ebuild != ebuild: - err('%s: does not seem to have a valid PORTDIR structure' % (ebuild,)) + err('%s: Invalid structure of repository' % (ebuild,)) if len(pargs) > 1 and "config" in pargs: other_phases = set(pargs)