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 D58EA158096 for ; Sun, 25 Sep 2022 19:12:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 192FDE109B; Sun, 25 Sep 2022 19:12:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 CFAF1E1098 for ; Sun, 25 Sep 2022 19:12:34 +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 E4A7D341119 for ; Sun, 25 Sep 2022 19:12:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 124D0584 for ; Sun, 25 Sep 2022 19:12:32 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1664132872.a83507be7ce04d3ac421f9cbe8b63816809b0f4e.floppym@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/dbapi/bintree.py X-VCS-Directories: lib/portage/dbapi/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: a83507be7ce04d3ac421f9cbe8b63816809b0f4e X-VCS-Branch: master Date: Sun, 25 Sep 2022 19:12:32 +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: ac9f760c-daf9-4930-8685-6e74a4d4478d X-Archives-Hash: c0f704447b93c4cd6d4eb1f538e3cf86 commit: a83507be7ce04d3ac421f9cbe8b63816809b0f4e Author: David Palao gmail com> AuthorDate: Fri Sep 23 13:42:33 2022 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Sun Sep 25 19:07:52 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a83507be chore(bintree): removed useless ``if True:`` This commit de-indents a large block. Signed-off-by: David Palao gmail.com> Signed-off-by: Mike Gilbert gentoo.org> lib/portage/dbapi/bintree.py | 263 +++++++++++++++++++++---------------------- 1 file changed, 131 insertions(+), 132 deletions(-) diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py index 7f5dc051c..28b3c481b 100644 --- a/lib/portage/dbapi/bintree.py +++ b/lib/portage/dbapi/bintree.py @@ -473,143 +473,142 @@ class binarytree: stacklevel=2, ) - if True: - self.pkgdir = normalize_path(pkgdir) - # NOTE: Event if binpkg-multi-instance is disabled, it's - # still possible to access a PKGDIR which uses the - # binpkg-multi-instance layout (or mixed layout). - self._multi_instance = "binpkg-multi-instance" in settings.features - if self._multi_instance: - self._allocate_filename = self._allocate_filename_multi - self.dbapi = bindbapi(self, settings=settings) - self.update_ents = self.dbapi.update_ents - self.move_slot_ent = self.dbapi.move_slot_ent - self.populated = 0 - self.tree = {} - self._binrepos_conf = None - self._remote_has_index = False - self._remotepkgs = None # remote metadata indexed by cpv - self._additional_pkgs = {} - self.invalids = [] - self.settings = settings - self._pkg_paths = {} - self._populating = False - self._all_directory = os.path.isdir(os.path.join(self.pkgdir, "All")) - self._pkgindex_version = 0 - self._pkgindex_hashes = ["MD5", "SHA1"] - self._pkgindex_file = os.path.join(self.pkgdir, "Packages") - self._pkgindex_keys = self.dbapi._aux_cache_keys.copy() - self._pkgindex_keys.update(["CPV", "SIZE"]) - self._pkgindex_aux_keys = [ - "BASE_URI", - "BDEPEND", + self.pkgdir = normalize_path(pkgdir) + # NOTE: Event if binpkg-multi-instance is disabled, it's + # still possible to access a PKGDIR which uses the + # binpkg-multi-instance layout (or mixed layout). + self._multi_instance = "binpkg-multi-instance" in settings.features + if self._multi_instance: + self._allocate_filename = self._allocate_filename_multi + self.dbapi = bindbapi(self, settings=settings) + self.update_ents = self.dbapi.update_ents + self.move_slot_ent = self.dbapi.move_slot_ent + self.populated = 0 + self.tree = {} + self._binrepos_conf = None + self._remote_has_index = False + self._remotepkgs = None # remote metadata indexed by cpv + self._additional_pkgs = {} + self.invalids = [] + self.settings = settings + self._pkg_paths = {} + self._populating = False + self._all_directory = os.path.isdir(os.path.join(self.pkgdir, "All")) + self._pkgindex_version = 0 + self._pkgindex_hashes = ["MD5", "SHA1"] + self._pkgindex_file = os.path.join(self.pkgdir, "Packages") + self._pkgindex_keys = self.dbapi._aux_cache_keys.copy() + self._pkgindex_keys.update(["CPV", "SIZE"]) + self._pkgindex_aux_keys = [ + "BASE_URI", + "BDEPEND", + "BINPKG_FORMAT", + "BUILD_ID", + "BUILD_TIME", + "CHOST", + "DEFINED_PHASES", + "DEPEND", + "DESCRIPTION", + "EAPI", + "FETCHCOMMAND", + "IDEPEND", + "IUSE", + "KEYWORDS", + "LICENSE", + "PDEPEND", + "PKGINDEX_URI", + "PROPERTIES", + "PROVIDES", + "RDEPEND", + "repository", + "REQUIRES", + "RESTRICT", + "RESUMECOMMAND", + "SIZE", + "SLOT", + "USE", + ] + self._pkgindex_aux_keys = list(self._pkgindex_aux_keys) + self._pkgindex_use_evaluated_keys = ( + "BDEPEND", + "DEPEND", + "IDEPEND", + "LICENSE", + "RDEPEND", + "PDEPEND", + "PROPERTIES", + "RESTRICT", + ) + self._pkgindex_header = None + self._pkgindex_header_keys = set( + [ + "ACCEPT_KEYWORDS", + "ACCEPT_LICENSE", + "ACCEPT_PROPERTIES", + "ACCEPT_RESTRICT", "BINPKG_FORMAT", - "BUILD_ID", - "BUILD_TIME", - "CHOST", - "DEFINED_PHASES", - "DEPEND", - "DESCRIPTION", - "EAPI", - "FETCHCOMMAND", - "IDEPEND", - "IUSE", - "KEYWORDS", - "LICENSE", - "PDEPEND", - "PKGINDEX_URI", - "PROPERTIES", - "PROVIDES", - "RDEPEND", - "repository", - "REQUIRES", - "RESTRICT", - "RESUMECOMMAND", - "SIZE", - "SLOT", + "CBUILD", + "CONFIG_PROTECT", + "CONFIG_PROTECT_MASK", + "FEATURES", + "GENTOO_MIRRORS", + "INSTALL_MASK", + "IUSE_IMPLICIT", "USE", + "USE_EXPAND", + "USE_EXPAND_HIDDEN", + "USE_EXPAND_IMPLICIT", + "USE_EXPAND_UNPREFIXED", ] - self._pkgindex_aux_keys = list(self._pkgindex_aux_keys) - self._pkgindex_use_evaluated_keys = ( - "BDEPEND", - "DEPEND", - "IDEPEND", - "LICENSE", - "RDEPEND", - "PDEPEND", - "PROPERTIES", - "RESTRICT", - ) - self._pkgindex_header = None - self._pkgindex_header_keys = set( - [ - "ACCEPT_KEYWORDS", - "ACCEPT_LICENSE", - "ACCEPT_PROPERTIES", - "ACCEPT_RESTRICT", - "BINPKG_FORMAT", - "CBUILD", - "CONFIG_PROTECT", - "CONFIG_PROTECT_MASK", - "FEATURES", - "GENTOO_MIRRORS", - "INSTALL_MASK", - "IUSE_IMPLICIT", - "USE", - "USE_EXPAND", - "USE_EXPAND_HIDDEN", - "USE_EXPAND_IMPLICIT", - "USE_EXPAND_UNPREFIXED", - ] - ) - self._pkgindex_default_pkg_data = { - "BDEPEND": "", - "BUILD_ID": "", - "BUILD_TIME": "", - "DEFINED_PHASES": "", - "DEPEND": "", - "EAPI": "0", - "IDEPEND": "", - "IUSE": "", - "KEYWORDS": "", - "LICENSE": "", - "PATH": "", - "PDEPEND": "", - "PROPERTIES": "", - "PROVIDES": "", - "RDEPEND": "", - "REQUIRES": "", - "RESTRICT": "", - "SLOT": "0", - "USE": "", - } - self._pkgindex_inherited_keys = ["BINPKG_FORMAT", "CHOST", "repository"] - - # Populate the header with appropriate defaults. - self._pkgindex_default_header_data = { - "BINPKG_FORMAT": self.settings.get( - "BINPKG_FORMAT", SUPPORTED_GENTOO_BINPKG_FORMATS[0] - ), - "CHOST": self.settings.get("CHOST", ""), - "repository": "", - } - - self._pkgindex_translated_keys = ( - ("DESCRIPTION", "DESC"), - ("_mtime_", "MTIME"), - ("repository", "REPO"), - ) + ) + self._pkgindex_default_pkg_data = { + "BDEPEND": "", + "BUILD_ID": "", + "BUILD_TIME": "", + "DEFINED_PHASES": "", + "DEPEND": "", + "EAPI": "0", + "IDEPEND": "", + "IUSE": "", + "KEYWORDS": "", + "LICENSE": "", + "PATH": "", + "PDEPEND": "", + "PROPERTIES": "", + "PROVIDES": "", + "RDEPEND": "", + "REQUIRES": "", + "RESTRICT": "", + "SLOT": "0", + "USE": "", + } + self._pkgindex_inherited_keys = ["BINPKG_FORMAT", "CHOST", "repository"] + + # Populate the header with appropriate defaults. + self._pkgindex_default_header_data = { + "BINPKG_FORMAT": self.settings.get( + "BINPKG_FORMAT", SUPPORTED_GENTOO_BINPKG_FORMATS[0] + ), + "CHOST": self.settings.get("CHOST", ""), + "repository": "", + } + + self._pkgindex_translated_keys = ( + ("DESCRIPTION", "DESC"), + ("_mtime_", "MTIME"), + ("repository", "REPO"), + ) - self._pkgindex_allowed_pkg_keys = set( - chain( - self._pkgindex_keys, - self._pkgindex_aux_keys, - self._pkgindex_hashes, - self._pkgindex_default_pkg_data, - self._pkgindex_inherited_keys, - chain(*self._pkgindex_translated_keys), - ) + self._pkgindex_allowed_pkg_keys = set( + chain( + self._pkgindex_keys, + self._pkgindex_aux_keys, + self._pkgindex_hashes, + self._pkgindex_default_pkg_data, + self._pkgindex_inherited_keys, + chain(*self._pkgindex_translated_keys), ) + ) @property def root(self):