diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2017-04-21 15:39:57 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-05-16 14:08:30 +0100 |
commit | 8c37bb4baa86dfffe46130cb3298c8e30c53f945 (patch) | |
tree | 2d8f8de010ea19a0ebb22dd1999ea8095c91ae38 | |
parent | 528abed7b1f64b99a3fe2382d18978895ed4e79a (diff) | |
download | poky-8c37bb4baa86dfffe46130cb3298c8e30c53f945.tar.gz |
dnf: update to 2.3.0
Drop dependency on pygpgme, replace it with gpgme's own bindings.
Add a patch that fixes an upstream regression.
(From OE-Core rev: ee5dcf78f3abfec40e278591ccbd1e475ca6df15)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/dnf/dnf/0001-Revert-proper-check-of-releasever-when-using-install.patch | 105 | ||||
-rw-r--r-- | meta/recipes-devtools/dnf/dnf_git.bb | 9 |
2 files changed, 110 insertions, 4 deletions
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 new file mode 100644 index 0000000000..879ecfa30d --- /dev/null +++ b/meta/recipes-devtools/dnf/dnf/0001-Revert-proper-check-of-releasever-when-using-install.patch | |||
@@ -0,0 +1,105 @@ | |||
1 | From 8cd0503612573c455f34db74cd1c2216ed25b69c Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Wed, 12 Apr 2017 15:42:06 +0300 | ||
4 | Subject: [PATCH] Revert "proper check of releasever, when using installroot | ||
5 | (RhBug:1417542)" | ||
6 | |||
7 | This reverts commit 3ddf684b7c67a2b384aa99dde53d8a43218f2e68, as it's causing | ||
8 | breakage when installing packages into a pristin rootfs. Upstream has been notified: | ||
9 | https://bugzilla.redhat.com/show_bug.cgi?id=1441636 | ||
10 | |||
11 | Upstream-Status: Inappropriate [pending proper fix] | ||
12 | Signed-off-by: Alex Kanavin <alex.kanavin@gmail.com> | ||
13 | --- | ||
14 | dnf/rpm/__init__.py | 59 +++++++++++++++++++++++++---------------------------- | ||
15 | doc/command_ref.rst | 3 +-- | ||
16 | 2 files changed, 29 insertions(+), 33 deletions(-) | ||
17 | |||
18 | diff --git a/dnf/rpm/__init__.py b/dnf/rpm/__init__.py | ||
19 | index 5976acd6..1d50e6a0 100644 | ||
20 | --- a/dnf/rpm/__init__.py | ||
21 | +++ b/dnf/rpm/__init__.py | ||
22 | @@ -30,38 +30,35 @@ def detect_releasever(installroot): | ||
23 | # :api | ||
24 | """Calculate the release version for the system.""" | ||
25 | |||
26 | - # if installroot is empty dir releasever is None, | ||
27 | - # that's why releasever is checked from '/' | ||
28 | - for root in [installroot, "/"]: | ||
29 | - ts = transaction.initReadOnlyTransaction(root=root) | ||
30 | - ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES | rpm._RPMVSF_NODIGESTS)) | ||
31 | - for distroverpkg in dnf.const.DISTROVERPKG: | ||
32 | - try: | ||
33 | - idx = ts.dbMatch('provides', distroverpkg) | ||
34 | - except (TypeError, rpm.error) as e: | ||
35 | - raise dnf.exceptions.Error('Error: %s' % str(e)) | ||
36 | - if not len(idx): | ||
37 | - continue | ||
38 | - try: | ||
39 | - hdr = next(idx) | ||
40 | - except StopIteration: | ||
41 | - msg = 'Error: rpmdb failed to list provides. Try: rpm --rebuilddb' | ||
42 | - raise dnf.exceptions.Error(msg) | ||
43 | - releasever = hdr['version'] | ||
44 | - try: | ||
45 | - off = hdr[rpm.RPMTAG_PROVIDENAME].index(distroverpkg) | ||
46 | - flag = hdr[rpm.RPMTAG_PROVIDEFLAGS][off] | ||
47 | - ver = hdr[rpm.RPMTAG_PROVIDEVERSION][off] | ||
48 | - if flag == rpm.RPMSENSE_EQUAL and ver: | ||
49 | - if hdr['name'] != distroverpkg: | ||
50 | - # override the package version | ||
51 | - releasever = ver | ||
52 | - except (ValueError, KeyError, IndexError): | ||
53 | - pass | ||
54 | + ts = transaction.initReadOnlyTransaction(root=installroot) | ||
55 | + ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES | rpm._RPMVSF_NODIGESTS)) | ||
56 | + for distroverpkg in dnf.const.DISTROVERPKG: | ||
57 | + try: | ||
58 | + idx = ts.dbMatch('provides', distroverpkg) | ||
59 | + except (TypeError, rpm.error) as e: | ||
60 | + raise dnf.exceptions.Error('Error: %s' % str(e)) | ||
61 | + if not len(idx): | ||
62 | + continue | ||
63 | + try: | ||
64 | + hdr = next(idx) | ||
65 | + except StopIteration: | ||
66 | + msg = 'Error: rpmdb failed to list provides. Try: rpm --rebuilddb' | ||
67 | + raise dnf.exceptions.Error(msg) | ||
68 | + releasever = hdr['version'] | ||
69 | + try: | ||
70 | + off = hdr[rpm.RPMTAG_PROVIDENAME].index(distroverpkg) | ||
71 | + flag = hdr[rpm.RPMTAG_PROVIDEFLAGS][off] | ||
72 | + ver = hdr[rpm.RPMTAG_PROVIDEVERSION][off] | ||
73 | + if flag == rpm.RPMSENSE_EQUAL and ver: | ||
74 | + if hdr['name'] != distroverpkg: | ||
75 | + # override the package version | ||
76 | + releasever = ver | ||
77 | + except (ValueError, KeyError, IndexError): | ||
78 | + pass | ||
79 | |||
80 | - if is_py3bytes(releasever): | ||
81 | - releasever = str(releasever, "utf-8") | ||
82 | - return releasever | ||
83 | + if is_py3bytes(releasever): | ||
84 | + releasever = str(releasever, "utf-8") | ||
85 | + return releasever | ||
86 | return None | ||
87 | |||
88 | |||
89 | diff --git a/doc/command_ref.rst b/doc/command_ref.rst | ||
90 | index 77e885ab..3dd451b5 100644 | ||
91 | --- a/doc/command_ref.rst | ||
92 | +++ b/doc/command_ref.rst | ||
93 | @@ -205,8 +205,7 @@ Options | ||
94 | Note: You may also want to use the command-line option | ||
95 | ``--releasever=<release>`` when creating the installroot otherwise the | ||
96 | *$releasever* value is taken from the rpmdb within the installroot (and thus | ||
97 | - it is empty at time of creation and *$releasever* is taken from rpmdb using | ||
98 | - installroot=/). | ||
99 | + it is empty at time of creation, the transaction will fail). | ||
100 | The new installroot path at time of creation do not contain *repository*, | ||
101 | *releasever*, and *dnf.conf* file. | ||
102 | |||
103 | -- | ||
104 | 2.11.0 | ||
105 | |||
diff --git a/meta/recipes-devtools/dnf/dnf_git.bb b/meta/recipes-devtools/dnf/dnf_git.bb index 9f814fb211..62c7127ac8 100644 --- a/meta/recipes-devtools/dnf/dnf_git.bb +++ b/meta/recipes-devtools/dnf/dnf_git.bb | |||
@@ -10,22 +10,23 @@ SRC_URI = "git://github.com/rpm-software-management/dnf.git \ | |||
10 | file://0001-Do-not-prepend-installroot-to-logdir.patch \ | 10 | file://0001-Do-not-prepend-installroot-to-logdir.patch \ |
11 | file://0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch \ | 11 | file://0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch \ |
12 | file://0001-Corretly-install-tmpfiles.d-configuration.patch \ | 12 | file://0001-Corretly-install-tmpfiles.d-configuration.patch \ |
13 | file://0001-Revert-proper-check-of-releasever-when-using-install.patch \ | ||
13 | " | 14 | " |
14 | 15 | ||
15 | PV = "2.0.0+git${SRCPV}" | 16 | PV = "2.3.0" |
16 | SRCREV = "f0093d672d3069cfee8447973ae70ef615fd8886" | 17 | SRCREV = "242079563b54b4714c889fd4ee32e8dd9960f3b8" |
17 | 18 | ||
18 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
19 | 20 | ||
20 | inherit cmake gettext bash-completion distutils3-base systemd | 21 | inherit cmake gettext bash-completion distutils3-base systemd |
21 | 22 | ||
22 | DEPENDS += "libdnf librepo libcomps python3-pygpgme python3-iniparse" | 23 | DEPENDS += "libdnf librepo libcomps python3-iniparse" |
23 | 24 | ||
24 | # manpages generation requires http://www.sphinx-doc.org/ | 25 | # manpages generation requires http://www.sphinx-doc.org/ |
25 | EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3" | 26 | EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3" |
26 | 27 | ||
27 | BBCLASSEXTEND = "native nativesdk" | 28 | BBCLASSEXTEND = "native nativesdk" |
28 | RDEPENDS_${PN}_class-target += "python3-core python3-codecs python3-netclient python3-email python3-threading python3-distutils librepo python3-shell python3-subprocess libcomps libdnf python3-sqlite3 python3-compression python3-pygpgme python3-rpm python3-iniparse python3-json python3-importlib python3-curses python3-argparse python3-misc" | 29 | RDEPENDS_${PN}_class-target += "python3-core python3-codecs python3-netclient python3-email python3-threading python3-distutils librepo python3-shell python3-subprocess libcomps libdnf python3-sqlite3 python3-compression python3-rpm python3-iniparse python3-json python3-importlib python3-curses python3-argparse python3-misc python3-gpg" |
29 | 30 | ||
30 | # Create a symlink called 'dnf' as 'make install' does not do it, but | 31 | # Create a symlink called 'dnf' as 'make install' does not do it, but |
31 | # .spec file in dnf source tree does (and then Fedora and dnf documentation | 32 | # .spec file in dnf source tree does (and then Fedora and dnf documentation |