Skip to content

Commit

Permalink
package_manager: disable %-interpolation in dnf.conf parser
Browse files Browse the repository at this point in the history
This fixes parsing of dnf.conf containing url-encoded links.

Fixes: rpm-software-management#1310
  • Loading branch information
praiskup committed Feb 6, 2024
1 parent db64d46 commit 492076d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mock/py/mockbuild/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions mock/tests/test_package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 492076d

Please sign in to comment.