Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Igor Gnatenko | c9001487b1 | |
Igor Gnatenko | 034c1c79ea | |
Igor Gnatenko | 7162e1c455 | |
Igor Gnatenko | 171a7916b4 | |
Igor Gnatenko | 91179be3a9 |
|
@ -87,3 +87,4 @@
|
|||
/dnf-1.1.7.tar.gz
|
||||
/dnf-1.1.8.tar.gz
|
||||
/dnf-1.1.9.tar.gz
|
||||
/dnf-1.1.10-1.tar.gz
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
From fba7ae2890ddc725fdad3fd092278e36dd029a83 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Studenik <pstudeni@redhat.com>
|
||||
Date: Fri, 2 Dec 2016 14:59:39 +0100
|
||||
Subject: [PATCH] 'SpacewalkRepo' object has no attribute 'repofile'
|
||||
(RhBug:1395737)
|
||||
|
||||
---
|
||||
dnf/repo.py | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dnf/repo.py b/dnf/repo.py
|
||||
index 5956206..ed9af43 100644
|
||||
--- a/dnf/repo.py
|
||||
+++ b/dnf/repo.py
|
||||
@@ -467,6 +467,7 @@ class Repo(dnf.yum.config.RepoConf):
|
||||
self.name = self.id
|
||||
self.key_import = _NullKeyImport()
|
||||
self.metadata = None # :api
|
||||
+ self.repofile = None # :api
|
||||
self.sync_strategy = self.DEFAULT_SYNC
|
||||
self.substitutions = dnf.conf.substitutions.Substitutions()
|
||||
self.max_mirror_tries = 0 # try them all
|
||||
--
|
||||
2.10.2
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
From 4838eeb486df7bce075da97ea1233935b6688a2e Mon Sep 17 00:00:00 2001
|
||||
From: Jan Silhan <jsilhan@redhat.com>
|
||||
Date: Mon, 13 Jun 2016 23:05:44 +0200
|
||||
Subject: [PATCH] subject: prefer obsoletes (RhBug:1096506)(RhBug:1332830)
|
||||
|
||||
DNF makes better selection of packages considering obsoletes from
|
||||
'pkg_spec' input when `multilib_policy` is set to `best`
|
||||
(by Subject.set_best_selector()). Moreover the selection of packages
|
||||
is evaluated during resolution so when the obsoleting package has
|
||||
broken dependencies the next best choose is picked (RhBug:1096506)
|
||||
|
||||
Subject.get_best_selector searches by provides first (RhBug:1332830)
|
||||
while prioritizing obsoletes and then packages with the same name as a
|
||||
provide.
|
||||
|
||||
Closes: #609
|
||||
Approved by: j-mracek
|
||||
---
|
||||
dnf/subject.py | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dnf/subject.py b/dnf/subject.py
|
||||
index ea7a0e57..a1b3fbf4 100644
|
||||
--- a/dnf/subject.py
|
||||
+++ b/dnf/subject.py
|
||||
@@ -123,9 +123,14 @@ class Subject(object):
|
||||
nevra = first(self.subj.nevra_possibilities_real(sack, **kwargs))
|
||||
if nevra:
|
||||
sltr = dnf.selector.Selector(sack)
|
||||
- s = self._nevra_to_selector(sltr, nevra)
|
||||
- if len(s.matches()) > 0:
|
||||
- return s
|
||||
+ if nevra._has_just_name():
|
||||
+ s = sltr.set(provides=nevra.name)
|
||||
+ if len(s.matches()) > 0:
|
||||
+ return s
|
||||
+ else:
|
||||
+ s = self._nevra_to_selector(sltr, nevra)
|
||||
+ if len(s.matches()) > 0:
|
||||
+ return s
|
||||
|
||||
reldep = first(self.subj.reldep_possibilities_real(sack))
|
||||
if reldep:
|
||||
--
|
||||
2.11.0
|
||||
|
|
@ -1,179 +0,0 @@
|
|||
From 8e9d4b5d27982da1c09ff81c3c8bc93349e968cd Mon Sep 17 00:00:00 2001
|
||||
From: Michal Luscon <mluscon@redhat.com>
|
||||
Date: Tue, 24 May 2016 16:30:20 +0200
|
||||
Subject: [PATCH 3/3] Revert "group: treat mandatory pkgs as mandatory if
|
||||
strict=true" (RhBug:1337731)
|
||||
|
||||
This reverts commit f0f6488e86e39b574c7d552d8a6c1aa6d09c5852.
|
||||
---
|
||||
dnf/base.py | 4 +---
|
||||
dnf/cli/commands/group.py | 10 +---------
|
||||
dnf/persistor.py | 3 ---
|
||||
tests/repos/main_comps.xml | 8 --------
|
||||
tests/support.py | 2 +-
|
||||
tests/test_comps.py | 6 +++---
|
||||
tests/test_groups.py | 23 +----------------------
|
||||
7 files changed, 7 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/dnf/base.py b/dnf/base.py
|
||||
index 7943c8a..7bb3a26 100644
|
||||
--- a/dnf/base.py
|
||||
+++ b/dnf/base.py
|
||||
@@ -1208,14 +1208,12 @@ class Base(object):
|
||||
for it in attr:
|
||||
if not self.sack.query().filter(name=it):
|
||||
# a comps item that doesn't refer to anything real
|
||||
- if (attr == trans.install):
|
||||
- self._group_persistor._rollback()
|
||||
- raise dnf.exceptions.MarkingError(it)
|
||||
continue
|
||||
sltr = dnf.selector.Selector(self.sack)
|
||||
sltr.set(name=it)
|
||||
fn(select=sltr)
|
||||
cnt += 1
|
||||
+
|
||||
self._goal.group_members.update(trans.install)
|
||||
self._goal.group_members.update(trans.install_opt)
|
||||
return cnt
|
||||
diff --git a/dnf/cli/commands/group.py b/dnf/cli/commands/group.py
|
||||
index d28f84c..510c539 100644
|
||||
--- a/dnf/cli/commands/group.py
|
||||
+++ b/dnf/cli/commands/group.py
|
||||
@@ -404,15 +404,7 @@ class GroupCommand(commands.Command):
|
||||
if cmd == 'install':
|
||||
types, patterns = self._split_extcmds(extcmds)
|
||||
self._remark = True
|
||||
- try:
|
||||
- return self.base.env_group_install(patterns, types,
|
||||
- self.base.conf.strict)
|
||||
- except dnf.exceptions.MarkingError as e:
|
||||
- msg = _('No package %s%s%s available.')
|
||||
- logger.info(msg, self.base.output.term.MODE['bold'], e,
|
||||
- self.base.output.term.MODE['normal'])
|
||||
- raise dnf.exceptions.PackagesNotAvailableError(
|
||||
- _("Unable to find a mandatory group package."))
|
||||
+ return self.base.env_group_install(patterns, types)
|
||||
if cmd == 'upgrade':
|
||||
return self.base.env_group_upgrade(extcmds)
|
||||
if cmd == 'remove':
|
||||
diff --git a/dnf/persistor.py b/dnf/persistor.py
|
||||
index 367343c..5d54895 100644
|
||||
--- a/dnf/persistor.py
|
||||
+++ b/dnf/persistor.py
|
||||
@@ -356,9 +356,6 @@ class GroupPersistor(object):
|
||||
for id_ in del_list:
|
||||
del members_dct[id_]
|
||||
|
||||
- def _rollback(self):
|
||||
- self.db = self._original.clone()
|
||||
-
|
||||
def commit(self):
|
||||
self._commit = True
|
||||
|
||||
diff --git a/tests/repos/main_comps.xml b/tests/repos/main_comps.xml
|
||||
index 3cf8faa..67fc6c7 100644
|
||||
--- a/tests/repos/main_comps.xml
|
||||
+++ b/tests/repos/main_comps.xml
|
||||
@@ -39,14 +39,6 @@
|
||||
<packagereq>lotus</packagereq>
|
||||
</packagelist>
|
||||
</group>
|
||||
- <group>
|
||||
- <id>broken-group</id>
|
||||
- <name>Broken Group</name>
|
||||
- <packagelist>
|
||||
- <packagereq type="mandatory">meaning-of-life</packagereq>
|
||||
- <packagereq>lotus</packagereq>
|
||||
- </packagelist>
|
||||
- </group>
|
||||
<category>
|
||||
<id>base-system</id>
|
||||
<display_order>99</display_order>
|
||||
diff --git a/tests/support.py b/tests/support.py
|
||||
index 584e7fe..275549c 100644
|
||||
--- a/tests/support.py
|
||||
+++ b/tests/support.py
|
||||
@@ -82,7 +82,7 @@ SYSTEM_NSOLVABLES = TOTAL_RPMDB_COUNT
|
||||
MAIN_NSOLVABLES = 9
|
||||
UPDATES_NSOLVABLES = 4
|
||||
AVAILABLE_NSOLVABLES = MAIN_NSOLVABLES + UPDATES_NSOLVABLES
|
||||
-TOTAL_GROUPS = 4
|
||||
+TOTAL_GROUPS = 3
|
||||
TOTAL_NSOLVABLES = SYSTEM_NSOLVABLES + AVAILABLE_NSOLVABLES
|
||||
|
||||
# testing infrastructure
|
||||
diff --git a/tests/test_comps.py b/tests/test_comps.py
|
||||
index 576e801..07a65ab 100644
|
||||
--- a/tests/test_comps.py
|
||||
+++ b/tests/test_comps.py
|
||||
@@ -100,7 +100,7 @@ class CompsTest(support.TestCase):
|
||||
def test_iteration(self):
|
||||
comps = self.comps
|
||||
self.assertEqual([g.name for g in comps.groups_iter()],
|
||||
- ['Base', 'Solid Ground', "Pepper's", "Broken Group"])
|
||||
+ ['Base', 'Solid Ground', "Pepper's"])
|
||||
self.assertEqual([c.name for c in comps.categories_iter()],
|
||||
['Base System'])
|
||||
g = dnf.util.first(comps.groups_iter())
|
||||
@@ -108,7 +108,7 @@ class CompsTest(support.TestCase):
|
||||
|
||||
def test_group_display_order(self):
|
||||
self.assertEqual([g.name for g in self.comps.groups],
|
||||
- ["Pepper's", 'Base', 'Solid Ground', 'Broken Group'])
|
||||
+ ["Pepper's", 'Base', 'Solid Ground'])
|
||||
|
||||
def test_packages(self):
|
||||
comps = self.comps
|
||||
@@ -120,7 +120,7 @@ class CompsTest(support.TestCase):
|
||||
|
||||
def test_size(self):
|
||||
comps = self.comps
|
||||
- self.assertLength(comps, 6)
|
||||
+ self.assertLength(comps, 5)
|
||||
self.assertLength(comps.groups, support.TOTAL_GROUPS)
|
||||
self.assertLength(comps.categories, 1)
|
||||
self.assertLength(comps.environments, 1)
|
||||
diff --git a/tests/test_groups.py b/tests/test_groups.py
|
||||
index 1986c0d..83f66d8 100644
|
||||
--- a/tests/test_groups.py
|
||||
+++ b/tests/test_groups.py
|
||||
@@ -68,7 +68,7 @@ class EmptyPersistorTest(support.ResultTestCase):
|
||||
self.assertEmpty(removed)
|
||||
|
||||
trans = dnf.comps.TransactionBunch()
|
||||
- trans.install_opt.add('waltz')
|
||||
+ trans.install.add('waltz')
|
||||
self.assertEqual(self.base._add_comps_trans(trans), 0)
|
||||
|
||||
|
||||
@@ -121,27 +121,6 @@ class PresetPersistorTest(support.ResultTestCase):
|
||||
self.assertEmpty(removed)
|
||||
self.assertTrue(p_grp.installed)
|
||||
|
||||
- def test_group_install_broken(self):
|
||||
- prst = self.base._group_persistor
|
||||
- grp = self.base.comps.group_by_pattern('Broken Group')
|
||||
- p_grp = prst.group('broken-group')
|
||||
- self.assertFalse(p_grp.installed)
|
||||
-
|
||||
- self.assertRaises(dnf.exceptions.MarkingError,
|
||||
- self.base.group_install, grp.id,
|
||||
- ('mandatory', 'default'))
|
||||
- p_grp = prst.group('broken-group')
|
||||
- self.assertFalse(p_grp.installed)
|
||||
-
|
||||
- self.assertEquals(self.base.group_install(grp.id,
|
||||
- ('mandatory', 'default'),
|
||||
- strict=False), 1)
|
||||
- inst, removed = self.installed_removed(self.base)
|
||||
- self.assertLength(inst, 1)
|
||||
- self.assertEmpty(removed)
|
||||
- p_grp = prst.group('broken-group')
|
||||
- self.assertTrue(p_grp.installed)
|
||||
-
|
||||
def test_group_remove(self):
|
||||
prst = self.base._group_persistor
|
||||
grp_ids = prst.groups_by_pattern('somerset')
|
||||
--
|
||||
2.7.4
|
||||
|
39
dnf.spec
39
dnf.spec
|
@ -1,4 +1,4 @@
|
|||
%global hawkey_version 0.6.1
|
||||
%global hawkey_version 0.6.3-6.1
|
||||
%global librepo_version 1.7.16
|
||||
%global libcomps_version 0.1.6
|
||||
%global rpm_version 4.12.0
|
||||
|
@ -22,16 +22,17 @@
|
|||
%global _docdir_fmt %{name}
|
||||
|
||||
Name: dnf
|
||||
Version: 1.1.9
|
||||
Release: 2%{?dist}
|
||||
Version: 1.1.10
|
||||
Release: 4%{?dist}
|
||||
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
|
||||
# For a breakdown of the licensing, see PACKAGE-LICENSING
|
||||
License: GPLv2+ and GPLv2 and GPL
|
||||
URL: https://github.com/rpm-software-management/dnf
|
||||
Source0: %{url}/archive/%{name}-%{version}/%{name}-%{version}.tar.gz
|
||||
Patch0: enforce-api-reflect-changes-from-992475-in-completio.patch
|
||||
Patch1: enforce-api-add-compatibility-methods-for-renamed-co.patch
|
||||
Patch2: Revert-group-treat-mandatory-pkgs-as-mandatory-if-st.patch
|
||||
Source0: %{url}/archive/%{name}-%{version}-1.tar.gz
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1401041
|
||||
# https://github.com/rpm-software-management/dnf/commit/fba7ae2890ddc725fdad3fd092278e36dd029a83
|
||||
Patch0001: 0001-SpacewalkRepo-object-has-no-attribute-repofile-RhBug.patch
|
||||
Patch0002: 0001-subject-prefer-obsoletes-RhBug-1096506-RhBug-1332830.patch
|
||||
BuildArch: noarch
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gettext
|
||||
|
@ -96,7 +97,11 @@ BuildRequires: python-iniparse
|
|||
BuildRequires: python-libcomps >= %{libcomps_version}
|
||||
BuildRequires: python-librepo >= %{librepo_version}
|
||||
BuildRequires: python-nose
|
||||
%if 0%{?rhel} && 0%{?rhel} <= 7
|
||||
BuildRequires: pygpgme
|
||||
%else
|
||||
BuildRequires: python2-pygpgme
|
||||
%endif
|
||||
BuildRequires: pyliblzma
|
||||
BuildRequires: rpm-python >= %{rpm_version}
|
||||
Recommends: bash-completion
|
||||
|
@ -107,10 +112,13 @@ Requires: python-hawkey >= %{hawkey_version}
|
|||
Requires: python-iniparse
|
||||
Requires: python-libcomps >= %{libcomps_version}
|
||||
Requires: python-librepo >= %{librepo_version}
|
||||
%if 0%{?rhel} && 0%{?rhel} <= 7
|
||||
Requires: pygpgme
|
||||
%else
|
||||
Requires: python2-pygpgme
|
||||
%endif
|
||||
Requires: rpm-plugin-systemd-inhibit
|
||||
Requires: rpm-python >= %{rpm_version}
|
||||
Obsoletes: %{name} <= 0.6.4
|
||||
|
||||
%description -n python2-%{name}
|
||||
Python 2 interface to DNF.
|
||||
|
@ -137,7 +145,6 @@ Requires: python3-librepo >= %{librepo_version}
|
|||
Requires: python3-pygpgme
|
||||
Requires: rpm-plugin-systemd-inhibit
|
||||
Requires: rpm-python3 >= %{rpm_version}
|
||||
Obsoletes: %{name} <= 0.6.4
|
||||
|
||||
%description -n python3-%{name}
|
||||
Python 3 interface to DNF.
|
||||
|
@ -155,7 +162,7 @@ Requires(postun): systemd
|
|||
Alternative CLI to "dnf upgrade" suitable for automatic, regular execution.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
%autosetup -n %{name}-%{name}-%{version}-1 -p1
|
||||
mkdir build
|
||||
%if %{with python3}
|
||||
mkdir build-py3
|
||||
|
@ -312,6 +319,18 @@ exit 0
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
* Sun Jan 22 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.1.10-4
|
||||
- Fix min version for hawkey (RHBZ #1415441)
|
||||
|
||||
* Tue Jan 17 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.1.10-3
|
||||
- Prefer obsoletes (RHBZ #1096506)
|
||||
|
||||
* Fri Dec 02 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.1.10-2
|
||||
- Backport upstream fix for dnf.Repo.repofile
|
||||
|
||||
* Thu Aug 18 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.1.10-1
|
||||
- Update to 1.1.10
|
||||
|
||||
* Tue May 24 2016 Michal Luscon <mluscon@redhat.com> 1.1.9-2
|
||||
- Revert "group: treat mandatory pkgs as mandatory if strict=true" (RhBug:1337731)
|
||||
- enforce-api: reflect changes from #992475 in completion_helper (RhBug:1338504)
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
From 176a81e357b8e169008c831963c3b487b3bac40a Mon Sep 17 00:00:00 2001
|
||||
From: Michal Luscon <mluscon@redhat.com>
|
||||
Date: Tue, 24 May 2016 16:05:54 +0200
|
||||
Subject: [PATCH 1/3] enforce-api: add compatibility methods for renamed
|
||||
counterparts (RhBug:1338564)
|
||||
|
||||
---
|
||||
dnf/base.py | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/dnf/base.py b/dnf/base.py
|
||||
index b2648f6..7943c8a 100644
|
||||
--- a/dnf/base.py
|
||||
+++ b/dnf/base.py
|
||||
@@ -925,6 +925,10 @@ class Base(object):
|
||||
self._add_tempfiles([path])
|
||||
return self.sack.add_cmdline_package(path)
|
||||
|
||||
+ def _sigCheckPkg(self, po):
|
||||
+ # :compat method
|
||||
+ self._sig_check_pkg(po)
|
||||
+
|
||||
def _sig_check_pkg(self, po):
|
||||
"""Verify the GPG signature of the given package object.
|
||||
|
||||
@@ -997,6 +1001,11 @@ class Base(object):
|
||||
logger.log(dnf.logging.DDEBUG,
|
||||
_('%s removed'), fn)
|
||||
|
||||
+ def _doPackageLists(self, pkgnarrow='all', patterns=None, showdups=None,
|
||||
+ ignore_case=False, reponame=None):
|
||||
+ # :compat method
|
||||
+ self._do_package_lists(pkgnarrow, patterns, showdups, ignore_case, reponame)
|
||||
+
|
||||
def _do_package_lists(self, pkgnarrow='all', patterns=None, showdups=None,
|
||||
ignore_case=False, reponame=None):
|
||||
"""Return a :class:`misc.GenericHolder` containing
|
||||
@@ -1802,6 +1811,10 @@ class Base(object):
|
||||
else:
|
||||
assert False
|
||||
|
||||
+ def _getKeyForPackage(self, po, askcb=None, fullaskcb=None):
|
||||
+ # :compat method
|
||||
+ self._get_key_for_package(po, askcb, fullaskcb)
|
||||
+
|
||||
def _get_key_for_package(self, po, askcb=None, fullaskcb=None):
|
||||
"""Retrieve a key for a package. If needed, use the given
|
||||
callback to prompt whether the key should be imported.
|
||||
--
|
||||
2.7.4
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
From b3b58ff94900f8b989c80b49fd2afec0fa502538 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Luscon <mluscon@redhat.com>
|
||||
Date: Tue, 24 May 2016 16:08:50 +0200
|
||||
Subject: [PATCH 2/3] enforce-api: reflect changes from #992475 in
|
||||
completion_helper (RhBug:1338504)
|
||||
|
||||
---
|
||||
dnf/cli/completion_helper.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dnf/cli/completion_helper.py b/dnf/cli/completion_helper.py
|
||||
index 2ca0360..26b575e 100644
|
||||
--- a/dnf/cli/completion_helper.py
|
||||
+++ b/dnf/cli/completion_helper.py
|
||||
@@ -169,8 +169,8 @@ def main(args):
|
||||
base = dnf.cli.cli.BaseCli()
|
||||
cli = dnf.cli.Cli(base)
|
||||
if args[0] == "_cmds":
|
||||
- base.plugins.load(base.conf.pluginpath, [])
|
||||
- base.plugins.run_init(base, cli)
|
||||
+ base._plugins.load(base.conf.pluginpath, [])
|
||||
+ base._plugins.run_init(base, cli)
|
||||
print("\n".join(filter_list_by_kw(args[1], cli.cli_commands)))
|
||||
return
|
||||
cli.cli_commands.clear()
|
||||
--
|
||||
2.7.4
|
||||
|
Loading…
Reference in New Issue