You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
469 B
25 lines
469 B
#!/usr/bin/python3
|
|
|
|
# `ok` on stdout indicates success; any stderr output indicates an error
|
|
# (probably an exception)
|
|
|
|
import dnf
|
|
import os
|
|
import sys
|
|
|
|
os.umask(0o022)
|
|
|
|
base = dnf.Base()
|
|
|
|
base.read_all_repos()
|
|
|
|
reponame = sys.argv[1]
|
|
repo = base.repos[reponame]
|
|
|
|
base.conf.write_raw_configfile(repo.repofile,
|
|
repo.id,
|
|
base.conf.substitutions,
|
|
{'enabled': '1'})
|
|
|
|
print('ok')
|