From 94d4bba43097ec22f120f4327e5d13a52c1724fd Mon Sep 17 00:00:00 2001 From: Tim Orling Date: Tue, 25 Sep 2018 21:59:50 -0700 Subject: dnf: upgrade 2.7.5 -> 3.4.0 Refresh and rename patches. License-Update: docs: Replace Yum with YUM. Signed-off-by: Tim Orling --- ...orrectly-install-tmpfiles.d-configuration.patch | 7 ++ ...Corretly-install-tmpfiles.d-configuration.patch | 22 ------- ...hardcode-etc-and-systemd-unit-directories.patch | 30 --------- ...hardcode-etc-and-systemd-unit-directories.patch | 0 ...0003-Do-not-prepend-installroot-to-logdir.patch | 13 ++++ ...-set-PYTHON_INSTALL_DIR-by-running-python.patch | 13 ++++ ...0005-Do-not-prepend-installroot-to-logdir.patch | 31 --------- .../dnf/0005-Run-python-scripts-using-env.patch | 20 ++++++ ...-set-PYTHON_INSTALL_DIR-by-running-python.patch | 28 -------- .../dnf/0030-Run-python-scripts-using-env.patch | 38 ----------- meta/recipes-devtools/dnf/dnf_2.7.5.bb | 75 ---------------------- meta/recipes-devtools/dnf/dnf_3.4.0.bb | 75 ++++++++++++++++++++++ 12 files changed, 128 insertions(+), 224 deletions(-) create mode 100644 meta/recipes-devtools/dnf/dnf/0001-Correctly-install-tmpfiles.d-configuration.patch delete mode 100644 meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch delete mode 100644 meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch create mode 100644 meta/recipes-devtools/dnf/dnf/0002-Do-not-hardcode-etc-and-systemd-unit-directories.patch create mode 100644 meta/recipes-devtools/dnf/dnf/0003-Do-not-prepend-installroot-to-logdir.patch create mode 100644 meta/recipes-devtools/dnf/dnf/0004-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch delete mode 100644 meta/recipes-devtools/dnf/dnf/0005-Do-not-prepend-installroot-to-logdir.patch create mode 100644 meta/recipes-devtools/dnf/dnf/0005-Run-python-scripts-using-env.patch delete mode 100644 meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch delete mode 100644 meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch delete mode 100644 meta/recipes-devtools/dnf/dnf_2.7.5.bb create mode 100644 meta/recipes-devtools/dnf/dnf_3.4.0.bb diff --git a/meta/recipes-devtools/dnf/dnf/0001-Correctly-install-tmpfiles.d-configuration.patch b/meta/recipes-devtools/dnf/dnf/0001-Correctly-install-tmpfiles.d-configuration.patch new file mode 100644 index 0000000000..e370656bb9 --- /dev/null +++ b/meta/recipes-devtools/dnf/dnf/0001-Correctly-install-tmpfiles.d-configuration.patch @@ -0,0 +1,7 @@ +Index: dnf/etc/tmpfiles.d/CMakeLists.txt +=================================================================== +--- dnf.orig/etc/tmpfiles.d/CMakeLists.txt ++++ dnf/etc/tmpfiles.d/CMakeLists.txt +@@ -1 +1 @@ +-INSTALL (FILES dnf.conf DESTINATION /usr/lib/tmpfiles.d/) ++INSTALL (FILES dnf.conf DESTINATION ${SYSCONFDIR}/tmpfiles.d/) diff --git a/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch b/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch deleted file mode 100644 index 6692b41a16..0000000000 --- a/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 05e059cd4e9910c00b32d377f4f98e3c8dde6bc6 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Thu, 26 Jan 2017 16:36:20 +0200 -Subject: [PATCH 4/5] Corretly install tmpfiles.d configuration - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin - ---- - etc/tmpfiles.d/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/etc/tmpfiles.d/CMakeLists.txt b/etc/tmpfiles.d/CMakeLists.txt -index f69c773e..3eb6d0e8 100644 ---- a/etc/tmpfiles.d/CMakeLists.txt -+++ b/etc/tmpfiles.d/CMakeLists.txt -@@ -1 +1 @@ --INSTALL (FILES dnf.conf DESTINATION /usr/lib/tmpfiles.d/) -+INSTALL (FILES dnf.conf DESTINATION ${SYSCONFDIR}/tmpfiles.d/) --- -2.14.2 - diff --git a/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch b/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch deleted file mode 100644 index 15a7bfc732..0000000000 --- a/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch +++ /dev/null @@ -1,30 +0,0 @@ -From a8ef81c115a45f05dad145c98e10f3c4940e4e29 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Thu, 26 Jan 2017 16:25:47 +0200 -Subject: [PATCH 3/5] Do not hardcode /etc and systemd unit directories - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin - ---- - CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 650b624a..10199618 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -7,8 +7,8 @@ if (NOT PYTHON_DESIRED) - set (PYTHON_DESIRED "2") - endif() - --SET( SYSCONFDIR /etc) --SET( SYSTEMD_DIR /usr/lib/systemd/system) -+SET( SYSCONFDIR ${CMAKE_INSTALL_SYSCONFDIR}) -+SET( SYSTEMD_DIR $ENV{systemd_system_unitdir}) - - if (${PYTHON_DESIRED} STREQUAL "2") - FIND_PACKAGE (PythonInterp REQUIRED) --- -2.14.2 - diff --git a/meta/recipes-devtools/dnf/dnf/0002-Do-not-hardcode-etc-and-systemd-unit-directories.patch b/meta/recipes-devtools/dnf/dnf/0002-Do-not-hardcode-etc-and-systemd-unit-directories.patch new file mode 100644 index 0000000000..e69de29bb2 diff --git a/meta/recipes-devtools/dnf/dnf/0003-Do-not-prepend-installroot-to-logdir.patch b/meta/recipes-devtools/dnf/dnf/0003-Do-not-prepend-installroot-to-logdir.patch new file mode 100644 index 0000000000..2c4c844b3b --- /dev/null +++ b/meta/recipes-devtools/dnf/dnf/0003-Do-not-prepend-installroot-to-logdir.patch @@ -0,0 +1,13 @@ +Index: dnf/dnf/cli/cli.py +=================================================================== +--- dnf.orig/dnf/cli/cli.py ++++ dnf/dnf/cli/cli.py +@@ -944,7 +944,7 @@ class Cli(object): + logger.warning(_("Unable to detect release version (use '--releasever' to specify " + "release version)")) + +- for opt in ('cachedir', 'logdir', 'persistdir'): ++ for opt in ('cachedir', 'persistdir'): + conf.prepend_installroot(opt) + + self.base._logging._setup_from_dnf_conf(conf) diff --git a/meta/recipes-devtools/dnf/dnf/0004-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/meta/recipes-devtools/dnf/dnf/0004-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch new file mode 100644 index 0000000000..e82319f36d --- /dev/null +++ b/meta/recipes-devtools/dnf/dnf/0004-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch @@ -0,0 +1,13 @@ +Index: dnf/CMakeLists.txt +=================================================================== +--- dnf.orig/CMakeLists.txt ++++ dnf/CMakeLists.txt +@@ -19,7 +19,7 @@ ELSE () + MESSAGE (FATAL_ERROR "Invalid PYTHON_DESIRED value: " ${PYTHON_DESIRED}) + ENDIF() + +-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) ++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) + MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}") + + ADD_SUBDIRECTORY (dnf) diff --git a/meta/recipes-devtools/dnf/dnf/0005-Do-not-prepend-installroot-to-logdir.patch b/meta/recipes-devtools/dnf/dnf/0005-Do-not-prepend-installroot-to-logdir.patch deleted file mode 100644 index aa20009cef..0000000000 --- a/meta/recipes-devtools/dnf/dnf/0005-Do-not-prepend-installroot-to-logdir.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 6365389074a1b86962f3d8b22a2ead2202026a98 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Wed, 11 Jan 2017 15:10:13 +0200 -Subject: [PATCH 5/5] Do not prepend installroot to logdir. - -This would otherwise write the logs into rootfs/var/log -(whereas we want them in $T), -and will break installation of base-files rpm. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin ---- - dnf/cli/cli.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py -index d2d9c082..82270ecf 100644 ---- a/dnf/cli/cli.py -+++ b/dnf/cli/cli.py -@@ -920,7 +920,7 @@ class Cli(object): - logger.warning(_("Unable to detect release version (use '--releasever' to specify " - "release version)")) - -- for opt in ('cachedir', 'logdir', 'persistdir'): -+ for opt in ('cachedir', 'persistdir'): - conf.prepend_installroot(opt) - - self.base._logging._setup_from_dnf_conf(conf) --- -2.14.2 - diff --git a/meta/recipes-devtools/dnf/dnf/0005-Run-python-scripts-using-env.patch b/meta/recipes-devtools/dnf/dnf/0005-Run-python-scripts-using-env.patch new file mode 100644 index 0000000000..870fcbed9e --- /dev/null +++ b/meta/recipes-devtools/dnf/dnf/0005-Run-python-scripts-using-env.patch @@ -0,0 +1,20 @@ +Index: dnf/bin/dnf-automatic.in +=================================================================== +--- dnf.orig/bin/dnf-automatic.in ++++ dnf/bin/dnf-automatic.in +@@ -1,4 +1,4 @@ +-#!@PYTHON_EXECUTABLE@ ++#!/usr/bin/env python3 + # dnf-automatic executable. + # + # Copyright (C) 2014-2016 Red Hat, Inc. +Index: dnf/bin/dnf.in +=================================================================== +--- dnf.orig/bin/dnf.in ++++ dnf/bin/dnf.in +@@ -1,4 +1,4 @@ +-#!@PYTHON_EXECUTABLE@ ++#!/usr/bin/env python3 + # The dnf executable script. + # + # Copyright (C) 2012-2016 Red Hat, Inc. diff --git a/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch deleted file mode 100644 index 6e011915df..0000000000 --- a/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 7205033e44d8fba1d3b18b490e7eaab82da1ffa3 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 30 Dec 2016 18:29:07 +0200 -Subject: [PATCH 1/5] Do not set PYTHON_INSTALL_DIR by running python - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin - ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 23e5f889..650b624a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -18,7 +18,7 @@ else() - FIND_PACKAGE(PythonInterp 3.0 REQUIRED) - endif() - --EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) -+#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write('%s.%s' % (sys.version_info.major, sys.version_info.minor))" OUTPUT_VARIABLE PYTHON_MAJOR_DOT_MINOR_VERSION) - MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}") - --- -2.14.2 - diff --git a/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch b/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch deleted file mode 100644 index eedbb5723f..0000000000 --- a/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 8d97b72a1d77149e2f9048d1ca6cef66da1a8aa5 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 30 Dec 2016 18:29:37 +0200 -Subject: [PATCH 2/5] Run python scripts using env - -Otherwise the build tools hardcode the python path into them. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin - ---- - bin/dnf-automatic.in | 2 +- - bin/dnf.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/bin/dnf-automatic.in b/bin/dnf-automatic.in -index 5b06aa26..891b4c24 100755 ---- a/bin/dnf-automatic.in -+++ b/bin/dnf-automatic.in -@@ -1,4 +1,4 @@ --#!@PYTHON_EXECUTABLE@ -+#!/usr/bin/env python3 - # dnf-automatic executable. - # - # Copyright (C) 2014-2016 Red Hat, Inc. -diff --git a/bin/dnf.in b/bin/dnf.in -index 645d0f06..bdf7b3c4 100755 ---- a/bin/dnf.in -+++ b/bin/dnf.in -@@ -1,4 +1,4 @@ --#!@PYTHON_EXECUTABLE@ -+#!/usr/bin/env python3 - # The dnf executable script. - # - # Copyright (C) 2012-2016 Red Hat, Inc. --- -2.14.2 - diff --git a/meta/recipes-devtools/dnf/dnf_2.7.5.bb b/meta/recipes-devtools/dnf/dnf_2.7.5.bb deleted file mode 100644 index df60d731b6..0000000000 --- a/meta/recipes-devtools/dnf/dnf_2.7.5.bb +++ /dev/null @@ -1,75 +0,0 @@ -SUMMARY = "Package manager forked from Yum, using libsolv as a dependency resolver" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://PACKAGE-LICENSING;md5=bfc29916e11321be06924c4fb096fdcc \ - " - -SRC_URI = "git://github.com/rpm-software-management/dnf.git \ - file://0001-Corretly-install-tmpfiles.d-configuration.patch \ - file://0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch \ - file://0005-Do-not-prepend-installroot-to-logdir.patch \ - file://0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \ - file://0030-Run-python-scripts-using-env.patch \ - " - -SRCREV = "564c44667c7014843fa6f1732621093114ec59b2" -UPSTREAM_CHECK_GITTAGREGEX = "(?P\d+(\.\d+)+)" - -S = "${WORKDIR}/git" - -inherit cmake gettext bash-completion distutils3-base systemd - -DEPENDS += "libdnf librepo libcomps python3-iniparse" - -# manpages generation requires http://www.sphinx-doc.org/ -EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3" - -BBCLASSEXTEND = "native nativesdk" - -RDEPENDS_${PN}_class-target += " \ - python3-core \ - python3-codecs \ - python3-netclient \ - python3-email \ - python3-threading \ - python3-distutils \ - python3-logging \ - python3-fcntl \ - librepo \ - python3-shell \ - libcomps \ - libdnf \ - python3-sqlite3 \ - python3-compression \ - python3-rpm \ - python3-iniparse \ - python3-json \ - python3-curses \ - python3-misc \ - python3-gpg \ - " - -RRECOMMENDS_${PN}_class-target += "gnupg" - -# Create a symlink called 'dnf' as 'make install' does not do it, but -# .spec file in dnf source tree does (and then Fedora and dnf documentation -# says that dnf binary is plain 'dnf'). -do_install_append() { - lnr ${D}/${bindir}/dnf-3 ${D}/${bindir}/dnf - lnr ${D}/${bindir}/dnf-automatic-3 ${D}/${bindir}/dnf-automatic -} - -# Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in -do_install_append_class-native() { - create_wrapper ${D}/${bindir}/dnf \ - RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ - RPM_NO_CHROOT_FOR_SCRIPTS=1 -} - -SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \ - dnf-automatic.service dnf-automatic.timer \ - dnf-automatic-download.service dnf-automatic-download.timer \ - dnf-automatic-install.service dnf-automatic-install.timer \ - dnf-automatic-notifyonly.service dnf-automatic-notifyonly.timer \ -" -SYSTEMD_AUTO_ENABLE ?= "disable" diff --git a/meta/recipes-devtools/dnf/dnf_3.4.0.bb b/meta/recipes-devtools/dnf/dnf_3.4.0.bb new file mode 100644 index 0000000000..7c33380a70 --- /dev/null +++ b/meta/recipes-devtools/dnf/dnf_3.4.0.bb @@ -0,0 +1,75 @@ +SUMMARY = "Package manager forked from Yum, using libsolv as a dependency resolver" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://PACKAGE-LICENSING;md5=4a0548e303dbc77f067335b4d688e745 \ + " + +SRC_URI = "git://github.com/rpm-software-management/dnf.git \ + file://0001-Correctly-install-tmpfiles.d-configuration.patch \ + file://0002-Do-not-hardcode-etc-and-systemd-unit-directories.patch \ + file://0003-Do-not-prepend-installroot-to-logdir.patch \ + file://0004-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \ + file://0005-Run-python-scripts-using-env.patch \ + " + +SRCREV = "8ee608a49e7b1fb1b639ea18be13c556a40e330f" +UPSTREAM_CHECK_GITTAGREGEX = "(?P\d+(\.\d+)+)" + +S = "${WORKDIR}/git" + +inherit cmake gettext bash-completion distutils3-base systemd + +DEPENDS += "libdnf librepo libcomps python3-iniparse" + +# manpages generation requires http://www.sphinx-doc.org/ +EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3" + +BBCLASSEXTEND = "native nativesdk" + +RDEPENDS_${PN}_class-target += " \ + python3-core \ + python3-codecs \ + python3-netclient \ + python3-email \ + python3-threading \ + python3-distutils \ + python3-logging \ + python3-fcntl \ + librepo \ + python3-shell \ + libcomps \ + libdnf \ + python3-sqlite3 \ + python3-compression \ + python3-rpm \ + python3-iniparse \ + python3-json \ + python3-curses \ + python3-misc \ + python3-gpg \ + " + +RRECOMMENDS_${PN}_class-target += "gnupg" + +# Create a symlink called 'dnf' as 'make install' does not do it, but +# .spec file in dnf source tree does (and then Fedora and dnf documentation +# says that dnf binary is plain 'dnf'). +do_install_append() { + lnr ${D}/${bindir}/dnf-3 ${D}/${bindir}/dnf + lnr ${D}/${bindir}/dnf-automatic-3 ${D}/${bindir}/dnf-automatic +} + +# Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in +do_install_append_class-native() { + create_wrapper ${D}/${bindir}/dnf \ + RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ + RPM_NO_CHROOT_FOR_SCRIPTS=1 +} + +SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \ + dnf-automatic.service dnf-automatic.timer \ + dnf-automatic-download.service dnf-automatic-download.timer \ + dnf-automatic-install.service dnf-automatic-install.timer \ + dnf-automatic-notifyonly.service dnf-automatic-notifyonly.timer \ +" +SYSTEMD_AUTO_ENABLE ?= "disable" -- cgit 1.2.3-korg