From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A222B15808B for ; Mon, 28 Mar 2022 01:10:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BF491E099B; Mon, 28 Mar 2022 01:10:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1B17AE099B for ; Mon, 28 Mar 2022 01:10:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E6293343507 for ; Mon, 28 Mar 2022 01:10:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 593B22F5 for ; Mon, 28 Mar 2022 01:10:29 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1648429819.0ad7157bcadf54bf39f28b0157355950b4c04f59.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/data.py X-VCS-Directories: lib/portage/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 0ad7157bcadf54bf39f28b0157355950b4c04f59 X-VCS-Branch: master Date: Mon, 28 Mar 2022 01:10:29 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bd869e67-106c-49bd-afff-2d198b953161 X-Archives-Hash: cde7c7af21a5274177090935794975b9 commit: 0ad7157bcadf54bf39f28b0157355950b4c04f59 Author: Kenneth Raplee kennethraplee com> AuthorDate: Mon Mar 28 00:59:30 2022 +0000 Commit: Sam James gentoo org> CommitDate: Mon Mar 28 01:10:19 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0ad7157b Revert Portage settings refactor This partially reverts 18e5a8170c69aecd10f162918de571d85055ae81. Bug: https://bugs.gentoo.org/836298 Bug: https://bugs.gentoo.org/836299 Closes: https://bugs.gentoo.org/836297 Signed-off-by: Kenneth Raplee kennethraplee.com> Signed-off-by: Sam James gentoo.org> lib/portage/data.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/portage/data.py b/lib/portage/data.py index c783d76d0..1ef8d4aef 100644 --- a/lib/portage/data.py +++ b/lib/portage/data.py @@ -332,15 +332,17 @@ def _init(settings): # from grp.getgrnam() with PyPy native_string = platform.python_implementation() == "PyPy" + v = settings.get("PORTAGE_GRPNAME", "portage") if native_string: - grpname = settings.get("PORTAGE_GRPNAME", "portage") - grpname = portage._native_string(grpname) - globals()["_portage_grpname"] = grpname - _initialized_globals.add("_portage_grpname") - username = settings.get("PORTAGE_USERNAME", "portage") - username = portage._native_string(username) - globals()["_portage_username"] = username - _initialized_globals.add("_portage_username") + v = portage._native_string(v) + globals()["_portage_grpname"] = v + _initialized_globals.add("_portage_grpname") + + v = settings.get("PORTAGE_USERNAME", "portage") + if native_string: + v = portage._native_string(v) + globals()["_portage_username"] = v + _initialized_globals.add("_portage_username") if "secpass" not in _initialized_globals: v = 0