Hello community,

here is the log from the commit of package libsolv for openSUSE:Factory checked 
in at 2014-01-27 15:28:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libsolv (Old)
 and      /work/SRC/openSUSE:Factory/.libsolv.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libsolv"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes  2013-12-10 
09:07:51.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes     2014-01-27 
15:29:01.000000000 +0100
@@ -1,0 +2,14 @@
+Fri Jan 24 13:50:03 CET 2014 - [email protected]
+
+- add -X option to susetags2solv [bnc#860271]
+- fix typos in pool_job2str
+- support DISTRO in content parser
+- make addfilelist more resistant against corrupt rpms
+- encode flags into rpmdb cookie
+- add identical and evrcmp methods in bindings
+- copy checksums in repo_add_rpmdb_reffp
+- repo_autopattern: make sure that the category is valid utf8
+- fix double-free if the number of languages is reduced to zero
+- bump version to 0.4.2
+
+-------------------------------------------------------------------

Old:
----
  libsolv-0.4.1.tar.bz2

New:
----
  libsolv-0.4.2.tar.bz2

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

Other differences:
------------------
++++++ libsolv.spec ++++++
--- /var/tmp/diff_new_pack.vstvIC/_old  2014-01-27 15:29:02.000000000 +0100
+++ /var/tmp/diff_new_pack.vstvIC/_new  2014-01-27 15:29:02.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libsolv
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           libsolv
-Version:        0.4.1
+Version:        0.4.2
 Release:        0
 Url:            git://gitorious.org/opensuse/libsolv.git
 Source:         libsolv-%{version}.tar.bz2

++++++ libsolv-0.4.1.tar.bz2 -> libsolv-0.4.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/CMakeLists.txt 
new/libsolv-0.4.2/CMakeLists.txt
--- old/libsolv-0.4.1/CMakeLists.txt    2013-10-15 13:01:33.000000000 +0200
+++ new/libsolv-0.4.2/CMakeLists.txt    2014-01-24 16:10:51.000000000 +0100
@@ -288,7 +288,7 @@
 set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -O3")
 set (CMAKE_C_FLAGS_DEBUG     "${CMAKE_C_FLAGS} -g3 -O0")
 
-SET (SYSTEM_LIBRARIES "-Wl,--as-needed" ${EXPAT_LIBRARY} ${ZLIB_LIBRARY})
+SET (SYSTEM_LIBRARIES ${EXPAT_LIBRARY} ${ZLIB_LIBRARY})
 IF (ENABLE_LZMA_COMPRESSION)
 SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY})
 ENDIF (ENABLE_LZMA_COMPRESSION)
@@ -301,6 +301,7 @@
 IF (ENABLE_HAIKU)
 SET (SYSTEM_LIBRARIES ${HAIKU_SYSTEM_LIBRARIES} ${SYSTEM_LIBRARIES})
 ENDIF (ENABLE_HAIKU)
+SET (SYSTEM_LIBRARIES "-Wl,--as-needed" ${SYSTEM_LIBRARIES})
 
 ADD_SUBDIRECTORY (src)
 ADD_SUBDIRECTORY (ext)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/VERSION.cmake 
new/libsolv-0.4.2/VERSION.cmake
--- old/libsolv-0.4.1/VERSION.cmake     2013-12-03 14:36:45.000000000 +0100
+++ new/libsolv-0.4.2/VERSION.cmake     2014-01-24 14:03:41.000000000 +0100
@@ -49,5 +49,5 @@
 
 SET(LIBSOLV_MAJOR "0")
 SET(LIBSOLV_MINOR "4")
-SET(LIBSOLV_PATCH "1")
+SET(LIBSOLV_PATCH "2")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/bindings/python/CMakeLists.txt 
new/libsolv-0.4.2/bindings/python/CMakeLists.txt
--- old/libsolv-0.4.1/bindings/python/CMakeLists.txt    2013-11-20 
13:01:43.000000000 +0100
+++ new/libsolv-0.4.2/bindings/python/CMakeLists.txt    2014-01-24 
15:10:51.000000000 +0100
@@ -5,6 +5,9 @@
 FIND_PACKAGE (PythonInterp REQUIRED)
 EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from 
distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" 
OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
 
+IF (NOT DEFINED PYTHON_VERSION_MAJOR)
+    SET (PYTHON_VERSION_MAJOR 2)
+ENDIF (NOT DEFINED PYTHON_VERSION_MAJOR)
 IF (${PYTHON_VERSION_MAJOR} GREATER 2)
     SET (SWIG_PY_FLAGS -DPYTHON3=1)
 ENDIF (${PYTHON_VERSION_MAJOR} GREATER 2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/bindings/solv.i 
new/libsolv-0.4.2/bindings/solv.i
--- old/libsolv-0.4.1/bindings/solv.i   2013-11-20 13:01:43.000000000 +0100
+++ new/libsolv-0.4.2/bindings/solv.i   2014-01-09 13:30:53.000000000 +0100
@@ -448,6 +448,7 @@
 
 #include "pool.h"
 #include "poolarch.h"
+#include "evr.h"
 #include "solver.h"
 #include "policy.h"
 #include "solverdebug.h"
@@ -2411,6 +2412,16 @@
     return sel;
   }
 
+#ifdef SWIGRUBY
+  %rename("identical?") identical;
+#endif
+  bool identical(XSolvable *s2) {
+    return solvable_identical($self->pool->solvables + $self->id, 
s2->pool->solvables + s2->id);
+  }
+  int evrcmp(XSolvable *s2) {
+    return pool_evrcmp($self->pool, $self->pool->solvables[$self->id].evr, 
s2->pool->solvables[s2->id].evr, EVRCMP_COMPARE);
+  }
+
   bool __eq__(XSolvable *s) {
     return $self->pool == s->pool && $self->id == s->id;
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/doc/libsolv-bindings.3 
new/libsolv-0.4.2/doc/libsolv-bindings.3
--- old/libsolv-0.4.1/doc/libsolv-bindings.3    2013-10-04 11:23:38.000000000 
+0200
+++ new/libsolv-0.4.2/doc/libsolv-bindings.3    2014-01-21 18:15:52.000000000 
+0100
@@ -2,12 +2,12 @@
 .\"     Title: Libsolv-Bindings
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.0 <http://docbook.sf.net/>
-.\"      Date: 09/24/2013
+.\"      Date: 01/21/2014
 .\"    Manual: LIBSOLV
 .\"    Source: libsolv
 .\"  Language: English
 .\"
-.TH "LIBSOLV\-BINDINGS" "3" "09/24/2013" "libsolv" "LIBSOLV"
+.TH "LIBSOLV\-BINDINGS" "3" "01/21/2014" "libsolv" "LIBSOLV"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -2336,6 +2336,36 @@
 .RS 4
 .\}
 .nf
+\fBbool identical(Solvable *\fR\fIother\fR\fB)\fR
+\fI$solvable\fR\fB\->identical(\fR\fI$other\fR\fB)\fR
+\fI$solvable\fR\fB\&.identical(\fR\fIother\fR\fB)\fR
+\fI$solvable\fR\fB\&.identical?(\fR\fIother\fR\fB)\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Return true if the two solvables are identical\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+\fBint evrcmp(Solvable *\fR\fIother\fR\fB)\fR
+\fI$solvable\fR\fB\->evrcmp(\fR\fIother\fR\fB)\fR
+\fI$solvable\fR\fB\&.evrcmp(\fR\fIother\fR\fB)\fR
+\fI$solvable\fR\fB\&.evrcmp(\fR\fIother\fR\fB)\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Returns \-1 if the epoch/version/release of the solvable is less then the one 
from the other solvable, 1 if it is greater, and 0 if they are equal\&. Note 
that "equal" does not mean that the evr is identical\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
 \fBSelection Selection(int\fR \fIsetflags\fR \fB= 0)\fR
 my \fI$sel\fR \fB=\fR \fI$solvable\fR\fB\->Selection()\fR;
 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
@@ -3495,6 +3525,63 @@
 .RS 4
 The problem can be solved by allowing to replace the package with some other 
package that has a different name\&.
 .RE
+.sp
+Reason constants
+.PP
+\fBSOLVER_REASON_UNRELATED\fR
+.RS 4
+The package status did not change as it was not related to any job\&.
+.RE
+.PP
+\fBSOLVER_REASON_UNIT_RULE\fR
+.RS 4
+The package was installed/erased/kept because of a unit rule, i\&.e\&. a rule 
where all literals but one were false\&.
+.RE
+.PP
+\fBSOLVER_REASON_KEEP_INSTALLED\fR
+.RS 4
+The package was chosen when trying to keep as many packages installed as 
possible\&.
+.RE
+.PP
+\fBSOLVER_REASON_RESOLVE_JOB\fR
+.RS 4
+The decision happened to fulfill a job rule\&.
+.RE
+.PP
+\fBSOLVER_REASON_UPDATE_INSTALLED\fR
+.RS 4
+The decision happened to fulfill a package update request\&.
+.RE
+.PP
+\fBSOLVER_REASON_CLEANDEPS_ERASE\fR
+.RS 4
+The package was erased when cleaning up dependencies from other erased 
packages\&.
+.RE
+.PP
+\fBSOLVER_REASON_RESOLVE\fR
+.RS 4
+The package was installed to fulfill package dependencies\&.
+.RE
+.PP
+\fBSOLVER_REASON_WEAKDEP\fR
+.RS 4
+The package was installed because of a weak dependency (Recommends or 
Supplements)\&.
+.RE
+.PP
+\fBSOLVER_REASON_RESOLVE_ORPHAN\fR
+.RS 4
+The decision about the package was made when deciding the fate of orphaned 
packages\&.
+.RE
+.PP
+\fBSOLVER_REASON_RECOMMENDED\fR
+.RS 4
+This is a special case of SOLVER_REASON_WEAKDEP\&.
+.RE
+.PP
+\fBSOLVER_REASON_SUPPLEMENTED\fR
+.RS 4
+This is a special case of SOLVER_REASON_WEAKDEP\&.
+.RE
 .SS "ATTRIBUTES"
 .sp
 .if n \{\
@@ -3518,9 +3605,9 @@
 .\}
 .nf
 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
-my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR 
\fI$value\fR\fB)\fR;
-\fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR 
\fIvalue\fR\fB)\fR
-\fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR 
\fIvalue\fR\fB)\fR
+my \fI$oldvalue\fR \fB=\fR \fI$solver\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR 
\fI$value\fR\fB)\fR;
+\fIoldvalue\fR \fB=\fR \fIsolver\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR 
\fIvalue\fR\fB)\fR
+\fIoldvalue\fR \fB=\fR \fIsolver\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR 
\fIvalue\fR\fB)\fR
 .fi
 .if n \{\
 .RE
@@ -3531,9 +3618,9 @@
 .\}
 .nf
 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
-my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
-\fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
-\fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
+my \fI$value\fR \fB=\fR \fI$solver\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
+\fIvalue\fR \fB=\fR \fIsolver\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
+\fIvalue\fR \fB=\fR \fIsolver\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
 .fi
 .if n \{\
 .RE
@@ -3570,6 +3657,21 @@
 .\}
 .sp
 Return the transaction to implement the calculated package changes\&. A 
transaction is available even if problems were found, this is useful for 
interactive user interfaces that show both the job result and the problems\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+\fBint\fR \fIreason\fR \fB= describe_decision(Solvable *\fR\fIs\fR\fB, Rule 
*\fR\fIOUTPUT\fR\fB)\fR
+my \fB(\fR\fI$reason\fR\fB,\fR \fI$rule\fR\fB) =\fR 
\fI$solver\fR\fB\->describe_decision(\fR\fI$solvable\fR\fB)\fR;
+\fB(\fR\fIreason\fR\fB,\fR \fIrule\fR\fB) =\fR 
\fIsolver\fR\fB\&.describe_decision(\fR\fIsolvable\fR\fB)\fR
+\fB(\fR\fIreason\fR\fB,\fR \fIrule\fR\fB) =\fR 
\fIsolver\fR\fB\&.describe_decision(\fR\fIsolvable\fR\fB)\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Return the reason why a specific solvable was installed or erased\&. For most 
of the reasons the rule that triggered the decision is also returned\&.
 .SH "THE PROBLEM CLASS"
 .sp
 Problems are the way of the solver to interact with the user\&. You can simply 
list all problems and terminate your program, but a better way is to present 
solutions to the user and let him pick the ones he likes\&.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/doc/libsolv-bindings.txt 
new/libsolv-0.4.2/doc/libsolv-bindings.txt
--- old/libsolv-0.4.1/doc/libsolv-bindings.txt  2013-10-04 11:23:38.000000000 
+0200
+++ new/libsolv-0.4.2/doc/libsolv-bindings.txt  2014-01-21 18:15:52.000000000 
+0100
@@ -1306,6 +1306,22 @@
 
 Return true if the solvable is installed on the system.
 
+       bool identical(Solvable *other)
+       $solvable->identical($other)
+       $solvable.identical(other)
+       $solvable.identical?(other)
+
+Return true if the two solvables are identical.
+
+       int evrcmp(Solvable *other)
+       $solvable->evrcmp(other)
+       $solvable.evrcmp(other)
+       $solvable.evrcmp(other)
+
+Returns -1 if the epoch/version/release of the solvable is less then the
+one from the other solvable, 1 if it is greater, and 0 if they are equal.
+Note that "equal" does not mean that the evr is identical.
+
        Selection Selection(int setflags = 0)
        my $sel = $solvable->Selection();
        sel = solvable.Selection()
@@ -2174,6 +2190,47 @@
 other package that has a different name.
 
 
+Reason constants
+
+*SOLVER_REASON_UNRELATED*::
+The package status did not change as it was not related to any job.
+
+*SOLVER_REASON_UNIT_RULE*::
+The package was installed/erased/kept because of a unit rule, i.e. a rule
+where all literals but one were false.
+
+*SOLVER_REASON_KEEP_INSTALLED*::
+The package was chosen when trying to keep as many packages installed as
+possible.
+
+*SOLVER_REASON_RESOLVE_JOB*::
+The decision happened to fulfill a job rule.
+
+*SOLVER_REASON_UPDATE_INSTALLED*::
+The decision happened to fulfill a package update request.
+
+*SOLVER_REASON_CLEANDEPS_ERASE*::
+The package was erased when cleaning up dependencies from other erased
+packages.
+
+*SOLVER_REASON_RESOLVE*::
+The package was installed to fulfill package dependencies.
+
+*SOLVER_REASON_WEAKDEP*::
+The package was installed because of a weak dependency (Recommends or
+Supplements).
+
+*SOLVER_REASON_RESOLVE_ORPHAN*::
+The decision about the package was made when deciding the fate of orphaned
+packages.
+
+*SOLVER_REASON_RECOMMENDED*::
+This is a special case of SOLVER_REASON_WEAKDEP.
+
+*SOLVER_REASON_SUPPLEMENTED*::
+This is a special case of SOLVER_REASON_WEAKDEP.
+
+
 === ATTRIBUTES ===
 
        Pool *pool;                             /* read only */
@@ -2186,14 +2243,14 @@
 === METHODS ===
 
        int set_flag(int flag, int value)
-       my $oldvalue = $pool->set_flag($flag, $value);
-       oldvalue = pool.set_flag(flag, value)
-       oldvalue = pool.set_flag(flag, value)
+       my $oldvalue = $solver->set_flag($flag, $value);
+       oldvalue = solver.set_flag(flag, value)
+       oldvalue = solver.set_flag(flag, value)
 
        int get_flag(int flag)
-       my $value = $pool->get_flag($flag);
-       value = pool.get_flag(flag)
-       value = pool.get_flag(flag)
+       my $value = $solver->get_flag($flag);
+       value = solver.get_flag(flag)
+       value = solver.get_flag(flag)
 
 Set/get a solver specific flag. The flags define the policies the solver has
 to obey. The flags are explained in the CONSTANTS section of this class.
@@ -2217,6 +2274,14 @@
 is available even if problems were found, this is useful for interactive user
 interfaces that show both the job result and the problems.
 
+       int reason = describe_decision(Solvable *s, Rule *OUTPUT)
+       my ($reason, $rule) = $solver->describe_decision($solvable);
+       (reason, rule) = solver.describe_decision(solvable)
+       (reason, rule) = solver.describe_decision(solvable)
+
+Return the reason why a specific solvable was installed or erased. For most of
+the reasons the rule that triggered the decision is also returned.
+
 The Problem Class
 -----------------
 Problems are the way of the solver to interact with the user. You can simply 
list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/doc/libsolv-constantids.3 
new/libsolv-0.4.2/doc/libsolv-constantids.3
--- old/libsolv-0.4.1/doc/libsolv-constantids.3 2013-10-15 17:16:42.000000000 
+0200
+++ new/libsolv-0.4.2/doc/libsolv-constantids.3 2014-01-21 19:10:52.000000000 
+0100
@@ -2,12 +2,12 @@
 .\"     Title: Libsolv-Constantids
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.0 <http://docbook.sf.net/>
-.\"      Date: 10/15/2013
+.\"      Date: 01/21/2014
 .\"    Manual: LIBSOLV
 .\"    Source: libsolv
 .\"  Language: English
 .\"
-.TH "LIBSOLV\-CONSTANTIDS" "3" "10/15/2013" "libsolv" "LIBSOLV"
+.TH "LIBSOLV\-CONSTANTIDS" "3" "01/21/2014" "libsolv" "LIBSOLV"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -453,6 +453,16 @@
 The seconds since the unix epoch when the pubkey expires\&.
 .RE
 .PP
+\fBPUBKEY_SUBKEYOF "pubkey:subkeyof"\fR
+.RS 4
+The keyid of the master pubkey for subkeys\&.
+.RE
+.PP
+\fBPUBKEY_DATA "pubkey:data"\fR
+.RS 4
+The MPI data of the pubkey\&.
+.RE
+.PP
 \fBSOLVABLE_ISVISIBLE "solvable:isvisible"\fR
 .RS 4
 An attribute describing if the package should be listed to the user or not\&. 
Used for SUSE patterns\&.
@@ -561,11 +571,6 @@
 This is a hack to allow self\-conflicting packages\&. It is not needed with 
current rpm version, so do not use this namespace\&.
 .RE
 .PP
-\fBNAMESPACE_PRODUCTBUDDY "namespace:productbuddy"\fR
-.RS 4
-This is a another hack to implement the SUSE product buddy system\&. Please 
ignore\&.
-.RE
-.PP
 \fBSOLVABLE_PREREQMARKER "solvable:prereqmarker"\fR
 .RS 4
 This marker partitions the normal require dependencies from the prerequires\&. 
It is not needed for dependency solving, but it is used by the transaction 
ordering algorithm when a dependency cycle needs to be broken (non\-prereq deps 
get broken first)\&.
@@ -867,6 +872,11 @@
 The suffix part of the file name of the delta package\&.
 .RE
 .PP
+\fBDELTA_LOCATION_BASE "delta:locbase"\fR
+.RS 4
+This attribute can be used to overwrite the repositories base url for the 
delta\&.
+.RE
+.PP
 \fBDELTA_DOWNLOADSIZE "delta:downloadsize"\fR
 .RS 4
 The size of the delta rpm file\&.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/doc/libsolv-constantids.txt 
new/libsolv-0.4.2/doc/libsolv-constantids.txt
--- old/libsolv-0.4.1/doc/libsolv-constantids.txt       2013-10-15 
17:16:42.000000000 +0200
+++ new/libsolv-0.4.2/doc/libsolv-constantids.txt       2014-01-21 
19:10:52.000000000 +0100
@@ -331,6 +331,12 @@
 *PUBKEY_EXPIRES "pubkey:expires"*::
   The seconds since the unix epoch when the pubkey expires.
 
+*PUBKEY_SUBKEYOF "pubkey:subkeyof"*::
+  The keyid of the master pubkey for subkeys.
+
+*PUBKEY_DATA "pubkey:data"*::
+  The MPI data of the pubkey.
+
 *SOLVABLE_ISVISIBLE "solvable:isvisible"*::
   An attribute describing if the package should be listed to the user
   or not. Used for SUSE patterns.
@@ -420,10 +426,6 @@
   This is a hack to allow self-conflicting packages. It is not needed
   with current rpm version, so do not use this namespace.
 
-*NAMESPACE_PRODUCTBUDDY "namespace:productbuddy"*::
-  This is a another hack to implement the SUSE product buddy system.
-  Please ignore.
-
 *SOLVABLE_PREREQMARKER "solvable:prereqmarker"*::
   This marker partitions the normal require dependencies from the
   prerequires. It is not needed for dependency solving, but it is
@@ -651,6 +653,10 @@
 *DELTA_LOCATION_SUFFIX "delta:locsuffix"*::
   The suffix part of the file name of the delta package.
 
+*DELTA_LOCATION_BASE "delta:locbase"*::
+  This attribute can be used to overwrite the repositories base url for
+  the delta.
+
 *DELTA_DOWNLOADSIZE "delta:downloadsize"*::
   The size of the delta rpm file.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/ext/repo_autopattern.c 
new/libsolv-0.4.2/ext/repo_autopattern.c
--- old/libsolv-0.4.1/ext/repo_autopattern.c    2013-10-16 16:31:42.000000000 
+0200
+++ new/libsolv-0.4.2/ext/repo_autopattern.c    2013-12-13 14:51:43.000000000 
+0100
@@ -180,7 +180,14 @@
              langtag = SOLVABLE_CATEGORY;
              if (*lang && strcmp(lang, "en") != 0)
                langtag = pool_id2langid(pool, SOLVABLE_CATEGORY, lang, 1);
-             repodata_set_str(data, s2 - pool->solvables, langtag, newname);
+             if (newname[solv_validutf8(newname)] == 0)
+               repodata_set_str(data, s2 - pool->solvables, langtag, newname);
+             else
+               {
+                 char *ustr = solv_latin1toutf8(newname);
+                 repodata_set_str(data, s2 - pool->solvables, langtag, ustr);
+                 solv_free(ustr);
+               }
            }
          else if (!strcmp(pn, "pattern-includes()") && evr)
            repodata_add_poolstr_array(data, s2 - pool->solvables, 
SOLVABLE_INCLUDES, pool_tmpjoin(pool, "pattern:", newname, 0));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/ext/repo_content.c 
new/libsolv-0.4.2/ext/repo_content.c
--- old/libsolv-0.4.1/ext/repo_content.c        2013-10-15 11:46:33.000000000 
+0200
+++ new/libsolv-0.4.2/ext/repo_content.c        2014-01-20 13:45:51.000000000 
+0100
@@ -290,6 +290,24 @@
              repodata_add_poolstr_array(data, SOLVID_META, REPOSITORY_REPOID, 
value);
              continue;
            }
+         if (istag ("DISTRO"))
+           {
+             Id dh = repodata_new_handle(data);
+             char *p;
+             /* like with createrepo --distro */
+             if ((p = strchr(value, ',')) != 0)
+               {
+                 *p++ = 0;
+                 if (*value)
+                   repodata_set_poolstr(data, dh, REPOSITORY_PRODUCT_CPEID, 
value);
+               }
+             else
+               p = value;
+             if (*p)
+               repodata_set_str(data, dh, REPOSITORY_PRODUCT_LABEL, p);
+             repodata_add_flexarray(data, SOLVID_META, REPOSITORY_DISTROS, dh);
+             continue;
+           }
 
          if (istag ("DESCRDIR"))
            {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/ext/repo_cudf.c 
new/libsolv-0.4.2/ext/repo_cudf.c
--- old/libsolv-0.4.1/ext/repo_cudf.c   2013-10-16 18:31:43.000000000 +0200
+++ new/libsolv-0.4.2/ext/repo_cudf.c   2014-01-08 14:30:53.000000000 +0100
@@ -177,7 +177,7 @@
 int
 repo_add_cudf(Repo *repo, Repo *installedrepo, FILE *fp, Queue *job, int flags)
 {
-  Pool *pool = repo->pool;
+  Pool *pool;
   char *buf, *p;
   int bufa, bufl, c;
   Solvable *s;
@@ -190,6 +190,7 @@
   xrepo = repo ? repo : installedrepo;
   if (!xrepo)
     return -1;
+  pool = xrepo->pool;
 
   buf = solv_malloc(4096);
   bufa = 4096;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/ext/repo_helix.c 
new/libsolv-0.4.2/ext/repo_helix.c
--- old/libsolv-0.4.1/ext/repo_helix.c  2013-10-16 18:31:43.000000000 +0200
+++ new/libsolv-0.4.2/ext/repo_helix.c  2013-12-13 15:02:48.000000000 +0100
@@ -15,7 +15,7 @@
  * wrote Red Carpet. The company was later renamed to Ximian.
  * The Red Carpet solver was merged into the ZYPP project, the
  * library used both by ZENworks and YaST for package management.
- * Red Carpet came with solver testcases in it's own repository
+ * Red Carpet came with solver testcases in its own repository
  * format, the 'helix' format.
  *
  */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/ext/repo_mdk.c 
new/libsolv-0.4.2/ext/repo_mdk.c
--- old/libsolv-0.4.1/ext/repo_mdk.c    2013-10-04 11:23:38.000000000 +0200
+++ new/libsolv-0.4.2/ext/repo_mdk.c    2014-01-08 14:30:53.000000000 +0100
@@ -95,7 +95,9 @@
   while (fgets(buf + bufl, bufa - bufl, fp) > 0)
     {
       bufl += strlen(buf + bufl);
-      if (bufl && buf[bufl - 1] != '\n')
+      if (!bufl)
+       continue;
+      if (buf[bufl - 1] != '\n')
        {
          if (bufa - bufl < 256)
            {
@@ -104,7 +106,7 @@
            }
          continue;
        }
-      buf[--bufl] = 0;
+      buf[bufl - 1] = 0;
       bufl = 0;
       if (buf[0] != '@')
        {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/ext/repo_pubkey.c 
new/libsolv-0.4.2/ext/repo_pubkey.c
--- old/libsolv-0.4.1/ext/repo_pubkey.c 2013-11-18 14:51:42.000000000 +0100
+++ new/libsolv-0.4.2/ext/repo_pubkey.c 2014-01-20 12:25:52.000000000 +0100
@@ -1195,7 +1195,7 @@
 
 #ifdef ENABLE_PGPVRFY
 
-/* warning: does not check key expiry/revokation, like gpgv or rpm */
+/* warning: does not check key expiry/revokation, same as with gpgv or rpm */
 /* returns the Id of the pubkey that verified the signature */
 Id
 repo_verify_sigdata(Repo *repo, unsigned char *sigdata, int sigdatal, const 
char *keyid)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/ext/repo_rpmdb.c 
new/libsolv-0.4.2/ext/repo_rpmdb.c
--- old/libsolv-0.4.1/ext/repo_rpmdb.c  2013-11-14 16:36:43.000000000 +0100
+++ new/libsolv-0.4.2/ext/repo_rpmdb.c  2014-01-22 17:15:52.000000000 +0100
@@ -50,7 +50,8 @@
 
 /* 3: added triggers */
 /* 4: fixed triggers */
-#define RPMDB_COOKIE_VERSION 4
+/* 5: fixed checksum copying */
+#define RPMDB_COOKIE_VERSION 5
 
 #define TAG_NAME               1000
 #define TAG_VERSION            1001
@@ -644,7 +645,7 @@
   for (i = 0; i < fc; i++)
     {
       if (di[i] >= dc)
-       continue;
+       continue;       /* corrupt entry */
       fn[di[i]]++;
       if (fsz[i] == 0 || !S_ISREG(fm[i]))
        continue;
@@ -682,7 +683,7 @@
   int bnc, dnc, dic;
   int i;
   Id lastdid = 0;
-  int lastdii = -1;
+  unsigned int lastdii = -1;
 
   if (!data)
     return;
@@ -719,6 +720,8 @@
        did = lastdid;
       else
        {
+         if (di[i] >= dnc)
+           continue;   /* corrupt entry */
          did = repodata_str2dir(data, dn[di[i]], 1);
          if (!did)
            did = repodata_str2dir(data, "/", 1);
@@ -1014,10 +1017,41 @@
 #endif
 }
 
+#ifdef FEDORA
+int
+serialize_dbenv_ops(struct rpmdbstate *state)
+{
+  char lpath[PATH_MAX];
+  mode_t oldmask;
+  int fd;
+  struct flock fl;
+
+  snprintf(lpath, PATH_MAX, "%s/var/lib/rpm/.dbenv.lock", state->rootdir ? 
state->rootdir : "");
+  oldmask = umask(022);
+  fd = open(lpath, (O_RDWR|O_CREAT), 0644);
+  umask(oldmask);
+  if (fd < 0)
+    return -1;
+  memset(&fl, 0, sizeof(fl));
+  fl.l_type = F_WRLCK;
+  fl.l_whence = SEEK_SET;
+  for (;;)
+    {
+      if (fcntl(fd, F_SETLKW, &fl) != -1)
+       return fd;
+      if (errno != EINTR)
+       break;
+    }
+  close(fd);
+  return -1;
+}
+#endif
+
 /* should look in /usr/lib/rpm/macros instead, but we want speed... */
 static int
-opendbenv(struct rpmdbstate *state, const char *rootdir)
+opendbenv(struct rpmdbstate *state)
 {
+  const char *rootdir = state->rootdir;
   char dbpath[PATH_MAX];
   DB_ENV *dbenv = 0;
   int r;
@@ -1035,7 +1069,10 @@
   else
     {
 #ifdef FEDORA
+      int serialize_fd = serialize_dbenv_ops(state);
       r = dbenv->open(dbenv, dbpath, DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL, 
0644);
+      if (serialize_fd >= 0)
+       close(serialize_fd);
 #else
       r = dbenv->open(dbenv, dbpath, DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL, 0);
 #endif
@@ -1050,20 +1087,45 @@
   return 1;
 }
 
+static void
+closedbenv(struct rpmdbstate *state)
+{
+#ifdef FEDORA
+  uint32_t eflags = 0;
+#endif
+
+  if (!state->dbenv)
+    return;
+#ifdef FEDORA
+  (void)state->dbenv->get_open_flags(state->dbenv, &eflags);
+  if (!(eflags & DB_PRIVATE))
+    {
+      int serialize_fd = serialize_dbenv_ops(state);
+      state->dbenv->close(state->dbenv, 0);
+      if (serialize_fd >= 0)
+       close(serialize_fd);
+    }
+  else
+    state->dbenv->close(state->dbenv, 0);
+#else
+  state->dbenv->close(state->dbenv, 0);
+#endif
+  state->dbenv = 0;
+}
+
 static int
 openpkgdb(struct rpmdbstate *state)
 {
   if (state->dbopened)
     return state->dbopened > 0 ? 1 : 0;
   state->dbopened = -1;
-  if (!state->dbenv && !opendbenv(state, state->rootdir))
+  if (!state->dbenv && !opendbenv(state))
     return 0;
   if (db_create(&state->db, state->dbenv, 0))
     {
       pool_error(state->pool, 0, "db_create: %s", strerror(errno));
       state->db = 0;
-      state->dbenv->close(state->dbenv, 0);
-      state->dbenv = 0;
+      closedbenv(state);
       return 0;
     }
   if (state->db->open(state->db, 0, "Packages", 0, DB_UNKNOWN, DB_RDONLY, 
0664))
@@ -1071,8 +1133,7 @@
       pool_error(state->pool, 0, "db->open Packages: %s", strerror(errno));
       state->db->close(state->db, 0);
       state->db = 0;
-      state->dbenv->close(state->dbenv, 0);
-      state->dbenv = 0;
+      closedbenv(state);
       return 0;
     }
   if (state->db->get_byteswapped(state->db, &state->byteswapped))
@@ -1080,8 +1141,7 @@
       pool_error(state->pool, 0, "db->get_byteswapped: %s", strerror(errno));
       state->db->close(state->db, 0);
       state->db = 0;
-      state->dbenv->close(state->dbenv, 0);
-      state->dbenv = 0;
+      closedbenv(state);
       return 0;
     }
   state->dbopened = 1;
@@ -1112,7 +1172,7 @@
   if (namedatap)
     *namedatap = 0;
 
-  if (!state->dbenv && !opendbenv(state, state->rootdir))
+  if (!state->dbenv && !opendbenv(state))
     return 0;
   dbenv = state->dbenv;
   if (db_create(&db, dbenv, 0))
@@ -1283,7 +1343,7 @@
   if (state->db)
     state->db->close(state->db, 0);
   if (state->dbenv)
-    state->dbenv->close(state->dbenv, 0);
+    closedbenv(state);
   solv_free(state->rpmhead);
 }
 
@@ -1306,8 +1366,9 @@
 }
 
 static int
-count_headers(Pool *pool, const char *rootdir, DB_ENV *dbenv)
+count_headers(struct rpmdbstate *state)
 {
+  Pool *pool = state->pool;
   char dbpath[PATH_MAX];
   struct stat statbuf;
   DB *db = 0;
@@ -1316,12 +1377,12 @@
   DBT dbkey;
   DBT dbdata;
 
-  snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Name", rootdir ? rootdir : "");
+  snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Name", state->rootdir ? 
state->rootdir : "");
   if (stat(dbpath, &statbuf))
     return 0;
   memset(&dbkey, 0, sizeof(dbkey));
   memset(&dbdata, 0, sizeof(dbdata));
-  if (db_create(&db, dbenv, 0))
+  if (db_create(&db, state->dbenv, 0))
     {
       pool_error(pool, 0, "db_create: %s", strerror(errno));
       return 0;
@@ -1468,6 +1529,11 @@
       cbdata->handle = repodata_new_handle(data);
       repodata_add_flexarray(data, cbdata->subhandle, keyname, cbdata->handle);
       break;
+    case REPOKEY_TYPE_MD5:
+    case REPOKEY_TYPE_SHA1:
+    case REPOKEY_TYPE_SHA256:
+      repodata_set_bin_checksum(data, handle, keyname, key->type, (const 
unsigned char *)kv->str);
+      break;
     default:
       break;
     }
@@ -1510,9 +1576,9 @@
 #else
   FOR_REPODATAS(fromrepo, i, data)
     {
-      if (p < data->start || p >= data->end)
-       continue;
-      repodata_search(data, p, 0, SEARCH_SUB | SEARCH_ARRAYSENTINEL, 
solvable_copy_cb, &cbdata);
+      if (p >= data->start && p < data->end)
+        repodata_search(data, p, 0, SEARCH_SUB | SEARCH_ARRAYSENTINEL, 
solvable_copy_cb, &cbdata);
+      cbdata.dircache = 0;     /* only for first repodata */
     }
 #endif
 }
@@ -1566,12 +1632,24 @@
 }
 
 static void
-mkrpmdbcookie(struct stat *st, unsigned char *cookie)
+mkrpmdbcookie(struct stat *st, unsigned char *cookie, int flags)
 {
+  int f = 0;
   memset(cookie, 0, 32);
   cookie[3] = RPMDB_COOKIE_VERSION;
   memcpy(cookie + 16, &st->st_ino, sizeof(st->st_ino));
   memcpy(cookie + 24, &st->st_dev, sizeof(st->st_dev));
+  if ((flags & RPM_ADD_WITH_PKGID) != 0)
+    f |= 1;
+  if ((flags & RPM_ADD_WITH_HDRID) != 0)
+    f |= 2;
+  if ((flags & RPM_ADD_WITH_CHANGELOG) != 0)
+    f |= 4;
+  if ((flags & RPM_ADD_NO_FILELIST) == 0)
+    f |= 8;
+  if ((flags & RPM_ADD_NO_RPMLIBREQS) != 0)
+    cookie[1] = 1;
+  cookie[0] = f;
 }
 
 /*
@@ -1590,7 +1668,6 @@
   Id oldcookietype = 0;
   Repodata *data;
   int count = 0, done = 0;
-  const char *rootdir = 0;
   struct rpmdbstate state;
   int i;
   Solvable *s;
@@ -1599,6 +1676,8 @@
   now = solv_timems(0);
   memset(&state, 0, sizeof(state));
   state.pool = pool;
+  if (flags & REPO_USE_ROOTDIR)
+    state.rootdir = solv_strdup(pool_get_rootdir(pool));
 
   data = repo_add_repodata(repo, flags);
 
@@ -1609,20 +1688,21 @@
       ref = 0;
     }
 
-  if (flags & REPO_USE_ROOTDIR)
-    rootdir = pool_get_rootdir(pool);
-  if (!opendbenv(&state, rootdir))
-    return -1;
+  if (!opendbenv(&state))
+    {
+      solv_free(state.rootdir);
+      return -1;
+    }
 
   /* XXX: should get ro lock of Packages database! */
-  snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Packages", rootdir ? rootdir : 
"");
+  snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Packages", state.rootdir ? 
state.rootdir : "");
   if (stat(dbpath, &packagesstat))
     {
       pool_error(pool, -1, "%s: %s", dbpath, strerror(errno));
       freestate(&state);
       return -1;
     }
-  mkrpmdbcookie(&packagesstat, newcookie);
+  mkrpmdbcookie(&packagesstat, newcookie, flags);
   repodata_set_bin_checksum(data, SOLVID_META, REPOSITORY_RPMDBCOOKIE, 
REPOKEY_TYPE_SHA256, newcookie);
 
   if (ref)
@@ -1636,7 +1716,7 @@
       if (ref && (flags & RPMDB_EMPTY_REFREPO) != 0)
        repo_empty(ref, 1);     /* get it out of the way */
       if ((flags & RPMDB_REPORT_PROGRESS) != 0)
-       count = count_headers(pool, rootdir, state.dbenv);
+       count = count_headers(&state);
       if (!openpkgdb(&state))
        {
          freestate(&state);
@@ -1807,7 +1887,7 @@
          if (res <= 0)
            {
              if (!res)
-               return pool_error(pool, -1, "inconsistent rpm database, key %d 
not found. run 'rpm --rebuilddb' to fix.", dbid);
+               pool_error(pool, -1, "inconsistent rpm database, key %d not 
found. run 'rpm --rebuilddb' to fix.", dbid);
              freestate(&state);
              solv_free(entries);
              solv_free(namedata);
@@ -2116,8 +2196,7 @@
       repodata_set_bin_checksum(data, s - pool->solvables, SOLVABLE_CHECKSUM, 
chksumtype, solv_chksum_get(chksumh, 0));
       chksumh = solv_chksum_free(chksumh, 0);
     }
-  if (rpmhead)
-    solv_free(rpmhead);
+  solv_free(rpmhead);
   if (!(flags & REPO_NO_INTERNALIZE))
     repodata_internalize(data);
   return s - pool->solvables;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/ext/testcase.c 
new/libsolv-0.4.2/ext/testcase.c
--- old/libsolv-0.4.1/ext/testcase.c    2013-11-14 16:36:43.000000000 +0100
+++ new/libsolv-0.4.2/ext/testcase.c    2014-01-08 14:30:53.000000000 +0100
@@ -1099,7 +1099,7 @@
       linep += strlen(linep);
       if (linep == line || linep[-1] != '\n')
        continue;
-      *--linep = 0;
+      linep[-1] = 0;
       linep = line + intag;
       if (intag)
        {
@@ -1739,6 +1739,7 @@
              pool_debug(solv->pool, SOLV_ERROR, "testcase_write: write 
error\n");
              solv_free(result);
              strqueue_free(&sq);
+             fclose(fp);
              return 0;
            }
          if (fclose(fp))
@@ -1763,6 +1764,7 @@
     {
       pool_debug(solv->pool, SOLV_ERROR, "testcase_write: write error\n");
       strqueue_free(&sq);
+      fclose(fp);
       return 0;
     }
   if (fclose(fp))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/package/libsolv.changes 
new/libsolv-0.4.2/package/libsolv.changes
--- old/libsolv-0.4.1/package/libsolv.changes   2013-12-09 13:51:27.000000000 
+0100
+++ new/libsolv-0.4.2/package/libsolv.changes   2014-01-24 14:03:41.000000000 
+0100
@@ -1,4 +1,18 @@
 -------------------------------------------------------------------
+Fri Jan 24 13:50:03 CET 2014 - [email protected]
+
+- add -X option to susetags2solv [bnc#860271]
+- fix typos in pool_job2str
+- support DISTRO in content parser
+- make addfilelist more resistant against corrupt rpms
+- encode flags into rpmdb cookie
+- add identical and evrcmp methods in bindings
+- copy checksums in repo_add_rpmdb_reffp
+- repo_autopattern: make sure that the category is valid utf8
+- fix double-free if the number of languages is reduced to zero
+- bump version to 0.4.2
+
+-------------------------------------------------------------------
 Mon Dec  9 11:53:06 CET 2013 - [email protected]
 
 - make repo2solv.sh work when appdata support is off
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/src/knownid.h 
new/libsolv-0.4.2/src/knownid.h
--- old/libsolv-0.4.1/src/knownid.h     2013-11-21 13:56:43.000000000 +0100
+++ new/libsolv-0.4.2/src/knownid.h     2014-01-20 11:25:53.000000000 +0100
@@ -15,6 +15,9 @@
  * the ABI!
  */
 
+#ifndef LIBSOLV_KNOWNID_H
+#define LIBSOLV_KNOWNID_H
+
 #undef KNOWNID
 #ifdef KNOWNID_INITIALIZE
 # define KNOWNID(a, b) b
@@ -270,3 +273,6 @@
 
 #undef KNOWNID
 
+#endif
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/src/pool.c new/libsolv-0.4.2/src/pool.c
--- old/libsolv-0.4.1/src/pool.c        2013-10-18 11:56:44.000000000 +0200
+++ new/libsolv-0.4.2/src/pool.c        2014-01-20 11:30:52.000000000 +0100
@@ -30,6 +30,7 @@
 
 #define SOLVABLE_BLOCK 255
 
+#undef LIBSOLV_KNOWNID_H
 #define KNOWNID_INITIALIZE
 #include "knownid.h"
 #undef KNOWNID_INITIALIZE
@@ -1661,12 +1662,9 @@
 
   pool->languagecache = solv_free(pool->languagecache);
   pool->languagecacheother = 0;
-  if (pool->nlanguages)
-    {
-      for (i = 0; i < pool->nlanguages; i++)
-       free((char *)pool->languages[i]);
-      free(pool->languages);
-    }
+  for (i = 0; i < pool->nlanguages; i++)
+    free((char *)pool->languages[i]);
+  pool->languages = solv_free(pool->languages);
   pool->nlanguages = nlanguages;
   if (!nlanguages)
     return;
@@ -1936,27 +1934,14 @@
 
 #define MPTREE_BLOCK 15
 
-void
-pool_calc_duchanges(Pool *pool, Map *installedmap, DUChanges *mps, int nmps)
+static struct mptree *
+create_mptree(DUChanges *mps, int nmps)
 {
-  char *p;
-  const char *path, *compstr;
-  struct mptree *mptree;
   int i, nmptree;
+  struct mptree *mptree;
   int pos, compl;
   int mp;
-  struct ducbdata cbd;
-  Solvable *s;
-  Id sp;
-  Map ignoredu;
-  Repo *oldinstalled = pool->installed;
-
-  memset(&ignoredu, 0, sizeof(ignoredu));
-  cbd.mps = mps;
-  cbd.addsub = 0;
-  cbd.dirmap = 0;
-  cbd.nmap = 0;
-  cbd.olddata = 0;
+  const char *p, *path, *compstr;
 
   mptree = solv_extend_resize(0, 1, sizeof(struct mptree), MPTREE_BLOCK);
 
@@ -2026,6 +2011,26 @@
     }
 #endif
 
+  return mptree;
+}
+
+void
+pool_calc_duchanges(Pool *pool, Map *installedmap, DUChanges *mps, int nmps)
+{
+  struct mptree *mptree;
+  struct ducbdata cbd;
+  Solvable *s;
+  int sp;
+  Map ignoredu;
+  Repo *oldinstalled = pool->installed;
+
+  map_init(&ignoredu, 0);
+  mptree = create_mptree(mps, nmps);
+
+  cbd.mps = mps;
+  cbd.dirmap = 0;
+  cbd.nmap = 0;
+  cbd.olddata = 0;
   cbd.mptree = mptree;
   cbd.addsub = 1;
   for (sp = 1, s = pool->solvables + sp; sp < pool->nsolvables; sp++, s++)
@@ -2040,8 +2045,8 @@
        {
          Id op, opp;
          /* no du data available, ignore data of all installed solvables we 
obsolete */
-         if (!ignoredu.map)
-           map_init(&ignoredu, oldinstalled->end - oldinstalled->start);
+         if (!ignoredu.size)
+           map_grow(&ignoredu, oldinstalled->end - oldinstalled->start);
          if (s->obsoletes)
            {
              Id obs, *obsp = s->repo->idarraydata + s->obsoletes;
@@ -2069,8 +2074,7 @@
          repo_search(oldinstalled, sp, SOLVABLE_DISKUSAGE, 0, 0, 
solver_fill_DU_cb, &cbd);
        }
     }
-  if (ignoredu.map)
-    map_free(&ignoredu);
+  map_free(&ignoredu);
   solv_free(cbd.dirmap);
   solv_free(mptree);
 }
@@ -2114,7 +2118,7 @@
 {
   while (ISRELDEP(dep))
     {
-      Reldep *rd = rd = GETRELDEP(pool, dep);
+      Reldep *rd = GETRELDEP(pool, dep);
       dep = rd->name;
     }
   return dep;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/src/rules.c 
new/libsolv-0.4.2/src/rules.c
--- old/libsolv-0.4.1/src/rules.c       2013-12-04 18:41:47.000000000 +0100
+++ new/libsolv-0.4.2/src/rules.c       2013-12-17 13:35:52.000000000 +0100
@@ -801,6 +801,21 @@
            }
        }
 
+      if (m && pool->implicitobsoleteusescolors && (s->arch > pool->lastarch 
|| pool->id2arch[s->arch] != 1))
+       {
+         int a = pool->id2arch[s->arch];
+         /* check lock-step candidates */
+         FOR_PROVIDES(p, pp, s->name)
+           {
+             Solvable *ps = pool->solvables + p;
+             if (s->name != ps->name || s->evr != ps->evr || MAPTST(m, p))
+               continue;
+             if (ps->arch > pool->lastarch || pool->id2arch[ps->arch] == 1 || 
pool->id2arch[ps->arch] >= a)
+               continue;
+             queue_push(&workq, p);
+           }
+       }
+
       /*-----------------------------------------
        * add recommends to the work queue
        */
@@ -1177,6 +1192,7 @@
 solver_addinfarchrules(Solver *solv, Map *addedmap)
 {
   Pool *pool = solv->pool;
+  Repo *installed = pool->installed;
   int first, i, j;
   Id p, pp, a, aa, bestarch;
   Solvable *s, *ps, *bests;
@@ -1207,7 +1223,7 @@
            break;
          a = ps->arch;
          a = (a <= pool->lastarch) ? pool->id2arch[a] : 0;
-         if (a != 1 && pool->installed && ps->repo == pool->installed)
+         if (a != 1 && installed && ps->repo == installed)
            {
              if (!solv->dupmap_all && !(solv->dupinvolvedmap.size && 
MAPTST(&solv->dupinvolvedmap, p)))
                queue_pushunique(&allowedarchs, ps->arch);      /* also ok to 
keep this architecture */
@@ -1221,9 +1237,51 @@
        }
       if (first)
        continue;
+
       /* speed up common case where installed package already has best arch */
       if (allowedarchs.count == 1 && bests && allowedarchs.elements[0] == 
bests->arch)
        allowedarchs.count--;   /* installed arch is best */
+
+      if (allowedarchs.count && pool->implicitobsoleteusescolors && installed 
&& bestarch)
+       {
+         /* need an extra pass for lockstep checking: we only allow to keep an 
inferior arch
+          * if the corresponding installed package is not lock-stepped */
+         queue_empty(&allowedarchs);
+         FOR_PROVIDES(p, pp, s->name)
+           {
+             Id p2, pp2;
+             ps = pool->solvables + p;
+             if (ps->name != s->name || ps->repo != installed || 
!MAPTST(addedmap, p))
+               continue;
+             if (solv->dupmap_all || (solv->dupinvolvedmap.size && 
MAPTST(&solv->dupinvolvedmap, p)))
+               continue;
+             a = ps->arch;
+             a = (a <= pool->lastarch) ? pool->id2arch[a] : 0;
+             if (!a)
+               {
+                 queue_pushunique(&allowedarchs, ps->arch);    /* strange 
arch, allow */
+                 continue;
+               }
+             if (a == 1 || ((a ^ bestarch) & 0xffff0000) == 0)
+               continue;
+             /* have installed package with inferior arch, check if 
lock-stepped */
+             FOR_PROVIDES(p2, pp2, s->name)
+               {
+                 Solvable *s2 = pool->solvables + p2;
+                 Id a2;
+                 if (p2 == p || s2->name != s->name || s2->evr != 
pool->solvables[p].evr || s2->arch == pool->solvables[p].arch)
+                   continue;
+                 a2 = s2->arch;
+                 a2 = (a2 <= pool->lastarch) ? pool->id2arch[a2] : 0;
+                 if (a2 && (a2 == 1 || ((a2 ^ bestarch) & 0xffff0000) == 0))
+                   break;
+               }
+             if (!p2)
+               queue_pushunique(&allowedarchs, ps->arch);
+           }
+       }
+
+      /* find all bad packages */
       queue_empty(&badq);
       FOR_PROVIDES(p, pp, s->name)
        {
@@ -1234,8 +1292,12 @@
          a = (a <= pool->lastarch) ? pool->id2arch[a] : 0;
          if (a != 1 && bestarch && ((a ^ bestarch) & 0xffff0000) != 0)
            {
-             if (pool->installed && ps->repo == pool->installed)
-               continue;       /* always ok to keep an installed package */
+             if (installed && ps->repo == installed)
+               {
+                 if (pool->implicitobsoleteusescolors)
+                   queue_push(&badq, p);               /* special lock-step 
handling, see below */
+                 continue;     /* always ok to keep an installed package */
+               }
              for (j = 0; j < allowedarchs.count; j++)
                {
                  aa = allowedarchs.elements[j];
@@ -1249,8 +1311,7 @@
                queue_push(&badq, p);
            }
        }
-      if (!badq.count)
-       continue;
+
       /* block all solvables in the badq! */
       for (j = 0; j < badq.count; j++)
        {
@@ -1259,6 +1320,7 @@
          if (pool->implicitobsoleteusescolors)
            {
              Id p2;
+             int haveinstalled = 0;
              queue_empty(&lsq);
              FOR_PROVIDES(p2, pp, s->name)
                {
@@ -1267,9 +1329,15 @@
                    continue;
                  a = s2->arch;
                  a = (a <= pool->lastarch) ? pool->id2arch[a] : 0;
-                 if (a && (a == 1 || a == bestarch))
-                   queue_push(&lsq, p2);
+                 if (a && (a == 1 || ((a ^ bestarch) & 0xffff000) == 0))
+                   {
+                     queue_push(&lsq, p2);
+                     if (installed && s2->repo == installed)
+                       haveinstalled = 1;
+                   }
                }
+             if (installed && pool->solvables[p].repo == installed && 
!haveinstalled)
+               continue;       /* installed package not in lock-step */
            }
          solver_addrule(solv, -p, lsq.count ? pool_queuetowhatprovides(pool, 
&lsq) : 0);
        }
@@ -2959,7 +3027,7 @@
                  if (solv->update_targets && solv->update_targets->elements[p 
- installed->start])
                    prune_to_update_targets(solv, 
solv->update_targets->elements + solv->update_targets->elements[p - 
installed->start], &q2);
                  if (solv->dupinvolvedmap.size && 
MAPTST(&solv->dupinvolvedmap, p))
-                   prune_to_dup_packages(solv, p, &q);
+                   prune_to_dup_packages(solv, p, &q2);
                  policy_filter_unwanted(solv, &q2, POLICY_MODE_RECOMMEND);
                  for (j = 0; j < q2.count; j++)
                    queue_pushunique(&q, q2.elements[j]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/src/selection.c 
new/libsolv-0.4.2/src/selection.c
--- old/libsolv-0.4.1/src/selection.c   2013-10-16 18:31:43.000000000 +0200
+++ new/libsolv-0.4.2/src/selection.c   2014-01-08 14:46:53.000000000 +0100
@@ -840,12 +840,11 @@
 selection_make(Pool *pool, Queue *selection, const char *name, int flags)
 {
   int ret = 0;
-  const char *r;
 
   queue_empty(selection);
   if (*name == '/' && (flags & SELECTION_FILELIST))
     ret = selection_filelist(pool, selection, name, flags);
-  if (!ret && (flags & SELECTION_REL) != 0 && (r = strpbrk(name, "<=>")) != 0)
+  if (!ret && (flags & SELECTION_REL) != 0 && strpbrk(name, "<=>") != 0)
     ret = selection_rel(pool, selection, name, flags);
   if (!ret)
     ret = selection_depglob_arch(pool, selection, name, flags);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/src/solvable.c 
new/libsolv-0.4.2/src/solvable.c
--- old/libsolv-0.4.1/src/solvable.c    2013-10-25 14:06:43.000000000 +0200
+++ new/libsolv-0.4.2/src/solvable.c    2014-01-08 14:30:53.000000000 +0100
@@ -404,7 +404,7 @@
 {
   while (ISRELDEP(dep))
     {
-      Reldep *rd = rd = GETRELDEP(pool, dep);
+      Reldep *rd = GETRELDEP(pool, dep);
       dep = rd->name;
     }
   return dep;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/src/solver.c 
new/libsolv-0.4.2/src/solver.c
--- old/libsolv-0.4.1/src/solver.c      2013-12-04 18:41:47.000000000 +0100
+++ new/libsolv-0.4.2/src/solver.c      2014-01-23 14:25:52.000000000 +0100
@@ -4354,7 +4354,7 @@
       return "do nothing";
     case SOLVER_INSTALL:
       if (select == SOLVER_SOLVABLE && pool->installed && 
pool->solvables[what].repo == pool->installed)
-       strstart = "keep ", strend = "installed";
+       strstart = "keep ", strend = " installed";
       else if (select == SOLVER_SOLVABLE || select == SOLVER_SOLVABLE_NAME)
        strstart = "install ";
       else if (select == SOLVER_SOLVABLE_PROVIDES)
@@ -4364,7 +4364,7 @@
       break;
     case SOLVER_ERASE:
       if (select == SOLVER_SOLVABLE && !(pool->installed && 
pool->solvables[what].repo == pool->installed))
-       strstart = "keep ", strend = "unstalled";
+       strstart = "keep ", strend = " uninstalled";
       else if (select == SOLVER_SOLVABLE_PROVIDES)
        strstart = "deinstall all packages ";
       else
@@ -4389,10 +4389,10 @@
       strstart = "verify ";
       break;
     case SOLVER_DROP_ORPHANED:
-      strstart = "deinstall ", strend = "if orphaned";
+      strstart = "deinstall ", strend = " if orphaned";
       break;
     case SOLVER_USERINSTALLED:
-      strstart = "regard ", strend = "as userinstalled";
+      strstart = "regard ", strend = " as userinstalled";
       break;
     default:
       strstart = "unknown job ";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/src/solverdebug.c 
new/libsolv-0.4.2/src/solverdebug.c
--- old/libsolv-0.4.1/src/solverdebug.c 2013-10-16 18:31:43.000000000 +0200
+++ new/libsolv-0.4.2/src/solverdebug.c 2014-01-08 14:46:53.000000000 +0100
@@ -75,7 +75,7 @@
     POOL_DEBUG(type, "Rule #%d:", (int)(r - solv->rules));
   else
     POOL_DEBUG(type, "Rule:");                /* r is any rule */
-  if (r && r->d < 0)
+  if (r->d < 0)
     POOL_DEBUG(type, " (disabled)");
   POOL_DEBUG(type, "\n");
   d = r->d < 0 ? -r->d - 1 : r->d;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libsolv-0.4.1/test/testcases/lockstep/lockstep_install.t 
new/libsolv-0.4.2/test/testcases/lockstep/lockstep_install.t
--- old/libsolv-0.4.1/test/testcases/lockstep/lockstep_install.t        
1970-01-01 01:00:00.000000000 +0100
+++ new/libsolv-0.4.2/test/testcases/lockstep/lockstep_install.t        
2013-12-17 13:35:52.000000000 +0100
@@ -0,0 +1,9 @@
+repo system 0 empty
+repo test 0 testtags <inline>
+#>=Pkg: A 1 1 i586
+#>=Prv: A(x32)
+#>=Pkg: A 1 1 x86_64
+#>=Prv: A(x64)
+system x86_64 rpm system
+poolflags implicitobsoleteusescolors
+job install provides A(x32)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libsolv-0.4.1/test/testcases/lockstep/lockstep_update.t 
new/libsolv-0.4.2/test/testcases/lockstep/lockstep_update.t
--- old/libsolv-0.4.1/test/testcases/lockstep/lockstep_update.t 1970-01-01 
01:00:00.000000000 +0100
+++ new/libsolv-0.4.2/test/testcases/lockstep/lockstep_update.t 2013-12-17 
13:35:52.000000000 +0100
@@ -0,0 +1,11 @@
+repo system 0 testtags <inline>
+#>=Pkg: A 1 1 i586
+#>=Pkg: A 1 1 x86_64
+repo test 0 testtags <inline>
+#>=Pkg: A 2 1 i586
+#>=Pkg: A 2 1 x86_64
+#>=Pkg: A 3 1 i586
+#>=Pkg: A 4 1 x86_64
+system x86_64 rpm system
+poolflags implicitobsoleteusescolors
+job update all packages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/tools/dumpsolv.c 
new/libsolv-0.4.2/tools/dumpsolv.c
--- old/libsolv-0.4.1/tools/dumpsolv.c  2013-10-04 11:23:38.000000000 +0200
+++ new/libsolv-0.4.2/tools/dumpsolv.c  2014-01-08 14:30:53.000000000 +0100
@@ -297,7 +297,7 @@
 static void
 dump_repodata(Repo *repo)
 {
-  unsigned int i;
+  int i;
   Repodata *data;
   if (repo->nrepodata == 0)
     return;
@@ -321,7 +321,7 @@
 static void
 dump_repodata_json(Repo *repo, struct cbdata *cbdata)
 {
-  unsigned int i;
+  int i;
   Repodata *data;
   if (repo->nrepodata == 0)
     return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/tools/susetags2solv.c 
new/libsolv-0.4.2/tools/susetags2solv.c
--- old/libsolv-0.4.1/tools/susetags2solv.c     2013-12-03 13:21:43.000000000 
+0100
+++ new/libsolv-0.4.2/tools/susetags2solv.c     2014-01-24 13:50:52.000000000 
+0100
@@ -22,6 +22,9 @@
 #include "repo_solv.h"
 #include "repo_susetags.h"
 #include "repo_content.h"
+#ifdef SUSE
+#include "repo_autopattern.h"
+#endif
 #include "common_write.h"
 #include "solv_xfopen.h"
 
@@ -68,11 +71,14 @@
   const char *mergefile = 0;
   Id defvendor = 0;
   int flags = 0;
+#ifdef SUSE
+  int add_auto = 0;
+#endif
   int c;
   Pool *pool;
   Repo *repo;
 
-  while ((c = getopt(argc, argv, "hn:c:d:b:q:M:")) >= 0)
+  while ((c = getopt(argc, argv, "hn:c:d:b:q:M:X")) >= 0)
     {
       switch (c)
        {
@@ -97,6 +103,11 @@
        case 'M':
          mergefile = optarg;
          break;
+       case 'X':
+#ifdef SUSE
+         add_auto = 1;
+#endif
+         break;
        default:
          usage(1);
          break;
@@ -295,6 +306,10 @@
        }
       fclose(fp);
     }
+#ifdef SUSE
+  if (add_auto)
+    repo_add_autopattern(repo, 0); 
+#endif
 
   if (query)
     doquery(pool, repo, query);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.4.1/tools/testsolv.c 
new/libsolv-0.4.2/tools/testsolv.c
--- old/libsolv-0.4.1/tools/testsolv.c  2013-10-04 11:23:38.000000000 +0200
+++ new/libsolv-0.4.2/tools/testsolv.c  2014-01-23 14:25:52.000000000 +0100
@@ -33,6 +33,7 @@
 {
   Pool *pool;
   Queue job;
+  Queue solq;
   Solver *solv;
   char *result = 0;
   int resultflags = 0;
@@ -43,8 +44,10 @@
   int ex = 0;
   const char *list = 0;
   FILE *fp;
+  const char *p;
 
-  while ((c = getopt(argc, argv, "vrhl:")) >= 0)
+  queue_init(&solq);
+  while ((c = getopt(argc, argv, "vrhl:s:")) >= 0)
     {
       switch (c)
       {
@@ -60,6 +63,12 @@
         case 'l':
          list = optarg;
           break;
+        case 's':
+         if ((p = strchr(optarg, ':')))
+           queue_push2(&solq, atoi(optarg), atoi(p + 1));
+         else
+           queue_push2(&solq, 1, atoi(optarg));
+          break;
         default:
          usage(1);
           break;
@@ -78,7 +87,7 @@
          perror(argv[optind]);
          exit(0);
        }
-      while(!feof(fp))
+      while (!feof(fp))
        {
          queue_init(&job);
          result = 0;
@@ -165,15 +174,43 @@
            }
          else
            {
-             if (solver_solve(solv, &job))
+             int pcnt = solver_solve(solv, &job);
+             if (pcnt && solq.count)
+               {
+                 int i, taken = 0;
+                 for (i = 0; i < solq.count; i += 2)
+                   {
+                     if (solq.elements[i] > 0 && solq.elements[i] <= pcnt)
+                       if (solq.elements[i + 1] > 0 && solq.elements[i + 1] <= 
 solver_solution_count(solv, solq.elements[i]))
+                         {
+                           printf("problem %d: taking solution %d\n", 
solq.elements[i], solq.elements[i + 1]);
+                           solver_take_solution(solv, solq.elements[i], 
solq.elements[i + 1], &job);
+                           taken = 1;
+                         }
+                   }
+                 if (taken)
+                   pcnt = solver_solve(solv, &job);
+               }
+             if (pcnt)
                {
-                 int problem, solution, pcnt, scnt;
-                 pcnt = solver_problem_count(solv);
+                 int problem, solution, scnt;
                  printf("Found %d problems:\n", pcnt);
                  for (problem = 1; problem <= pcnt; problem++)
                    {
                      printf("Problem %d:\n", problem);
+#if 1
                      solver_printprobleminfo(solv, problem);
+#else
+                     {
+                       Queue pq;
+                       int j;
+                       queue_init(&pq);
+                       solver_findallproblemrules(solv, problem, &pq);
+                       for (j = 0; j < pq.count; j++)
+                         solver_printproblemruleinfo(solv, pq.elements[j]);
+                       queue_free(&pq);
+                     }
+#endif
                      printf("\n");
                      scnt = solver_solution_count(solv, problem);
                      for (solution = 1; solution <= scnt; solution++)
@@ -198,5 +235,6 @@
       pool_free(pool);
       fclose(fp);
     }
+  queue_free(&solq);
   exit(ex);
 }

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to