From 7d5be831757c91efda67b54a8746edfb70cfa5b4 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Feb 13 2021 06:12:05 +0000 Subject: import libdnf-0.55.0-3.el8 --- diff --git a/SOURCES/0002-modules-Add-special-handling-for-src-artifacts-RhBug-1809314.patch b/SOURCES/0002-modules-Add-special-handling-for-src-artifacts-RhBug-1809314.patch new file mode 100644 index 0000000..a16d544 --- /dev/null +++ b/SOURCES/0002-modules-Add-special-handling-for-src-artifacts-RhBug-1809314.patch @@ -0,0 +1,73 @@ +From 71db968178e5d8cd4c01ed36fa940c2a95f3e494 Mon Sep 17 00:00:00 2001 +From: Jaroslav Mracek +Date: Mon, 9 Nov 2020 18:10:37 +0100 +Subject: [PATCH] [modules] Add special handling for src artifacts + (RhBug:1809314) + +Source packages are special because they cannot be installed and provide +nothing, therefore they should be handled by a different way than binary +packages. Source rpm should not trigger a removal of binary packages. +--- + libdnf/dnf-sack.cpp | 22 +++++++++++++++++++--- + 1 file changed, 19 insertions(+), 3 deletions(-) + +diff --git a/libdnf/dnf-sack.cpp b/libdnf/dnf-sack.cpp +index 9fd2c72d1..d44e1d86d 100644 +--- a/libdnf/dnf-sack.cpp ++++ b/libdnf/dnf-sack.cpp +@@ -2335,20 +2335,29 @@ setModuleExcludes(DnfSack *sack, const char ** hotfixRepos, + { + dnf_sack_set_module_excludes(sack, nullptr); + std::vector names; ++ std::vector srcNames; + libdnf::DependencyContainer nameDependencies{sack}; + libdnf::Nevra nevra; + for (const auto &rpm : includeNEVRAs) { + if (nevra.parse(rpm.c_str(), HY_FORM_NEVRA)) { +- names.push_back(nevra.getName()); +- nameDependencies.addReldep(nevra.getName().c_str()); ++ auto arch = nevra.getArch(); ++ // source packages do not provide anything and must not cause excluding binary packages ++ if (arch == "src" || arch == "nosrc") { ++ srcNames.push_back(nevra.getName()); ++ } else { ++ names.push_back(nevra.getName()); ++ nameDependencies.addReldep(nevra.getName().c_str()); ++ } + } + } + + std::vector namesCString(names.size() + 1); ++ std::vector srcNamesCString(srcNames.size() + 1); + std::vector excludeNEVRAsCString(excludeNEVRAs.size() + 1); + std::vector includeNEVRAsCString(includeNEVRAs.size() + 1); + + transform(names.begin(), names.end(), namesCString.begin(), std::mem_fn(&std::string::c_str)); ++ transform(srcNames.begin(), srcNames.end(), srcNamesCString.begin(), std::mem_fn(&std::string::c_str)); + transform(excludeNEVRAs.begin(), excludeNEVRAs.end(), excludeNEVRAsCString.begin(), + std::mem_fn(&std::string::c_str)); + transform(includeNEVRAs.begin(), includeNEVRAs.end(), includeNEVRAsCString.begin(), +@@ -2363,6 +2372,7 @@ setModuleExcludes(DnfSack *sack, const char ** hotfixRepos, + libdnf::Query excludeQuery{keepPackages}; + libdnf::Query excludeProvidesQuery{keepPackages}; + libdnf::Query excludeNamesQuery(keepPackages); ++ libdnf::Query excludeSrcNamesQuery(keepPackages); + includeQuery.addFilter(HY_PKG_NEVRA_STRICT, HY_EQ, includeNEVRAsCString.data()); + + excludeQuery.addFilter(HY_PKG_NEVRA_STRICT, HY_EQ, excludeNEVRAsCString.data()); +@@ -2372,8 +2382,14 @@ setModuleExcludes(DnfSack *sack, const char ** hotfixRepos, + excludeProvidesQuery.addFilter(HY_PKG_PROVIDES, &nameDependencies); + excludeProvidesQuery.queryDifference(includeQuery); + +- // Requred to filtrate out source packages and packages with incompatible architectures ++ // Search for source packages with same names as included source artifacts ++ excludeSrcNamesQuery.addFilter(HY_PKG_NAME, HY_EQ, srcNamesCString.data()); ++ const char * srcArchs[] = {"src", "nosrc", nullptr}; ++ excludeSrcNamesQuery.addFilter(HY_PKG_ARCH, HY_EQ, srcArchs); ++ ++ // Required to filtrate out source packages and packages with incompatible architectures + excludeNamesQuery.addFilter(HY_PKG_NAME, HY_EQ, namesCString.data()); ++ excludeNamesQuery.queryUnion(excludeSrcNamesQuery); + excludeNamesQuery.queryDifference(includeQuery); + + dnf_sack_set_module_excludes(sack, excludeQuery.getResultPset()); diff --git a/SOURCES/0003-Avoid-multilib-file-conflict-in-config.h-RhBug-1918818.patch b/SOURCES/0003-Avoid-multilib-file-conflict-in-config.h-RhBug-1918818.patch new file mode 100644 index 0000000..ae93fb0 --- /dev/null +++ b/SOURCES/0003-Avoid-multilib-file-conflict-in-config.h-RhBug-1918818.patch @@ -0,0 +1,101 @@ +From 3f6adc99506f065d0858e4d9d46055be9d070634 Mon Sep 17 00:00:00 2001 +From: Nicola Sella +Date: Fri, 22 Jan 2021 16:07:37 +0100 +Subject: [PATCH] Avoid multilib file conflict in config.h (RhBug:1918818) + +=changelog= +msg: Avoid multilib file conflicts in config.h +resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1918818 +--- + .gitignore | 2 +- + libdnf/CMakeLists.txt | 8 ++++++- + libdnf/{config.h.in => config-64.h.in} | 6 +++--- + libdnf/config.h | 29 ++++++++++++++++++++++++++ + 4 files changed, 40 insertions(+), 5 deletions(-) + rename libdnf/{config.h.in => config-64.h.in} (87%) + create mode 100644 libdnf/config.h + +diff --git a/.gitignore b/.gitignore +index e17a9b9bb..0a63bdae7 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -5,4 +5,4 @@ + build + *.pyc + data/tests/modules/yum.repos.d/test.repo +-libdnf/config.h ++libdnf/config-64.h +diff --git a/libdnf/CMakeLists.txt b/libdnf/CMakeLists.txt +index e82aac11e..25f33d7b0 100644 +--- a/libdnf/CMakeLists.txt ++++ b/libdnf/CMakeLists.txt +@@ -35,7 +35,13 @@ set(LIBDNF_SRCS + include_directories(transaction) + add_subdirectory("transaction") + +-configure_file("config.h.in" ${CMAKE_CURRENT_SOURCE_DIR}/config.h) ++if(CMAKE_SIZEOF_VOID_P EQUAL 8) ++ set(MULTILIB_ARCH "64") ++ configure_file("config-64.h.in" ${CMAKE_CURRENT_SOURCE_DIR}/config-64.h) ++elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) ++ set(MULTILIB_ARCH "32") ++ configure_file("config-64.h.in" ${CMAKE_CURRENT_SOURCE_DIR}/config-32.h) ++endif() + configure_file("dnf-version.h.in" ${CMAKE_CURRENT_SOURCE_DIR}/dnf-version.h) + configure_file("libdnf.pc.in" ${CMAKE_CURRENT_BINARY_DIR}/libdnf.pc @ONLY) + +diff --git a/libdnf/config.h.in b/libdnf/config-64.h.in +similarity index 87% +rename from libdnf/config.h.in +rename to libdnf/config-64.h.in +index 77974f757..e2329fe71 100644 +--- a/libdnf/config.h.in ++++ b/libdnf/config-64.h.in +@@ -18,9 +18,9 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#ifndef _LIBDNF_CONFIG_H_ +-#define _LIBDNF_CONFIG_H_ ++#ifndef _LIBDNF_CONFIG_@MULTILIB_ARCH@_H_ ++#define _LIBDNF_CONFIG_@MULTILIB_ARCH@_H_ + + #define DEFAULT_PLUGINS_DIRECTORY "@CMAKE_INSTALL_FULL_LIBDIR@/libdnf/plugins/" + +-#endif // _LIBDNF_CONFIG_H_ ++#endif // _LIBDNF_CONFIG_@MULTILIB_ARCH@_H_ +diff --git a/libdnf/config.h b/libdnf/config.h +new file mode 100644 +index 000000000..16121f6f5 +--- /dev/null ++++ b/libdnf/config.h +@@ -0,0 +1,29 @@ ++/* ++ * Copyright (C) 2018 Red Hat, Inc. ++ * ++ * Licensed under the GNU Lesser General Public License Version 2.1 ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#include ++ ++#if __WORDSIZE == 32 ++#include "config-32.h" ++#elif __WORDSIZE == 64 ++#include "config-64.h" ++#else ++#error "Unknown word size" ++#endif diff --git a/SPECS/libdnf.spec b/SPECS/libdnf.spec index 5305a12..865821c 100644 --- a/SPECS/libdnf.spec +++ b/SPECS/libdnf.spec @@ -1,7 +1,7 @@ %global libsolv_version 0.7.7 %global libmodulemd_version 2.5.0 %global librepo_version 1.12.0 -%global dnf_conflict 4.2.23 +%global dnf_conflict 4.3.0 %global swig_version 3.0.12 %global libdnf_major_version 0 %global libdnf_minor_version 55 @@ -56,12 +56,14 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library providing simplified C and Python API to libsolv License: LGPLv2+ URL: https://github.com/rpm-software-management/libdnf Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch0: 0001-Better-msgs-if-basecachedir-or-proxy-password-isn-t-set-RhBug-1888946.patch +Patch1: 0002-modules-Add-special-handling-for-src-artifacts-RhBug-1809314.patch +Patch2: 0003-Avoid-multilib-file-conflict-in-config.h-RhBug-1918818.patch BuildRequires: cmake BuildRequires: gcc @@ -309,6 +311,10 @@ popd %endif %changelog +* Fri Jan 29 2021 Nicola Sella - 0.55.0-3 +- Avoid multilib file conflict in config.h (RhBug:1918818) +- [modules] Add special handling for src artifacts (RhBug:1809314) + * Fri Jan 15 2021 Nicola Sella - 0.55.0-2 - Better msgs if "basecachedir" or "proxy_password" isn't set (RhBug:1888946)