Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libsolv for openSUSE:Factory checked 
in at 2021-10-08 22:04:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libsolv (Old)
 and      /work/SRC/openSUSE:Factory/.libsolv.new.2443 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libsolv"

Fri Oct  8 22:04:48 2021 rev:85 rq:923195 version:0.7.20

Changes:
--------
--- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes  2021-04-15 
16:57:21.158668159 +0200
+++ /work/SRC/openSUSE:Factory/.libsolv.new.2443/libsolv.changes        
2021-10-08 22:05:08.112568707 +0200
@@ -1,0 +2,16 @@
+Sat Sep 25 22:45:07 CEST 2021 - [email protected]
+
+- fix misparsing of '&' in attributes with libxml2
+- choice rules: treat orphaned packages as newest [bsc#1190465]
+- fix compatibility with Python 3.10
+- new SOLVER_EXCLUDEFROMWEAK job type
+- support for environments in comps parser
+- bump version to 0.7.20
+
+-------------------------------------------------------------------
+Fri Jul 30 11:43:29 UTC 2021 - Dominique Leuenberger <[email protected]>
+
+- Disable python2 usage on suse_version >= 1550 by default (still
+  possible to use osc build --with=python).
+
+-------------------------------------------------------------------

Old:
----
  libsolv-0.7.19.tar.bz2

New:
----
  libsolv-0.7.20.tar.bz2

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

Other differences:
------------------
++++++ libsolv.spec ++++++
--- /var/tmp/diff_new_pack.od6zbs/_old  2021-10-08 22:05:08.668569622 +0200
+++ /var/tmp/diff_new_pack.od6zbs/_new  2021-10-08 22:05:08.672569628 +0200
@@ -38,7 +38,11 @@
 # we need at least swig 1.3.40 for the bindings ($typemap support)
 %if 0%{?suse_version} != 1110
 %bcond_without python3
+%if 0%{?suse_version} < 1550
 %bcond_without python
+%else
+%bcond_with python
+%endif
 %bcond_without ruby
 %bcond_without perl
 %else
@@ -52,7 +56,7 @@
 %bcond_with zypp
 
 Name:           libsolv
-Version:        0.7.19
+Version:        0.7.20
 Release:        0
 Summary:        Package dependency solver using a satisfiability algorithm
 License:        BSD-3-Clause
@@ -130,6 +134,7 @@
 dependencies.
 
 %endif
+
 %package devel
 Summary:        Development files for libsolv, a package solver
 Group:          Development/Libraries/C and C++

++++++ libsolv-0.7.19.tar.bz2 -> libsolv-0.7.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/NEWS new/libsolv-0.7.20/NEWS
--- old/libsolv-0.7.19/NEWS     2021-04-07 14:59:20.000000000 +0200
+++ new/libsolv-0.7.20/NEWS     2021-09-25 22:59:13.000000000 +0200
@@ -2,6 +2,15 @@
 This file contains the major changes between
 libsolv versions:
 
+Version 0.7.20
+- selected bug fixes:
+  * fix misparsing of '&' in attributes with libxml2
+  * choice rules: treat orphaned packages as newest
+  * fix compatibility with Python 3.10
+- new features:
+  * new SOLVER_EXCLUDEFROMWEAK job to ignore pkgs for weak dependencies
+  * support for environments in comps parser
+
 Version 0.7.19
 - selected bug fixes:
   * fix rare segfault in resolve_jobrules() that could happen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/VERSION.cmake 
new/libsolv-0.7.20/VERSION.cmake
--- old/libsolv-0.7.19/VERSION.cmake    2021-04-07 14:59:20.000000000 +0200
+++ new/libsolv-0.7.20/VERSION.cmake    2021-09-25 22:59:13.000000000 +0200
@@ -49,5 +49,5 @@
 
 SET(LIBSOLV_MAJOR "0")
 SET(LIBSOLV_MINOR "7")
-SET(LIBSOLV_PATCH "19")
+SET(LIBSOLV_PATCH "20")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/bindings/solv.i 
new/libsolv-0.7.20/bindings/solv.i
--- old/libsolv-0.7.19/bindings/solv.i  2021-04-08 16:34:29.000000000 +0200
+++ new/libsolv-0.7.20/bindings/solv.i  2021-09-02 16:19:13.000000000 +0200
@@ -10,6 +10,12 @@
 %markfunc Pool "mark_Pool";
 #endif
 
+#ifdef SWIGPYTHON
+%begin %{
+#define PY_SSIZE_T_CLEAN
+%}
+#endif
+
 /**
  ** binaryblob handling
  **/
@@ -69,7 +75,7 @@
 
 %typemap(out,noblock=1,fragment="SWIG_FromCharPtrAndSize") BinaryBlob {
 #if defined(SWIGPYTHON) && defined(PYTHON3)
-  $result = $1.data ? Py_BuildValue("y#", $1.data, $1.len) : SWIG_Py_Void();
+  $result = $1.data ? Py_BuildValue("y#", $1.data, (Py_ssize_t)$1.len) : 
SWIG_Py_Void();
 #elif defined(SWIGTCL)
   Tcl_SetObjResult(interp, $1.data ? Tcl_NewByteArrayObj($1.data, $1.len) : 
NULL);
 #else
@@ -1277,6 +1283,7 @@
   static const Id SOLVER_ALLOWUNINSTALL = SOLVER_ALLOWUNINSTALL;
   static const Id SOLVER_FAVOR = SOLVER_FAVOR;
   static const Id SOLVER_DISFAVOR = SOLVER_DISFAVOR;
+  static const Id SOLVER_EXCLUDEFROMWEAK = SOLVER_EXCLUDEFROMWEAK;
   static const Id SOLVER_JOBMASK = SOLVER_JOBMASK;
   static const Id SOLVER_WEAK = SOLVER_WEAK;
   static const Id SOLVER_ESSENTIAL = SOLVER_ESSENTIAL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/doc/libsolv-bindings.txt 
new/libsolv-0.7.20/doc/libsolv-bindings.txt
--- old/libsolv-0.7.19/doc/libsolv-bindings.txt 2019-07-29 06:34:22.000000000 
+0200
+++ new/libsolv-0.7.20/doc/libsolv-bindings.txt 2021-09-25 23:29:14.000000000 
+0200
@@ -12,10 +12,10 @@
 Description
 -----------
 Libsolv's language bindings offer an abstract, object orientated interface
-to the library. The supported languages are currently perl, python, and ruby.
-All example code (except in the specifics sections, of course) lists first
-the ``C-ish'' interface, then the syntax for perl, python, and ruby (in that
-order).
+to the library. The supported languages are currently perl, python, ruby and
+tcl. All example code (except in the specifics sections, of course) lists
+first the ``C-ish'' interface, then the syntax for perl, python, and ruby
+(in that order).
 
 
 Perl Specifics
@@ -2076,6 +2076,10 @@
 can also be used to block recommended or supplemented packages from being
 installed.
 
+*SOLVER_EXCLUDEFROMWEAK*::
+Avoid the specified packages to satisfy recommended or supplemented 
dependencies.
+Unlike SOLVER_DISFAVOR, it does not interfere with other rules.
+
 *SOLVER_JOBMASK*::
 A mask containing all the above action bits.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/doc/libsolv-constantids.txt 
new/libsolv-0.7.20/doc/libsolv-constantids.txt
--- old/libsolv-0.7.19/doc/libsolv-constantids.txt      2018-10-01 
11:09:18.000000000 +0200
+++ new/libsolv-0.7.20/doc/libsolv-constantids.txt      2021-09-25 
23:29:14.000000000 +0200
@@ -15,9 +15,9 @@
 to ease programming and reduce the number of pool_str2id calls. The
 constant Ids are part of the binary ABI of libsolv, a minor version 
 update will only add new constants and not change existing Ids to
-maintain compatible. The on-disk solv format works does not use the
-fixed Ids, but instead references the strings, so solv files can still
-be read when the ABI is broken.
+maintain compatibility. The on-disk solv format does not use the fixed
+Ids, but instead references the strings, so solv files can still be
+read when the ABI is broken.
 
 
 Special Strings
@@ -31,7 +31,7 @@
 
 Solvable Attributes
 -------------------
-These are Ids for keyname of attributes. They can be used in the
+These are Ids for keynames of attributes. They can be used in the
 lookup and storage functions to select the correct attribute in the
 solvable. The descriptions below describe the intended semantics
 of the values stored in the attribute with the keyname.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/doc/libsolv-history.txt 
new/libsolv-0.7.20/doc/libsolv-history.txt
--- old/libsolv-0.7.19/doc/libsolv-history.txt  2018-10-01 11:09:18.000000000 
+0200
+++ new/libsolv-0.7.20/doc/libsolv-history.txt  2021-09-25 23:29:14.000000000 
+0200
@@ -53,12 +53,12 @@
 to see that this indeed was the missing piece: SAT algorithms are well
 researched and there are quite some open source implementations.
 I decided to look at the minisat code, as it is one of the fastest
-solvers while consisting of too many lines of code.
+solvers while consisting of not too many lines of code.
 
 Of course, directly using minisat would not work, as a package solver
 does not need to find just one correct solution, but it also has to
 optimize some metrics, i.e. keep as many packages installed as possible.
-Thus, I needed to write my own solver incorporation the ideas and
+Thus, I needed to write my own solver, incorporating the ideas and
 algorithms used in minisat. This wasn't very hard, and at the end of
 the hack week the solver calculated the first right solutions.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/doc/libsolv.txt 
new/libsolv-0.7.20/doc/libsolv.txt
--- old/libsolv-0.7.19/doc/libsolv.txt  2018-10-01 11:09:18.000000000 +0200
+++ new/libsolv-0.7.20/doc/libsolv.txt  2021-09-25 23:29:14.000000000 +0200
@@ -28,7 +28,7 @@
 Pointer Validity
 ----------------
 Note that all pointers to objects that have an Id have only a limited
-validity period, with the exception of Repo pointers. There are only
+validity period, with the exception of Repo pointers. They are only
 guaranteed to be valid until a new object of that type is added or an
 object of that type is removed. Thus pointers to Solvable objects are only 
 valid until another solvable is created, because adding a Solvable may
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/ext/repo_comps.c 
new/libsolv-0.7.20/ext/repo_comps.c
--- old/libsolv-0.7.19/ext/repo_comps.c 2021-01-19 15:00:21.000000000 +0100
+++ new/libsolv-0.7.20/ext/repo_comps.c 2021-08-30 09:26:04.000000000 +0200
@@ -54,6 +54,8 @@
   STATE_CDISPLAY_ORDER,
   STATE_GROUPLIST,
   STATE_GROUPID,
+  STATE_ENVIRONMENT,
+  STATE_OPTIONLIST,
   NUMSTATES
 };
 
@@ -61,6 +63,7 @@
   { STATE_START,       "comps",         STATE_COMPS,         0 },
   { STATE_COMPS,       "group",         STATE_GROUP,         0 },
   { STATE_COMPS,       "category",      STATE_CATEGORY,      0 },
+  { STATE_COMPS,       "environment",   STATE_ENVIRONMENT,   0 },
   { STATE_GROUP,       "id",            STATE_ID,            1 },
   { STATE_GROUP,       "name",          STATE_NAME,          1 },
   { STATE_GROUP,       "description",   STATE_DESCRIPTION,   1 },
@@ -77,6 +80,13 @@
   { STATE_CATEGORY ,   "grouplist",     STATE_GROUPLIST,     0 },
   { STATE_CATEGORY ,   "display_order", STATE_DISPLAY_ORDER, 1 },
   { STATE_GROUPLIST,   "groupid",       STATE_GROUPID,       1 },
+  { STATE_ENVIRONMENT, "id",            STATE_ID,            1 },
+  { STATE_ENVIRONMENT, "name",          STATE_NAME,          1 },
+  { STATE_ENVIRONMENT, "description",   STATE_DESCRIPTION,   1 },
+  { STATE_ENVIRONMENT, "grouplist",     STATE_GROUPLIST,     0 },
+  { STATE_ENVIRONMENT, "optionlist",    STATE_OPTIONLIST,    0 },
+  { STATE_ENVIRONMENT, "display_order", STATE_DISPLAY_ORDER, 1 },
+  { STATE_OPTIONLIST,  "groupid",       STATE_GROUPID,       1 },
   { NUMSTATES }
 };
 
@@ -128,9 +138,15 @@
     {
     case STATE_GROUP:
     case STATE_CATEGORY:
+    case STATE_ENVIRONMENT:
       s = pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo));
       pd->handle = s - pool->solvables;
-      pd->kind = state == STATE_GROUP ? "group" : "category";
+      if (state == STATE_GROUP)
+        pd->kind = "group";
+      else if (state == STATE_CATEGORY)
+        pd->kind = "category";
+      else
+        pd->kind = "environment";
       pd->isvisible = COMPS_DEFAULT_ISVISIBLE;
       pd->isdefault = COMPS_DEFAULT_ISDEFAULT;
       break;
@@ -160,6 +176,18 @@
        break;
       }
 
+    case STATE_GROUPLIST:
+      {
+       pd->reqtype = SOLVABLE_REQUIRES;
+       break;
+      }
+
+    case STATE_OPTIONLIST:
+      {
+       pd->reqtype = SOLVABLE_SUGGESTS;
+       break;
+      }
+
     default:
       break;
     }
@@ -177,6 +205,7 @@
     {
     case STATE_GROUP:
     case STATE_CATEGORY:
+    case STATE_ENVIRONMENT:
       if (!s->arch)
        s->arch = ARCH_NOARCH;
       if (!s->evr)
@@ -211,7 +240,7 @@
 
     case STATE_GROUPID:
       id = pool_str2id(pd->pool, join2(&pd->jd, "group", ":", content), 1);
-      s->requires = repo_addid_dep(pd->repo, s->requires, id, 0);
+      repo_add_idarray(pd->repo, pd->handle, pd->reqtype, id);
       break;
 
     case STATE_USERVISIBLE:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/ext/repo_testcase.c 
new/libsolv-0.7.20/ext/repo_testcase.c
--- old/libsolv-0.7.19/ext/repo_testcase.c      2020-09-08 12:03:10.000000000 
+0200
+++ new/libsolv-0.7.20/ext/repo_testcase.c      2021-08-30 09:26:04.000000000 
+0200
@@ -480,6 +480,12 @@
       tmp = solvable_lookup_str(s, SOLVABLE_BUILDVERSION);
       if (tmp)
         fprintf(fp, "=Bvr: %s\n", tmp);
+      if (solvable_lookup_idarray(s, SOLVABLE_TRACK_FEATURES, &q))
+       {
+         int i;
+         for (i = 0; i < q.count; i++)
+           fprintf(fp, "=Trf: %s\n", pool_id2str(pool, q.elements[i]));
+       }
       ti = solvable_lookup_num(s, SOLVABLE_BUILDTIME, 0);
       if (ti)
        fprintf(fp, "=Tim: %u\n", ti);
@@ -707,6 +713,9 @@
        case 'B' << 16 | 'v' << 8 | 'r':
          repodata_set_str(data, s - pool->solvables, SOLVABLE_BUILDVERSION, 
line + 6);
          break;
+       case 'T' << 16 | 'r' << 8 | 'f':
+         repodata_add_poolstr_array(data, s - pool->solvables, 
SOLVABLE_TRACK_FEATURES, line + 6);
+         break;
         default:
          break;
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/ext/solv_xmlparser.c 
new/libsolv-0.7.20/ext/solv_xmlparser.c
--- old/libsolv-0.7.19/ext/solv_xmlparser.c     2018-11-22 13:29:48.000000000 
+0100
+++ new/libsolv-0.7.20/ext/solv_xmlparser.c     2021-09-20 15:14:14.000000000 
+0200
@@ -54,6 +54,47 @@
 }
 
 #ifdef WITH_LIBXML2
+static void fixup_att_inplace(char *at)
+{
+  while ((at = strchr(at, '&')) != 0)
+    {
+      at++;
+      if (!memcmp(at, "#38;", 4))
+       memmove(at, at + 4, strlen(at + 4) + 1);
+    }
+}
+
+static const xmlChar **fixup_atts(struct solv_xmlparser *xmlp, const xmlChar 
**atts)
+{
+  size_t needsize = 0;
+  size_t natts;
+  char **at;
+
+  for (natts = 0; atts[natts]; natts++)
+    if (strchr((char *)atts[natts], '&'))
+      needsize += strlen((const char *)atts[natts]) + 1;
+  if (!needsize)
+    return atts;
+  at = xmlp->attsdata = solv_realloc(xmlp->attsdata, (natts + 1) * 
sizeof(xmlChar *) + needsize);
+  needsize = (natts + 1) * sizeof(xmlChar *);
+  for (natts = 0; atts[natts]; natts++)
+    {
+      at[natts] = (char *)atts[natts];
+      if (strchr(at[natts], '&'))
+        {
+         size_t l = strlen(at[natts]) + 1;
+         memcpy((char *)at + needsize, at[natts], l);
+         at[natts] = (char *)at + needsize;
+         needsize += l;
+         fixup_att_inplace(at[natts]);
+        }
+    }
+  at[natts] = 0;
+  return (const xmlChar **)at;
+}
+#endif
+
+#ifdef WITH_LIBXML2
 static void
 start_element(void *userData, const xmlChar *name, const xmlChar **atts)
 #else
@@ -97,6 +138,8 @@
       static const char *nullattr;
       atts = (const xmlChar **)&nullattr;
     }
+  else if (xmlp->state != oldstate)
+    atts = fixup_atts(xmlp, atts);
 #endif
   if (xmlp->state != oldstate)
     xmlp->startelement(xmlp, xmlp->state, el->element, (const char **)atts);
@@ -177,6 +220,7 @@
   queue_free(&xmlp->elementq);
   xmlp->content = solv_free(xmlp->content);
   xmlp->errstr = solv_free(xmlp->errstr);
+  xmlp->attsdata = solv_free(xmlp->attsdata);
 }
 
 static void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/ext/solv_xmlparser.h 
new/libsolv-0.7.20/ext/solv_xmlparser.h
--- old/libsolv-0.7.19/ext/solv_xmlparser.h     2018-11-22 12:59:31.000000000 
+0100
+++ new/libsolv-0.7.20/ext/solv_xmlparser.h     2021-09-20 15:14:14.000000000 
+0200
@@ -30,6 +30,7 @@
 
   Id *elementhelper;
   void *parser;
+  void *attsdata;
 };
 
 #define SOLV_XMLPARSER_OK      0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/ext/testcase.c 
new/libsolv-0.7.20/ext/testcase.c
--- old/libsolv-0.7.19/ext/testcase.c   2021-03-29 15:09:55.000000000 +0200
+++ new/libsolv-0.7.20/ext/testcase.c   2021-09-25 23:14:10.000000000 +0200
@@ -60,6 +60,7 @@
   { SOLVER_FAVOR,          "favor" },
   { SOLVER_DISFAVOR,       "disfavor" },
   { SOLVER_BLACKLIST,      "blacklist" },
+  { SOLVER_EXCLUDEFROMWEAK,   "excludefromweak" },
   { 0, 0 }
 };
 
@@ -2095,7 +2096,7 @@
            }
           repo->priority = prio;
           repo->subpriority = subprio;
-         if (strcmp(pieces[3], "empty") != 0)
+         if (strcmp(pieces[3], "empty") != 0 && npieces > 4)
            {
              const char *repotype = pool_tmpjoin(pool, pieces[3], 0, 0);       
/* gets overwritten in <inline> case */
              if (!strcmp(pieces[4], "<inline>"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/package/libsolv.changes 
new/libsolv-0.7.20/package/libsolv.changes
--- old/libsolv-0.7.19/package/libsolv.changes  2021-04-07 14:59:20.000000000 
+0200
+++ new/libsolv-0.7.20/package/libsolv.changes  2021-10-04 17:59:24.000000000 
+0200
@@ -1,4 +1,20 @@
 -------------------------------------------------------------------
+Sat Sep 25 22:45:07 CEST 2021 - [email protected]
+
+- fix misparsing of '&' in attributes with libxml2
+- choice rules: treat orphaned packages as newest [bsc#1190465]
+- fix compatibility with Python 3.10
+- new SOLVER_EXCLUDEFROMWEAK job type
+- support for environments in comps parser
+- bump version to 0.7.20
+
+-------------------------------------------------------------------
+Fri Jul 30 11:43:29 UTC 2021 - Dominique Leuenberger <[email protected]>
+
+- Disable python2 usage on suse_version >= 1550 by default (still
+  possible to use osc build --with=python).
+
+-------------------------------------------------------------------
 Wed Apr  7 14:56:16 CEST 2021 - [email protected]
 
 - fix rare segfault in resolve_jobrules() that could happen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/package/libsolv.spec.in 
new/libsolv-0.7.20/package/libsolv.spec.in
--- old/libsolv-0.7.19/package/libsolv.spec.in  2020-06-23 12:49:23.000000000 
+0200
+++ new/libsolv-0.7.20/package/libsolv.spec.in  2021-08-30 09:26:04.000000000 
+0200
@@ -1,7 +1,7 @@
 #
 # spec file for package libsolv
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,9 +12,10 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 %define libname libsolv@LIBSOLV_SOVERSION@
 
 %if 0%{?sle_version} >= 120300 || 0%{?suse_version} >= 1330 || 
!0%{?suse_version}
@@ -37,7 +38,11 @@
 # we need at least swig 1.3.40 for the bindings ($typemap support)
 %if 0%{?suse_version} != 1110
 %bcond_without python3
+%if 0%{?suse_version} < 1550
 %bcond_without python
+%else
+%bcond_with python
+%endif
 %bcond_without ruby
 %bcond_without perl
 %else
@@ -56,7 +61,7 @@
 Summary:        Package dependency solver using a satisfiability algorithm
 License:        BSD-3-Clause
 Group:          Development/Libraries/C and C++
-Url:            https://github.com/openSUSE/libsolv
+URL:            https://github.com/openSUSE/libsolv
 Source:         libsolv-%{version}.tar.bz2
 BuildRequires:  cmake
 BuildRequires:  gcc-c++
@@ -112,7 +117,6 @@
 BuildRequires:  libzstd-devel
 %endif
 
-
 %description
 libsolv is a library for solving packages and reading repositories.
 The solver uses a satisfiability algorithm.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/src/conda.c 
new/libsolv-0.7.20/src/conda.c
--- old/libsolv-0.7.19/src/conda.c      2020-07-03 12:09:37.000000000 +0200
+++ new/libsolv-0.7.20/src/conda.c      2021-08-30 09:26:04.000000000 +0200
@@ -670,7 +670,7 @@
   if (build)
     {
       *p++ = ' ';
-      memcpy(p, build, buildend - build);
+      memmove(p, build, buildend - build);
       p += buildend - build;
     }
   evrid = pool_strn2id(pool, version, p - version, 1);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/src/rules.c 
new/libsolv-0.7.20/src/rules.c
--- old/libsolv-0.7.19/src/rules.c      2021-03-18 13:17:35.000000000 +0100
+++ new/libsolv-0.7.20/src/rules.c      2021-09-15 17:04:17.000000000 +0200
@@ -3203,7 +3203,7 @@
       if (!ur->p)
         ur = solv->rules + solv->featurerules + (pi - pool->installed->start);
       if (!ur->p)
-       return 0;
+       return 1;               /* orphaned, thus newest */
       queue_push2(q, pi, 0);
       FOR_RULELITERALS(p, pp, ur)
        if (p > 0 && p != pi)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/src/sha2.c 
new/libsolv-0.7.20/src/sha2.c
--- old/libsolv-0.7.19/src/sha2.c       2019-03-21 15:32:17.000000000 +0100
+++ new/libsolv-0.7.20/src/sha2.c       2021-09-25 23:24:10.000000000 +0200
@@ -607,7 +607,7 @@
        SHA256_Transform(context, context->buffer);
 }
 
-void solv_SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
+void solv_SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* 
context) {
        sha2_word32     *d = (sha2_word32*)digest;
 
        /* Sanity check: */
@@ -904,7 +904,7 @@
        SHA512_Transform(context, context->buffer);
 }
 
-void solv_SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
+void solv_SHA512_Final(sha2_byte digest[SHA512_DIGEST_LENGTH], SHA512_CTX* 
context) {
        sha2_word64     *d = (sha2_word64*)digest;
 
        /* Sanity check: */
@@ -948,7 +948,7 @@
        solv_SHA512_Update((SHA512_CTX*)context, data, len);
 }
 
-void solv_SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
+void solv_SHA384_Final(sha2_byte digest[SHA384_DIGEST_LENGTH], SHA384_CTX* 
context) {
        sha2_word64     *d = (sha2_word64*)digest;
 
        /* Sanity check: */
@@ -993,7 +993,7 @@
        solv_SHA256_Update((SHA256_CTX*)context, data, len);
 }
 
-void solv_SHA224_Final(sha2_byte digest[], SHA224_CTX* context) {
+void solv_SHA224_Final(sha2_byte digest[SHA224_DIGEST_LENGTH], SHA224_CTX* 
context) {
        sha2_word32     *d = (sha2_word32*)digest;
 
        /* Sanity check: */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/src/solver.c 
new/libsolv-0.7.20/src/solver.c
--- old/libsolv-0.7.19/src/solver.c     2021-03-31 13:41:34.000000000 +0200
+++ new/libsolv-0.7.20/src/solver.c     2021-09-02 16:19:13.000000000 +0200
@@ -1398,6 +1398,8 @@
   map_free(&solv->droporphanedmap);
   map_free(&solv->cleandepsmap);
   map_free(&solv->allowuninstallmap);
+  map_free(&solv->excludefromweakmap);
+
 
   solv_free(solv->favormap);
   solv_free(solv->decisionmap);
@@ -2202,6 +2204,20 @@
     queue_truncate(plist, j);
 }
 
+static void
+prune_exclude_from_weak(Solver *solv, Queue *plist)
+{
+  int i, j;
+  for (i = j = 0; i < plist->count; i++)
+    {
+      Id p = plist->elements[i];
+      if (!MAPTST(&solv->excludefromweakmap, p))
+        plist->elements[j++] = p;
+    }
+  if (i != j)
+    queue_truncate(plist, j);
+}
+
 static int
 resolve_weak(Solver *solv, int level, int disablerules, Queue *dq, Queue *dqs, 
int *rerunp)
 {
@@ -2275,6 +2291,8 @@
            continue;
          if (solv->havedisfavored && solv->favormap[i] < 0)
            continue;   /* disfavored supplements, do not install */
+         if (solv->excludefromweakmap.size && 
MAPTST(&solv->excludefromweakmap, i))
+           continue;   /* excluded for weak deps, do not install */
          queue_push(dqs, i);
        }
     }
@@ -2283,6 +2301,10 @@
   if (dq->count && solv->havedisfavored)
     prune_disfavored(solv, dq);
 
+  /* filter out weak_excluded recommended packages */
+  if (solv->excludefromweakmap.size)
+    prune_exclude_from_weak(solv, dq);
+
   /* filter out all packages obsoleted by installed packages */
   /* this is no longer needed if we have (and trust) reverse obsoletes */
   if ((dqs->count || dq->count) && solv->installed)
@@ -3320,6 +3342,37 @@
 #endif
 
 static void
+solver_add_exclude_from_weak(Solver *solv)
+{
+  Queue *job = &solv->job;
+  Pool *pool = solv->pool;
+  int i;
+  Id p, pp, how, what, select;
+for (i = 0; i < job->count; i += 2)
+  {
+    how = job->elements[i];
+    if ((how & SOLVER_JOBMASK) != SOLVER_EXCLUDEFROMWEAK)
+       continue;
+    if (!solv->excludefromweakmap.size)
+       map_grow(&solv->excludefromweakmap, pool->nsolvables);
+    what = job->elements[i + 1];
+    select = how & SOLVER_SELECTMASK;
+    if (select == SOLVER_SOLVABLE_REPO)
+      {
+       Repo *repo = pool_id2repo(pool, what);
+         if (repo)
+           {
+             Solvable *s;
+             FOR_REPO_SOLVABLES(repo, p, s)
+               MAPSET(&solv->excludefromweakmap, p);
+           }
+       }
+      FOR_JOB_SELECT(p, pp, select, what)
+       MAPSET(&solv->excludefromweakmap, p);
+    }
+}
+
+static void
 setup_favormap(Solver *solv)
 {
   Queue *job = &solv->job;
@@ -3385,6 +3438,7 @@
   int hasfavorjob = 0;
   int haslockjob = 0;
   int hasblacklistjob = 0;
+  int hasexcludefromweakjob = 0;
 
   solve_start = solv_timems(0);
 
@@ -3436,6 +3490,7 @@
   map_zerosize(&solv->droporphanedmap);
   solv->allowuninstall_all = 0;
   map_zerosize(&solv->allowuninstallmap);
+  map_zerosize(&solv->excludefromweakmap);
   map_zerosize(&solv->cleandepsmap);
   map_zerosize(&solv->weakrulemap);
   solv->favormap = solv_free(solv->favormap);
@@ -3999,6 +4054,10 @@
          POOL_DEBUG(SOLV_DEBUG_JOB, "job: blacklist %s\n", 
solver_select2str(pool, select, what));
          hasblacklistjob = 1;
          break;
+        case SOLVER_EXCLUDEFROMWEAK:
+         POOL_DEBUG(SOLV_DEBUG_JOB, "job: excludefromweak %s\n", 
solver_select2str(pool, select, what));
+         hasexcludefromweakjob = 1;
+         break;
        default:
          POOL_DEBUG(SOLV_DEBUG_JOB, "job: unknown job\n");
          break;
@@ -4057,6 +4116,9 @@
   else
     solv->blackrules = solv->blackrules_end = solv->nrules;
 
+  if (hasexcludefromweakjob)
+    solver_add_exclude_from_weak(solv);
+
   if (solv->havedisfavored && solv->strongrecommends && solv->recommendsruleq)
     solver_addrecommendsrules(solv);
   else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.7.19/src/solver.h 
new/libsolv-0.7.20/src/solver.h
--- old/libsolv-0.7.19/src/solver.h     2019-11-08 14:39:59.000000000 +0100
+++ new/libsolv-0.7.20/src/solver.h     2021-09-02 16:19:13.000000000 +0200
@@ -208,6 +208,8 @@
   Map allowuninstallmap;               /* ok to uninstall those */
   int allowuninstall_all;
 
+  Map excludefromweakmap;              /* remove them from candidates for 
supplements and recommends */
+
   Id *favormap;                                /* favor job index, > 0: 
favored, < 0: disfavored */
   int havedisfavored;                  /* do we have disfavored packages? */
 
@@ -248,6 +250,7 @@
 #define SOLVER_FAVOR                   0x0c00
 #define SOLVER_DISFAVOR                        0x0d00
 #define SOLVER_BLACKLIST               0x0e00
+#define SOLVER_EXCLUDEFROMWEAK         0x1000
 
 #define SOLVER_JOBMASK                 0xff00
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libsolv-0.7.19/test/testcases/excludefromweak/excludefromweak-obsoletes.t 
new/libsolv-0.7.20/test/testcases/excludefromweak/excludefromweak-obsoletes.t
--- 
old/libsolv-0.7.19/test/testcases/excludefromweak/excludefromweak-obsoletes.t   
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/libsolv-0.7.20/test/testcases/excludefromweak/excludefromweak-obsoletes.t   
    2021-09-02 16:19:13.000000000 +0200
@@ -0,0 +1,35 @@
+repo @System 0 testtags <inline>
+#>=Pkg: pkg-A 1.0 1 noarch
+#>=Prv: pkg-A = 1.0-1
+#>=Rec: pkg-C
+#>=Pkg: pkg-B 1.0 1 noarch
+#>=Prv: pkg-B = 1.0-1
+
+repo available -99.-1000 testtags <inline>
+#>=Pkg: pkg-A 1.0 3 noarch
+#>=Prv: pkg-A = 1.0-3
+#>=Rec: pkg-B
+#>=Pkg: pkg-B 1.0 2 noarch
+#>=Prv: pkg-B = 1.0-2
+#>=Pkg: pkg-C 1.0 1 noarch
+#>=Prv: pkg-C = 1.0-1
+#>=Obs: pkg-B
+
+system x86_64 rpm @System
+poolflags implicitobsoleteusescolors
+solverflags allowvendorchange keepexplicitobsoletes bestobeypolicy keeporphans 
yumobsoletes
+
+job update all packages [forcebest]
+job excludefromweak name pkg-C
+result transaction,problems <inline>
+#>erase pkg-B-1.0-1.noarch@@System pkg-C-1.0-1.noarch@available
+#>install pkg-C-1.0-1.noarch@available
+#>upgrade pkg-A-1.0-1.noarch@@System pkg-A-1.0-3.noarch@available
+
+nextjob
+job update oneof pkg-A-1.0-1.noarch@@System pkg-B-1.0-1.noarch@@System 
pkg-A-1.0-3.noarch@available pkg-B-1.0-2.noarch@available 
pkg-C-1.0-1.noarch@available [forcebest,targeted,setevr,setarch]
+job excludefromweak name pkg-C
+result transaction,problems <inline>
+#>erase pkg-B-1.0-1.noarch@@System pkg-C-1.0-1.noarch@available
+#>install pkg-C-1.0-1.noarch@available
+#>upgrade pkg-A-1.0-1.noarch@@System pkg-A-1.0-3.noarch@available
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libsolv-0.7.19/test/testcases/excludefromweak/excludefromweak.t 
new/libsolv-0.7.20/test/testcases/excludefromweak/excludefromweak.t
--- old/libsolv-0.7.19/test/testcases/excludefromweak/excludefromweak.t 
1970-01-01 01:00:00.000000000 +0100
+++ new/libsolv-0.7.20/test/testcases/excludefromweak/excludefromweak.t 
2021-09-02 16:19:13.000000000 +0200
@@ -0,0 +1,24 @@
+repo @System 0 testtags <inline>
+
+repo available -99.-1000 testtags <inline>
+#>=Pkg: pkg-A 1 1 noarch
+#>=Prv: pkg-A = 1-1
+#>=Rec: pkg-B
+#>=Pkg: pkg-B 1 1 noarch
+#>=Prv: pkg-B = 1-1
+
+system x86_64 rpm @System
+poolflags implicitobsoleteusescolors
+solverflags allowvendorchange keepexplicitobsoletes bestobeypolicy keeporphans 
yumobsoletes
+
+job install oneof pkg-A-1-1.noarch@available 
[forcebest,targeted,setevr,setarch]
+job excludefromweak name pkg-B
+result transaction,problems <inline>
+#>install pkg-A-1-1.noarch@available
+
+nextjob
+job install oneof pkg-A-1-1.noarch@available 
[forcebest,targeted,setevr,setarch]
+job excludefromweak name pkg-A
+job excludefromweak name pkg-B
+result transaction,problems <inline>
+#>install pkg-A-1-1.noarch@available

Reply via email to