From 0b6293a79865fb4556b0bd02e0a41e96e9a56545 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 5 Mar 2022 04:44:48 +0000 Subject: [PATCH] porttree: skip metadata verification if repository is immutable Closes: https://bugs.gentoo.org/528394 Signed-off-by: Sam James --- lib/portage/dbapi/porttree.py | 5 +++-- lib/portage/repository/config.py | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/portage/dbapi/porttree.py b/lib/portage/dbapi/porttree.py index cd919ba31..fa927165c 100644 --- a/lib/portage/dbapi/porttree.py +++ b/lib/portage/dbapi/porttree.py @@ -616,7 +616,8 @@ class portdbapi(dbapi): if ro_auxdb is not None: auxdbs.append(ro_auxdb) auxdbs.append(self.auxdb[repo_path]) - eclass_db = self.repositories.get_repo_for_location(repo_path).eclass_db + repo = self.repositories.get_repo_for_location(repo_path) + eclass_db = repo.eclass_db for auxdb in auxdbs: try: @@ -639,7 +640,7 @@ class portdbapi(dbapi): # EAPI from _parse_eapi_ebuild_head, we disregard cache entries # for unsupported EAPIs. continue - if auxdb.validate_entry(metadata, ebuild_hash, eclass_db): + if repo.immutable or auxdb.validate_entry(metadata, ebuild_hash, eclass_db): break else: metadata = None diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py index 0b591d94f..7f0fa7448 100644 --- a/lib/portage/repository/config.py +++ b/lib/portage/repository/config.py @@ -120,6 +120,7 @@ class RepoConfig: "find_invalid_path_char", "force", "format", + "immutable", "local_config", "location", "main_repo", @@ -200,6 +201,8 @@ class RepoConfig: self.eclass_db = None self.eclass_locations = None + self.immutable = repo_opts.get("immutable", "false").lower() in ("true", "yes") + if local_config or "masters" in force: # Masters from repos.conf override layout.conf. masters = repo_opts.get("masters") @@ -660,6 +663,9 @@ class RepoConfigLoader: if repos_conf_opts is not None: # Selectively copy only the attributes which # repos.conf is allowed to override. + # 'immutable' is intentionally not here as + # the use case for this is local modifications for development + # and we can't assume people are generating metadata for each change. for k in ( "aliases", "auto_sync", @@ -1211,6 +1217,7 @@ class RepoConfigLoader: def config_string(self): bool_keys = ( + "immutable", "strict_misc_digests", "sync_allow_hardlinks", "sync_openpgp_key_refresh", -- 2.37.1