|
|
@ -4,7 +4,6 @@
|
|
|
|
# (probably an exception)
|
|
|
|
# (probably an exception)
|
|
|
|
|
|
|
|
|
|
|
|
import dnf
|
|
|
|
import dnf
|
|
|
|
import iniparse
|
|
|
|
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
@ -17,16 +16,9 @@ base.read_all_repos()
|
|
|
|
reponame = sys.argv[1]
|
|
|
|
reponame = sys.argv[1]
|
|
|
|
repo = base.repos[reponame]
|
|
|
|
repo = base.repos[reponame]
|
|
|
|
|
|
|
|
|
|
|
|
# Loosely based on write_raw_configfile() from DNF source code, because
|
|
|
|
base.conf.write_raw_configfile(repo.repofile,
|
|
|
|
# that method was introduced in DNF 2.0 but Qubes dom0 has DNF 1.x.
|
|
|
|
repo.id,
|
|
|
|
with open(repo.repofile) as fp:
|
|
|
|
base.conf.substitutions,
|
|
|
|
ini = iniparse.INIConfig(fp)
|
|
|
|
{'enabled': '0'})
|
|
|
|
|
|
|
|
|
|
|
|
ini[reponame]['enabled'] = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with open(repo.repofile + '.new', 'w') as fp:
|
|
|
|
|
|
|
|
fp.write(str(ini))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
os.rename(repo.repofile + '.new', repo.repofile)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print('ok')
|
|
|
|
print('ok')
|
|
|
|