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 9F41B138206 for ; Fri, 29 Apr 2016 23:16:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 62C3DE0810; Fri, 29 Apr 2016 23:16:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EF319E0810 for ; Fri, 29 Apr 2016 23:16:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7618B340D6F for ; Fri, 29 Apr 2016 23:16:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BB80A32C for ; Fri, 29 Apr 2016 23:16:15 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1461971668.75fbbcf58f244717712602a83765bcdc6f07ddcf.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/module.py X-VCS-Directories: pym/portage/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 75fbbcf58f244717712602a83765bcdc6f07ddcf X-VCS-Branch: master Date: Fri, 29 Apr 2016 23:16:15 +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: 4b3e8423-a5f9-4d67-9172-afa2aea58878 X-Archives-Hash: 966ff2eff320829fd7c59f2fec5e20ec commit: 75fbbcf58f244717712602a83765bcdc6f07ddcf Author: Brian Dolbec gentoo org> AuthorDate: Fri Apr 29 23:14:28 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Fri Apr 29 23:14:28 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=75fbbcf5 portage/module.py: Restore backaward compatibilty for previous module_spec. If the module_spec is missing the 'sourcefile' key and value it will fall back to the previous code. It will also print a warning message. pym/portage/module.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pym/portage/module.py b/pym/portage/module.py index 1a10996..b7967ba 100644 --- a/pym/portage/module.py +++ b/pym/portage/module.py @@ -4,9 +4,12 @@ from __future__ import print_function +import warnings + from portage import os from portage.exception import PortageException from portage.cache.mappings import ProtectedDict +from portage.localization import _ class InvalidModuleName(PortageException): @@ -46,7 +49,14 @@ class Module(object): for submodule in self.module_spec['provides']: kid = self.module_spec['provides'][submodule] kidname = kid['name'] - kid['module_name'] = '.'.join([mod_name, kid['sourcefile']]) + try: + kid['module_name'] = '.'.join([mod_name, kid['sourcefile']]) + except KeyError: + kid['module_name'] = '.'.join([mod_name, self.name]) + warnings.warn( + _("%s module's module_spec is old and needs updating. " + "Backward compatibility may be removed in the future.") + % (self.name), UserWarning, stacklevel=2) kid['is_imported'] = False self.kids[kidname] = kid self.kids_names.append(kidname) 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 ED29C138224 for ; Tue, 3 May 2016 06:11:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D083DE087D; Tue, 3 May 2016 06:11:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 101E2E087D for ; Tue, 3 May 2016 06:11:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1CF29340A15 for ; Tue, 3 May 2016 06:11:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E9387331 for ; Tue, 3 May 2016 06:11:28 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1461971668.75fbbcf58f244717712602a83765bcdc6f07ddcf.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/module.py X-VCS-Directories: pym/portage/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 75fbbcf58f244717712602a83765bcdc6f07ddcf X-VCS-Branch: repoman Date: Tue, 3 May 2016 06:11:28 +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: a8296538-7875-4ff6-b665-aa0803a2a642 X-Archives-Hash: 31ef0175c38002fb96e95cb4283fc130 Message-ID: <20160503061128.orweb6MDv1wkD0Gt-37jTxB2urPPT8_aOkYrUZBdYQU@z> commit: 75fbbcf58f244717712602a83765bcdc6f07ddcf Author: Brian Dolbec gentoo org> AuthorDate: Fri Apr 29 23:14:28 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Fri Apr 29 23:14:28 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=75fbbcf5 portage/module.py: Restore backaward compatibilty for previous module_spec. If the module_spec is missing the 'sourcefile' key and value it will fall back to the previous code. It will also print a warning message. pym/portage/module.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pym/portage/module.py b/pym/portage/module.py index 1a10996..b7967ba 100644 --- a/pym/portage/module.py +++ b/pym/portage/module.py @@ -4,9 +4,12 @@ from __future__ import print_function +import warnings + from portage import os from portage.exception import PortageException from portage.cache.mappings import ProtectedDict +from portage.localization import _ class InvalidModuleName(PortageException): @@ -46,7 +49,14 @@ class Module(object): for submodule in self.module_spec['provides']: kid = self.module_spec['provides'][submodule] kidname = kid['name'] - kid['module_name'] = '.'.join([mod_name, kid['sourcefile']]) + try: + kid['module_name'] = '.'.join([mod_name, kid['sourcefile']]) + except KeyError: + kid['module_name'] = '.'.join([mod_name, self.name]) + warnings.warn( + _("%s module's module_spec is old and needs updating. " + "Backward compatibility may be removed in the future.") + % (self.name), UserWarning, stacklevel=2) kid['is_imported'] = False self.kids[kidname] = kid self.kids_names.append(kidname)