From f74fd6dbcc664b4f902e5c88cee835f9877dde45 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 21 Jun 2017 15:58:20 +0300 Subject: dnf: update to 2.5.1 Drop 0001-Revert-proper-check-of-releasever-when-using-install.patch as the problem has been solved upstream. Add 0001-Move-releasever-check-after-the-etc-dnf-vars-substit.patch, as the warning for missing releasever is issued prematurely in our case. (From OE-Core rev: 68b01f9fe239aa224daa8dc901fa3cf0350261c0) Signed-off-by: Alexander Kanavin Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- ...ever-check-after-the-etc-dnf-vars-substit.patch | 37 ++++++++ ...er-check-of-releasever-when-using-install.patch | 105 --------------------- 2 files changed, 37 insertions(+), 105 deletions(-) create mode 100644 meta/recipes-devtools/dnf/dnf/0001-Move-releasever-check-after-the-etc-dnf-vars-substit.patch delete mode 100644 meta/recipes-devtools/dnf/dnf/0001-Revert-proper-check-of-releasever-when-using-install.patch (limited to 'meta/recipes-devtools/dnf/dnf') diff --git a/meta/recipes-devtools/dnf/dnf/0001-Move-releasever-check-after-the-etc-dnf-vars-substit.patch b/meta/recipes-devtools/dnf/dnf/0001-Move-releasever-check-after-the-etc-dnf-vars-substit.patch new file mode 100644 index 0000000000..0226d4fdec --- /dev/null +++ b/meta/recipes-devtools/dnf/dnf/0001-Move-releasever-check-after-the-etc-dnf-vars-substit.patch @@ -0,0 +1,37 @@ +From 3d0cdd8af1b415712eeb00e377c307001684ad06 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Wed, 21 Jun 2017 15:35:20 +0300 +Subject: [PATCH] Move releasever check after the etc/dnf/vars substitutions. + +The substitutions may actually set the releasever correctly, +and so the check is premature. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin +--- + dnf/cli/cli.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py +index c53c2a52..f9f2c13a 100644 +--- a/dnf/cli/cli.py ++++ b/dnf/cli/cli.py +@@ -882,12 +882,12 @@ class Cli(object): + releasever = dnf.rpm.detect_releasever(conf.installroot) + elif releasever == '/': + releasever = dnf.rpm.detect_releasever(releasever) +- if releasever is None: +- logger.warning(_("Unable to detect release version (use '--releasever' to specify " +- "release version)")) + conf.releasever = releasever + subst = conf.substitutions + subst.update_from_etc(conf.installroot) ++ if releasever is None: ++ logger.warning(_("Unable to detect release version (use '--releasever' to specify " ++ "release version)")) + + for opt in ('cachedir', 'logdir', 'persistdir'): + conf.prepend_installroot(opt) +-- +2.11.0 + diff --git a/meta/recipes-devtools/dnf/dnf/0001-Revert-proper-check-of-releasever-when-using-install.patch b/meta/recipes-devtools/dnf/dnf/0001-Revert-proper-check-of-releasever-when-using-install.patch deleted file mode 100644 index 879ecfa30d..0000000000 --- a/meta/recipes-devtools/dnf/dnf/0001-Revert-proper-check-of-releasever-when-using-install.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 8cd0503612573c455f34db74cd1c2216ed25b69c Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Wed, 12 Apr 2017 15:42:06 +0300 -Subject: [PATCH] Revert "proper check of releasever, when using installroot - (RhBug:1417542)" - -This reverts commit 3ddf684b7c67a2b384aa99dde53d8a43218f2e68, as it's causing -breakage when installing packages into a pristin rootfs. Upstream has been notified: -https://bugzilla.redhat.com/show_bug.cgi?id=1441636 - -Upstream-Status: Inappropriate [pending proper fix] -Signed-off-by: Alex Kanavin ---- - dnf/rpm/__init__.py | 59 +++++++++++++++++++++++++---------------------------- - doc/command_ref.rst | 3 +-- - 2 files changed, 29 insertions(+), 33 deletions(-) - -diff --git a/dnf/rpm/__init__.py b/dnf/rpm/__init__.py -index 5976acd6..1d50e6a0 100644 ---- a/dnf/rpm/__init__.py -+++ b/dnf/rpm/__init__.py -@@ -30,38 +30,35 @@ def detect_releasever(installroot): - # :api - """Calculate the release version for the system.""" - -- # if installroot is empty dir releasever is None, -- # that's why releasever is checked from '/' -- for root in [installroot, "/"]: -- ts = transaction.initReadOnlyTransaction(root=root) -- ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES | rpm._RPMVSF_NODIGESTS)) -- for distroverpkg in dnf.const.DISTROVERPKG: -- try: -- idx = ts.dbMatch('provides', distroverpkg) -- except (TypeError, rpm.error) as e: -- raise dnf.exceptions.Error('Error: %s' % str(e)) -- if not len(idx): -- continue -- try: -- hdr = next(idx) -- except StopIteration: -- msg = 'Error: rpmdb failed to list provides. Try: rpm --rebuilddb' -- raise dnf.exceptions.Error(msg) -- releasever = hdr['version'] -- try: -- off = hdr[rpm.RPMTAG_PROVIDENAME].index(distroverpkg) -- flag = hdr[rpm.RPMTAG_PROVIDEFLAGS][off] -- ver = hdr[rpm.RPMTAG_PROVIDEVERSION][off] -- if flag == rpm.RPMSENSE_EQUAL and ver: -- if hdr['name'] != distroverpkg: -- # override the package version -- releasever = ver -- except (ValueError, KeyError, IndexError): -- pass -+ ts = transaction.initReadOnlyTransaction(root=installroot) -+ ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES | rpm._RPMVSF_NODIGESTS)) -+ for distroverpkg in dnf.const.DISTROVERPKG: -+ try: -+ idx = ts.dbMatch('provides', distroverpkg) -+ except (TypeError, rpm.error) as e: -+ raise dnf.exceptions.Error('Error: %s' % str(e)) -+ if not len(idx): -+ continue -+ try: -+ hdr = next(idx) -+ except StopIteration: -+ msg = 'Error: rpmdb failed to list provides. Try: rpm --rebuilddb' -+ raise dnf.exceptions.Error(msg) -+ releasever = hdr['version'] -+ try: -+ off = hdr[rpm.RPMTAG_PROVIDENAME].index(distroverpkg) -+ flag = hdr[rpm.RPMTAG_PROVIDEFLAGS][off] -+ ver = hdr[rpm.RPMTAG_PROVIDEVERSION][off] -+ if flag == rpm.RPMSENSE_EQUAL and ver: -+ if hdr['name'] != distroverpkg: -+ # override the package version -+ releasever = ver -+ except (ValueError, KeyError, IndexError): -+ pass - -- if is_py3bytes(releasever): -- releasever = str(releasever, "utf-8") -- return releasever -+ if is_py3bytes(releasever): -+ releasever = str(releasever, "utf-8") -+ return releasever - return None - - -diff --git a/doc/command_ref.rst b/doc/command_ref.rst -index 77e885ab..3dd451b5 100644 ---- a/doc/command_ref.rst -+++ b/doc/command_ref.rst -@@ -205,8 +205,7 @@ Options - Note: You may also want to use the command-line option - ``--releasever=`` when creating the installroot otherwise the - *$releasever* value is taken from the rpmdb within the installroot (and thus -- it is empty at time of creation and *$releasever* is taken from rpmdb using -- installroot=/). -+ it is empty at time of creation, the transaction will fail). - The new installroot path at time of creation do not contain *repository*, - *releasever*, and *dnf.conf* file. - --- -2.11.0 - -- cgit v1.2.3-54-g00ecf