richardphibel / rpms / dnf

Forked from rpms/dnf 2 years ago
Clone
Blob Blame History Raw
From 5e8a1723a7c93f7f2a564d12a62b52d00d33c446 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Tue, 30 Oct 2018 12:53:07 +0100
Subject: [PATCH] Fix priority cachedir priority with --cacheonly

---
 dnf/cli/cli.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
index ff7d80d..17a31fc 100644
--- a/dnf/cli/cli.py
+++ b/dnf/cli/cli.py
@@ -811,7 +811,8 @@ class Cli(object):
         # Read up configuration options and initialize plugins
         try:
             if opts.cacheonly:
-                self.base.conf.cachedir = self.base.conf.system_cachedir
+                opt = self.base.conf._get_option("cachedir")
+                opt._set(self.base.conf.system_cachedir, dnf.conf.PRIO_COMMANDLINE)
                 self.demands.cacheonly = True
             self.base.conf._configure_from_options(opts)
             self._read_conf_file(opts.releasever)
--
libgit2 0.26.7