From acc8c7683dcfcbb75fda71996472ce1433fb764d Mon Sep 17 00:00:00 2001 From: anolis-bot Date: Thu, 15 Sep 2022 00:11:58 +0800 Subject: [PATCH 1/4] update to libdnf-0.63.0-8.2.el8_6 Signed-off-by: anolis-bot --- ...to-filtering-for-advisory-candidates.patch | 71 +++++++++++++++++++ 1000-anolis-fix-platform-compatibility.patch | 20 ------ 1001-arch-add-loongarch64-to-arch_map.patch | 24 ------- dist | 1 + libdnf.spec | 17 ++--- 5 files changed, 77 insertions(+), 56 deletions(-) create mode 100644 0028-Add-obsoletes-to-filtering-for-advisory-candidates.patch delete mode 100644 1000-anolis-fix-platform-compatibility.patch delete mode 100644 1001-arch-add-loongarch64-to-arch_map.patch create mode 100644 dist diff --git a/0028-Add-obsoletes-to-filtering-for-advisory-candidates.patch b/0028-Add-obsoletes-to-filtering-for-advisory-candidates.patch new file mode 100644 index 0000000..85a93de --- /dev/null +++ b/0028-Add-obsoletes-to-filtering-for-advisory-candidates.patch @@ -0,0 +1,71 @@ +From fa6da3b29705b99de69a653e869af258ac302ab6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= +Date: Tue, 5 Jul 2022 09:02:22 +0200 +Subject: [PATCH] Add obsoletes to filtering for advisory candidates + +Patch https://github.com/rpm-software-management/libdnf/pull/1526 +introduced a regression where we no longer do a security upgrade if a +package A is installed and package B obsoletes A and B is available in two +versions while there is an advisory for the second version. + +Test: https://github.com/rpm-software-management/ci-dnf-stack/pull/1130 +--- + libdnf/sack/query.cpp | 32 ++++++++++++++++++++++++++++---- + 1 file changed, 28 insertions(+), 4 deletions(-) + +diff --git a/libdnf/sack/query.cpp b/libdnf/sack/query.cpp +index 03d39659..5355f9f7 100644 +--- a/libdnf/sack/query.cpp ++++ b/libdnf/sack/query.cpp +@@ -1878,6 +1878,13 @@ Query::Impl::filterAdvisory(const Filter & f, Map *m, int keyname) + std::vector installed_solvables; + + if (cmp_type & HY_UPGRADE) { ++ // When doing HY_UPGRADE consider only candidate pkgs that have matching Name and Arch with: ++ // * some already installed pkg (in other words: some other version of the pkg is already installed) ++ // or ++ // * with pkg that obsoletes some already installed (or to be installed in this transaction) pkg ++ // Otherwise a pkg with different Arch than installed can end up in upgrade set which is wrong. ++ // It can result in dependency issues, reported as: RhBug:2088149. ++ + Query installed(sack, ExcludeFlags::IGNORE_EXCLUDES); + installed.installed(); + installed.addFilter(HY_PKG_LATEST_PER_ARCH, HY_EQ, 1); +@@ -1887,13 +1894,30 @@ Query::Impl::filterAdvisory(const Filter & f, Map *m, int keyname) + installed_solvables.push_back(pool_id2solvable(pool, installed_id)); + } + std::sort(installed_solvables.begin(), installed_solvables.end(), NameArchSolvableComparator); ++ ++ Query obsoletes(sack, ExcludeFlags::IGNORE_EXCLUDES); ++ obsoletes.addFilter(HY_PKG, HY_EQ, resultPset); ++ obsoletes.available(); ++ ++ Query possibly_obsoleted(sack, ExcludeFlags::IGNORE_EXCLUDES); ++ possibly_obsoleted.addFilter(HY_PKG, HY_EQ, resultPset); ++ possibly_obsoleted.addFilter(HY_PKG_UPGRADES, HY_EQ, 1); ++ possibly_obsoleted.queryUnion(installed); ++ possibly_obsoleted.apply(); ++ ++ obsoletes.addFilter(HY_PKG_OBSOLETES, HY_EQ, possibly_obsoleted.runSet()); ++ obsoletes.apply(); ++ Id obsoleted_id = -1; ++ // Add to candidates resultPset pkgs that obsolete some installed (or to be installed in this transaction) pkg ++ while ((obsoleted_id = obsoletes.pImpl->result->next(obsoleted_id)) != -1) { ++ Solvable * s = pool_id2solvable(pool, obsoleted_id); ++ candidates.push_back(s); ++ } ++ + Id id = -1; ++ // Add to candidates resultPset pkgs that match name and arch with some already installed pkg + while ((id = resultPset->next(id)) != -1) { + Solvable * s = pool_id2solvable(pool, id); +- // When doing HY_UPGRADE consider only candidate pkgs that have matching Name and Arch +- // with some already installed pkg (in other words: some other version of the pkg is already installed). +- // Otherwise a pkg with different Arch than installed can end up in upgrade set which is wrong. +- // It can result in dependency issues, reported as: RhBug:2088149. + auto low = std::lower_bound(installed_solvables.begin(), installed_solvables.end(), s, NameArchSolvableComparator); + if (low != installed_solvables.end() && s->name == (*low)->name && s->arch == (*low)->arch) { + candidates.push_back(s); +-- +2.37.1 + diff --git a/1000-anolis-fix-platform-compatibility.patch b/1000-anolis-fix-platform-compatibility.patch deleted file mode 100644 index b470693..0000000 --- a/1000-anolis-fix-platform-compatibility.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Nur libdnf-0.55.0/libdnf/module/ModulePackage.cpp libdnf-0.55.0.new/libdnf/module/ModulePackage.cpp ---- libdnf-0.55.0/libdnf/module/ModulePackage.cpp 2020-11-09 22:42:13.000000000 +0800 -+++ libdnf-0.55.0.new/libdnf/module/ModulePackage.cpp 2021-07-08 16:40:15.635247194 +0800 -@@ -580,6 +580,16 @@ - Id id = repo_add_solvable(repo); - Solvable *solvable = pool_id2solvable(pool, id); - setSovable(pool, solvable, name, stream, version, context, "noarch"); -+ if (name == "platform" and stream == "an8") -+ { -+ std::string compatible_stream = "el8"; -+ setSovable(pool, solvable, name, compatible_stream, version, context, "noarch"); -+ } -+ if (name == "platform" and stream == "el8") -+ { -+ std::string compatible_stream = "an8"; -+ setSovable(pool, solvable, name, compatible_stream, version, context, "noarch"); -+ } - repoImpl->needs_internalizing = 1; - dnf_sack_set_provides_not_ready(moduleSack); - dnf_sack_set_considered_to_update(moduleSack); diff --git a/1001-arch-add-loongarch64-to-arch_map.patch b/1001-arch-add-loongarch64-to-arch_map.patch deleted file mode 100644 index be4e9b1..0000000 --- a/1001-arch-add-loongarch64-to-arch_map.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 9753114b8aaf03ef2bb30d02cf20275836f1d4ed Mon Sep 17 00:00:00 2001 -From: Liwei Ge -Date: Wed, 14 Sep 2022 15:09:32 +0800 -Subject: [PATCH] arch: add loongarch64 to arch_map - ---- - libdnf/dnf-context.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp -index d119e7d..4de4333 100644 ---- a/libdnf/dnf-context.cpp -+++ b/libdnf/dnf-context.cpp -@@ -115,6 +115,7 @@ static const struct { - { "sparc", { "sparc", "sparc64", "sparc64v", "sparcv8", - "sparcv9", "sparcv9v", NULL } }, - { "x86_64", { "x86_64", "amd64", "ia32e", NULL } }, -+ { "loongarch64",{ "loongarch64", NULL } }, - { NULL, { NULL } } - }; - --- -2.27.0 - diff --git a/dist b/dist new file mode 100644 index 0000000..0ee7539 --- /dev/null +++ b/dist @@ -0,0 +1 @@ +an8_6 diff --git a/libdnf.spec b/libdnf.spec index 66cb12c..795e8f2 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.2 %global libsolv_version 0.7.17 %global libmodulemd_version 2.11.2-2 %global librepo_version 1.13.1 @@ -37,7 +36,7 @@ %bcond_without python2 %endif -%if 0%{?rhel} && ! 0%{?centos} && ! 0%{?anolis} +%if 0%{?rhel} && ! 0%{?centos} %bcond_without rhsm %else %bcond_with rhsm @@ -57,7 +56,7 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 8.1%{anolis_release}%{?dist} +Release: 8.2%{?dist} Summary: Library providing simplified C and Python API to libsolv License: LGPLv2+ URL: https://github.com/rpm-software-management/libdnf @@ -89,9 +88,7 @@ Patch24: 0024-Add-unittest-for-setting-up-repo-with-empty-keyfile-RhBug19 Patch25: 0025-Add-getLatestModules.patch Patch26: 0026-Update-translations-RhBug-2017272.patch Patch27: 0027-advisory-upgrade-filter-out-advPkgs-with-different-a.patch - -Patch1000: 1000-anolis-fix-platform-compatibility.patch -Patch1001: 1001-arch-add-loongarch64-to-arch_map.patch +Patch28: 0028-Add-obsoletes-to-filtering-for-advisory-candidates.patch BuildRequires: cmake BuildRequires: gcc @@ -336,12 +333,8 @@ popd %endif %changelog -* Wed Sep 14 2022 Liwei Ge - 0.63.0-8.1.0.2 -- Add loongarch64 to arch_map - -* Fri Aug 05 2022 Liu Xiaoping - 0.63.0-8.1.0.1 -- Disable rhsm support in Anolis (geliwei@openanolis.org) -- rebrand: fix platform compatibility (geliwei@openanolis.org) +* Wed Aug 17 2022 Lukas Hrazky - 0.63.0-8.2 +- Add obsoletes to filtering for advisory candidates * Wed Jun 15 2022 Lukas Hrazky - 0.63.0-8.1 - advisory upgrade: filter out advPkgs with different arch -- Gitee From cfeec87bfa4adb9c192c2e5248787f5274e48560 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Tue, 17 May 2022 19:16:16 +0800 Subject: [PATCH 2/4] Disable rhsm support in Anolis --- libdnf.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libdnf.spec b/libdnf.spec index 795e8f2..4238c10 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 %global libsolv_version 0.7.17 %global libmodulemd_version 2.11.2-2 %global librepo_version 1.13.1 @@ -36,7 +37,7 @@ %bcond_without python2 %endif -%if 0%{?rhel} && ! 0%{?centos} +%if 0%{?rhel} && ! 0%{?centos} && ! 0%{?anolis} %bcond_without rhsm %else %bcond_with rhsm @@ -56,7 +57,7 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 8.2%{?dist} +Release: 8.2%{anolis_release}%{?dist} Summary: Library providing simplified C and Python API to libsolv License: LGPLv2+ URL: https://github.com/rpm-software-management/libdnf @@ -333,6 +334,9 @@ popd %endif %changelog +* Fri Sep 16 2022 Liu Xiaoping - 0.63.0-8.2.0.1 +- Disable rhsm support in Anolis (geliwei@openanolis.org) + * Wed Aug 17 2022 Lukas Hrazky - 0.63.0-8.2 - Add obsoletes to filtering for advisory candidates -- Gitee From b23ef5c358a9bc45053e32d75f8fe3745d45fd85 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Wed, 18 May 2022 14:02:51 +0800 Subject: [PATCH 3/4] module: fix platform compatibility with centos --- 1000-anolis-fix-platform-compatibility.patch | 20 ++++++++++++++++++++ libdnf.spec | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 1000-anolis-fix-platform-compatibility.patch diff --git a/1000-anolis-fix-platform-compatibility.patch b/1000-anolis-fix-platform-compatibility.patch new file mode 100644 index 0000000..b470693 --- /dev/null +++ b/1000-anolis-fix-platform-compatibility.patch @@ -0,0 +1,20 @@ +diff -Nur libdnf-0.55.0/libdnf/module/ModulePackage.cpp libdnf-0.55.0.new/libdnf/module/ModulePackage.cpp +--- libdnf-0.55.0/libdnf/module/ModulePackage.cpp 2020-11-09 22:42:13.000000000 +0800 ++++ libdnf-0.55.0.new/libdnf/module/ModulePackage.cpp 2021-07-08 16:40:15.635247194 +0800 +@@ -580,6 +580,16 @@ + Id id = repo_add_solvable(repo); + Solvable *solvable = pool_id2solvable(pool, id); + setSovable(pool, solvable, name, stream, version, context, "noarch"); ++ if (name == "platform" and stream == "an8") ++ { ++ std::string compatible_stream = "el8"; ++ setSovable(pool, solvable, name, compatible_stream, version, context, "noarch"); ++ } ++ if (name == "platform" and stream == "el8") ++ { ++ std::string compatible_stream = "an8"; ++ setSovable(pool, solvable, name, compatible_stream, version, context, "noarch"); ++ } + repoImpl->needs_internalizing = 1; + dnf_sack_set_provides_not_ready(moduleSack); + dnf_sack_set_considered_to_update(moduleSack); diff --git a/libdnf.spec b/libdnf.spec index 4238c10..a3e73d2 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -91,6 +91,8 @@ Patch26: 0026-Update-translations-RhBug-2017272.patch Patch27: 0027-advisory-upgrade-filter-out-advPkgs-with-different-a.patch Patch28: 0028-Add-obsoletes-to-filtering-for-advisory-candidates.patch +Patch1000: 1000-anolis-fix-platform-compatibility.patch + BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ @@ -336,6 +338,7 @@ popd %changelog * Fri Sep 16 2022 Liu Xiaoping - 0.63.0-8.2.0.1 - Disable rhsm support in Anolis (geliwei@openanolis.org) +- rebrand: fix platform compatibility (geliwei@openanolis.org) * Wed Aug 17 2022 Lukas Hrazky - 0.63.0-8.2 - Add obsoletes to filtering for advisory candidates -- Gitee From 5bc746f95ee6c8d4ecb7e7967b1c1a038b36cd23 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Wed, 14 Sep 2022 15:15:37 +0800 Subject: [PATCH 4/4] arch: add loongarch64 to arch_map Signed-off-by: Liwei Ge --- 1001-arch-add-loongarch64-to-arch_map.patch | 24 +++++++++++++++++++++ libdnf.spec | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 1001-arch-add-loongarch64-to-arch_map.patch diff --git a/1001-arch-add-loongarch64-to-arch_map.patch b/1001-arch-add-loongarch64-to-arch_map.patch new file mode 100644 index 0000000..be4e9b1 --- /dev/null +++ b/1001-arch-add-loongarch64-to-arch_map.patch @@ -0,0 +1,24 @@ +From 9753114b8aaf03ef2bb30d02cf20275836f1d4ed Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Wed, 14 Sep 2022 15:09:32 +0800 +Subject: [PATCH] arch: add loongarch64 to arch_map + +--- + libdnf/dnf-context.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp +index d119e7d..4de4333 100644 +--- a/libdnf/dnf-context.cpp ++++ b/libdnf/dnf-context.cpp +@@ -115,6 +115,7 @@ static const struct { + { "sparc", { "sparc", "sparc64", "sparc64v", "sparcv8", + "sparcv9", "sparcv9v", NULL } }, + { "x86_64", { "x86_64", "amd64", "ia32e", NULL } }, ++ { "loongarch64",{ "loongarch64", NULL } }, + { NULL, { NULL } } + }; + +-- +2.27.0 + diff --git a/libdnf.spec b/libdnf.spec index a3e73d2..5c3d69e 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -92,6 +92,7 @@ Patch27: 0027-advisory-upgrade-filter-out-advPkgs-with-different-a.patch Patch28: 0028-Add-obsoletes-to-filtering-for-advisory-candidates.patch Patch1000: 1000-anolis-fix-platform-compatibility.patch +Patch1001: 1001-arch-add-loongarch64-to-arch_map.patch BuildRequires: cmake BuildRequires: gcc @@ -339,6 +340,7 @@ popd * Fri Sep 16 2022 Liu Xiaoping - 0.63.0-8.2.0.1 - Disable rhsm support in Anolis (geliwei@openanolis.org) - rebrand: fix platform compatibility (geliwei@openanolis.org) +- Add loongarch64 to arch_map (liwei.glw@alibaba-inc.com) * Wed Aug 17 2022 Lukas Hrazky - 0.63.0-8.2 - Add obsoletes to filtering for advisory candidates -- Gitee