From 8ea1ae98bea185f30a7658f82e714dfa0ae5779c Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Mon, 27 Mar 2023 19:41:47 +0200 Subject: [PATCH] repo_config; changed detection fixes --- distro/repo_config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/distro/repo_config.py b/distro/repo_config.py index ea04079..96116b5 100644 --- a/distro/repo_config.py +++ b/distro/repo_config.py @@ -142,15 +142,15 @@ REPOS_CONFIG_DEFAULT = ReposConfigFile({ }, }) -_current_config = deepcopy(REPOS_CONFIG_DEFAULT) +_current_config = None + def get_repo_config( initialize_pkgbuilds: bool = False, repo_config_file: Optional[str] = None, ) -> tuple[ReposConfigFile, bool]: global _current_config - pkgbuilds_dir = config.get_path('pkgbuilds') - repo_config_file_default = os.path.join(pkgbuilds_dir, REPOS_CONFIG_FILE) + repo_config_file_default = os.path.join(config.get_path('pkgbuilds'), REPOS_CONFIG_FILE) if repo_config_file is None: repo_config_file_path = repo_config_file_default else: @@ -166,7 +166,7 @@ def get_repo_config( return get_repo_config(initialize_pkgbuilds=False, repo_config_file=repo_config_file_path) conf = _current_config changed = False - if not conf or conf._path != repo_config_file_path or conf._checksum != sha256sum(repo_config_file_path): + if (not _current_config) or _current_config._path != repo_config_file_path or _current_config._checksum != sha256sum(repo_config_file_path): conf = ReposConfigFile.parse_config(repo_config_file_path) if repo_config_file_path == repo_config_file_default: _current_config = conf