Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libsolv for openSUSE:Factory checked 
in at 2023-09-28 00:24:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libsolv (Old)
 and      /work/SRC/openSUSE:Factory/.libsolv.new.23327 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libsolv"

Thu Sep 28 00:24:31 2023 rev:90 rq:1112865 version:0.7.25

Changes:
--------
--- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes  2023-04-14 
13:12:12.199263687 +0200
+++ /work/SRC/openSUSE:Factory/.libsolv.new.23327/libsolv.changes       
2023-09-28 00:37:31.678779550 +0200
@@ -1,0 +2,12 @@
+Thu Sep 14 14:17:08 CEST 2023 - [email protected]
+
+- support complex deps in SOLVABLE_PREREQ_IGNOREINST
+- fix minimization not prefering installed packages in some cases
+- reduce memory usage in repo_updateinfoxml
+- fix lock-step interfering with architecture selection
+- fix choice rule handing for package downgrades
+- fix complex dependencies with an "else" part sometimes leading
+  to unsolved dependencies
+- bump version to 0.7.25
+
+-------------------------------------------------------------------

Old:
----
  libsolv-0.7.24.tar.bz2

New:
----
  libsolv-0.7.25.tar.bz2

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

Other differences:
------------------
++++++ libsolv.spec ++++++
--- /var/tmp/diff_new_pack.JlzZ0r/_old  2023-09-28 00:37:33.202834989 +0200
+++ /var/tmp/diff_new_pack.JlzZ0r/_new  2023-09-28 00:37:33.206835134 +0200
@@ -56,7 +56,7 @@
 %bcond_with zypp
 
 Name:           libsolv
-Version:        0.7.24
+Version:        0.7.25
 Release:        0
 Summary:        Package dependency solver using a satisfiability algorithm
 License:        BSD-3-Clause

++++++ libsolv-0.7.24.tar.bz2 -> libsolv-0.7.25.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/NEWS new/libsolv-0.7.25/NEWS
--- old/libsolv-0.7.24/NEWS     2023-04-13 16:42:03.000000000 +0200
+++ new/libsolv-0.7.25/NEWS     2023-09-14 14:20:06.000000000 +0200
@@ -1,6 +1,16 @@
 
 This file contains the major changes between libsolv versions:
 
+Version 0.7.25
+- selected bug fixes:
+  * support complex deps in SOLVABLE_PREREQ_IGNOREINST
+  * fix minimization not prefering installed packages in some cases
+  * reduce memory usage in repo_updateinfoxml
+  * fix lock-step interfering with architecture selection
+  * fix choice rule handing for package downgrades
+  * fix complex dependencies with an "else" part sometimes leading
+    to unsolved dependencies
+
 Version 0.7.24
 - selected bug fixes:
   * handle learnt rules in solver_alternativeinfo()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/VERSION.cmake 
new/libsolv-0.7.25/VERSION.cmake
--- old/libsolv-0.7.24/VERSION.cmake    2023-04-13 16:42:03.000000000 +0200
+++ new/libsolv-0.7.25/VERSION.cmake    2023-09-14 14:20:06.000000000 +0200
@@ -49,5 +49,5 @@
 
 SET(LIBSOLV_MAJOR "0")
 SET(LIBSOLV_MINOR "7")
-SET(LIBSOLV_PATCH "24")
+SET(LIBSOLV_PATCH "25")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/ext/repo_conda.c 
new/libsolv-0.7.25/ext/repo_conda.c
--- old/libsolv-0.7.24/ext/repo_conda.c 2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/ext/repo_conda.c 2023-07-23 13:02:36.000000000 +0200
@@ -314,8 +314,16 @@
   /* if we have a global subdir make sure that it matches */
   if (subdir && pd->subdir && strcmp(subdir, pd->subdir) != 0)
     {
+      /* we used to return an error here, but classic conda
+       * just overwrites the package subdir with the global
+       * subdir */
+#if 0
       pd->error = "subdir mismatch";
       return JP_ERROR;
+#else
+      solv_free(subdir);
+      subdir = solv_strdup(pd->subdir);
+#endif
     }
 
   if (fn || kfn)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/ext/repo_rpmdb.c 
new/libsolv-0.7.25/ext/repo_rpmdb.c
--- old/libsolv-0.7.24/ext/repo_rpmdb.c 2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/ext/repo_rpmdb.c 2023-09-12 13:20:06.000000000 +0200
@@ -678,29 +678,32 @@
       if ((f[i] & (DEP_LESS|DEP_EQUAL|DEP_GREATER)) == 0 && n[i][0] == '(')
        {
          id = pool_parserpmrichdep(pool, n[i]);
-         if (id)
-           *ida++ = id;
-         else
-           cc--;
-         continue;
+         if (!id)
+           {
+             cc--;
+             continue;
+           }
        }
+      else
 #endif
-      id = pool_str2id(pool, n[i], 1);
-      if (f[i] & (DEP_LESS|DEP_GREATER|DEP_EQUAL))
        {
-         Id evr;
-         int fl = 0;
-         if ((f[i] & DEP_LESS) != 0)
-           fl |= REL_LT;
-         if ((f[i] & DEP_EQUAL) != 0)
-           fl |= REL_EQ;
-         if ((f[i] & DEP_GREATER) != 0)
-           fl |= REL_GT;
-         if (v[i][0] == '0' && v[i][1] == ':' && v[i][2])
-           evr = pool_str2id(pool, v[i] + 2, 1);
-         else
-           evr = pool_str2id(pool, v[i], 1);
-         id = pool_rel2id(pool, id, evr, fl, 1);
+         id = pool_str2id(pool, n[i], 1);
+         if (f[i] & (DEP_LESS|DEP_GREATER|DEP_EQUAL))
+           {
+             Id evr;
+             int fl = 0;
+             if ((f[i] & DEP_LESS) != 0)
+               fl |= REL_LT;
+             if ((f[i] & DEP_EQUAL) != 0)
+               fl |= REL_EQ;
+             if ((f[i] & DEP_GREATER) != 0)
+               fl |= REL_GT;
+             if (v[i][0] == '0' && v[i][1] == ':' && v[i][2])
+               evr = pool_str2id(pool, v[i] + 2, 1);
+             else
+               evr = pool_str2id(pool, v[i], 1);
+             id = pool_rel2id(pool, id, evr, fl, 1);
+           }
        }
       *ida++ = id;
       if (haspre == 2 && ignq)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/ext/repo_updateinfoxml.c 
new/libsolv-0.7.25/ext/repo_updateinfoxml.c
--- old/libsolv-0.7.24/ext/repo_updateinfoxml.c 2023-03-13 16:49:56.000000000 
+0100
+++ new/libsolv-0.7.25/ext/repo_updateinfoxml.c 2023-07-20 13:02:46.000000000 
+0200
@@ -113,7 +113,7 @@
   Id pkghandle;
   struct solv_xmlparser xmlp;
   struct joindata jd;
-  Id collhandle;
+  Queue collectionq;
 };
 
 /*
@@ -289,9 +289,7 @@
       break;
 
     case STATE_COLLECTION:
-      {
-        pd->collhandle = repodata_new_handle(pd->data);
-      }
+      queue_empty(&pd->collectionq);
       break;
 
       /*   <package arch="ppc64" name="imlib-debuginfo" release="6.fc8"
@@ -371,7 +369,7 @@
         if (arch)
           repodata_set_poolstr(pd->data, module_handle, UPDATE_MODULE_ARCH, 
arch);
         repodata_add_flexarray(pd->data, pd->handle, UPDATE_MODULE, 
module_handle);
-        repodata_add_flexarray(pd->data, pd->collhandle, UPDATE_MODULE, 
module_handle);
+       queue_push2(&pd->collectionq, UPDATE_MODULE, module_handle);
         break;
       }
 
@@ -436,13 +434,19 @@
       break;
 
     case STATE_COLLECTION:
-      repodata_add_flexarray(pd->data, pd->handle, UPDATE_COLLECTIONLIST, 
pd->collhandle);
-      pd->collhandle = 0;
+      {
+       Id collhandle = repodata_new_handle(pd->data);
+       int i;
+       for (i = 0; i < pd->collectionq.count; i += 2)
+         repodata_add_flexarray(pd->data, collhandle, 
pd->collectionq.elements[i], pd->collectionq.elements[i + 1]);
+       repodata_add_flexarray(pd->data, pd->handle, UPDATE_COLLECTIONLIST, 
collhandle);
+       queue_empty(&pd->collectionq);
+      }
       break;
 
     case STATE_PACKAGE:
       repodata_add_flexarray(pd->data, pd->handle, UPDATE_COLLECTION, 
pd->pkghandle);
-      repodata_add_flexarray(pd->data, pd->collhandle, UPDATE_COLLECTION, 
pd->pkghandle);
+      queue_push2(&pd->collectionq, UPDATE_COLLECTION, pd->pkghandle);
       pd->pkghandle = 0;
       break;
 
@@ -499,11 +503,13 @@
   pd.pool = pool;
   pd.repo = repo;
   pd.data = data;
+  queue_init(&pd.collectionq);
   solv_xmlparser_init(&pd.xmlp, stateswitches, &pd, startElement, endElement);
   if (solv_xmlparser_parse(&pd.xmlp, fp) != SOLV_XMLPARSER_OK)
     pd.ret = pool_error(pool, -1, "repo_updateinfoxml: %s at line %u:%u", 
pd.xmlp.errstr, pd.xmlp.line, pd.xmlp.column);
   solv_xmlparser_free(&pd.xmlp);
   join_freemem(&pd.jd);
+  queue_free(&pd.collectionq);
 
   if (!(flags & REPO_NO_INTERNALIZE))
     repodata_internalize(data);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/package/libsolv.changes 
new/libsolv-0.7.25/package/libsolv.changes
--- old/libsolv-0.7.24/package/libsolv.changes  2023-04-13 16:42:03.000000000 
+0200
+++ new/libsolv-0.7.25/package/libsolv.changes  2023-09-14 14:20:06.000000000 
+0200
@@ -1,4 +1,16 @@
 -------------------------------------------------------------------
+Thu Sep 14 14:17:08 CEST 2023 - [email protected]
+
+- support complex deps in SOLVABLE_PREREQ_IGNOREINST
+- fix minimization not prefering installed packages in some cases
+- reduce memory usage in repo_updateinfoxml
+- fix lock-step interfering with architecture selection
+- fix choice rule handing for package downgrades
+- fix complex dependencies with an "else" part sometimes leading
+  to unsolved dependencies
+- bump version to 0.7.25
+
+-------------------------------------------------------------------
 Thu Apr 13 16:03:04 CEST 2023 - [email protected]
 
 - handle learnt rules in solver_alternativeinfo()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/cplxdeps.c 
new/libsolv-0.7.25/src/cplxdeps.c
--- old/libsolv-0.7.24/src/cplxdeps.c   2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/src/cplxdeps.c   2023-07-19 11:52:42.000000000 +0200
@@ -405,6 +405,7 @@
              Reldep *rd2 = GETRELDEP(pool, rd->evr);
              if (rd2->flags == REL_ELSE)
                {
+                 pool_add_pos_literals_complex_dep(pool, rd2->name, q, m, 
!neg);
                  pool_add_pos_literals_complex_dep(pool, rd2->evr, q, m, !neg);
                  dep = rd2->name;
                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/dataiterator.h 
new/libsolv-0.7.25/src/dataiterator.h
--- old/libsolv-0.7.24/src/dataiterator.h       2023-03-13 16:49:56.000000000 
+0100
+++ new/libsolv-0.7.25/src/dataiterator.h       2023-07-19 11:52:42.000000000 
+0200
@@ -20,8 +20,6 @@
 extern "C" {
 #endif
 
-struct s_Repo;
-
 typedef struct s_KeyValue {
   Id id;
   const char *str;
@@ -106,8 +104,8 @@
   int flags;
 
   Pool *pool;
-  struct s_Repo *repo;
-  struct s_Repodata *data;
+  Repo *repo;
+  Repodata *data;
 
   /* data pointers */
   unsigned char *dp;
@@ -165,9 +163,9 @@
  * keyname: if non-null, limit search to this keyname
  * match:   if non-null, limit search to this match
  */
-int  dataiterator_init(Dataiterator *di, Pool *pool, struct s_Repo *repo, Id 
p, Id keyname, const char *match, int flags);
+int  dataiterator_init(Dataiterator *di, Pool *pool, Repo *repo, Id p, Id 
keyname, const char *match, int flags);
 void dataiterator_init_clone(Dataiterator *di, Dataiterator *from);
-void dataiterator_set_search(Dataiterator *di, struct s_Repo *repo, Id p);
+void dataiterator_set_search(Dataiterator *di, Repo *repo, Id p);
 void dataiterator_set_keyname(Dataiterator *di, Id keyname);
 int  dataiterator_set_match(Dataiterator *di, const char *match, int flags);
 
@@ -181,7 +179,7 @@
 void dataiterator_skip_solvable(Dataiterator *di);
 void dataiterator_skip_repo(Dataiterator *di);
 void dataiterator_jump_to_solvid(Dataiterator *di, Id solvid);
-void dataiterator_jump_to_repo(Dataiterator *di, struct s_Repo *repo);
+void dataiterator_jump_to_repo(Dataiterator *di, Repo *repo);
 void dataiterator_entersub(Dataiterator *di);
 void dataiterator_clonepos(Dataiterator *di, Dataiterator *from);
 void dataiterator_seek(Dataiterator *di, int whence);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/pool.h 
new/libsolv-0.7.25/src/pool.h
--- old/libsolv-0.7.24/src/pool.h       2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/src/pool.h       2023-07-19 11:52:42.000000000 +0200
@@ -36,13 +36,11 @@
 
 /*----------------------------------------------- */
 
-struct s_Repo;
-struct s_Repodata;
 struct s_Repokey;
 struct s_KeyValue;
 
 typedef struct s_Datapos {
-  struct s_Repo *repo;
+  Repo *repo;
   Id solvid;
   Id repodataid;
   Id schema;
@@ -66,16 +64,16 @@
 struct s_Pool {
   void *appdata;               /* application private pointer */
 
-  struct s_Stringpool ss;
+  Stringpool ss;
 
   Reldep *rels;                        /* table of rels: Id -> Reldep */
   int nrels;                   /* number of unique rels */
 
-  struct s_Repo **repos;
+  Repo **repos;
   int nrepos;                  /* repos allocated */
   int urepos;                  /* repos in use */
 
-  struct s_Repo *installed;    /* packages considered installed */
+  Repo *installed;     /* packages considered installed */
 
   Solvable *solvables;
   int nsolvables;              /* solvables allocated */
@@ -109,16 +107,16 @@
   Map *considered;
 
   /* callback for REL_NAMESPACE dependencies handled by the application  */
-  Id (*nscallback)(struct s_Pool *, void *data, Id name, Id evr);
+  Id (*nscallback)(Pool *, void *data, Id name, Id evr);
   void *nscallbackdata;
 
   /* debug mask and callback */
   int  debugmask;
-  void (*debugcallback)(struct s_Pool *, void *data, int type, const char 
*str);
+  void (*debugcallback)(Pool *, void *data, int type, const char *str);
   void *debugcallbackdata;
 
   /* load callback */
-  int (*loadcallback)(struct s_Pool *, struct s_Repodata *, void *);
+  int (*loadcallback)(Pool *, Repodata *, void *);
   void *loadcallbackdata;
 
   /* search position */
@@ -155,7 +153,7 @@
 
   char *rootdir;
 
-  int (*custom_vendorcheck)(struct s_Pool *, Solvable *, Solvable *);
+  int (*custom_vendorcheck)(Pool *, Solvable *, Solvable *);
 
   int addfileprovidesfiltered; /* 1: only use filtered file list for 
addfileprovides */
   int addedfileprovides;       /* true: application called addfileprovides */
@@ -251,14 +249,14 @@
 extern int  pool_get_flag(Pool *pool, int flag);
 
 extern void pool_debug(Pool *pool, int type, const char *format, ...) 
__attribute__((format(printf, 3, 4)));
-extern void pool_setdebugcallback(Pool *pool, void (*debugcallback)(struct 
s_Pool *, void *data, int type, const char *str), void *debugcallbackdata);
+extern void pool_setdebugcallback(Pool *pool, void (*debugcallback)(Pool 
*pool, void *data, int type, const char *str), void *debugcallbackdata);
 extern void pool_setdebugmask(Pool *pool, int mask);
-extern void pool_setloadcallback(Pool *pool, int (*cb)(struct s_Pool *, struct 
s_Repodata *, void *), void *loadcbdata);
-extern void pool_setnamespacecallback(Pool *pool, Id (*cb)(struct s_Pool *, 
void *, Id, Id), void *nscbdata);
+extern void pool_setloadcallback(Pool *pool, int (*cb)(Pool *, Repodata *, 
void *), void *loadcbdata);
+extern void pool_setnamespacecallback(Pool *pool, Id (*cb)(Pool *, void *, Id, 
Id), void *nscbdata);
 extern void pool_flush_namespaceproviders(Pool *pool, Id ns, Id evr);
 
-extern void pool_set_custom_vendorcheck(Pool *pool, int (*vendorcheck)(struct 
s_Pool *, Solvable *, Solvable *));
-extern int (*pool_get_custom_vendorcheck(Pool *pool))(struct s_Pool *, 
Solvable *, Solvable *);
+extern void pool_set_custom_vendorcheck(Pool *pool, int (*vendorcheck)(Pool *, 
Solvable *, Solvable *));
+extern int (*pool_get_custom_vendorcheck(Pool *pool))(Pool *, Solvable *, 
Solvable *);
 
 extern char *pool_alloctmpspace(Pool *pool, int len);
 extern void  pool_freetmpspace(Pool *pool, const char *space);
@@ -266,7 +264,7 @@
 extern char *pool_tmpappend(Pool *pool, const char *str1, const char *str2, 
const char *str3);
 extern const char *pool_bin2hex(Pool *pool, const unsigned char *buf, int len);
 
-extern void pool_set_installed(Pool *pool, struct s_Repo *repo);
+extern void pool_set_installed(Pool *pool, Repo *repo);
 
 extern int  pool_error(Pool *pool, int ret, const char *format, ...) 
__attribute__((format(printf, 3, 4)));
 extern char *pool_errstr(Pool *pool);
@@ -363,7 +361,7 @@
  *   key   - search only this key
  *   match - key must match this string
  */
-void pool_search(Pool *pool, Id p, Id key, const char *match, int flags, int 
(*callback)(void *cbdata, Solvable *s, struct s_Repodata *data, struct 
s_Repokey *key, struct s_KeyValue *kv), void *cbdata);
+void pool_search(Pool *pool, Id p, Id key, const char *match, int flags, int 
(*callback)(void *cbdata, Solvable *s, Repodata *data, struct s_Repokey *key, 
struct s_KeyValue *kv), void *cbdata);
 
 void pool_clear_pos(Pool *pool);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/pooltypes.h 
new/libsolv-0.7.25/src/pooltypes.h
--- old/libsolv-0.7.24/src/pooltypes.h  2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/src/pooltypes.h  2023-07-19 11:52:42.000000000 +0200
@@ -40,6 +40,15 @@
 struct s_Pool;
 typedef struct s_Pool Pool;
 
+struct s_Repo;
+typedef struct s_Repo Repo;
+
+struct s_Repodata;
+typedef struct s_Repodata Repodata;
+
+struct s_Solvable;
+typedef struct s_Solvable Solvable;
+
 /* identifier for string values */
 typedef int Id;                /* must be signed!, since negative Id is used 
in solver rules to denote negation */
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/repo.h 
new/libsolv-0.7.25/src/repo.h
--- old/libsolv-0.7.24/src/repo.h       2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/src/repo.h       2023-07-19 11:52:42.000000000 +0200
@@ -24,7 +24,7 @@
 extern "C" {
 #endif
 
-typedef struct s_Repo {
+struct s_Repo {
   const char *name;            /* name pointer */
   Id repoid;                   /* our id */
   void *appdata;               /* application private pointer */
@@ -56,7 +56,7 @@
   int lastmarker;
   Offset lastmarkerpos;
 #endif /* LIBSOLV_INTERNAL */
-} Repo;
+};
 
 extern Repo *repo_create(Pool *pool, const char *name);
 extern void repo_free(Repo *repo, int reuseids);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/repodata.h 
new/libsolv-0.7.25/src/repodata.h
--- old/libsolv-0.7.24/src/repodata.h   2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/src/repodata.h   2023-07-19 11:52:42.000000000 +0200
@@ -34,7 +34,6 @@
 #define SIZEOF_SHA384  48
 #define SIZEOF_SHA512  64
 
-struct s_Repo;
 struct s_KeyValue;
 
 typedef struct s_Repokey {
@@ -67,13 +66,13 @@
 #define REPODATA_FILELIST_FILTERED     1
 #define REPODATA_FILELIST_EXTENSION    2
 
-typedef struct s_Repodata {
+struct s_Repodata {
   Id repodataid;               /* our id */
-  struct s_Repo *repo;         /* back pointer to repo */
+  Repo *repo;                  /* back pointer to repo */
 
   int state;                   /* available, stub or error */
 
-  void (*loadcallback)(struct s_Repodata *);
+  void (*loadcallback)(Repodata *);
 
   int start;                   /* start of solvables this repodata is valid 
for */
   int end;                     /* last solvable + 1 of this repodata */
@@ -140,7 +139,7 @@
   struct dircache *dircache;
 #endif
 
-} Repodata;
+};
 
 #define SOLVID_META            -1
 #define SOLVID_POS             -2
@@ -149,7 +148,7 @@
 /*-----
  * management functions
  */
-void repodata_initdata(Repodata *data, struct s_Repo *repo, int localpool);
+void repodata_initdata(Repodata *data, Repo *repo, int localpool);
 void repodata_freedata(Repodata *data);
 
 void repodata_free(Repodata *data);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/rules.c 
new/libsolv-0.7.25/src/rules.c
--- old/libsolv-0.7.24/src/rules.c      2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/src/rules.c      2023-07-19 11:52:42.000000000 +0200
@@ -1672,6 +1672,16 @@
       if (first)
        continue;               /* not the first in the group */
 
+      if (!bestscore && allowedarchs.count > 1 && 
pool->implicitobsoleteusescolors)
+       {
+         for (j = 0; j < allowedarchs.count; j++)
+           {
+             a = pool_arch2score(pool, allowedarchs.elements[j]);
+             if (a && a != 1 && (!bestscore || a < bestscore))
+               bestscore = a;
+           }
+       }
+
       if (!bestscore)
        continue;               /* did not find a score for this group */
 
@@ -2357,6 +2367,31 @@
 #define DISABLE_BLACK   4
 #define DISABLE_REPOPRIO 5
 
+/* check if installed package p is in lock-step with another installed package 
*/
+static int
+installed_is_in_lockstep(Solver *solv, Id p)
+{
+  Pool *pool = solv->pool;
+  Repo *installed = solv->installed;
+  int rid;
+  Id pp, l;
+  Rule *r;
+
+  if (!installed)
+    return 0;
+  for (rid = solv->infarchrules, r = solv->rules + rid; rid < 
solv->infarchrules_end; rid++, r++)
+    {
+      if (r->p >= 0)
+       continue;
+      if (pool->solvables[-r->p].repo != installed)
+       continue;
+      FOR_RULELITERALS(l, pp, r)
+       if (l == p)
+         return 1;
+    }
+  return 0;
+}
+
 static void
 jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
 {
@@ -2578,6 +2613,20 @@
     case SOLVER_ERASE:
       if (!installed)
        break;
+      set = how & SOLVER_SETMASK;
+      if (!(set & (SOLVER_NOAUTOSET | SOLVER_SETARCH)) && 
pool->implicitobsoleteusescolors && solv->infarchrules != 
solv->infarchrules_end)
+       {
+         if (select == SOLVER_SOLVABLE)
+           set |= SOLVER_SETARCH;
+         else if ((select == SOLVER_SOLVABLE_NAME || select == 
SOLVER_SOLVABLE_PROVIDES) && ISRELDEP(what))
+           {
+             Reldep *rd = GETRELDEP(pool, what);
+             if (rd->flags <= 7 && ISRELDEP(rd->name))
+               rd = GETRELDEP(pool, rd->name);
+             if (rd->flags == REL_ARCH)
+               set |= SOLVER_SETARCH;
+           }
+       }
       if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && 
what == installed->repoid))
        {
          FOR_REPO_SOLVABLES(installed, p, s)
@@ -2587,6 +2636,9 @@
        if (pool->solvables[p].repo == installed)
          {
            queue_push2(q, DISABLE_UPDATE, p);
+           if ((set & SOLVER_SETARCH) != 0 && pool->implicitobsoleteusescolors 
&& solv->infarchrules != solv->infarchrules_end)
+             if (installed_is_in_lockstep(solv, p))
+               queue_push2(q, DISABLE_INFARCH, pool->solvables[p].name);       
        /* allow to break the lock-step */
 #ifdef ENABLE_LINKED_PKGS
            if (solv->instbuddy && solv->instbuddy[p - installed->start] > 1)
              queue_push2(q, DISABLE_UPDATE, solv->instbuddy[p - 
installed->start]);
@@ -3397,6 +3449,7 @@
   int lastaddedcnt;
   unsigned int now;
   int isinstalled;
+  int dodowngradecheck = solv->allowdowngrade;
 
   solv->choicerules = solv->nrules;
   if (!pool->installed)
@@ -3405,6 +3458,8 @@
       return;
     }
   now = solv_timems(0);
+  if ((solv->dupinvolvedmap_all || solv->dupinvolvedmap.size) && 
solv->dup_allowdowngrade)
+    dodowngradecheck = 1;
   queue_init(&q);
   queue_init(&qi);
   queue_init(&qcheck);
@@ -3480,8 +3535,16 @@
          /* do extra checking for packages related to installed packages */
          for (i = j = 0; i < qi.count; i += 2)
            {
+             int isdowngrade = 0;
              p2 = qi.elements[i];
-             if (solv->updatemap_all || (solv->updatemap.size && 
MAPTST(&solv->updatemap, p2 - solv->installed->start)))
+             if (dodowngradecheck)
+               {
+                 p = qi.elements[i + 1];
+                 if (pool->solvables[p2].name == pool->solvables[p].name)
+                   if (pool_evrcmp(pool, pool->solvables[p2].evr, 
pool->solvables[p].evr, EVRCMP_COMPARE) > 0)
+                     isdowngrade = 1;
+               }
+             if (isdowngrade || solv->updatemap_all || (solv->updatemap.size 
&& MAPTST(&solv->updatemap, p2 - solv->installed->start)))
                {
                  if (solver_choicerulecheck(solv, p2, r, &m, &qcheck))
                    continue;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/rules.h 
new/libsolv-0.7.25/src/rules.h
--- old/libsolv-0.7.24/src/rules.h      2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/src/rules.h      2023-07-19 11:52:42.000000000 +0200
@@ -13,10 +13,15 @@
 #ifndef LIBSOLV_RULES_H
 #define LIBSOLV_RULES_H
 
+#include "pooltypes.h"
+#include "bitmap.h"
+#include "queue.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+
 /* ----------------------------------------------
  * Rule
  *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/solver.c 
new/libsolv-0.7.25/src/solver.c
--- old/libsolv-0.7.24/src/solver.c     2023-03-13 16:49:56.000000000 +0100
+++ new/libsolv-0.7.25/src/solver.c     2023-09-06 14:20:05.000000000 +0200
@@ -1135,6 +1135,58 @@
   queue_truncate(q, j);
 }
 
+static int
+replaces_installed_package(Pool *pool, Id p, Map *noupdate)
+{
+  Repo *installed = pool->installed;
+  Solvable *s = pool->solvables + p, *s2;
+  Id p2, pp2;
+  Id obs, *obsp;
+
+  if (s->repo == installed && !(noupdate && MAPTST(noupdate, p - 
installed->start)))
+    return 1;
+  FOR_PROVIDES(p2, pp2, s->name)
+    {
+      s2 = pool->solvables + p2;
+      if (s2->repo == installed && s2->name == s->name && !(noupdate && 
MAPTST(noupdate, p - installed->start)))
+       return 1;
+    }
+  if (!s->obsoletes)
+    return 0;
+  obsp = s->repo->idarraydata + s->obsoletes;
+  while ((obs = *obsp++) != 0)
+    {
+      FOR_PROVIDES(p2, pp2, obs)
+       {
+         s2 = pool->solvables + p2;
+         if (s2->repo != pool->installed || (noupdate && MAPTST(noupdate, p - 
installed->start)))
+           continue;
+         if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, s2, obs))
+           continue;
+         if (pool->obsoleteusescolors && !pool_colormatch(pool, s, s2))
+           continue;
+         return 1;
+       }
+    }
+  return 0;
+}
+
+static void
+prune_dq_for_future_installed(Solver *solv, Queue *dq)
+{
+  Pool *pool = solv->pool;
+  int i, j;
+  for (i = j = 0; i < dq->count; i++)
+    {
+      Id p = dq->elements[i];
+      if (replaces_installed_package(pool, p, &solv->noupdate))
+        dq->elements[j++] = p;
+    }
+  if (j)
+    queue_truncate(dq, j);
+}
+
+
 static void
 reorder_dq_for_future_installed(Solver *solv, int level, Queue *dq)
 {
@@ -1314,9 +1366,13 @@
   if (dq->count > 1)
     policy_filter_unwanted(solv, dq, POLICY_MODE_CHOOSE);
   /* if we're resolving rules and didn't resolve the installed packages yet,
-   * do some special supplements ordering */
+   * do some special pruning and supplements ordering */
   if (dq->count > 1 && solv->do_extra_reordering)
-    reorder_dq_for_future_installed(solv, level, dq);
+    {
+      prune_dq_for_future_installed(solv, dq);
+      if (dq->count > 1)
+       reorder_dq_for_future_installed(solv, level, dq);
+    }
   /* check if the candidates are all connected via yumobs rules */
   if (dq->count > 1 && solv->yumobsrules_end > solv->yumobsrules)
     prune_yumobs(solv, dq, ruleid);
@@ -2980,6 +3036,8 @@
                        continue;
                      if (solv->favormap && solv->favormap[p] > 
solv->favormap[solv->branches.elements[lastsi]])
                        continue;       /* current selection is more favored */
+                     if (replaces_installed_package(pool, p, &solv->noupdate))
+                       continue;       /* current selection replaces an 
installed package */
                      if (!(MAPTST(&solv->recommendsmap, p) || 
solver_is_supplementing(solv, pool->solvables + p)))
                        {
                          lasti = lastsi;
@@ -4671,7 +4729,7 @@
 int
 pool_isemptyupdatejob(Pool *pool, Id how, Id what)
 {
-  Id p, pp, pi, pip;
+  Id p, pp;
   Id select = how & SOLVER_SELECTMASK;
   if ((how & SOLVER_JOBMASK) != SOLVER_UPDATE)
     return 0;
@@ -4684,34 +4742,8 @@
       return 0;
   /* hard work */
   FOR_JOB_SELECT(p, pp, select, what)
-    {
-      Solvable *s = pool->solvables + p;
-      FOR_PROVIDES(pi, pip, s->name)
-       {
-         Solvable *si = pool->solvables + pi;
-         if (si->repo != pool->installed || si->name != s->name)
-           continue;
-         return 0;
-       }
-      if (s->obsoletes)
-       {
-         Id obs, *obsp = s->repo->idarraydata + s->obsoletes;
-         while ((obs = *obsp++) != 0)
-           {
-             FOR_PROVIDES(pi, pip, obs)
-               {
-                 Solvable *si = pool->solvables + pi;
-                 if (si->repo != pool->installed)
-                   continue;
-                 if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, si, 
obs))
-                   continue;
-                 if (pool->obsoleteusescolors && !pool_colormatch(pool, s, si))
-                   continue;
-                 return 0;
-               }
-           }
-       }
-    }
+    if (replaces_installed_package(pool, p, 0))
+      return 0;
   return 1;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/src/transaction.h 
new/libsolv-0.7.25/src/transaction.h
--- old/libsolv-0.7.24/src/transaction.h        2023-03-13 16:49:56.000000000 
+0100
+++ new/libsolv-0.7.25/src/transaction.h        2023-07-19 11:52:42.000000000 
+0200
@@ -21,12 +21,11 @@
 extern "C" {
 #endif
 
-struct s_Pool;
 struct s_DUChanges;
 struct s_TransactionOrderdata;
 
 typedef struct s_Transaction {
-  struct s_Pool *pool;         /* back pointer to pool */
+  Pool *pool;                  /* back pointer to pool */
 
   Queue steps;                 /* the transaction steps */
 
@@ -93,8 +92,8 @@
 #define SOLVER_ORDERCYCLE_NORMAL               1
 #define SOLVER_ORDERCYCLE_CRITICAL             2
 
-extern Transaction *transaction_create(struct s_Pool *pool);
-extern Transaction *transaction_create_decisionq(struct s_Pool *pool, Queue 
*decisionq, Map *multiversionmap);
+extern Transaction *transaction_create(Pool *pool);
+extern Transaction *transaction_create_decisionq(Pool *pool, Queue *decisionq, 
Map *multiversionmap);
 extern Transaction *transaction_create_clone(Transaction *srctrans);
 extern void transaction_free(Transaction *trans);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.24/test/testcases/cplxdeps/ifelse_rec.t 
new/libsolv-0.7.25/test/testcases/cplxdeps/ifelse_rec.t
--- old/libsolv-0.7.24/test/testcases/cplxdeps/ifelse_rec.t     1970-01-01 
01:00:00.000000000 +0100
+++ new/libsolv-0.7.25/test/testcases/cplxdeps/ifelse_rec.t     2023-07-19 
11:52:42.000000000 +0200
@@ -0,0 +1,11 @@
+feature complex_deps
+repo appstream 0 testtags <inline>
+#>=Pkg: xorg-x11-server-Xorg 1.20.11 18.el9 noarch
+#>=Req: missing-req
+#>=Pkg: pass 1.7.4 6.el9 noarch
+#>=Rec: xclip <IF> (xorg-x11-server-Xorg <ELSE> wl-clipboard)
+repo @System 0 empty
+system unset * @System
+job install pkg pass-1.7.4-6.el9.noarch@appstream
+result transaction,problems <inline>
+#>install pass-1.7.4-6.el9.noarch@appstream

Reply via email to