From 3569d7e45f4d66814428ebc92abcdcae88f54296 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Tue, 6 Feb 2024 15:16:07 +0100 Subject: [PATCH] package_manager: disable %-interpolation in dnf.conf parser This fixes parsing of dnf.conf containing url-encoded links. Fixes: #1310 --- mock/py/mockbuild/package_manager.py | 2 +- mock/tests/test_package_manager.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mock/py/mockbuild/package_manager.py b/mock/py/mockbuild/package_manager.py index b35e2e3d0..1f939907b 100644 --- a/mock/py/mockbuild/package_manager.py +++ b/mock/py/mockbuild/package_manager.py @@ -480,7 +480,7 @@ def _bind_mount_repos_to_bootstrap(self): } # in dnf, the last occurence of the same option beats the previous - config = ConfigParser(strict=False) + config = ConfigParser(strict=False, interpolation=None) config.read_string(self.pkg_manager_config) # don't bindmount the same paths multiple times diff --git a/mock/tests/test_package_manager.py b/mock/tests/test_package_manager.py index 9093222bf..5eaed9f8d 100644 --- a/mock/tests/test_package_manager.py +++ b/mock/tests/test_package_manager.py @@ -89,6 +89,9 @@ def test_absolute_path_name_in_baseurl(self): [external] baseurl = http://exmaple.com/test/ + [external-urlencoded] + baseurl = http://example.com/results/%40fedora-llvm-team/ + [fedora] baseurl = {} """.format(repo_directory)