Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libdnf for openSUSE:Factory checked 
in at 2023-06-01 17:19:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libdnf (Old)
 and      /work/SRC/openSUSE:Factory/.libdnf.new.2531 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libdnf"

Thu Jun  1 17:19:03 2023 rev:33 rq:1089771 version:0.70.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/libdnf/libdnf.changes    2023-03-01 
16:13:32.678442357 +0100
+++ /work/SRC/openSUSE:Factory/.libdnf.new.2531/libdnf.changes  2023-06-01 
17:19:08.210023963 +0200
@@ -1,0 +2,9 @@
+Tue May 30 07:51:43 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to 0.70.1:
+  * Add repoid to solver errors for RPMs (RhBug:2179413)
+  * Avoid using obsolete RPM API and drop redundant calls
+  * Remove DNF from list of protected packages
+- avoid bashism
+
+-------------------------------------------------------------------

Old:
----
  libdnf-0.70.0.tar.gz

New:
----
  libdnf-0.70.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libdnf.spec ++++++
--- /var/tmp/diff_new_pack.uK2RCE/_old  2023-06-01 17:19:08.826027614 +0200
+++ /var/tmp/diff_new_pack.uK2RCE/_new  2023-06-01 17:19:08.834027661 +0200
@@ -34,7 +34,7 @@
 %define devname %{name}-devel
 
 Name:           libdnf
-Version:        0.70.0
+Version:        0.70.1
 Release:        0
 Summary:        Library providing C and Python APIs atop libsolv
 License:        LGPL-2.1-or-later
@@ -181,7 +181,7 @@
 # library, so we force it by creating an LD_LIBRARY_PATH
 export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
 
-if [ "$(id -u)" == "0" ] ; then
+if [ "$(id -u)" = "0" ] ; then
         cat <<ERROR 1>&2
 Package tests cannot be run under superuser account.
 Please build the package as non-root user.

++++++ libdnf-0.70.0.tar.gz -> libdnf-0.70.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdnf-0.70.0/VERSION.cmake 
new/libdnf-0.70.1/VERSION.cmake
--- old/libdnf-0.70.0/VERSION.cmake     2023-02-21 09:37:36.000000000 +0100
+++ new/libdnf-0.70.1/VERSION.cmake     2023-05-15 12:52:55.000000000 +0200
@@ -1,6 +1,6 @@
 set (DEFAULT_LIBDNF_MAJOR_VERSION 0)
 set (DEFAULT_LIBDNF_MINOR_VERSION 70)
-set (DEFAULT_LIBDNF_MICRO_VERSION 0)
+set (DEFAULT_LIBDNF_MICRO_VERSION 1)
 
 if(DEFINED LIBDNF_MAJOR_VERSION)
   if(NOT ${DEFAULT_LIBDNF_MAJOR_VERSION} STREQUAL ${LIBDNF_MAJOR_VERSION})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdnf-0.70.0/docs/release_notes.rst 
new/libdnf-0.70.1/docs/release_notes.rst
--- old/libdnf-0.70.0/docs/release_notes.rst    2023-02-21 09:37:36.000000000 
+0100
+++ new/libdnf-0.70.1/docs/release_notes.rst    2023-05-15 12:52:55.000000000 
+0200
@@ -20,6 +20,21 @@
 ######################
 
 ====================
+0.70.1 Release Notes
+====================
+
+- New features:
+  - Add repoid to solver errors for RPMs (RhBug:2179413)
+
+- Others:
+  - Avoid using obsolete RPM API and drop redundant calls
+  - Remove DNF from list of protected packages
+
+Bugs fixed in 0.70.1:
+
+* :rhbug:`2179413`
+
+====================
 0.70.0 Release Notes
 ====================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdnf-0.70.0/libdnf/conf/ConfigMain.cpp 
new/libdnf-0.70.1/libdnf/conf/ConfigMain.cpp
--- old/libdnf-0.70.0/libdnf/conf/ConfigMain.cpp        2023-02-21 
09:37:36.000000000 +0100
+++ new/libdnf-0.70.1/libdnf/conf/ConfigMain.cpp        2023-05-15 
12:52:55.000000000 +0200
@@ -313,7 +313,7 @@
         }
     };
 
-    OptionStringList protected_packages{resolveGlobs("dnf 
glob:/etc/yum/protected.d/*.conf " \
+    OptionStringList 
protected_packages{resolveGlobs("glob:/etc/yum/protected.d/*.conf " \
                                           "glob:/etc/dnf/protected.d/*.conf")};
     OptionString username{""};
     OptionString password{""};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdnf-0.70.0/libdnf/dnf-keyring.cpp 
new/libdnf-0.70.1/libdnf/dnf-keyring.cpp
--- old/libdnf-0.70.0/libdnf/dnf-keyring.cpp    2023-02-21 09:37:36.000000000 
+0100
+++ new/libdnf-0.70.1/libdnf/dnf-keyring.cpp    2023-05-15 12:52:55.000000000 
+0200
@@ -63,7 +63,6 @@
     int rc;
     gsize len;
     pgpArmor armor;
-    pgpDig dig = NULL;
     rpmPubkey pubkey = NULL;
     rpmPubkey *subkeys = NULL;
     int nsubkeys = 0;
@@ -116,16 +115,7 @@
         goto out;
     }
 
-    /* does the key exist in the keyring */
-    dig = rpmPubkeyDig(pubkey);
-    rc = rpmKeyringLookup(keyring, dig);
-    if (rc == RPMRC_OK) {
-        ret = TRUE;
-        g_debug("%s is already present", filename);
-        goto out;
-    }
-
-    /* add to rpmdb automatically, without a prompt */
+    /* add to in-memory keyring */
     rc = rpmKeyringAddKey(keyring, pubkey);
     if (rc == 1) {
         ret = TRUE;
@@ -169,8 +159,6 @@
         }
         free(subkeys);
     }
-    if (dig != NULL)
-        pgpFreeDig(dig);
     return ret;
 } CATCH_TO_GERROR(FALSE)
 
@@ -250,9 +238,7 @@
     FD_t fd = NULL;
     gboolean ret = FALSE;
     Header hdr = NULL;
-    pgpDig dig = NULL;
     rpmRC rc;
-    rpmtd td = NULL;
     rpmts ts = NULL;
 
     char *path = g_strdup(filename);
@@ -314,51 +300,6 @@
         goto out;
     }
 
-    /* convert and upscale */
-    headerConvert(hdr, HEADERCONV_RETROFIT_V3);
-
-    /* get RSA key */
-    td = rpmtdNew();
-    rc = static_cast<rpmRC>(headerGet(hdr, RPMTAG_RSAHEADER, td, 
HEADERGET_MINMEM));
-    if (rc != RPMRC_NOTFOUND) {
-        /* try to read DSA key as a fallback */
-        rc = static_cast<rpmRC>(headerGet(hdr, RPMTAG_DSAHEADER, td, 
HEADERGET_MINMEM));
-    }
-
-    /* the package has no signing key */
-    if (rc != RPMRC_NOTFOUND) {
-        g_autofree char *package_filename = g_path_get_basename(filename);
-        ret = FALSE;
-        g_set_error(error,
-                    DNF_ERROR,
-                    DNF_ERROR_GPG_SIGNATURE_INVALID,
-                    "package not signed: %s", package_filename);
-        goto out;
-    }
-
-    /* make it into a digest */
-    dig = pgpNewDig();
-    rc = static_cast<rpmRC>(pgpPrtPkts(static_cast<const uint8_t *>(td->data), 
td->count, dig, 0));
-    if (rc != RPMRC_OK) {
-        g_set_error(error,
-                    DNF_ERROR,
-                    DNF_ERROR_FILE_INVALID,
-                    "failed to parse digest header for %s",
-                    filename);
-        goto out;
-    }
-
-    /* does the key exist in the keyring */
-    rc = rpmKeyringLookup(keyring, dig);
-    if (rc != RPMRC_OK) {
-        g_set_error(error,
-                    DNF_ERROR,
-                    DNF_ERROR_GPG_SIGNATURE_INVALID,
-                    "failed to lookup digest in keyring for %s",
-                    filename);
-        goto out;
-    }
-
     /* the package is signed by a key we trust */
     g_debug("%s has been verified as trusted", filename);
     ret = TRUE;
@@ -367,12 +308,6 @@
 
     if (path != NULL)
         g_free(path);
-    if (dig != NULL)
-        pgpFreeDig(dig);
-    if (td != NULL) {
-        rpmtdFreeData(td);
-        rpmtdFree(td);
-    }
     if (ts != NULL)
         rpmtsFree(ts);
     if (hdr != NULL)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdnf-0.70.0/libdnf/goal/Goal.cpp 
new/libdnf-0.70.1/libdnf/goal/Goal.cpp
--- old/libdnf-0.70.0/libdnf/goal/Goal.cpp      2023-02-21 09:37:36.000000000 
+0100
+++ new/libdnf-0.70.1/libdnf/goal/Goal.cpp      2023-05-15 12:52:55.000000000 
+0200
@@ -87,8 +87,8 @@
 };
 
 static const std::map<int, const char *> PKG_PROBLEMS_DICT = {
-    {RULE_DISTUPGRADE, M_(" does not belong to a distupgrade repository")},
-    {RULE_INFARCH, M_(" has inferior architecture")},
+    {RULE_DISTUPGRADE, M_("%s from %s  does not belong to a distupgrade 
repository")},
+    {RULE_INFARCH, M_("%s from %s  has inferior architecture")},
     {RULE_UPDATE, M_("problem with installed package ")},
     {RULE_JOB, M_("conflicting requests")},
     {RULE_JOB_UNSUPPORTED, M_("unsupported request")},
@@ -98,24 +98,24 @@
     {RULE_PKG, M_("some dependency problem")},
     {RULE_BEST_1, M_("cannot install the best update candidate for package ")},
     {RULE_BEST_2, M_("cannot install the best candidate for the job")},
-    {RULE_PKG_NOT_INSTALLABLE_1, M_("package %s is filtered out by modular 
filtering")},
-    {RULE_PKG_NOT_INSTALLABLE_2, M_("package %s does not have a compatible 
architecture")},
-    {RULE_PKG_NOT_INSTALLABLE_3, M_("package %s is not installable")},
-    {RULE_PKG_NOT_INSTALLABLE_4, M_("package %s is filtered out by exclude 
filtering")},
-    {RULE_PKG_NOTHING_PROVIDES_DEP, M_("nothing provides %s needed by %s")},
-    {RULE_PKG_SAME_NAME, M_("cannot install both %s and %s")},
-    {RULE_PKG_CONFLICTS, M_("package %s conflicts with %s provided by %s")},
-    {RULE_PKG_OBSOLETES, M_("package %s obsoletes %s provided by %s")},
-    {RULE_PKG_INSTALLED_OBSOLETES, M_("installed package %s obsoletes %s 
provided by %s")},
-    {RULE_PKG_IMPLICIT_OBSOLETES, M_("package %s implicitly obsoletes %s 
provided by %s")},
-    {RULE_PKG_REQUIRES, M_("package %s requires %s, but none of the providers 
can be installed")},
-    {RULE_PKG_SELF_CONFLICT, M_("package %s conflicts with %s provided by 
itself")},
-    {RULE_YUMOBS, M_("both package %s and %s obsolete %s")}
+    {RULE_PKG_NOT_INSTALLABLE_1, M_("package %s from %s is filtered out by 
modular filtering")},
+    {RULE_PKG_NOT_INSTALLABLE_2, M_("package %s from %s does not have a 
compatible architecture")},
+    {RULE_PKG_NOT_INSTALLABLE_3, M_("package %s from %s is not installable")},
+    {RULE_PKG_NOT_INSTALLABLE_4, M_("package %s from %s is filtered out by 
exclude filtering")},
+    {RULE_PKG_NOTHING_PROVIDES_DEP, M_("nothing provides %s needed by %s from 
%s")},
+    {RULE_PKG_SAME_NAME, M_("cannot install both %s from %s and %s from %s")},
+    {RULE_PKG_CONFLICTS, M_("package %s from %s conflicts with %s provided by 
%s from %s")},
+    {RULE_PKG_OBSOLETES, M_("package %s from %s obsoletes %s provided by %s 
from %s")},
+    {RULE_PKG_INSTALLED_OBSOLETES, M_("installed package %s obsoletes %s 
provided by %s from %s")},
+    {RULE_PKG_IMPLICIT_OBSOLETES, M_("package %s from %s implicitly obsoletes 
%s provided by %s from %s")},
+    {RULE_PKG_REQUIRES, M_("package %s from %s requires %s, but none of the 
providers can be installed")},
+    {RULE_PKG_SELF_CONFLICT, M_("package %s from %s conflicts with %s provided 
by itself")},
+    {RULE_YUMOBS, M_("both package %s from %s and %s from %s obsolete %s")}
 };
 
 static const std::map<int, const char *> MODULE_PROBLEMS_DICT = {
-    {RULE_DISTUPGRADE, M_(" does not belong to a distupgrade repository")},
-    {RULE_INFARCH, M_(" has inferior architecture")},
+    {RULE_DISTUPGRADE, M_("%s from %s does not belong to a distupgrade 
repository")},
+    {RULE_INFARCH, M_("%s from %s has inferior architecture")},
     {RULE_UPDATE, M_("problem with installed module ")},
     {RULE_JOB, M_("conflicting requests")},
     {RULE_JOB_UNSUPPORTED, M_("unsupported request")},
@@ -125,19 +125,19 @@
     {RULE_PKG, M_("some dependency problem")},
     {RULE_BEST_1, M_("cannot install the best update candidate for module ")},
     {RULE_BEST_2, M_("cannot install the best candidate for the job")},
-    {RULE_PKG_NOT_INSTALLABLE_1, M_("module %s is disabled")},
-    {RULE_PKG_NOT_INSTALLABLE_2, M_("module %s does not have a compatible 
architecture")},
-    {RULE_PKG_NOT_INSTALLABLE_3, M_("module %s is not installable")},
-    {RULE_PKG_NOT_INSTALLABLE_4, M_("module %s is disabled")},
-    {RULE_PKG_NOTHING_PROVIDES_DEP, M_("nothing provides %s needed by module 
%s")},
-    {RULE_PKG_SAME_NAME, M_("cannot install both modules %s and %s")},
-    {RULE_PKG_CONFLICTS, M_("module %s conflicts with %s provided by %s")},
-    {RULE_PKG_OBSOLETES, M_("module %s obsoletes %s provided by %s")},
-    {RULE_PKG_INSTALLED_OBSOLETES, M_("installed module %s obsoletes %s 
provided by %s")},
-    {RULE_PKG_IMPLICIT_OBSOLETES, M_("module %s implicitly obsoletes %s 
provided by %s")},
-    {RULE_PKG_REQUIRES, M_("module %s requires %s, but none of the providers 
can be installed")},
-    {RULE_PKG_SELF_CONFLICT, M_("module %s conflicts with %s provided by 
itself")},
-    {RULE_YUMOBS, M_("both module %s and %s obsolete %s")}
+    {RULE_PKG_NOT_INSTALLABLE_1, M_("module %s from %s is disabled")},
+    {RULE_PKG_NOT_INSTALLABLE_2, M_("module %s from %s does not have a 
compatible architecture")},
+    {RULE_PKG_NOT_INSTALLABLE_3, M_("module %s from %s is not installable")},
+    {RULE_PKG_NOT_INSTALLABLE_4, M_("module %s from %s is disabled")},
+    {RULE_PKG_NOTHING_PROVIDES_DEP, M_("nothing provides %s needed by module 
%s from %s")},
+    {RULE_PKG_SAME_NAME, M_("cannot install both modules %s from %s and %s 
from %s")},
+    {RULE_PKG_CONFLICTS, M_("module %s from %s conflicts with %s provided by 
%s from %s")},
+    {RULE_PKG_OBSOLETES, M_("module %s from %s obsoletes %s provided by %s 
from %s")},
+    {RULE_PKG_INSTALLED_OBSOLETES, M_("installed module %s obsoletes %s 
provided by %s from %s")},
+    {RULE_PKG_IMPLICIT_OBSOLETES, M_("module %s from %s implicitly obsoletes 
%s provided by %s from %s")},
+    {RULE_PKG_REQUIRES, M_("module %s from %s requires %s, but none of the 
providers can be installed")},
+    {RULE_PKG_SELF_CONFLICT, M_("module %s from %s conflicts with %s provided 
by itself")},
+    {RULE_YUMOBS, M_("both module %s from %s and %s from %s obsolete %s")}
 };
 
 static std::string
@@ -151,9 +151,11 @@
     Solvable *ss;
     switch (type) {
         case SOLVER_RULE_DISTUPGRADE:
-            return solvid2str(pool, source) + 
TM_(problemDict.at(RULE_DISTUPGRADE), 1);
+            return tfm::format(TM_(problemDict.at(RULE_DISTUPGRADE), 1), 
solvid2str(pool, source).c_str(),
+                               pool_id2solvable(pool, source)->repo->name);
         case SOLVER_RULE_INFARCH:
-            return solvid2str(pool, source) + 
TM_(problemDict.at(RULE_INFARCH), 1);
+            return tfm::format(TM_(problemDict.at(RULE_DISTUPGRADE), 1), 
solvid2str(pool, source).c_str(),
+                               pool_id2solvable(pool, source)->repo->name);
         case SOLVER_RULE_UPDATE:
             return std::string(TM_(problemDict.at(RULE_UPDATE), 1)) + 
solvid2str(pool, source);
         case SOLVER_RULE_JOB:
@@ -176,44 +178,53 @@
             ss = pool->solvables + source;
             if (pool_disabled_solvable(pool, ss)) {
                 if (modularExclude && modularExclude->has(source)) {
-                    return 
tfm::format(TM_(problemDict.at(RULE_PKG_NOT_INSTALLABLE_1), 1), 
solvid2str(pool, source).c_str());
+                    return 
tfm::format(TM_(problemDict.at(RULE_PKG_NOT_INSTALLABLE_1), 1),
+                                       solvid2str(pool, source).c_str(), 
pool_id2solvable(pool, source)->repo->name);
                 } else {
-                    return 
tfm::format(TM_(problemDict.at(RULE_PKG_NOT_INSTALLABLE_4), 1), 
solvid2str(pool, source).c_str());
+                    return 
tfm::format(TM_(problemDict.at(RULE_PKG_NOT_INSTALLABLE_4), 1),
+                                       solvid2str(pool, source).c_str(), 
pool_id2solvable(pool, source)->repo->name);
                 }
             }
             if (ss->arch && ss->arch != ARCH_SRC && ss->arch != ARCH_NOSRC &&
                 pool->id2arch && (ss->arch > pool->lastarch || 
!pool->id2arch[ss->arch]))
-                return 
tfm::format(TM_(problemDict.at(RULE_PKG_NOT_INSTALLABLE_2), 1), 
solvid2str(pool, source).c_str());
-            return tfm::format(TM_(problemDict.at(RULE_PKG_NOT_INSTALLABLE_3), 
1), solvid2str(pool, source).c_str());
+                return 
tfm::format(TM_(problemDict.at(RULE_PKG_NOT_INSTALLABLE_2), 1), 
solvid2str(pool, source).c_str(),
+                                   pool_id2solvable(pool, source)->repo->name);
+            return tfm::format(TM_(problemDict.at(RULE_PKG_NOT_INSTALLABLE_3), 
1), solvid2str(pool, source).c_str(),
+                               pool_id2solvable(pool, source)->repo->name);
         case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
             return 
tfm::format(TM_(problemDict.at(RULE_PKG_NOTHING_PROVIDES_DEP), 1), 
pool_dep2str(pool, dep),
-                               solvid2str(pool, source).c_str());
+                               solvid2str(pool, source).c_str(), 
pool_id2solvable(pool, source)->repo->name);
         case SOLVER_RULE_PKG_SAME_NAME:
             return tfm::format(TM_(problemDict.at(RULE_PKG_SAME_NAME), 1), 
solvid2str(pool, source).c_str(),
-                               solvid2str(pool, target).c_str());
+                               pool_id2solvable(pool, source)->repo->name, 
solvid2str(pool, target).c_str(),
+                               pool_id2solvable(pool, target)->repo->name);
         case SOLVER_RULE_PKG_CONFLICTS:
             return tfm::format(TM_(problemDict.at(RULE_PKG_CONFLICTS), 1), 
solvid2str(pool, source).c_str(),
-                               pool_dep2str(pool, dep), solvid2str(pool, 
target).c_str());
+                               pool_id2solvable(pool, source)->repo->name, 
pool_dep2str(pool, dep),
+                               solvid2str(pool, target).c_str(), 
pool_id2solvable(pool, target)->repo->name);
         case SOLVER_RULE_PKG_OBSOLETES:
             return tfm::format(TM_(problemDict.at(RULE_PKG_OBSOLETES), 1), 
solvid2str(pool, source).c_str(),
-                               pool_dep2str(pool, dep), solvid2str(pool, 
target).c_str());
+                               pool_id2solvable(pool, source)->repo->name, 
pool_dep2str(pool, dep),
+                               solvid2str(pool, target).c_str(), 
pool_id2solvable(pool, target)->repo->name);
         case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
             return 
tfm::format(TM_(problemDict.at(RULE_PKG_INSTALLED_OBSOLETES), 1),
                                solvid2str(pool, source).c_str(), 
pool_dep2str(pool, dep),
-                               solvid2str(pool, target).c_str());
+                               solvid2str(pool, target).c_str(), 
pool_id2solvable(pool, target)->repo->name);
         case SOLVER_RULE_PKG_IMPLICIT_OBSOLETES:
             return 
tfm::format(TM_(problemDict.at(RULE_PKG_IMPLICIT_OBSOLETES), 1),
                                solvid2str(pool, source).c_str(), 
pool_dep2str(pool, dep),
-                               solvid2str(pool, target).c_str());
+                               pool_id2solvable(pool, source)->repo->name, 
solvid2str(pool, target).c_str(),
+                               pool_id2solvable(pool, target)->repo->name);
         case SOLVER_RULE_PKG_REQUIRES:
             return tfm::format(TM_(problemDict.at(RULE_PKG_REQUIRES), 1), 
solvid2str(pool, source).c_str(),
-                               pool_dep2str(pool, dep));
+                               pool_id2solvable(pool, source)->repo->name, 
pool_dep2str(pool, dep));
         case SOLVER_RULE_PKG_SELF_CONFLICT:
             return tfm::format(TM_(problemDict.at(RULE_PKG_SELF_CONFLICT), 1), 
solvid2str(pool, source).c_str(),
-                               pool_dep2str(pool, dep));
+                               pool_id2solvable(pool, source)->repo->name, 
pool_dep2str(pool, dep));
         case SOLVER_RULE_YUMOBS:
             return tfm::format(TM_(problemDict.at(RULE_YUMOBS), 1), 
solvid2str(pool, source).c_str(),
-                               solvid2str(pool, target).c_str(), 
pool_dep2str(pool, dep));
+                               pool_id2solvable(pool, source)->repo->name, 
solvid2str(pool, target).c_str(),
+                               pool_id2solvable(pool, target)->repo->name, 
pool_dep2str(pool, dep));
         default:
             return solver_problemruleinfo2str(solv, type, source, target, dep);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libdnf-0.70.0/libdnf/module/ModulePackageContainer.cpp 
new/libdnf-0.70.1/libdnf/module/ModulePackageContainer.cpp
--- old/libdnf-0.70.0/libdnf/module/ModulePackageContainer.cpp  2023-02-21 
09:37:36.000000000 +0100
+++ new/libdnf-0.70.1/libdnf/module/ModulePackageContainer.cpp  2023-05-15 
12:52:55.000000000 +0200
@@ -286,13 +286,6 @@
         pImpl->persistDir = dir;
     }
 
-    Pool * pool = dnf_sack_get_pool(pImpl->moduleSack);
-    HyRepo hrepo = hy_repo_create("available");
-    auto repoImpl = libdnf::repoGetImpl(hrepo);
-    LibsolvRepo *repo = repo_create(pool, "available");
-    repo->appdata = hrepo;
-    repoImpl->libsolvRepo = repo;
-    repoImpl->needs_internalizing = 1;
     pImpl->installRoot = installRoot;
     g_autofree gchar * path = g_build_filename(pImpl->installRoot.c_str(),
                                               "/etc/dnf/modules.d", NULL);
@@ -375,23 +368,36 @@
     md.addMetadataFromString(fileContent, 0);
     md.resolveAddedMetadata();
 
+    LibsolvRepo * repo = nullptr;
     LibsolvRepo * r;
     Id id;
 
+    // Search whether available repo was already created
     FOR_REPOS(id, r) {
-        if (strcmp(r->name, "available") == 0) {
-            g_autofree gchar * path = 
g_build_filename(pImpl->installRoot.c_str(),
-                                                      "/etc/dnf/modules.d", 
NULL);
-            auto packages = md.getAllModulePackages(pImpl->moduleSack, r, 
repoID, pImpl->modulesV2);
-            for(auto const& modulePackagePtr: packages) {
-                std::unique_ptr<ModulePackage> modulePackage(modulePackagePtr);
-                pImpl->modules.insert(std::make_pair(modulePackage->getId(), 
std::move(modulePackage)));
-                pImpl->persistor->insert(modulePackagePtr->getName(), path);
-            }
-
-            return;
+        if (strcmp(r->name, repoID.c_str()) == 0) {
+            repo = r;
         }
     }
+
+    // If not created yet, create it
+    if (!repo) {
+        Pool * pool = dnf_sack_get_pool(pImpl->moduleSack);
+        HyRepo hrepo = hy_repo_create(repoID.c_str());
+        auto repoImpl = libdnf::repoGetImpl(hrepo);
+        repo = repo_create(pool, repoID.c_str());
+        repo->appdata = hrepo;
+        repoImpl->libsolvRepo = repo;
+        repoImpl->needs_internalizing = 1;
+    }
+
+    // add all modules to repository and pass ownership to module container
+    g_autofree gchar * path = g_build_filename(pImpl->installRoot.c_str(), 
"/etc/dnf/modules.d", NULL);
+    auto packages = md.getAllModulePackages(pImpl->moduleSack, repo, repoID, 
pImpl->modulesV2);
+    for(auto const& modulePackagePtr: packages) {
+        std::unique_ptr<ModulePackage> modulePackage(modulePackagePtr);
+        pImpl->modules.insert(std::make_pair(modulePackage->getId(), 
std::move(modulePackage)));
+        pImpl->persistor->insert(modulePackagePtr->getName(), path);
+    }
 }
 
 Id
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdnf-0.70.0/libdnf.spec 
new/libdnf-0.70.1/libdnf.spec
--- old/libdnf-0.70.0/libdnf.spec       2023-02-21 09:37:36.000000000 +0100
+++ new/libdnf-0.70.1/libdnf.spec       2023-05-15 12:52:55.000000000 +0200
@@ -5,7 +5,7 @@
 %global swig_version 3.0.12
 %global libdnf_major_version 0
 %global libdnf_minor_version 70
-%global libdnf_micro_version 0
+%global libdnf_micro_version 1
 
 %define __cmake_in_source_build 1
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdnf-0.70.0/tests/hawkey/test_goal.cpp 
new/libdnf-0.70.1/tests/hawkey/test_goal.cpp
--- old/libdnf-0.70.0/tests/hawkey/test_goal.cpp        2023-02-21 
09:37:36.000000000 +0100
+++ new/libdnf-0.70.1/tests/hawkey/test_goal.cpp        2023-05-15 
12:52:55.000000000 +0200
@@ -593,11 +593,11 @@
     auto problems = goal->describeProblemRules(0, true);
     const char *expected[] = {
                 "conflicting requests",
-                "nothing provides goodbye needed by hello-1-1.noarch"
+                "nothing provides goodbye needed by hello-1-1.noarch from main"
                 };
-    fail_unless(problems.size() == 2);
-    fail_unless(problems[0] == expected[0]);
-    fail_unless(problems[1] == expected[1]);
+    ck_assert_int_eq(problems.size(), 2);
+    ck_assert_str_eq(problems[0].c_str(), expected[0]);
+    ck_assert_str_eq(problems[1].c_str(), expected[1]);
 
     g_object_unref(pkg);
     hy_goal_free(goal);
@@ -860,10 +860,10 @@
 
     auto problems = goal->describeProblemRules(0, true);
     const char *expected[] = {
-                "package bloop-ext-2.0-1.noarch requires bloop = 2.0-1, but 
none of the providers can be installed",
-                "cannot install both bloop-2.0-1.noarch and 
bloop-1.0-1.noarch",
+                "package bloop-ext-2.0-1.noarch from updates requires bloop = 
2.0-1, but none of the providers can be installed",
+                "cannot install both bloop-2.0-1.noarch from updates and 
bloop-1.0-1.noarch from @System",
                 "conflicting requests",
-                "package bloop-ext-1.0-1.noarch is filtered out by exclude 
filtering"
+                "package bloop-ext-1.0-1.noarch from updates is filtered out 
by exclude filtering"
                 };
     ck_assert_int_eq(problems.size(), 4);
     ck_assert_str_eq(problems[0].c_str(), expected[0]);

Reply via email to