Don't enable multilib-testing unless we want multilib enabled. (#974)

* Don't enable multilib-testing unless we want multilib enabled.

* flake8

* Rename variable to make code more clear
This commit is contained in:
Dylan M. Taylor 2022-02-12 17:42:48 -05:00 committed by GitHub
parent 3e6e6b4ec7
commit a741b1a530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -289,7 +289,7 @@ class Installer:
def post_install_check(self, *args :str, **kwargs :str) -> List[str]:
return [step for step, flag in self.helper_flags.items() if flag is False]
def enable_testing_repositories(self):
def enable_testing_repositories(self, enable_multilib_testing=False):
# Set up a regular expression pattern of a commented line containing 'testing' within []
pattern = re.compile("^#\\[.*testing.*\\]$")
@ -303,7 +303,7 @@ class Installer:
# Open the file again in write mode, to replace the contents
with open("/etc/pacman.conf", "w") as pacman_conf:
for line in lines:
if pattern.match(line):
if pattern.match(line) and (enable_multilib_testing or 'multilib' not in line):
# If this is the [] block containing 'testing', uncomment it and set the matched tracking boolean.
pacman_conf.write(line.lstrip('#'))
matched = True