2018-12-09 01:43:36 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
2018-12-31 23:04:15 +00:00
|
|
|
# `ok` on stdout indicates success; any stderr output indicates an error
|
|
|
|
# (probably an exception)
|
2018-12-09 01:43:36 +00:00
|
|
|
|
|
|
|
import dnf
|
2018-12-09 06:46:38 +00:00
|
|
|
import os
|
2018-12-09 01:43:36 +00:00
|
|
|
import sys
|
|
|
|
|
2018-12-09 07:03:17 +00:00
|
|
|
os.umask(0o022)
|
|
|
|
|
2018-12-09 01:43:36 +00:00
|
|
|
base = dnf.Base()
|
|
|
|
|
|
|
|
base.read_all_repos()
|
|
|
|
|
2018-12-09 07:09:46 +00:00
|
|
|
reponame = sys.argv[1]
|
2018-12-09 01:43:36 +00:00
|
|
|
repo = base.repos[reponame]
|
|
|
|
|
2019-08-28 14:40:13 +00:00
|
|
|
base.conf.write_raw_configfile(repo.repofile,
|
|
|
|
repo.id,
|
|
|
|
base.conf.substitutions,
|
|
|
|
{'enabled': '0'})
|
2018-12-31 23:04:15 +00:00
|
|
|
|
|
|
|
print('ok')
|