forked from rpms/dnf-plugins-core
import dnf-plugins-core-4.0.8-3.el8
This commit is contained in:
commit
8b33c47539
1
.dnf-plugins-core.metadata
Normal file
1
.dnf-plugins-core.metadata
Normal file
@ -0,0 +1 @@
|
||||
e189d7f2acca298cd42b2dc18345b42fadf5e2f4 SOURCES/dnf-plugins-core-4.0.8.tar.gz
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
SOURCES/dnf-plugins-core-4.0.8.tar.gz
|
13077
SOURCES/0001-Update-localizations-from-zanata-RhBug1689984.patch
Normal file
13077
SOURCES/0001-Update-localizations-from-zanata-RhBug1689984.patch
Normal file
File diff suppressed because it is too large
Load Diff
152
SOURCES/0002-Rename-dnf-utils-to-yum-utils-RhBug1722093.patch
Normal file
152
SOURCES/0002-Rename-dnf-utils-to-yum-utils-RhBug1722093.patch
Normal file
@ -0,0 +1,152 @@
|
||||
From 322125be1b32e9fedb2a9ea25e6e9af5f255e225 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
||||
Date: Wed, 26 Jun 2019 14:56:00 +0200
|
||||
Subject: [PATCH 1/2] [spec] Rename dnf-utils to yum-utils (RhBug:1722093)
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1722093
|
||||
---
|
||||
dnf-plugins-core.spec | 29 ++++++++++++++++++-----------
|
||||
1 file changed, 18 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dnf-plugins-core.spec b/dnf-plugins-core.spec
|
||||
index 154ee7f..be01cd2 100644
|
||||
--- a/dnf-plugins-core.spec
|
||||
+++ b/dnf-plugins-core.spec
|
||||
@@ -1,6 +1,7 @@
|
||||
%{?!dnf_lowest_compatible: %global dnf_lowest_compatible 4.2.1}
|
||||
%global dnf_plugins_extra 2.0.0
|
||||
%global hawkey_version 0.34.0
|
||||
+%global yum_utils_subpackage_name dnf-utils
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} <= 7
|
||||
%bcond_with python3
|
||||
@@ -15,15 +16,16 @@
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} > 7 || 0%{?fedora} > 30
|
||||
+%global yum_utils_subpackage_name yum-utils
|
||||
%bcond_without yumcompatibility
|
||||
%else
|
||||
%bcond_with yumcompatibility
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} <= 7
|
||||
-%bcond_with dnfutils
|
||||
+%bcond_with yumutils
|
||||
%else
|
||||
-%bcond_without dnfutils
|
||||
+%bcond_without yumutils
|
||||
%endif
|
||||
|
||||
Name: dnf-plugins-core
|
||||
@@ -161,12 +163,17 @@ repoclosure, repograph, repomanage, reposync, changelog and repodiff commands.
|
||||
Additionally provides generate_completion_cache passive plugin.
|
||||
%endif
|
||||
|
||||
-%if %{with dnfutils}
|
||||
-%package -n dnf-utils
|
||||
+%if %{with yumutils}
|
||||
+%package -n %{yum_utils_subpackage_name}
|
||||
+%if "%{yum_utils_subpackage_name}" == "dnf-utils"
|
||||
Conflicts: yum-utils < 1.1.31-513
|
||||
%if 0%{?rhel} != 7
|
||||
Provides: yum-utils = %{version}-%{release}
|
||||
%endif
|
||||
+%else
|
||||
+Provides: dnf-utils = %{version}-%{release}
|
||||
+Obsoletes: dnf-utils < %{version}-%{release}
|
||||
+%endif
|
||||
Requires: dnf >= %{dnf_lowest_compatible}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%if %{with python3}
|
||||
@@ -176,7 +183,7 @@ Requires: python2-dnf >= %{dnf_lowest_compatible}
|
||||
%endif
|
||||
Summary: Yum-utils CLI compatibility layer
|
||||
|
||||
-%description -n dnf-utils
|
||||
+%description -n %{yum_utils_subpackage_name}
|
||||
As a Yum-utils CLI compatibility layer, supplies in CLI shims for
|
||||
debuginfo-install, repograph, package-cleanup, repoclosure, repomanage,
|
||||
repoquery, reposync, repotrack, repodiff, builddep, config-manager, debug
|
||||
@@ -393,7 +400,7 @@ pushd build-py3
|
||||
popd
|
||||
%endif
|
||||
%find_lang %{name}
|
||||
-%if %{with dnfutils}
|
||||
+%if %{with yumutils}
|
||||
%if %{with python3}
|
||||
mv %{buildroot}%{_libexecdir}/dnf-utils-3 %{buildroot}%{_libexecdir}/dnf-utils
|
||||
%else
|
||||
@@ -402,7 +409,7 @@ popd
|
||||
%endif
|
||||
rm -vf %{buildroot}%{_libexecdir}/dnf-utils-*
|
||||
|
||||
-%if %{with dnfutils}
|
||||
+%if %{with yumutils}
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
ln -sf %{_libexecdir}/dnf-utils %{buildroot}%{_bindir}/debuginfo-install
|
||||
ln -sf %{_libexecdir}/dnf-utils %{buildroot}%{_bindir}/needs-restarting
|
||||
@@ -523,8 +530,8 @@ PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
|
||||
%{python3_sitelib}/dnfpluginscore/
|
||||
%endif
|
||||
|
||||
-%if %{with dnfutils}
|
||||
-%files -n dnf-utils
|
||||
+%if %{with yumutils}
|
||||
+%files -n %{yum_utils_subpackage_name}
|
||||
%{_libexecdir}/dnf-utils
|
||||
%{_bindir}/debuginfo-install
|
||||
%{_bindir}/needs-restarting
|
||||
@@ -556,13 +563,13 @@ PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
|
||||
%{_mandir}/man1/yumdownloader.*
|
||||
%{_mandir}/man1/package-cleanup.*
|
||||
%{_mandir}/man1/dnf-utils.*
|
||||
-# These are only built with dnfutils bcond.
|
||||
+# These are only built with yumutils bcond.
|
||||
%{_mandir}/man1/find-repos-of-install.*
|
||||
%{_mandir}/man1/repoquery.*
|
||||
%{_mandir}/man1/repotrack.*
|
||||
%{_mandir}/man1/yum-utils.*
|
||||
%else
|
||||
-# These are built regardless of dnfutils bcond so we need to exclude them.
|
||||
+# These are built regardless of yumutils bcond so we need to exclude them.
|
||||
%exclude %{_mandir}/man1/debuginfo-install.*
|
||||
%exclude %{_mandir}/man1/needs-restarting.*
|
||||
%exclude %{_mandir}/man1/repo-graph.*
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From a58ded1019343ea50cf40bd94ad6aaf69fa91a37 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
||||
Date: Thu, 27 Jun 2019 09:22:29 +0200
|
||||
Subject: [PATCH 2/2] [doc] Changed header in dnf-utils/yum-utils documentation
|
||||
(RhBug:1722093)
|
||||
|
||||
The documentation is mainly yum-utils description and package from
|
||||
Fedora 31 is going to be renamed to yum-utils, therefore the primary
|
||||
name in documentation should be yum-utils.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1722093
|
||||
---
|
||||
doc/dnf-utils.rst | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/doc/dnf-utils.rst b/doc/dnf-utils.rst
|
||||
index 02dfc1d..311e980 100644
|
||||
--- a/doc/dnf-utils.rst
|
||||
+++ b/doc/dnf-utils.rst
|
||||
@@ -1,8 +1,8 @@
|
||||
=========
|
||||
-DNF Utils
|
||||
+YUM Utils
|
||||
=========
|
||||
|
||||
-The main purpose of these shims is ensuring backward compatibility.
|
||||
+The main purpose of these shims is ensuring backward compatibility with yum-3.
|
||||
|
||||
--------------
|
||||
Shell Commands
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,121 @@
|
||||
From 5a3b3bf30c37ebdcf7f3e25d4eac7039acfe57c4 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Blaha <mblaha@redhat.com>
|
||||
Date: Fri, 31 May 2019 09:48:13 +0200
|
||||
Subject: [PATCH] [builddep] Report all rpm errors (RhBug:1663619,1658292,1724668)
|
||||
|
||||
Dnf uses rpm for parsing .spec and srpm files. Any parsing
|
||||
errors were not reported to the user, but swallowed by dnf.
|
||||
User was only informed that the spec file could not be parsed:
|
||||
|
||||
$ dnf builddep gdb.spec
|
||||
Failed to open: 'gdb.spec', not a valid spec file: can't parse specfile
|
||||
|
||||
This patch also prints messages from rpm error log to the user so he
|
||||
could better understand what the root cause of the problem is:
|
||||
|
||||
$ dnf builddep gdb.spec
|
||||
RPM: error: Unable to open /root/rpmbuild/SOURCES/_gdb.spec.Patch.include: No such file or directory
|
||||
Failed to open: 'gdb.spec', not a valid spec file: can't parse specfile
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1663619
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1658292
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1724668
|
||||
---
|
||||
dnf-plugins-core.spec | 2 +-
|
||||
plugins/builddep.py | 38 +++++++++-----------------------------
|
||||
2 files changed, 10 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/dnf-plugins-core.spec b/dnf-plugins-core.spec
|
||||
index be01cd2..b84477f 100644
|
||||
--- a/dnf-plugins-core.spec
|
||||
+++ b/dnf-plugins-core.spec
|
||||
@@ -1,4 +1,4 @@
|
||||
-%{?!dnf_lowest_compatible: %global dnf_lowest_compatible 4.2.1}
|
||||
+%{?!dnf_lowest_compatible: %global dnf_lowest_compatible 4.2.8}
|
||||
%global dnf_plugins_extra 2.0.0
|
||||
%global hawkey_version 0.34.0
|
||||
%global yum_utils_subpackage_name dnf-utils
|
||||
diff --git a/plugins/builddep.py b/plugins/builddep.py
|
||||
index bc3b257..0252d1f 100644
|
||||
--- a/plugins/builddep.py
|
||||
+++ b/plugins/builddep.py
|
||||
@@ -21,44 +21,18 @@
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
-from dnfpluginscore import _, logger, rpm_logger
|
||||
+from dnfpluginscore import _, logger
|
||||
|
||||
import argparse
|
||||
import dnf
|
||||
import dnf.cli
|
||||
import dnf.exceptions
|
||||
import dnf.rpm.transaction
|
||||
-import functools
|
||||
-import logging
|
||||
+import dnf.yum.rpmtrans
|
||||
import os
|
||||
import rpm
|
||||
|
||||
|
||||
-class redirect_rpm_logging(object):
|
||||
- def __init__(self):
|
||||
- self.sink = None
|
||||
-
|
||||
- def __call__(self, func):
|
||||
- @functools.wraps(func)
|
||||
- def inner(*args, **kwds):
|
||||
- with self:
|
||||
- return func(*args, **kwds)
|
||||
- return inner
|
||||
-
|
||||
- def __enter__(self):
|
||||
- for handler in rpm_logger.handlers:
|
||||
- if isinstance(handler, logging.FileHandler):
|
||||
- rpm.setLogFile(handler.stream)
|
||||
- break
|
||||
- else:
|
||||
- self.sink = open('/dev/null', 'w')
|
||||
- rpm.setLogFile(self.sink)
|
||||
-
|
||||
- def __exit__(self, exc_type, exc, exc_tb):
|
||||
- if self.sink:
|
||||
- self.sink.close()
|
||||
-
|
||||
-
|
||||
@dnf.plugin.register_command
|
||||
class BuildDepCommand(dnf.cli.Command):
|
||||
|
||||
@@ -91,6 +65,10 @@ class BuildDepCommand(dnf.cli.Command):
|
||||
ptype.add_argument('--srpm', action='store_true',
|
||||
help=_('treat commandline arguments as source rpm'))
|
||||
|
||||
+ def pre_configure(self):
|
||||
+ if not self.opts.rpmverbosity:
|
||||
+ self.opts.rpmverbosity = 'error'
|
||||
+
|
||||
def configure(self):
|
||||
demands = self.cli.demands
|
||||
demands.available_repos = True
|
||||
@@ -107,8 +85,8 @@ class BuildDepCommand(dnf.cli.Command):
|
||||
self.base.repos.enable_source_repos()
|
||||
break
|
||||
|
||||
- @redirect_rpm_logging()
|
||||
def run(self):
|
||||
+ rpmlog = dnf.yum.rpmtrans.RPMTransaction(self.base)
|
||||
# Push user-supplied macro definitions for spec parsing
|
||||
for macro in self.opts.define:
|
||||
rpm.addMacro(macro[0], macro[1])
|
||||
@@ -127,6 +105,8 @@ class BuildDepCommand(dnf.cli.Command):
|
||||
else:
|
||||
self._remote_deps(pkgspec)
|
||||
except dnf.exceptions.Error as e:
|
||||
+ for line in rpmlog.messages():
|
||||
+ logger.error(_("RPM: {}").format(line))
|
||||
logger.error(e)
|
||||
pkg_errors = True
|
||||
|
||||
--
|
||||
libgit2 0.28.2
|
||||
|
@ -0,0 +1,342 @@
|
||||
From e5a30424d51f9c20cd0ec6cd3e515ac5509a9287 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Rohel <jrohel@redhat.com>
|
||||
Date: Thu, 18 Jul 2019 09:50:43 +0200
|
||||
Subject: [PATCH 1/6] [config-manager] --setopt: Fix crash with "--save --dump"
|
||||
(RhBug:1702678)
|
||||
|
||||
Removes useless code which only causes crash.
|
||||
|
||||
Example of crash:
|
||||
dnf config-manager --save --dump --setopt=fedora.gpgcheck=1 fedora
|
||||
============================================================== repo: fedora ==============================================================
|
||||
Error: Error parsing '['1']': Wrong number or type of arguments for overloaded function 'OptionChildBool_set'.
|
||||
Possible C/C++ prototypes are:
|
||||
libdnf::OptionChild< libdnf::OptionBool >::set(libdnf::Option::Priority,libdnf::OptionBool::ValueType const &)
|
||||
libdnf::OptionChild< libdnf::OptionBool >::set(libdnf::Option::Priority,std::string const &)
|
||||
---
|
||||
plugins/config_manager.py | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/plugins/config_manager.py b/plugins/config_manager.py
|
||||
index 38fd51d..6db1bcb 100644
|
||||
--- a/plugins/config_manager.py
|
||||
+++ b/plugins/config_manager.py
|
||||
@@ -90,8 +90,6 @@ class ConfigManagerCommand(dnf.cli.Command):
|
||||
self.base.conf.write_raw_configfile(dnf.const.CONF_FILENAME, 'main', sbc.substitutions, modify)
|
||||
if self.opts.dump:
|
||||
print(self.base.output.fmtSection('main'))
|
||||
- for name, val in modify.items():
|
||||
- sbc._set_value(name, val)
|
||||
print(self.base.conf.dump())
|
||||
|
||||
if self.opts.set_enabled or self.opts.set_disabled:
|
||||
@@ -120,9 +118,6 @@ class ConfigManagerCommand(dnf.cli.Command):
|
||||
self.base.conf.write_raw_configfile(repo.repofile, repo.id, sbc.substitutions, repo_modify)
|
||||
if self.opts.dump:
|
||||
print(self.base.output.fmtSection('repo: ' + repo.id))
|
||||
- for name, val in repo_modify.items():
|
||||
- if repo._has_option(name):
|
||||
- repo._set_value(name, val)
|
||||
print(repo.dump())
|
||||
|
||||
def add_repo(self):
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From f096fe3e88884f8cc212bfcee5549bfc6b8a3ad0 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Rohel <jrohel@redhat.com>
|
||||
Date: Wed, 10 Jul 2019 09:21:37 +0200
|
||||
Subject: [PATCH 2/6] [config-manager] --setopt: Add globs support to repoid
|
||||
(RhBug:1702678)
|
||||
|
||||
Set key in all repositories whose id starts with "updates-testing":
|
||||
dnf config-manager --save --setopt=updates-testing*.skip_if_unavailable=true
|
||||
---
|
||||
plugins/config_manager.py | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/plugins/config_manager.py b/plugins/config_manager.py
|
||||
index 6db1bcb..dedcc82 100644
|
||||
--- a/plugins/config_manager.py
|
||||
+++ b/plugins/config_manager.py
|
||||
@@ -23,6 +23,7 @@ from dnfpluginscore import _, logger, P_
|
||||
import dnf
|
||||
import dnf.cli
|
||||
import dnf.pycomp
|
||||
+import fnmatch
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
@@ -111,9 +112,10 @@ class ConfigManagerCommand(dnf.cli.Command):
|
||||
repo_modify['enabled'] = "1"
|
||||
elif self.opts.set_disabled:
|
||||
repo_modify['enabled'] = "0"
|
||||
- if (hasattr(self.opts, 'repo_setopts')
|
||||
- and repo.id in self.opts.repo_setopts):
|
||||
- repo_modify.update(self.opts.repo_setopts[repo.id])
|
||||
+ if hasattr(self.opts, 'repo_setopts'):
|
||||
+ for repoid, setopts in self.opts.repo_setopts.items():
|
||||
+ if fnmatch.fnmatch(repo.id, repoid):
|
||||
+ repo_modify.update(setopts)
|
||||
if self.opts.save and repo_modify:
|
||||
self.base.conf.write_raw_configfile(repo.repofile, repo.id, sbc.substitutions, repo_modify)
|
||||
if self.opts.dump:
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From c2ef00188a7ec911a5efc36d3df0cceae5a682c1 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Rohel <jrohel@redhat.com>
|
||||
Date: Tue, 16 Jul 2019 13:32:39 +0200
|
||||
Subject: [PATCH 3/6] [config-manager] --setopt=key=value is not applied to
|
||||
repositories config (RhBug:1702678)
|
||||
|
||||
The command "dnf config-manager --setopt=key=value repo1 main" set key value
|
||||
in repo1 and global config before the patch. It was inconsistent with the rest
|
||||
of DNF because "--setopt=key=value" means to set key in global config only.
|
||||
To set key in repos we can use "--setopt=*.key=value".
|
||||
---
|
||||
plugins/config_manager.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugins/config_manager.py b/plugins/config_manager.py
|
||||
index dedcc82..1dcf085 100644
|
||||
--- a/plugins/config_manager.py
|
||||
+++ b/plugins/config_manager.py
|
||||
@@ -107,7 +107,7 @@ class ConfigManagerCommand(dnf.cli.Command):
|
||||
raise dnf.exceptions.Error(_("No matching repo to modify: %s.")
|
||||
% ', '.join(self.opts.crepo))
|
||||
for repo in sorted(matched):
|
||||
- repo_modify = dict(modify) # create local copy
|
||||
+ repo_modify = {}
|
||||
if self.opts.set_enabled:
|
||||
repo_modify['enabled'] = "1"
|
||||
elif self.opts.set_disabled:
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 3af60a1613877ad2fd090a83ba9da00623a00818 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Rohel <jrohel@redhat.com>
|
||||
Date: Tue, 16 Jul 2019 14:05:54 +0200
|
||||
Subject: [PATCH 4/6] [config-manager] --setopt and empty list of repositories
|
||||
(RhBug:1702678)
|
||||
|
||||
This:
|
||||
"dnf config-manager --save --setopts=repo1.key1=value1 --setopt=repo2.key2=value2 repo1 repo2"
|
||||
|
||||
can be replaced by this now:
|
||||
"dnf config-manager --save --setopts=repo1.key1=value1 --setopt=repo2.key2=value2"
|
||||
|
||||
Empty list of repositories allowed to change only the global configuration
|
||||
before. Now empty list of repositories means that setopt works
|
||||
for any repository too.
|
||||
|
||||
Better compatibility with YUM.
|
||||
It solves : https://bugzilla.redhat.com/show_bug.cgi?id=1702678
|
||||
---
|
||||
plugins/config_manager.py | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugins/config_manager.py b/plugins/config_manager.py
|
||||
index 1dcf085..41b36fa 100644
|
||||
--- a/plugins/config_manager.py
|
||||
+++ b/plugins/config_manager.py
|
||||
@@ -96,12 +96,16 @@ class ConfigManagerCommand(dnf.cli.Command):
|
||||
if self.opts.set_enabled or self.opts.set_disabled:
|
||||
self.opts.save = True
|
||||
|
||||
+ matched = []
|
||||
if self.opts.crepo:
|
||||
- matched = []
|
||||
for name in self.opts.crepo:
|
||||
matched.extend(self.base.repos.get_matching(name))
|
||||
else:
|
||||
- return
|
||||
+ if hasattr(self.opts, 'repo_setopts'):
|
||||
+ for name in self.opts.repo_setopts.keys():
|
||||
+ matched.extend(self.base.repos.get_matching(name))
|
||||
+ if not matched:
|
||||
+ return
|
||||
|
||||
if not matched:
|
||||
raise dnf.exceptions.Error(_("No matching repo to modify: %s.")
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 27205851a592a3383a7592d87ceee5b69c9dfb70 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Rohel <jrohel@redhat.com>
|
||||
Date: Tue, 16 Jul 2019 15:51:38 +0200
|
||||
Subject: [PATCH 5/6] [config-manager] --setopt: Add check for existence of
|
||||
input repositories (RhBug:1702678)
|
||||
|
||||
Examples:
|
||||
dnf config-manager --save --setopt=non_existent.key=value
|
||||
Error: No matching repo to modify: non_existent.
|
||||
|
||||
dnf config-manager --save --setopt=non_existent*.key=value
|
||||
Error: No matching repo to modify: non_existent*.
|
||||
|
||||
None change in configuration is done after the error.
|
||||
---
|
||||
plugins/config_manager.py | 44 ++++++++++++++++++++++++++-------------
|
||||
1 file changed, 29 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/plugins/config_manager.py b/plugins/config_manager.py
|
||||
index 41b36fa..83d58be 100644
|
||||
--- a/plugins/config_manager.py
|
||||
+++ b/plugins/config_manager.py
|
||||
@@ -78,6 +78,31 @@ class ConfigManagerCommand(dnf.cli.Command):
|
||||
def modify_repo(self):
|
||||
""" process --set-enabled, --set-disabled and --setopt options """
|
||||
|
||||
+ matching_repos = [] # list of matched repositories
|
||||
+ not_matching_repos_id = set() # IDs of not matched repositories
|
||||
+
|
||||
+ def match_repos(key, add_matching_repos):
|
||||
+ matching = self.base.repos.get_matching(key)
|
||||
+ if not matching:
|
||||
+ not_matching_repos_id.add(name)
|
||||
+ elif add_matching_repos:
|
||||
+ matching_repos.extend(matching)
|
||||
+
|
||||
+ if self.opts.crepo:
|
||||
+ for name in self.opts.crepo:
|
||||
+ match_repos(name, True)
|
||||
+ if hasattr(self.opts, 'repo_setopts'):
|
||||
+ for name in self.opts.repo_setopts.keys():
|
||||
+ match_repos(name, False)
|
||||
+ else:
|
||||
+ if hasattr(self.opts, 'repo_setopts'):
|
||||
+ for name in self.opts.repo_setopts.keys():
|
||||
+ match_repos(name, True)
|
||||
+
|
||||
+ if not_matching_repos_id:
|
||||
+ raise dnf.exceptions.Error(_("No matching repo to modify: %s.")
|
||||
+ % ', '.join(not_matching_repos_id))
|
||||
+
|
||||
sbc = self.base.conf
|
||||
modify = {}
|
||||
if hasattr(self.opts, 'main_setopts') and self.opts.main_setopts:
|
||||
@@ -93,24 +118,13 @@ class ConfigManagerCommand(dnf.cli.Command):
|
||||
print(self.base.output.fmtSection('main'))
|
||||
print(self.base.conf.dump())
|
||||
|
||||
+ if not matching_repos:
|
||||
+ return
|
||||
+
|
||||
if self.opts.set_enabled or self.opts.set_disabled:
|
||||
self.opts.save = True
|
||||
|
||||
- matched = []
|
||||
- if self.opts.crepo:
|
||||
- for name in self.opts.crepo:
|
||||
- matched.extend(self.base.repos.get_matching(name))
|
||||
- else:
|
||||
- if hasattr(self.opts, 'repo_setopts'):
|
||||
- for name in self.opts.repo_setopts.keys():
|
||||
- matched.extend(self.base.repos.get_matching(name))
|
||||
- if not matched:
|
||||
- return
|
||||
-
|
||||
- if not matched:
|
||||
- raise dnf.exceptions.Error(_("No matching repo to modify: %s.")
|
||||
- % ', '.join(self.opts.crepo))
|
||||
- for repo in sorted(matched):
|
||||
+ for repo in sorted(matching_repos):
|
||||
repo_modify = {}
|
||||
if self.opts.set_enabled:
|
||||
repo_modify['enabled'] = "1"
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From f7d1fa8e5f657b3cc8ed60acdeaa02f6b725312a Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Rohel <jrohel@redhat.com>
|
||||
Date: Thu, 18 Jul 2019 12:13:43 +0200
|
||||
Subject: [PATCH 6/6] [config-manager] Update documentation (RhBug:1702678)
|
||||
|
||||
---
|
||||
doc/config_manager.rst | 32 +++++++++++++++++++++-----------
|
||||
1 file changed, 21 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/doc/config_manager.rst b/doc/config_manager.rst
|
||||
index 2feafcb..80ee0fa 100644
|
||||
--- a/doc/config_manager.rst
|
||||
+++ b/doc/config_manager.rst
|
||||
@@ -19,22 +19,25 @@
|
||||
DNF config-manager Plugin
|
||||
==========================
|
||||
|
||||
-Manage main DNF configuration options, toggle which
|
||||
+Manage main and repository DNF configuration options, toggle which
|
||||
repositories are enabled or disabled, and add new repositories.
|
||||
|
||||
--------
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
-``dnf config-manager [options] <repoid>...``
|
||||
+``dnf config-manager [options] <section>...``
|
||||
|
||||
---------
|
||||
Arguments
|
||||
---------
|
||||
|
||||
-``<repoid>``
|
||||
- Display / modify a repository identified by <repoid>. If not specified, display / modify
|
||||
- main DNF configuration. Repositories can be specified using globs.
|
||||
+``<section>``
|
||||
+ This argument can be used to explicitly select the configuration sections to manage.
|
||||
+ A section can either be ``main`` or a repoid.
|
||||
+ If not specified, the program will select the ``main`` section and each repoid
|
||||
+ used within any ``--setopt`` options.
|
||||
+ A repoid can be specified using globs.
|
||||
|
||||
-------
|
||||
Options
|
||||
@@ -51,13 +54,17 @@ Options
|
||||
Print dump of current configuration values to stdout.
|
||||
|
||||
``--set-disabled``, ``--disable``
|
||||
- Disable the specified repos (automatically saves).
|
||||
+ Disable the specified repos (implies ``--save``).
|
||||
|
||||
``--set-enabled``, ``--enable``
|
||||
- Enable the specified repos (automatically saves).
|
||||
+ Enable the specified repos (implies ``--save``).
|
||||
|
||||
``--save``
|
||||
- Save the current options (useful with --setopt).
|
||||
+ Save the current options (useful with ``--setopt``).
|
||||
+
|
||||
+``--setopt=<option>=<value>``
|
||||
+ Set a configuration option. To set configuration options for repositories, use
|
||||
+ ``repoid.option`` for the ``<option>``. Globs are supported in repoid.
|
||||
|
||||
--------
|
||||
Examples
|
||||
@@ -71,12 +78,15 @@ Examples
|
||||
``dnf config-manager --dump``
|
||||
Display main DNF configuration.
|
||||
|
||||
-``dnf config-manager <repoid> --dump``
|
||||
- Display configuration of a repository identified by <repoid>.
|
||||
+``dnf config-manager --dump <section>``
|
||||
+ Display configuration of a repository identified by <section>.
|
||||
|
||||
``dnf config-manager --set-enabled <repoid>``
|
||||
Enable repository identified by <repoid> and make the change permanent.
|
||||
|
||||
-``dnf config-manager --setopt proxy=http://proxy.example.com:3128/ <repo1> <repo2> --save``
|
||||
+``dnf config-manager --save --setopt=*.proxy=http://proxy.example.com:3128/ <repo1> <repo2>``
|
||||
Update proxy setting in repositories with repoid <repo1> and <repo2> and make the change
|
||||
permanent.
|
||||
+
|
||||
+``dnf config-manager --save --setopt=*-debuginfo.gpgcheck=0``
|
||||
+ Update gpgcheck setting in all repositories whose id ends with -debuginfo and make the change permanent.
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,82 @@
|
||||
From 134d5405d024e6e313e24062ed92fa2a946e0287 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Domonkos <mdomonko@redhat.com>
|
||||
Date: Fri, 9 Aug 2019 17:34:58 +0200
|
||||
Subject: [PATCH] [spec] Generate yum-utils(1) instead of symlinking (RhBug:1676418)
|
||||
|
||||
This ensures that the man page actually says "yum-utils" instead of
|
||||
"dnf-utils" in the beginning.
|
||||
---
|
||||
dnf-plugins-core.spec | 12 ++++++------
|
||||
doc/CMakeLists.txt | 1 +
|
||||
doc/conf.py | 2 ++
|
||||
3 files changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dnf-plugins-core.spec b/dnf-plugins-core.spec
|
||||
index b84477f..a072438 100644
|
||||
--- a/dnf-plugins-core.spec
|
||||
+++ b/dnf-plugins-core.spec
|
||||
@@ -428,11 +428,10 @@ ln -sf %{_libexecdir}/dnf-utils %{buildroot}%{_bindir}/yum-debug-dump
|
||||
ln -sf %{_libexecdir}/dnf-utils %{buildroot}%{_bindir}/yum-debug-restore
|
||||
ln -sf %{_libexecdir}/dnf-utils %{buildroot}%{_bindir}/yumdownloader
|
||||
# These commands don't have a dedicated man page, so let's just point them to
|
||||
-# dnf-utils(1) which contains the descriptions.
|
||||
-ln -sf %{_mandir}/man1/dnf-utils.1.gz %{buildroot}%{_mandir}/man1/find-repos-of-install.1.gz
|
||||
-ln -sf %{_mandir}/man1/dnf-utils.1.gz %{buildroot}%{_mandir}/man1/repoquery.1.gz
|
||||
-ln -sf %{_mandir}/man1/dnf-utils.1.gz %{buildroot}%{_mandir}/man1/repotrack.1.gz
|
||||
-ln -sf %{_mandir}/man1/dnf-utils.1.gz %{buildroot}%{_mandir}/man1/yum-utils.1.gz
|
||||
+# to the utils page which contains their descriptions.
|
||||
+ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/man1/find-repos-of-install.1.gz
|
||||
+ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/man1/repoquery.1.gz
|
||||
+ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/man1/repotrack.1.gz
|
||||
%endif
|
||||
|
||||
%check
|
||||
@@ -563,11 +562,11 @@ PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
|
||||
%{_mandir}/man1/yumdownloader.*
|
||||
%{_mandir}/man1/package-cleanup.*
|
||||
%{_mandir}/man1/dnf-utils.*
|
||||
+%{_mandir}/man1/yum-utils.*
|
||||
# These are only built with yumutils bcond.
|
||||
%{_mandir}/man1/find-repos-of-install.*
|
||||
%{_mandir}/man1/repoquery.*
|
||||
%{_mandir}/man1/repotrack.*
|
||||
-%{_mandir}/man1/yum-utils.*
|
||||
%else
|
||||
# These are built regardless of yumutils bcond so we need to exclude them.
|
||||
%exclude %{_mandir}/man1/debuginfo-install.*
|
||||
@@ -584,6 +583,7 @@ PYTHONPATH=./plugins nosetests-%{python3_version} -s tests/
|
||||
%exclude %{_mandir}/man1/yumdownloader.*
|
||||
%exclude %{_mandir}/man1/package-cleanup.*
|
||||
%exclude %{_mandir}/man1/dnf-utils.*
|
||||
+%exclude %{_mandir}/man1/yum-utils.*
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} == 0
|
||||
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
|
||||
index b4ba2d5..b258c84 100644
|
||||
--- a/doc/CMakeLists.txt
|
||||
+++ b/doc/CMakeLists.txt
|
||||
@@ -60,6 +60,7 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/debuginfo-install.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/yumdownloader.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/package-cleanup.1
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dnf-utils.1
|
||||
+ ${CMAKE_CURRENT_BINARY_DIR}/yum-utils.1
|
||||
DESTINATION share/man/man1)
|
||||
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/yum-versionlock.conf.5
|
||||
diff --git a/doc/conf.py b/doc/conf.py
|
||||
index b4bbba5..fd6d28c 100644
|
||||
--- a/doc/conf.py
|
||||
+++ b/doc/conf.py
|
||||
@@ -293,6 +293,8 @@ man_pages = [
|
||||
'orphaned packages.', AUTHORS, 1),
|
||||
('dnf-utils', 'dnf-utils', u'classic YUM utilities implemented as CLI shims on top of DNF',
|
||||
AUTHORS, 1),
|
||||
+ ('dnf-utils', 'yum-utils', u'classic YUM utilities implemented as CLI shims on top of DNF',
|
||||
+ AUTHORS, 1),
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
--
|
||||
libgit2 0.28.2
|
||||
|
1390
SPECS/dnf-plugins-core.spec
Normal file
1390
SPECS/dnf-plugins-core.spec
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user