Skip to content
Snippets Groups Projects
Commit fb40b1b3 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Prefer dnf to yum, make metadata checks after 60 s

parent 8f1ec906
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,8 @@ def conf(path):
"tolerant=1",
"exactarch=1",
"obsoletes=1",
"installonly_limit=8" ]
"installonly_limit=8",
"metadata_expire=60" ]
dir = yumdir(path)
for m in mio.filecache.expand_mirror(dir):
......@@ -85,18 +86,26 @@ def run(path, rpm, exclude):
else:
verb = mio.log.verbosity - 2
# Use dnf in preference of yum
if os.access('/usr/bin/dnf', os.X_OK):
CMD = '/usr/bin/dnf'
else:
CMD = '/usr/bin/yum'
# Do an update of already installed packages, this has
# to be done before the install, because outdated packages
# need to be updated before the install, or we might get
# a conflict.
exclude_arg = map(lambda s: "-x %s" % s, exclude)
update = "yum -c %s -e %s -d %s -y update %s" % (f.name, verb, verb,
" ".join(exclude_arg))
update = "%s -c %s -e %s -d %s -y update %s" % (
CMD, f.name, verb, verb, "".join(exclude_arg))
mio.log.log(NORMAL, update)
result = mio.daemon_cage.system(update)
# Install new packages
install = "yum -c %s -e %s -d %s -y install" % (f.name, verb, verb)
install = "%s -c %s -e %s -d %s -y install" % (
CMD, f.name, verb, verb)
i = 0
for p in rpm:
i += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment