Hello community,
here is the log from the commit of package libzypp
checked in at Fri Sep 7 15:02:56 CEST 2007.
--------
--- libzypp/libzypp.changes 2007-09-05 22:40:01.000000000 +0200
+++ /mounts/work_src_done/STABLE/libzypp/libzypp.changes 2007-09-07 14:58:09.791692000 +0200
@@ -1,0 +2,46 @@
+Fri Sep 7 13:03:48 CEST 2007 - schubi@suse.de
+
+- RequirementIsMet: return true only if ALL Atoms are NOT incomplete; Bug
+ 308252
+- r 7143
+
+-------------------------------------------------------------------
+Thu Sep 6 18:22:36 CEST 2007 - schubi@suse.de
+
+- Error: Select two candidate with the same name while update.
+ Solution: If there is a candidate which is already selected for installation -->
+ take thatone #308082
+- r 7132
+
+-------------------------------------------------------------------
+Thu Sep 6 14:11:58 CEST 2007 - ma@suse.de
+
+- Work arround installed patterns providing an empty vendor string. (#307743)
+- Let the solver treat vendor suse and opensuse as equivalent.
+- version 3.22.4
+
+-------------------------------------------------------------------
+Thu Sep 6 12:33:27 CEST 2007 - schubi@suse.de
+
+- Checking item before evaluating the concerning vendor. bug #307941
+- r 7119
+
+-------------------------------------------------------------------
+Wed Sep 6 02:24:37 CEST 2007 - dmacvicar@suse.de
+
+- Fix for bug #307163 - empty package descriptions
+ a.k.a shared tag not 100% implemented
+- r 7117
+- version 3.22.3
+
+-------------------------------------------------------------------
+Wed Sep 5 17:52:37 CEST 2007 - schubi@suse.de
+
+- logging "reverse" NEEDED_BY in the detail description of solver
+ problems.
+- improved error message if a requiremnt is not fulfilled Bug 307743
+- Add "ignore" option to the solution if a requirement is not fulfilled
+ Bug 304276
+- revision 7113
+
+-------------------------------------------------------------------
@@ -7,0 +54 @@
+- version 3.22.2
@@ -13 +60 @@
-- revision 7103
+- revision 7103
Old:
----
libzypp-3.22.1.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.qV7150/_old 2007-09-07 15:01:44.000000000 +0200
+++ /var/tmp/diff_new_pack.qV7150/_new 2007-09-07 15:01:44.000000000 +0200
@@ -17,10 +17,9 @@
Autoreqprov: on
Summary: Package, Patch, Pattern, and Product Management
Version: 3.22.1
-Release: 4
+Release: 7
Source: libzypp-3.22.1.tar.bz2
Source1: libzypp-rpmlintrc
-Patch: libzypp-3.22.1.patch
Prefix: /usr
Provides: yast2-packagemanager
Obsoletes: yast2-packagemanager
@@ -70,7 +69,6 @@
%prep
%setup -q
-%patch -p2
%build
mkdir build
@@ -127,11 +125,40 @@
%{_libdir}/pkgconfig/libzypp.pc
%changelog
+* Fri Sep 07 2007 - schubi@suse.de
+- RequirementIsMet: return true only if ALL Atoms are NOT incomplete; Bug
+ 308252
+- r 7143
+* Thu Sep 06 2007 - schubi@suse.de
+- Error: Select two candidate with the same name while update.
+ Solution: If there is a candidate which is already selected for installation -->
+ take thatone #308082
+- r 7132
+* Thu Sep 06 2007 - ma@suse.de
+- Work arround installed patterns providing an empty vendor string. (#307743)
+- Let the solver treat vendor suse and opensuse as equivalent.
+- version 3.22.4
+* Thu Sep 06 2007 - schubi@suse.de
+- Checking item before evaluating the concerning vendor. bug #307941
+- r 7119
+* Thu Sep 06 2007 - dmacvicar@suse.de
+- Fix for bug #307163 - empty package descriptions
+ a.k.a shared tag not 100%% implemented
+- r 7117
+- version 3.22.3
+* Wed Sep 05 2007 - schubi@suse.de
+- logging "reverse" NEEDED_BY in the detail description of solver
+ problems.
+- improved error message if a requiremnt is not fulfilled Bug 307743
+- Add "ignore" option to the solution if a requirement is not fulfilled
+ Bug 304276
+- revision 7113
* Wed Sep 05 2007 - jkupec@suse.cz
- fixed the order of operands of susetags local metadata status
computation which caused the YaST repositories to always get
refreshed (part of bug #304310)
- revision 7107
+- version 3.22.2
* Tue Sep 04 2007 - schubi@suse.de
- comparing vendor with VendorAttr::equivalent
- revision 7103
++++++ libzypp-3.22.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/CMakeLists.txt.bak new/libzypp-3.22.1/CMakeLists.txt.bak
--- old/libzypp-3.22.1/CMakeLists.txt.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/CMakeLists.txt.bak 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,248 @@
+PROJECT(libzypp)
+
+# Library
+IF ( DEFINED LIB )
+ SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
+ELSE ( DEFINED LIB )
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+ SET( LIB_SUFFIX "64" )
+ ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
+ SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
+ENDIF ( DEFINED LIB )
+MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
+####################################################################
+# CONFIGURATION #
+####################################################################
+
+# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
+
+INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake )
+MATH( EXPR LIBZYPP_CURRENT "${LIBZYPP_MAJOR} * 100 + ${LIBZYPP_MINOR}" )
+MATH( EXPR LIBZYPP_AGE "${LIBZYPP_MINOR} - ${LIBZYPP_COMPATMINOR}" )
+# Libtool wanted current:patch:age
+# But cmake is not libtool, it wants the verbatim suffix to libzypp.so
+MATH( EXPR LIBZYPP_SO_FIRST "${LIBZYPP_CURRENT}-${LIBZYPP_AGE}" )
+
+SET( PACKAGE "libzypp" )
+SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
+
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 -Wall -Woverloaded-virtual" )
+SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -Wall" )
+ADD_DEFINITIONS( -D_FILE_OFFSET_BITS=64 )
+ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
+SET( LIBZYPP_VERSION_INFO "${LIBZYPP_SO_FIRST}.${LIBZYPP_AGE}.${LIBZYPP_PATCH}" )
+
+
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Novell's package management core engine.")
+SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
+#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
+#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+SET(CPACK_PACKAGE_VERSION_MAJOR ${LIBZYPP_MAJOR})
+SET(CPACK_PACKAGE_VERSION_MINOR ${LIBZYPP_MINOR})
+SET(CPACK_PACKAGE_VERSION_PATCH ${LIBZYPP_PATCH})
+SET( CPACK_GENERATOR "TBZ2")
+SET( CPACK_SOURCE_GENERATOR "TBZ2")
+SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" )
+
+# The following components are regex's to match anywhere (unless anchored)
+# in absolute path + filename to find files or directories to be excluded
+# from source tarball.
+SET (CPACK_SOURCE_IGNORE_FILES
+#/CVS/;/\\.svn/;/\\.libs/;/\\.deps/;\\.swp$;/build/;\\.o$;\\.lo$;\\.la$;~$;\\\\.cvsignore$;Makefile\\\\.in$;
+/CVS/;/\\\\.svn/;/\\\\.libs/;/\\\\.deps/;\\\\.swp$;/build/;\\\\.o$;\\\\.lo$;\\\\.la$;~$
+)
+
+SET (CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES}
+"/CVS/;/.libs/;/.deps/;/.git/;.swp$;.#;/#;/build/"
+"~$"
+"\\\\.cvsignore$"
+"/package"
+"Makefile\\\\.in$"
+)
+
+SET (CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES}
+"/CVS/;/.libs/;/.deps/;/.git/;.swp$;.#;/#;/build/"
+"~$"
+"\\\\.cvsignore$"
+"/package"
+"Makefile\\\\.in$"
+)
+
+INCLUDE(CPack)
+
+####################################################################
+
+SET( DOC_INSTALL_DIR
+ "${CMAKE_INSTALL_PREFIX}/share/doc/packages/${PACKAGE}"
+ CACHE PATH "The install dir for documentation (default prefix/share/doc/packages/${PACKAGE})"
+ FORCE
+)
+
+####################################################################
+# INCLUDES #
+####################################################################
+
+#SET (CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} SYSTEM )
+
+####################################################################
+
+
+FIND_PACKAGE(Rpm REQUIRED)
+IF ( NOT RPM_FOUND)
+ MESSAGE( FATAL_ERROR " rpm not found" )
+ELSE ( NOT RPM_FOUND)
+ INCLUDE_DIRECTORIES(${RPM_INCLUDE_DIR})
+ENDIF( NOT RPM_FOUND)
+
+FIND_PACKAGE(Boost REQUIRED)
+IF (Boost_FOUND)
+ MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}")
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+ LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+ENDIF(Boost_FOUND)
+
+FIND_PACKAGE(Gettext REQUIRED)
+IF (GETTEXT_FOUND)
+ MESSAGE(STATUS "Found Gettext: ${GETTEXT_SOURCE}")
+ INCLUDE_DIRECTORIES(${GETTEXT_INCLUDE_DIR})
+ELSE (GETTEXT_FOUND)
+ MESSAGE( FATAL_ERROR "Gettext not found" )
+ENDIF (GETTEXT_FOUND)
+
+FIND_PACKAGE(Hal REQUIRED)
+IF ( NOT HAL_FOUND)
+ MESSAGE( FATAL_ERROR " Hal not found" )
+ELSE ( NOT HAL_FOUND)
+ INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR})
+# hal/libhal-storage.h is broken grrr
+ INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR}/hal)
+ENDIF( NOT HAL_FOUND)
+
+FIND_PACKAGE(Dbus REQUIRED)
+IF ( NOT DBUS_FOUND)
+ MESSAGE( FATAL_ERROR " dbus not found" )
+ELSE ( NOT DBUS_FOUND)
+ INCLUDE_DIRECTORIES(${DBUS_INCLUDE_DIR})
+ INCLUDE_DIRECTORIES(${DBUS_ARCH_INCLUDE_DIR})
+ENDIF( NOT DBUS_FOUND)
+
+FIND_PACKAGE(Glib REQUIRED)
+IF (GLIB_FOUND)
+ MESSAGE( STATUS "glib found: includes in ${GLIB_INCLUDE_DIR}, library in ${GLIB_LIBRARY}")
+ INCLUDE_DIRECTORIES(${GLIB_INCLUDE_DIR})
+ INCLUDE_DIRECTORIES(${GLIB_CONFIG_INCLUDE_DIR})
+ELSE(GLIB_FOUND)
+ MESSAGE( FATAL_ERROR "glib not found" )
+ENDIF(GLIB_FOUND)
+
+#IF (DBUS_GLIB_FOUND)
+# MESSAGE( STATUS "dbus-glib found" )
+# INCLUDE_DIRECTORIES(${DBUS_GLIB_INCLUDE_DIR})
+# LINK_DIRECTORIES(${DBUS_GLIB_LINK_DIR})
+#ELSE(DBUS_GLIB_FOUND)
+# MESSAGE( ERROR "dbus-glib not found" )
+#ENDIF(DBUS_GLIB_FOUND)
+
+FIND_PACKAGE(Curl REQUIRED)
+IF ( NOT CURL_FOUND)
+ MESSAGE( FATAL_ERROR " curl not found" )
+ELSE ( NOT CURL_FOUND)
+ INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
+ENDIF( NOT CURL_FOUND)
+
+FIND_PACKAGE(Libxml REQUIRED)
+IF ( NOT LIBXML_FOUND)
+ MESSAGE( FATAL_ERROR " libxml not found" )
+ELSE ( NOT LIBXML_FOUND)
+ INCLUDE_DIRECTORIES(${LIBXML_INCLUDE_DIR})
+ENDIF( NOT LIBXML_FOUND)
+
+FIND_PACKAGE(Sqlite REQUIRED)
+
+FIND_PACKAGE(ZLIB REQUIRED)
+IF ( NOT ZLIB_FOUND)
+ MESSAGE( FATAL_ERROR " zlib not found" )
+ELSE ( NOT ZLIB_FOUND)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+ENDIF( NOT ZLIB_FOUND)
+
+FIND_PROGRAM( DOXYGEN doxygen )
+IF ( NOT DOXYGEN )
+ MESSAGE( FATAL_ERROR "doxygen not found: install doxygen to build the documentation." )
+ELSE ( NOT DOXYGEN )
+ MESSAGE( STATUS "doxygen found: ${DOXYGEN}" )
+ENDIF ( NOT DOXYGEN )
+
+MESSAGE(STATUS "soname: ${LIBZYPP_VERSION_INFO}")
+MESSAGE(STATUS "version: ${VERSION}")
+
+####################################################################
+# RPM SPEC #
+####################################################################
+
+MACRO(SPECFILE)
+ MESSAGE(STATUS "Writing spec file...")
+ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libzypp.spec.cmake ${CMAKE_BINARY_DIR}/package/libzypp.spec @ONLY)
+ MESSAGE(STATUS "I hate you rpm-lint...!!!")
+ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/libzypp-rpmlint.cmake ${CMAKE_BINARY_DIR}/package/libzypp-rpmlintrc @ONLY)
+ENDMACRO(SPECFILE)
+
+SPECFILE()
+
+MESSAGE(STATUS "Writing pkg-config file...")
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libzypp.pc.cmake ${CMAKE_BINARY_DIR}/libzypp.pc @ONLY)
+INSTALL( FILES ${CMAKE_BINARY_DIR}/libzypp.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig )
+
+MESSAGE(STATUS "FindZypp.cmake will be installed in ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules")
+INSTALL( FILES ${CMAKE_SOURCE_DIR}/cmake/modules/FindZypp.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules )
+
+####################################################################
+# SUBDIRECTORIES #
+####################################################################
+
+ADD_SUBDIRECTORY( zypp )
+#ADD_SUBDIRECTORY( zypp2 )
+# do not build devel by default
+ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL )
+ADD_SUBDIRECTORY( tools )
+#ADD_SUBDIRECTORY( examples )
+ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
+ADD_SUBDIRECTORY( doc EXCLUDE_FROM_ALL )
+ADD_SUBDIRECTORY( tests EXCLUDE_FROM_ALL )
+
+####################################################################
+# OTHERS #
+####################################################################
+
+#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
+#yumschemadir=${zyppdir}/schema/yum
+#xmlstoreschemadir=${zyppdir}/schema/xmlstore
+
+####################################################################
+# INSTALL #
+####################################################################
+
+#INSTALL_FILES( FILES libzypp.pc )
+
+ADD_CUSTOM_TARGET( svncheck
+ COMMAND cd $(CMAKE_SOURCE_DIR) && ! LC_ALL=C svn status --show-updates --quiet | grep -v '^Status against revision'
+)
+
+SET( AUTOBUILD_COMMAND
+ COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/package/*.tar.bz2
+ COMMAND ${CMAKE_MAKE_PROGRAM} package_source
+ COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package
+ COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/${PACKAGE}.changes" "${CMAKE_BINARY_DIR}/package/${PACKAGE}.changes"
+)
+
+ADD_CUSTOM_TARGET( srcpackage_local
+ ${AUTOBUILD_COMMAND}
+)
+
+ADD_CUSTOM_TARGET( srcpackage
+ COMMAND ${CMAKE_MAKE_PROGRAM} svncheck
+ ${AUTOBUILD_COMMAND}
+)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/VERSION.cmake.bak new/libzypp-3.22.1/VERSION.cmake.bak
--- old/libzypp-3.22.1/VERSION.cmake.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/VERSION.cmake.bak 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,50 @@
+# ==================================================
+# Versioning
+# ==========
+#
+# MAJOR Major number for this branch.
+#
+# MINOR The most recent interface number this
+# library implements.
+#
+# COMPATMINOR The latest binary compatible minor number
+# this library implements.
+#
+# PATCH The implementation number of the current interface.
+#
+#
+# - The package VERSION will be MAJOR.MINOR.PATCH.
+#
+# - Libtool's -version-info will be derived from MAJOR, MINOR, PATCH
+# and COMPATMINOR (see configure.ac).
+#
+# - Changing MAJOR always breaks binary compatibility.
+#
+# - Changing MINOR doesn't break binary compatibility by default.
+# Only if COMPATMINOR is changed as well.
+#
+#
+# 1) After branching from TRUNK increment TRUNKs MAJOR and
+# start with version `MAJOR.0.0' and also set COMPATMINOR to 0.
+#
+# 2) Update the version information only immediately before a public release
+# of your software. More frequent updates are unnecessary, and only guarantee
+# that the current interface number gets larger faster.
+#
+# 3) If the library source code has changed at all since the last update,
+# then increment PATCH.
+#
+# 4) If any interfaces have been added, removed, or changed since the last
+# update, increment MINOR, and set PATCH to 0.
+#
+# 5) If any interfaces have been added since the last public release, then
+# leave COMPATMINOR unchanged. (binary compatible change)
+#
+# 6) If any interfaces have been removed since the last public release, then
+# set COMPATMINOR to MINOR. (binary incompatible change)
+#
+
+SET(LIBZYPP_MAJOR "3")
+SET(LIBZYPP_MINOR "22")
+SET(LIBZYPP_COMPATMINOR "21")
+SET(LIBZYPP_PATCH "4")
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.ma/CMakeLists.txt new/libzypp-3.22.1/devel/devel.ma/CMakeLists.txt
--- old/libzypp-3.22.1/devel/devel.ma/CMakeLists.txt 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.ma/CMakeLists.txt 2007-09-07 14:53:33.000000000 +0200
@@ -29,7 +29,7 @@
## ############################################################
-FOREACH( loop_var ScanSource Iorder Xml Main)
+FOREACH( loop_var ScanSource Iorder Xml Main FakePool AOUT Parse Test Basic)
ADD_EXECUTABLE( ${loop_var}
${loop_var}.cc
)
@@ -39,15 +39,6 @@
ENDFOREACH( loop_var )
-FOREACH( loop_var AOUT Parse Test Basic)
- ADD_EXECUTABLE( ${loop_var}
- ${loop_var}.cc
- )
- TARGET_LINK_LIBRARIES( ${loop_var}
- zypp
- )
-ENDFOREACH( loop_var )
-
FOREACH( loop_var MaTest )
ADD_EXECUTABLE( ${loop_var}
${loop_var}.cc
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.ma/FakePool.cc new/libzypp-3.22.1/devel/devel.ma/FakePool.cc
--- old/libzypp-3.22.1/devel/devel.ma/FakePool.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.ma/FakePool.cc 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,84 @@
+#include "Tools.h"
+#include "Tools.h"
+
+#include <iostream>
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "zypp/ResPoolProxy.h"
+
+using namespace std;
+using namespace zypp;
+using namespace zypp::ui;
+
+bool chst( Selectable::Ptr & sel, Status status )
+{
+ DBG << "+++ " << sel << endl;
+ Status ostatus( sel->status() );
+ bool res = sel->set_status( status );
+ (res?MIL:WAR) << ostatus << " -> " << status << " ==>(" << res << ") " << sel->status() << endl;
+ DBG << "--- " << sel << endl;
+ return res;
+}
+
+/******************************************************************
+**
+** FUNCTION NAME : main
+** FUNCTION TYPE : int
+*/
+int main( int argc, char * argv[] )
+{
+ INT << "===[START]==========================================" << endl;
+
+ const char *const lines[] = {
+ "@ package",
+ "@ installed",
+ "- foo 1 1 i686",
+ "@ available",
+ "- foo 2 1 i686",
+ "@ fin"
+ };
+
+ debug::addPool( lines, lines+(sizeof(lines)/sizeof(const char *const)) );
+
+ ResPool pool( getZYpp()->pool() );
+ ResPoolProxy uipool( getZYpp()->poolProxy() );
+
+ USR << pool << endl;
+ USR << uipool << endl;
+
+ //for_each( pool.begin(), pool.end(), Print() );
+
+ Selectable::Ptr sel( *uipool.byKindBegin<Package>() );
+
+/* enum Status
+ {
+ S_Protected, // Keep this unmodified ( have installedObj && S_Protected )
+ S_Taboo, // Keep this unmodified ( have no installedObj && S_Taboo)
+ // requested by user:
+ S_Del, // delete installedObj ( clears S_Protected if set )
+ S_Update, // install candidateObj ( have installedObj, clears S_Protected if set )
+ S_Install, // install candidateObj ( have no installedObj, clears S_Taboo if set )
+ // not requested by user:
+ S_AutoDel, // delete installedObj
+ S_AutoUpdate, // install candidateObj ( have installedObj )
+ S_AutoInstall, // install candidateObj ( have no installedObj )
+ // no modification:
+ S_KeepInstalled, // no modification ( have installedObj && !S_Protected, clears S_Protected if set )
+ S_NoInst, // no modification ( have no installedObj && !S_Taboo, clears S_Taboo if set )
+ };
+*/
+ MIL << sel << endl;
+ chst( sel, ui::S_Update );
+ chst( sel, ui::S_Install );
+ chst( sel, ui::S_Protected );
+ chst( sel, ui::S_KeepInstalled );
+
+ INT << "===[END]============================================" << endl
+ << endl;
+ return 0;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.ma/Parse.cc new/libzypp-3.22.1/devel/devel.ma/Parse.cc
--- old/libzypp-3.22.1/devel/devel.ma/Parse.cc 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.ma/Parse.cc 2007-09-07 14:53:33.000000000 +0200
@@ -54,8 +54,8 @@
{
//handle( asKind<Package>( obj_r ) );
//handle( asKind<Patch>( obj_r ) );
- //handle( asKind<Pattern>( obj_r ) );
- //handle( asKind<Product>( obj_r ) );
+ handle( asKind<Pattern>( obj_r ) );
+ handle( asKind<Product>( obj_r ) );
return true;
}
@@ -71,11 +71,6 @@
{
if ( !p )
return;
-
- ui::PatchContents pc( p );
- MIL << p << endl;
- dumpRange( DBG << pc.size() << endl,
- pc.begin(), pc.end() );
}
void handle( const Pattern_constPtr & p )
@@ -83,7 +78,10 @@
if ( !p )
return;
- MIL << p << endl;
+ if ( p->vendor().empty() )
+ ERR << p << endl;
+ else if ( p->vendor() == "SUSE (assumed)" )
+ SEC << p << endl;
}
void handle( const Product_constPtr & p )
@@ -91,8 +89,9 @@
if ( !p )
return;
- ERR << p << endl;
- ERR << p->type() << endl;
+ USR << p << endl;
+ USR << p->vendor() << endl;
+ USR << p->type() << endl;
}
template<class _C>
@@ -329,6 +328,11 @@
{ /////////////////////////////////////////////////////////////////
+ void Vtst( const std::string & lhs, const std::string & rhs )
+ {
+ (VendorAttr::instance().equivalent( lhs, rhs )?MIL:ERR) << lhs << " <==> "<< rhs << endl;
+
+ }
/////////////////////////////////////////////////////////////////
} // namespace zypp
@@ -347,12 +351,23 @@
INT << "===[START]==========================================" << endl;
setenv( "ZYPP_CONF", "/Local/ROOT/zypp.conf", 1 );
- std::string t( "ABCD" );
- MIL << str::toLower(t.substr(0,3)) << endl;
- MIL << str::toLower(t.substr(0,4)) << endl;
- MIL << str::toLower(t.substr(0,5)) << endl;
- throw;
-
+ Vtst( "", "" );
+ Vtst( "", "a" );
+ Vtst( "", "suse lkgjhdl" );
+ Vtst( "", "opensuse" );
+ Vtst( "a", "" );
+ Vtst( "a", "a" );
+ Vtst( "a", "suse lkgjhdl" );
+ Vtst( "a", "opensuse" );
+ Vtst( "suse", "" );
+ Vtst( "suse", "a" );
+ Vtst( "suse", "suse lkgjhdl" );
+ Vtst( "suse", "opensuse" );
+ Vtst( "opensuse fdhgdd", "" );
+ Vtst( "opensuse fdhgdd", "a" );
+ Vtst( "opensuse fdhgdd", "suse lkgjhdl" );
+ Vtst( "opensuse fdhgdd", "opensuse" );
+ throw;
DigestReceive foo;
KeyRingSignalsReceive baa;
@@ -419,20 +434,12 @@
{
{
zypp::base::LogControl::TmpLineWriter shutUp;
- getZYpp()->initTarget( sysRoot );
+ //getZYpp()->initTarget( sysRoot );
+ getZYpp()->initTarget( "/" );
}
MIL << "Added target: " << pool << endl;
}
- INT << getZYpp()->diskUsage() << endl;
-
- {
- Measure x("SHUTDOWN");
- getZYpp()->removeResolvables( getZYpp()->target()->resolvables() );
- getZYpp()->target()->reset();
- }
-
-
std::for_each( pool.begin(), pool.end(), Xprint() );
///////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/CMakeLists.txt new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/CMakeLists.txt
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/CMakeLists.txt 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,34 @@
+PROJECT(pdbtozypp)
+
+SET( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" )
+
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -O2 -Wall -W -fpic -D_REENTRANT" )
+
+FIND_PACKAGE(Zypp REQUIRED)
+IF ( NOT ZYPP_LIBRARY )
+ MESSAGE( FATAL_ERROR " zypp not found" )
+ELSE ( NOT ZYPP_LIBRARY )
+ MESSAGE( STATUS "zypp found" )
+ENDIF ( NOT ZYPP_LIBRARY )
+
+SET( pdbtozypp_SRCS
+ db.cc
+ pdbtozypp.cc
+ resolvable.cc
+ )
+
+SET( pdbtozypp_HEADERS
+ db.h
+ pdbtozypp.h
+ resolvable.h
+ )
+
+INSTALL( FILES ${pdbtozypp_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/pdbtozypp" )
+
+ADD_LIBRARY(pdbtozypp SHARED ${pdbtozypp_SRCS})
+TARGET_LINK_LIBRARIES(pdbtozypp ${ZYPP_LIBRARY} )
+TARGET_LINK_LIBRARIES(pdbtozypp -lmysqlclient )
+
+INSTALL(TARGETS pdbtozypp LIBRARY DESTINATION ${LIB_INSTALL_DIR} )
+
+#ADD_SUBDIRECTORY(swig)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/db.cc new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/db.cc
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/db.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/db.cc 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,91 @@
+#include "db.h"
+#include <iostream>
+
+using std::string;
+
+//Constructor
+
+database::database(string nHost, string nUsername, string nPassword, string nDatabase, unsigned int nPort, string nSocket, unsigned long nClient_flag){
+ host = nHost;
+ username = nUsername;
+ password = nPassword;
+ db = nDatabase;
+ port = nPort;
+ socket = nSocket;
+ client_flag = nClient_flag;
+
+ conn = mysql_init(NULL);
+}
+
+//Destructor
+
+database::~database(){
+}
+
+//Connect to db
+
+unsigned int database::connect(){
+ if(mysql_real_connect(conn, host.c_str(), username.c_str(), password.c_str(), db.c_str(), port, socket.c_str(), client_flag) == NULL){
+
+ if(mysql_error(conn) != "")
+ std::cout << mysql_error(conn) << std::endl;
+ return mysql_errno(conn);
+ }
+
+ return 1;
+}
+
+//Close db connection
+
+void database::close(){
+ mysql_close(conn);
+}
+
+//Execute given SQL-Statement
+
+unsigned int database::sqlexecute(string sqlcom){
+
+ if(mysql_query(conn, sqlcom.c_str())){
+ if(mysql_error(conn) != "")
+ std::cout << mysql_error(conn) << std::endl;
+ return mysql_errno(conn);
+ }
+
+ if((result = mysql_store_result(conn)) == NULL){
+ if(mysql_error(conn) != "")
+ std::cout << mysql_error(conn) << std::endl;
+ return mysql_errno(conn);
+ }
+
+ unsigned int numrows = mysql_num_rows(result);
+ unsigned int numfields = mysql_num_fields(result);
+
+ //std::cout << "Zeilen: " << numrows << " Spalten: " << numfields << std::endl;
+
+ return 1;
+
+}
+
+//Pushes the fetchbuffer in a vector
+
+std::vector< std::vector<string> > database::getResult(){
+
+ std::vector< std::vector<string> > outResult;
+ int vecCtr = 0;
+ unsigned int numfields = mysql_num_fields(result);
+
+ while ((fetchbuffer = mysql_fetch_row(result)) != NULL){
+ //if(mysql_error(conn) != "")
+ // std::cout << mysql_error(conn) << "\n";
+ std::vector<string> temp;
+ outResult.push_back(temp);
+
+ for(unsigned int i = 0; i < numfields; i++){
+ outResult[vecCtr].push_back(fetchbuffer[i] ? fetchbuffer[i] : "NULL");
+ }
+ vecCtr++;
+
+ }
+
+ return outResult;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/db.h new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/db.h
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/db.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/db.h 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,33 @@
+#include
+#include <string>
+#include <vector>
+
+#ifndef DB_H
+#define DB_H
+
+using std::string;
+
+class database{
+ private:
+ string host;
+ string username;
+ string password;
+ string db;
+ unsigned int port;
+ string socket;
+ unsigned long client_flag;
+ MYSQL* conn;
+ MYSQL_ROW fetchbuffer;
+ MYSQL_RES* result;
+
+ public:
+ database(string host, string username, string password, string db, unsigned int port = 0, string socket = "", unsigned long client_flag = 0);
+ ~database();
+ unsigned int connect();
+ void close();
+ unsigned int sqlexecute(string sqlcom);
+ std::vector< std::vector<string> > getResult();
+};
+
+
+#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/pdbtozypp.cc new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/pdbtozypp.cc
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/pdbtozypp.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/pdbtozypp.cc 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,205 @@
+#include "pdbtozypp.h"
+#include <iostream>
+
+using namespace zypp;
+
+//Constructor
+PdbToZypp::PdbToZypp(){
+ //store = _store;
+}
+
+PdbToZypp::~PdbToZypp(){
+
+}
+
+int PdbToZypp::readOut(){
+
+ //store = new ResStore;
+
+ database *dbDeps = new database("lorien.suse.de", "rpmread", "rrrrrrr", "rpm");
+ database *dbPackages = new database("lorien.suse.de", "rpmread", "rrrrrrr", "package");
+
+ if(dbPackages->connect() != 1){
+ std::cout << "NO DB CONNECTION!!!\n";
+ return 0;
+ }
+
+ if(dbDeps->connect() != 1){
+ std::cout << "NO DB CONNECTION!!!\n";
+ return 0;
+ }
+
+ dbPackages->sqlexecute("SELECT PackID, PackNameShort, PackStatus FROM Packages WHERE CDReleaseID IN (10, 64) AND PackStatus IN (0, 6, 7, 8) OR PackStatus IS NULL AND BasedOnID IS NULL");
+
+ std::vector< std::vector<string> > packIDs = dbPackages->getResult();
+
+ Resolvable::Kind kind = ResTraits<Package>::kind;
+ CapFactory factory;
+
+ for(unsigned int i = 0; i < packIDs.size(); i++){
+
+ string sqlcom("SELECT PackID FROM Packages WHERE BasedOnID=");
+ sqlcom.append(packIDs[i].at(0));
+ dbPackages->sqlexecute(sqlcom);
+ std::vector< std::vector<string> > basedIDs = dbPackages->getResult();
+
+ std::vector< std::vector<string> > binPack;
+
+ for(unsigned int j = 0; j < basedIDs.size(); j++){
+
+ sqlcom = "SELECT BinPackID, Version FROM BinaryPackages WHERE PackID=";
+ sqlcom.append(basedIDs[j].at(0));
+ dbDeps->sqlexecute(sqlcom);
+ std::vector< std::vector<string> > tempVec = dbDeps->getResult();
+ for(unsigned int x = 0; x < tempVec.size(); x++)
+ binPack.push_back(tempVec.at(x));
+ }
+
+ intrusive_ptr<resolvZypp> pkg;
+ CapSet prov;
+ CapSet preq;
+ CapSet req;
+ CapSet conf;
+ CapSet obs;
+ CapSet rec;
+ CapSet sug;
+ CapSet fre;
+ CapSet enh;
+ CapSet sup;
+
+ string edition = "";
+
+ // If Deps
+ if(binPack.size() != 0){
+
+ std::vector< std::vector<string> > packDeps;
+
+ for(unsigned int k = 0; k < binPack.size(); k++){
+ sqlcom = "SELECT Symbol, Kind, Compare, Version FROM PackReqProv WHERE BinPackID=";
+ sqlcom.append(binPack[k].at(0));
+ dbDeps->sqlexecute(sqlcom);
+ std::vector< std::vector<string> > tempVec = dbDeps->getResult();
+ for(unsigned int l = 0; l < tempVec.size(); l++)
+ packDeps.push_back(tempVec.at(l));
+
+ sqlcom = "SELECT name, DirID FROM PackFilelist WHERE DirID IN(1, 22, 24, 96, 178, 756, 1981) AND BinPackID=";
+ sqlcom.append(binPack[k].at(0));
+ dbDeps->sqlexecute(sqlcom);
+ tempVec = dbDeps->getResult();
+
+ for(unsigned int m = 0; m < tempVec.size(); m++){
+ sqlcom = "SELECT dir FROM PackFileDirs WHERE DirID=";
+ sqlcom.append(tempVec[m].at(1));
+ dbDeps->sqlexecute(sqlcom);
+ std::vector< std::vector<string> > tempVec2 = dbDeps->getResult();
+ for(unsigned int n = 0; n < tempVec2.size(); n++){
+ string fileprov = tempVec2[n].at(0) + "/" + tempVec[m].at(0);
+ prov.insert(factory.parse(kind, fileprov, Rel::ANY, Edition("")));
+ }
+
+ }
+ }
+
+ for(unsigned int y = 0; y < packDeps.size(); y++){
+
+ string ed = "";
+ string symbol = packDeps[y].at(0);
+ Rel rel = Rel::ANY;
+
+ if(packDeps[y].at(0) == "(none)")
+ continue;
+
+ if(packDeps[y].at(2) != "NULL"){
+ rel = Rel(packDeps[y].at(2));
+ ed = packDeps[y].at(3);
+ }
+
+
+ if(packDeps[y].at(1) == "provides"){
+ if(symbol.find(" = ")){
+ prov.insert(factory.parse(kind, packDeps[y].at(0)));
+ }else{
+ prov.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }
+
+ }else if(packDeps[y].at(1) == "prerequires"){
+ preq.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }else if(packDeps[y].at(1) == "requires"){
+ req.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }else if(packDeps[y].at(1) == "conflicts"){
+ conf.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }else if(packDeps[y].at(1) == "obsoletes"){
+ obs.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }else if(packDeps[y].at(1) == "recommends"){
+ rec.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }else if(packDeps[y].at(1) == "suggests"){
+ sug.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }else if(packDeps[y].at(1) == "freshens"){
+ fre.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }else if(packDeps[y].at(1) == "enhances"){
+ enh.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }else if(packDeps[y].at(1) == "supplements"){
+ sup.insert(factory.parse(kind, packDeps[y].at(0)
+ , rel, Edition(ed)));
+ }
+ }
+
+ edition = binPack[0].at(1);
+
+ }
+
+ Dependencies deps;
+ if(prov.size() > 0)
+ deps[Dep::PROVIDES] = prov;
+ if(preq.size() > 0)
+ deps[Dep::PREREQUIRES] = preq;
+ if(req.size() > 0)
+ deps[Dep::REQUIRES] = req;
+ if(conf.size() > 0)
+ deps[Dep::CONFLICTS] = conf;
+ if(obs.size() > 0)
+ deps[Dep::OBSOLETES] = obs;
+ if(rec.size() > 0)
+ deps[Dep::RECOMMENDS] = rec;
+ if(sug.size() > 0)
+ deps[Dep::SUGGESTS] = sug;
+ if(fre.size() > 0)
+ deps[Dep::FRESHENS] = fre;
+ if(enh.size() > 0)
+ deps[Dep::ENHANCES] = enh;
+ if(sup.size() > 0)
+ deps[Dep::SUPPLEMENTS] = sup;
+
+ NVRAD nvPkg(packIDs[i].at(1), Edition(edition), Arch("i386"), deps);
+
+ Package::Ptr p( detail::makeResolvableAndImpl(nvPkg, pkg));
+
+ //set Status to install
+ /*for(unsigned int ii = 0; ii < pToInst.size(); ii++){
+ if(pToInst.at(ii) == packIDs[i].at(1)){
+ PoolItem_Ref poolItem(p);
+ poolItem.status().setToBeInstalled(ResStatus::USER);
+ }
+ }*/
+
+ store.insert(p);
+ }
+
+ dbDeps->close();
+ dbPackages->close();
+
+ return 1;
+}
+
+ResStore PdbToZypp::getStore(){
+ return store;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/pdbtozypp.h new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/pdbtozypp.h
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/pdbtozypp.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/pdbtozypp.h 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,22 @@
+#include <vector>
+#include "db.h"
+#include "resolvable.h"
+
+#include
+#include
+#include
+#include
+//#include
+#include
+
+class PdbToZypp{
+ public:
+ //typedef zypp::ResStore ResStore;
+ //PdbToZypp(zypp::ResStore & _store);
+ PdbToZypp();
+ ~PdbToZypp();
+ int readOut();
+ zypp::ResStore getStore();
+ private:
+ zypp::ResStore store;
+};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/resolvable.cc new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/resolvable.cc
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/resolvable.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/resolvable.cc 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,25 @@
+#include "resolvable.h"
+
+resolvable::resolvable(string _name, string _kind, string _arch, string _version, string _release){
+ name = _name;
+ kind = _kind;
+ arch = _arch;
+ version = _version;
+ release = _release;
+}
+
+resolvable::~resolvable(){
+}
+
+/*
+void resolvable::addDep(depType _type, string _dep){
+
+ if(deps.find(_type) == deps.end()){
+ std::vector<string> temp;
+ deps[_type] = temp;
+ }
+
+ deps[_type].push_back(_dep);
+
+}
+*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/resolvable.h new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/resolvable.h
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/resolvable.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/resolvable.h 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,34 @@
+#include <string>
+#include <vector>
+#include <map>
+#include
+
+#ifndef RESOLVABLE_H
+#define RESOLVABLE_H
+
+using std::string;
+
+enum depType{
+ REQUIRES,
+ PROVIDES,
+ OBSOLETES,
+ CONFLICTS
+};
+
+class resolvable{
+ private:
+ string name;
+ string kind;
+ string arch;
+ string version;
+ string release;
+ std::map < depType, std::vector<string> > deps;
+
+ public:
+ resolvable(string name, string version, string kind = "package", string arch = "i386", string release ="0");
+ ~resolvable();
+ //void addDep(depType type, string dep, string compare, string version);
+};
+
+class resolvZypp : public zypp::detail::PackageImplIf {};
+#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/swig/CMakeLists.txt new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/swig/CMakeLists.txt
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/swig/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/swig/CMakeLists.txt 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,57 @@
+PROJECT(swigpdbtozypp)
+
+FIND_PACKAGE(Perl REQUIRED)
+
+FIND_PROGRAM(SWIG_EXECUTABLE
+ NAMES swig-1.3 swig
+ PATHS ${SWIG_DIR} ${SWIG_DIR}/.. ${SWIG_DIR}/../../bin /usr/bin /usr/local/bin ${CMAKE_INSTALL_PREFIX}/bin
+)
+
+IF ( NOT SWIG_EXECUTABLE )
+ MESSAGE( FATAL_ERROR " swig not found" )
+ELSE ( NOT SWIG_EXECUTABLE )
+ MESSAGE( STATUS "SWIG found at ${SWIG_EXECUTABLE}" )
+ENDIF ( NOT SWIG_EXECUTABLE )
+
+
+EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -e "use Config; print \$Config{cppflags}" OUTPUT_VARIABLE PERL_CXX_FLAGS)
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PERL_CXX_FLAGS}")
+
+EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -e "use Config; print \$Config{archlibexp}" OUTPUT_VARIABLE PERL_LIB_PATH)
+SET( PERL_INS_PATH "${PERL_LIB_PATH}" )
+SET( PERL_LIB_PATH "${PERL_LIB_PATH}/CORE" )
+
+MESSAGE(STATUS "Perl executable: ${PERL_EXECUTABLE}")
+MESSAGE(STATUS "Perl cpp-flags: ${PERL_CXX_FLAGS}")
+MESSAGE(STATUS "Perl lib path: ${PERL_LIB_PATH}")
+
+SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/PdbToZypp_wrap.cxx" )
+SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/PdbToZypp.i" )
+
+ADD_CUSTOM_COMMAND (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PdbToZypp_wrap.cxx
+ COMMAND ${CMAKE_COMMAND} -E echo_append "Creating wrapper code for perl..."
+ COMMAND ${SWIG_EXECUTABLE} -c++ -perl5 -xmlout ${CMAKE_CURRENT_BINARY_DIR}/parse.xml -o ${CMAKE_CURRENT_BINARY_DIR}/PdbToZypp_wrap.cxx -I${ZYPP_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/PdbToZypp.i
+ COMMAND ${CMAKE_COMMAND} -E echo "Done."
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.i ${CMAKE_CURRENT_SOURCE_DIR}/*.i
+)
+
+ADD_CUSTOM_TARGET( glue
+ DEPENDS ${SWIG_OUTPUT}
+)
+
+ADD_LIBRARY( rpdbtozypp SHARED "${CMAKE_CURRENT_BINARY_DIR}/PdbToZypp_wrap.cxx" )
+SET_TARGET_PROPERTIES( rpdbtozypp PROPERTIES PREFIX "" )
+ADD_DEPENDENCIES( rpdbtozypp glue )
+
+INCLUDE_DIRECTORIES( ${PERL_LIB_PATH} )
+INCLUDE_DIRECTORIES( ${ZYPP_INCLUDE_DIR} )
+INCLUDE_DIRECTORIES( ${CMAKE_INSTALL_PREFIX}/include/pdbtozypp )
+TARGET_LINK_LIBRARIES( rpdbtozypp ${ZYPP_LIBRARY} )
+TARGET_LINK_LIBRARIES( rpdbtozypp -lpdbtozypp )
+
+INSTALL(TARGETS rpdbtozypp LIBRARY DESTINATION ${PERL_INS_PATH})
+INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/rpdbtozypp.pm DESTINATION ${PERL_INS_PATH})
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/swig/PdbToZypp.i new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/swig/PdbToZypp.i
--- old/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/swig/PdbToZypp.i 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/devel/devel.shaas/PdbToZypp/swig/PdbToZypp.i 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,18 @@
+%module rpdbtozypp
+%{
+#undef NORMAL
+#include "pdbtozypp.h"
+using namespace zypp;
+%}
+
+class PdbToZypp{
+ public:
+ //typedef zypp::ResStore ResStore;
+ //PdbToZypp(zypp::ResStore & _store);
+ PdbToZypp();
+ ~PdbToZypp();
+ int readOut();
+ ResStore getStore();
+ private:
+ ResStore store;
+};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/old/Makefile new/libzypp-3.22.1/devel/devel.shaas/old/Makefile
--- old/libzypp-3.22.1/devel/devel.shaas/old/Makefile 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/old/Makefile 2007-09-07 14:53:33.000000000 +0200
@@ -8,7 +8,7 @@
INCPATH = -I/usr/include -I. -I. -I.
LINK = g++
LFLAGS = -lpdbtozypp
-LIBS = $(SUBLIBS) -L/usr/local/lib
+LIBS = $(SUBLIBS) -L/usr/lib
####### Output directory
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/old/main.cc new/libzypp-3.22.1/devel/devel.shaas/old/main.cc
--- old/libzypp-3.22.1/devel/devel.shaas/old/main.cc 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/old/main.cc 2007-09-07 14:53:33.000000000 +0200
@@ -1,13 +1,45 @@
#include
+#include
+#include
+#include
+#include
using namespace zypp;
using namespace std;
int main(){
static ZYpp::Ptr God;
- ResStore store = pdbToZypp();
- try {
+ PdbToZypp pdb;
+ pdb.readOut();
+
+ ResStore store = pdb.getStore();
+
+ /*RepoInfo repo_info;
+ repo_info.setAlias("test");
+ repo_info.setName("Test Repo");
+ repo_info.setEnabled(true);
+ repo_info.setAutorefresh(false);
+ repo_info.addBaseUrl(Url("ftp://dist.suse.de/install/stable-x86/"));
+
+ RepoManagerOptions opts;
+ filesystem::TmpDir cachePath;
+ filesystem::TmpDir rawPath;
+ filesystem::TmpDir reposPath;
+
+ opts.repoCachePath = cachePath.path();
+ opts.repoRawCachePath = rawPath.path();
+ opts.knownReposPath = reposPath.path();
+
+ RepoManager repo_man(opts);
+
+ repo_man.addRepository(repo_info);
+ repo_man.refreshMetadata(repo_info);
+ repo_man.buildCache(repo_info);
+ Repository repo = repo_man.createFromCache(repo_info);
+ ResStore store = repo.resolvables();*/
+
+ try {
God = zypp::getZYpp();
}
catch (const Exception & excpt_r ) {
@@ -18,5 +50,30 @@
God->addResolvables(store);
cout << "Elements in pool: " << God->pool().size() << endl;
+
+ for(pool::PoolTraits::const_iterator iter = God->pool().begin(); iter != God->pool().end(); iter++){
+
+ ResObject::constPtr r = iter->resolvable();
+ if(r->name() == "glibc"){
+ cout << "Package found!" << endl;
+ iter->status().setToBeInstalled(ResStatus::USER);
+ }
+
+ }
+
+ Resolver res(God->pool());
+
+ if(res.resolvePool() == false){
+ cout << "It was not possible to solve the pool" << endl;
+ list<string> problems = res.problemDescription();
+
+ for(list<string>::iterator iter = problems.begin(); iter != problems.end(); iter++){
+ cout << *iter << endl;
+ }
+
+ }else{
+ cout << "The pool was solved corectly" << endl;
+ }
+
return 0;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/src/Makefile new/libzypp-3.22.1/devel/devel.shaas/src/Makefile
--- old/libzypp-3.22.1/devel/devel.shaas/src/Makefile 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/src/Makefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,56 +0,0 @@
-####### Compiler, tools and options
-
-CC = gcc
-CXX = g++
-DEFINES =
-CFLAGS = -pipe -O2 -Wall -W -fpic -D_REENTRANT $(DEFINES)
-CXXFLAGS = -pipe -O2 -Wall -W -fpic -D_REENTRANT $(DEFINES)
-INCPATH = -I/usr/include -I. -I. -I.
-LINK = g++
-LFLAGS = -shared -lmysqlclient
-LIBS = $(SUBLIBS) -L/usr/local/lib
-
-####### Output directory
-
-OBJECTS_DIR = ./
-
-####### Files
-
-SOURCES = db.cc resolvable.h pdbtozypp.cc
-OBJECTS = db.o pdbtozypp.o
-OBJCOMP = /usr/local/lib/libzypp.so
-DESTDIR =
-TARGET = libpdbtozypp.so
-
-first: all
-####### Implicit rules
-
-.SUFFIXES: .o .c .cpp .cc .cxx .C
-
-.cpp.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
-
-.cc.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
-
-.cxx.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
-
-.C.o:
- $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
-
-.c.o:
- $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
-
-####### Build rules
-
-all: Makefile $(TARGET)
-
-$(TARGET): $(OBJECTS)
- $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
-
-install:
- install --mode=644 db.h /usr/include/pdbtozypp/
- install --mode=644 resolvable.h /usr/include/pdbtozypp/
- install --mode=644 pdbtozypp.h /usr/include/pdbtozypp/
- install --mode=555 libpdbtozypp.so /usr/lib/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/src/db.cc new/libzypp-3.22.1/devel/devel.shaas/src/db.cc
--- old/libzypp-3.22.1/devel/devel.shaas/src/db.cc 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/src/db.cc 1970-01-01 01:00:00.000000000 +0100
@@ -1,91 +0,0 @@
-#include "db.h"
-#include <iostream>
-
-using std::string;
-
-//Constructor
-
-database::database(string nHost, string nUsername, string nPassword, string nDatabase, unsigned int nPort, string nSocket, unsigned long nClient_flag){
- host = nHost;
- username = nUsername;
- password = nPassword;
- db = nDatabase;
- port = nPort;
- socket = nSocket;
- client_flag = nClient_flag;
-
- conn = mysql_init(NULL);
-}
-
-//Destructor
-
-database::~database(){
-}
-
-//Connect to db
-
-unsigned int database::connect(){
- if(mysql_real_connect(conn, host.c_str(), username.c_str(), password.c_str(), db.c_str(), port, socket.c_str(), client_flag) == NULL){
-
- if(mysql_error(conn) != "")
- std::cout << mysql_error(conn) << std::endl;
- return mysql_errno(conn);
- }
-
- return 1;
-}
-
-//Close db connection
-
-void database::close(){
- mysql_close(conn);
-}
-
-//Execute given SQL-Statement
-
-unsigned int database::sqlexecute(string sqlcom){
-
- if(mysql_query(conn, sqlcom.c_str())){
- if(mysql_error(conn) != "")
- std::cout << mysql_error(conn) << std::endl;
- return mysql_errno(conn);
- }
-
- if((result = mysql_store_result(conn)) == NULL){
- if(mysql_error(conn) != "")
- std::cout << mysql_error(conn) << std::endl;
- return mysql_errno(conn);
- }
-
- unsigned int numrows = mysql_num_rows(result);
- unsigned int numfields = mysql_num_fields(result);
-
- //std::cout << "Zeilen: " << numrows << " Spalten: " << numfields << std::endl;
-
- return 1;
-
-}
-
-//Pushes the fetchbuffer in a vector
-
-std::vector< std::vector<string> > database::getResult(){
-
- std::vector< std::vector<string> > outResult;
- int vecCtr = 0;
- unsigned int numfields = mysql_num_fields(result);
-
- while ((fetchbuffer = mysql_fetch_row(result)) != NULL){
- //if(mysql_error(conn) != "")
- // std::cout << mysql_error(conn) << "\n";
- std::vector<string> temp;
- outResult.push_back(temp);
-
- for(unsigned int i = 0; i < numfields; i++){
- outResult[vecCtr].push_back(fetchbuffer[i] ? fetchbuffer[i] : "NULL");
- }
- vecCtr++;
-
- }
-
- return outResult;
-}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/src/db.h new/libzypp-3.22.1/devel/devel.shaas/src/db.h
--- old/libzypp-3.22.1/devel/devel.shaas/src/db.h 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/src/db.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,33 +0,0 @@
-#include
-#include <string>
-#include <vector>
-
-#ifndef DB_H
-#define DB_H
-
-using std::string;
-
-class database{
- private:
- string host;
- string username;
- string password;
- string db;
- unsigned int port;
- string socket;
- unsigned long client_flag;
- MYSQL* conn;
- MYSQL_ROW fetchbuffer;
- MYSQL_RES* result;
-
- public:
- database(string host, string username, string password, string db, unsigned int port = 0, string socket = "", unsigned long client_flag = 0);
- ~database();
- unsigned int connect();
- void close();
- unsigned int sqlexecute(string sqlcom);
- std::vector< std::vector<string> > getResult();
-};
-
-
-#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/src/pdbtozypp.cc new/libzypp-3.22.1/devel/devel.shaas/src/pdbtozypp.cc
--- old/libzypp-3.22.1/devel/devel.shaas/src/pdbtozypp.cc 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/src/pdbtozypp.cc 1970-01-01 01:00:00.000000000 +0100
@@ -1,181 +0,0 @@
-#include "pdbtozypp.h"
-#include <iostream>
-
-using namespace zypp;
-
-//Constructor
-PdbToZypp::PdbToZypp(){
-
- store = new ResStore;
-
- database *dbDeps = new database("lorien.suse.de", "rpmread", "***", "rpm");
- database *dbPackages = new database("lorien.suse.de", "rpmread", "***", "package");
-
- if(dbPackages->connect() != 1){
- //std::cout << "NO DB CONNECTION!!!\n";
- //return 1;
- }
-
- if(dbDeps->connect() != 1){
- //std::cout << "NO DB CONNECTION!!!\n";
- //return 1;
- }
-
- dbPackages->sqlexecute("SELECT PackID, PackNameShort, PackStatus FROM Packages WHERE CDReleaseID = 10 AND PackStatus IN (0, 6, 7, 8) AND BasedOnID IS NULL");
-
- std::vector< std::vector<string> > packIDs = dbPackages->getResult();
-
- Resolvable::Kind kind = ResTraits<Package>::kind;
- CapFactory factory;
-
- for(unsigned int i = 0; i < packIDs.size(); i++){
-
- string sqlcom("SELECT PackID FROM Packages WHERE BasedOnID=");
- sqlcom.append(packIDs[i].at(0));
- dbPackages->sqlexecute(sqlcom);
- std::vector< std::vector<string> > basedIDs = dbPackages->getResult();
-
- std::vector< std::vector<string> > binPack;
-
- for(unsigned int j = 0; j < basedIDs.size(); j++){
-
- sqlcom = "SELECT BinPackID, Version FROM BinaryPackages WHERE PackID=";
- sqlcom.append(basedIDs[j].at(0));
- dbDeps->sqlexecute(sqlcom);
- std::vector< std::vector<string> > tempVec = dbDeps->getResult();
- for(unsigned int x = 0; x < tempVec.size(); x++)
- binPack.push_back(tempVec.at(x));
- }
-
- intrusive_ptr<resolvZypp> pkg;
- CapSet prov;
- CapSet preq;
- CapSet req;
- CapSet conf;
- CapSet obs;
- CapSet rec;
- CapSet sug;
- CapSet fre;
- CapSet enh;
- CapSet sup;
-
- string edition = "";
-
- // If Deps
- if(binPack.size() != 0){
-
- std::vector< std::vector<string> > packDeps;
-
- for(unsigned int k = 0; k < binPack.size(); k++){
- sqlcom = "SELECT Symbol, Kind, Compare, Version FROM PackReqProv WHERE BinPackID=";
- sqlcom.append(binPack[k].at(0));
- dbDeps->sqlexecute(sqlcom);
- std::vector< std::vector<string> > tempVec = dbDeps->getResult();
- for(unsigned int l = 0; l < tempVec.size(); l++)
- packDeps.push_back(tempVec.at(l));
-
-
- }
-
- for(unsigned int y = 0; y < packDeps.size(); y++){
-
- string ed = "";
- string symbol = packDeps[y].at(0);
- Rel rel = Rel::ANY;
-
- if(packDeps[y].at(0) == "(none)")
- continue;
-
- if(packDeps[y].at(2) != "NULL"){
- rel = Rel(packDeps[y].at(2));
- ed = packDeps[y].at(3);
- }
-
-
- if(packDeps[y].at(1) == "provides"){
- if(symbol.find(" = ")){
- prov.insert(factory.parse(kind, packDeps[y].at(0)));
- }else{
- prov.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }
-
- }else if(packDeps[y].at(1) == "prerequires"){
- preq.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }else if(packDeps[y].at(1) == "requires"){
- req.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }else if(packDeps[y].at(1) == "conflicts"){
- conf.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }else if(packDeps[y].at(1) == "obsoletes"){
- obs.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }else if(packDeps[y].at(1) == "recommends"){
- rec.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }else if(packDeps[y].at(1) == "suggests"){
- sug.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }else if(packDeps[y].at(1) == "freshens"){
- fre.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }else if(packDeps[y].at(1) == "enhances"){
- enh.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }else if(packDeps[y].at(1) == "supplements"){
- sup.insert(factory.parse(kind, packDeps[y].at(0)
- , rel, Edition(ed)));
- }
- }
-
- edition = binPack[0].at(1);
-
- }
-
- Dependencies deps;
- if(prov.size() > 0)
- deps[Dep::PROVIDES] = prov;
- if(preq.size() > 0)
- deps[Dep::PREREQUIRES] = preq;
- if(req.size() > 0)
- deps[Dep::REQUIRES] = req;
- if(conf.size() > 0)
- deps[Dep::CONFLICTS] = conf;
- if(obs.size() > 0)
- deps[Dep::OBSOLETES] = obs;
- if(rec.size() > 0)
- deps[Dep::RECOMMENDS] = rec;
- if(sug.size() > 0)
- deps[Dep::SUGGESTS] = sug;
- if(fre.size() > 0)
- deps[Dep::FRESHENS] = fre;
- if(enh.size() > 0)
- deps[Dep::ENHANCES] = enh;
- if(sup.size() > 0)
- deps[Dep::SUPPLEMENTS] = sup;
-
- NVRAD nvPkg(packIDs[i].at(1), Edition(edition), Arch("i386"), deps);
-
- Package::Ptr p( detail::makeResolvableAndImpl(nvPkg, pkg));
-
- //set Status to install
- /*for(unsigned int ii = 0; ii < pToInst.size(); ii++){
- if(pToInst.at(ii) == packIDs[i].at(1)){
- PoolItem_Ref poolItem(p);
- poolItem.status().setToBeInstalled(ResStatus::USER);
- }
- }*/
-
- store->insert(p);
- }
-
- dbDeps->close();
- dbPackages->close();
-
-}
-
-ResStore& PdbToZypp::getStore(){
- return *store;
-}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/src/pdbtozypp.h new/libzypp-3.22.1/devel/devel.shaas/src/pdbtozypp.h
--- old/libzypp-3.22.1/devel/devel.shaas/src/pdbtozypp.h 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/src/pdbtozypp.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,19 +0,0 @@
-#include <vector>
-#include "db.h"
-#include "resolvable.h"
-
-#include
-#include
-#include
-#include
-//#include
-#include
-
-class PdbToZypp{
- public:
- typedef zypp::ResStore ResStore;
- PdbToZypp();
- ResStore& getStore();
- private:
- ResStore *store;
-};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/src/resolvable.cc new/libzypp-3.22.1/devel/devel.shaas/src/resolvable.cc
--- old/libzypp-3.22.1/devel/devel.shaas/src/resolvable.cc 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/src/resolvable.cc 1970-01-01 01:00:00.000000000 +0100
@@ -1,25 +0,0 @@
-#include "resolvable.h"
-
-resolvable::resolvable(string _name, string _kind, string _arch, string _version, string _release){
- name = _name;
- kind = _kind;
- arch = _arch;
- version = _version;
- release = _release;
-}
-
-resolvable::~resolvable(){
-}
-
-/*
-void resolvable::addDep(depType _type, string _dep){
-
- if(deps.find(_type) == deps.end()){
- std::vector<string> temp;
- deps[_type] = temp;
- }
-
- deps[_type].push_back(_dep);
-
-}
-*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/devel/devel.shaas/src/resolvable.h new/libzypp-3.22.1/devel/devel.shaas/src/resolvable.h
--- old/libzypp-3.22.1/devel/devel.shaas/src/resolvable.h 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/devel/devel.shaas/src/resolvable.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,34 +0,0 @@
-#include <string>
-#include <vector>
-#include <map>
-#include
-
-#ifndef RESOLVABLE_H
-#define RESOLVABLE_H
-
-using std::string;
-
-enum depType{
- REQUIRES,
- PROVIDES,
- OBSOLETES,
- CONFLICTS
-};
-
-class resolvable{
- private:
- string name;
- string kind;
- string arch;
- string version;
- string release;
- std::map < depType, std::vector<string> > deps;
-
- public:
- resolvable(string name, string version, string kind = "package", string arch = "i386", string release ="0");
- ~resolvable();
- //void addDep(depType type, string dep, string compare, string version);
-};
-
-class resolvZypp : public zypp::detail::PackageImplIf {};
-#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/libzypp.spec.cmake new/libzypp-3.22.1/libzypp.spec.cmake
--- old/libzypp-3.22.1/libzypp.spec.cmake 2007-09-03 17:18:11.000000000 +0200
+++ new/libzypp-3.22.1/libzypp.spec.cmake 2007-09-07 14:53:34.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package libzypp
#
-# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -11,7 +11,7 @@
# norootforbuild
Name: @PACKAGE@
-License: GPL
+License: GPL v2 or later
Group: System/Packages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Autoreqprov: on
@@ -75,12 +75,12 @@
cd build
cmake -DCMAKE_INSTALL_PREFIX=%{prefix} \
-DLIB=%{_lib} \
- -DCMAKE_C_FLAGS="%{optflags}" \
- -DCMAKE_CXX_FLAGS="%{optflags}" \
+ -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
+ -DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SKIP_RPATH=1 \
..
-make %{?jobs:-j %jobs}
+make %{?jobs:-j %jobs} VERBOSE=1
make -C doc/autodoc %{?jobs:-j %jobs}
make -C po %{?jobs:-j %jobs} translations
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/package/libzypp.changes new/libzypp-3.22.1/package/libzypp.changes
--- old/libzypp-3.22.1/package/libzypp.changes 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/package/libzypp.changes 2007-09-07 14:53:34.000000000 +0200
@@ -1,4 +1,70 @@
-------------------------------------------------------------------
+Fri Sep 7 13:03:48 CEST 2007 - schubi@suse.de
+
+- RequirementIsMet: return true only if ALL Atoms are NOT incomplete; Bug
+ 308252
+- r 7143
+
+-------------------------------------------------------------------
+Thu Sep 6 18:22:36 CEST 2007 - schubi@suse.de
+
+- Error: Select two candidate with the same name while update.
+ Solution: If there is a candidate which is already selected for installation -->
+ take thatone #308082
+- r 7132
+
+-------------------------------------------------------------------
+Thu Sep 6 14:11:58 CEST 2007 - ma@suse.de
+
+- Work arround installed patterns providing an empty vendor string. (#307743)
+- Let the solver treat vendor suse and opensuse as equivalent.
+- version 3.22.4
+
+-------------------------------------------------------------------
+Thu Sep 6 12:33:27 CEST 2007 - schubi@suse.de
+
+- Checking item before evaluating the concerning vendor. bug #307941
+- r 7119
+
+-------------------------------------------------------------------
+Wed Sep 6 02:24:37 CEST 2007 - dmacvicar@suse.de
+
+- Fix for bug #307163 - empty package descriptions
+ a.k.a shared tag not 100% implemented
+- r 7117
+- version 3.22.3
+
+-------------------------------------------------------------------
+Wed Sep 5 17:52:37 CEST 2007 - schubi@suse.de
+
+- logging "reverse" NEEDED_BY in the detail description of solver
+ problems.
+- improved error message if a requiremnt is not fulfilled Bug 307743
+- Add "ignore" option to the solution if a requirement is not fulfilled
+ Bug 304276
+- revision 7113
+
+-------------------------------------------------------------------
+Wed Sep 5 14:33:02 CEST 2007 - jkupec@suse.cz
+
+- fixed the order of operands of susetags local metadata status
+ computation which caused the YaST repositories to always get
+ refreshed (part of bug #304310)
+- revision 7107
+- version 3.22.2
+
+-------------------------------------------------------------------
+Tue Sep 4 12:09:10 CEST 2007 - schubi@suse.de
+
+- comparing vendor with VendorAttr::equivalent
+- revision 7103
+
+-------------------------------------------------------------------
+Mon Sep 3 18:43:51 CEST 2007 - schwab@suse.de
+
+- Use $RPM_OPT_FLAGS.
+
+-------------------------------------------------------------------
Mon Sep 3 17:14:02 CEST 2007 - ma@suse.de
- Reset transact bits when switching status from
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/po/zypp.pot new/libzypp-3.22.1/po/zypp.pot
--- old/libzypp-3.22.1/po/zypp.pot 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/po/zypp.pot 2007-09-07 14:53:29.000000000 +0200
@@ -0,0 +1,4779 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR SuSE Linux Products GmbH, Nuernberg
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-09-03 13:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../zypp/url/UrlBase.cc:154
+#, c-format
+msgid "Url scheme does not allow a %s"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:173
+#, c-format
+msgid "Invalid %s component '%s'"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:180
+#, c-format
+msgid "Invalid %s component"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:727
+msgid "Path parameter parsing not supported for this URL"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:782 ../zypp/url/UrlBase.cc:1229
+msgid "Query string parsing not supported for this URL"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:820
+msgid "Url scheme is a required component"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:826
+#, c-format
+msgid "Invalid Url scheme '%s'"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:947
+msgid "Url scheme does not allow a username"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:981
+msgid "Url scheme does not allow a password"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:1010
+msgid "Url scheme requires a host component"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:1020
+msgid "Url scheme does not allow a host component"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:1047
+#, c-format
+msgid "Invalid host component '%s'"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:1068
+msgid "Url scheme does not allow a port"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:1079
+#, c-format
+msgid "Invalid port component '%s'"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:1096
+msgid "Url scheme requires path name"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:1117 ../zypp/url/UrlBase.cc:1131
+msgid "Relative path not allowed if authority exists"
+msgstr ""
+
+#: ../zypp/url/UrlBase.cc:1184
+msgid "Path Parameter parsing not supported for this URL"
+msgstr ""
+
+#: ../zypp/url/UrlUtils.cc:111
+msgid "Encoded string contains a NUL byte"
+msgstr ""
+
+#: ../zypp/url/UrlUtils.cc:173
+msgid "Invalid parameter array split separator character"
+msgstr ""
+
+#: ../zypp/url/UrlUtils.cc:213
+msgid "Invalid parameter map split separator character"
+msgstr ""
+
+#: ../zypp/url/UrlUtils.cc:283
+msgid "Invalid parameter array join separator character"
+msgstr ""
+
+#. TranslatorExplanation followed by the list of error messages that lead to this exception
+#: ../zypp/base/Exception.cc:89
+msgid "History:"
+msgstr ""
+
+#: ../zypp/repo/PackageProvider.cc:237
+msgid "applydeltarpm check failed."
+msgstr ""
+
+#: ../zypp/repo/PackageProvider.cc:251
+msgid "applydeltarpm failed."
+msgstr ""
+
+#. TranslatorExplanation %s = package being checked for integrity
+#: ../zypp/repo/PackageProvider.cc:318
+#, c-format
+msgid "Package %s fails integrity check. Do you want to retry?"
+msgstr ""
+
+#: ../zypp/repo/RepoProvideFile.cc:206
+msgid "No url in repository."
+msgstr ""
+
+#. iteration over urls
+#: ../zypp/repo/RepoProvideFile.cc:278
+#, c-format
+msgid "Can't provide file %s from repository %s"
+msgstr ""
+
+#: ../zypp/repo/cached/RepoImpl.cc:73
+#, c-format
+msgid "Reading '%s' repository cache"
+msgstr ""
+
+#: ../zypp/repo/cached/RepoImpl.cc:194
+#, c-format
+msgid "Reading patch and delta rpms from '%s' repository cache"
+msgstr ""
+
+#: ../zypp/media/MediaUserAuth.cc:97
+#, c-format
+msgid "Unsupported HTTP authentication method '%s'"
+msgstr ""
+
+#: ../zypp/media/MediaCurl.cc:715 ../zypp/media/MediaCurl.cc:784
+msgid "Invalid user name or password."
+msgstr ""
+
+#: ../zypp/media/MediaCurl.cc:718 ../zypp/media/MediaCurl.cc:787
+#, c-format
+msgid "Authentication required for '%s'"
+msgstr ""
+
+#: ../zypp/RepoManager.cc:115
+#, c-format
+msgid "Cleaning repository '%s' cache"
+msgstr ""
+
+#. we will throw this later if no URL checks out fine
+#: ../zypp/RepoManager.cc:521
+msgid "Valid metadata not found at specified URL(s)"
+msgstr ""
+
+#: ../zypp/RepoManager.cc:677
+#, c-format
+msgid "Building repository '%s' cache"
+msgstr ""
+
+#. progress.sendTo( progressrcv );
+#: ../zypp/RepoManager.cc:822
+#, c-format
+msgid "Reading repository '%s' cache"
+msgstr ""
+
+#: ../zypp/RepoManager.cc:912
+#, c-format
+msgid "Adding repository '%s'"
+msgstr ""
+
+#: ../zypp/RepoManager.cc:1017
+#, c-format
+msgid "Removing repository '%s'"
+msgstr ""
+
+#: ../zypp/Url.cc:112
+msgid "Invalid LDAP URL query string"
+msgstr ""
+
+#: ../zypp/Url.cc:151
+#, c-format
+msgid "Invalid LDAP URL query parameter '%s'"
+msgstr ""
+
+#: ../zypp/Url.cc:295
+msgid "Unable to clone Url object"
+msgstr ""
+
+#: ../zypp/Url.cc:308
+msgid "Invalid empty Url object reference"
+msgstr ""
+
+#: ../zypp/Url.cc:321 ../zypp/Url.cc:335
+msgid "Unable to parse Url components"
+msgstr ""
+
+#: ../zypp/LanguageCode.cc:145
+msgid "Unknown language: "
+msgstr ""
+
+#. Defined LanguageCode constants
+#. Defined CountryCode constants
+#: ../zypp/LanguageCode.cc:225 ../zypp/CountryCode.cc:215
+msgid "No Code"
+msgstr ""
+
+#. language code: aar aa
+#: ../zypp/LanguageCode.cc:238
+msgid "Afar"
+msgstr ""
+
+#. language code: abk ab
+#: ../zypp/LanguageCode.cc:240
+msgid "Abkhazian"
+msgstr ""
+
+#. language code: ace
+#: ../zypp/LanguageCode.cc:242
+msgid "Achinese"
+msgstr ""
+
+#. language code: ach
+#: ../zypp/LanguageCode.cc:244
+msgid "Acoli"
+msgstr ""
+
+#. language code: ada
+#: ../zypp/LanguageCode.cc:246
+msgid "Adangme"
+msgstr ""
+
+#. language code: ady
+#: ../zypp/LanguageCode.cc:248
+msgid "Adyghe"
+msgstr ""
+
+#. language code: afa
+#: ../zypp/LanguageCode.cc:250
+msgid "Afro-Asiatic (Other)"
+msgstr ""
+
+#. language code: afh
+#: ../zypp/LanguageCode.cc:252
+msgid "Afrihili"
+msgstr ""
+
+#. language code: afr af
+#: ../zypp/LanguageCode.cc:254
+msgid "Afrikaans"
+msgstr ""
+
+#. language code: ain
+#: ../zypp/LanguageCode.cc:256
+msgid "Ainu"
+msgstr ""
+
+#. language code: aka ak
+#: ../zypp/LanguageCode.cc:258
+msgid "Akan"
+msgstr ""
+
+#. language code: akk
+#: ../zypp/LanguageCode.cc:260
+msgid "Akkadian"
+msgstr ""
+
+#. language code: alb sqi sq
+#: ../zypp/LanguageCode.cc:262 ../zypp/LanguageCode.cc:264
+msgid "Albanian"
+msgstr ""
+
+#. language code: ale
+#: ../zypp/LanguageCode.cc:266
+msgid "Aleut"
+msgstr ""
+
+#. language code: alg
+#: ../zypp/LanguageCode.cc:268
+msgid "Algonquian Languages"
+msgstr ""
+
+#. language code: alt
+#: ../zypp/LanguageCode.cc:270
+msgid "Southern Altai"
+msgstr ""
+
+#. language code: amh am
+#: ../zypp/LanguageCode.cc:272
+msgid "Amharic"
+msgstr ""
+
+#. language code: ang
+#: ../zypp/LanguageCode.cc:274
+msgid "English, Old (ca.450-1100)"
+msgstr ""
+
+#. language code: apa
+#: ../zypp/LanguageCode.cc:276
+msgid "Apache Languages"
+msgstr ""
+
+#. language code: ara ar
+#: ../zypp/LanguageCode.cc:278
+msgid "Arabic"
+msgstr ""
+
+#. language code: arc
+#: ../zypp/LanguageCode.cc:280
+msgid "Aramaic"
+msgstr ""
+
+#. language code: arg an
+#: ../zypp/LanguageCode.cc:282
+msgid "Aragonese"
+msgstr ""
+
+#. language code: arm hye hy
+#: ../zypp/LanguageCode.cc:284 ../zypp/LanguageCode.cc:286
+msgid "Armenian"
+msgstr ""
+
+#. language code: arn
+#: ../zypp/LanguageCode.cc:288
+msgid "Araucanian"
+msgstr ""
+
+#. language code: arp
+#: ../zypp/LanguageCode.cc:290
+msgid "Arapaho"
+msgstr ""
+
+#. language code: art
+#: ../zypp/LanguageCode.cc:292
+msgid "Artificial (Other)"
+msgstr ""
+
+#. language code: arw
+#: ../zypp/LanguageCode.cc:294
+msgid "Arawak"
+msgstr ""
+
+#. language code: asm as
+#: ../zypp/LanguageCode.cc:296
+msgid "Assamese"
+msgstr ""
+
+#. language code: ast
+#: ../zypp/LanguageCode.cc:298
+msgid "Asturian"
+msgstr ""
+
+#. language code: ath
+#: ../zypp/LanguageCode.cc:300
+msgid "Athapascan Languages"
+msgstr ""
+
+#. language code: aus
+#: ../zypp/LanguageCode.cc:302
+msgid "Australian Languages"
+msgstr ""
+
+#. language code: ava av
+#: ../zypp/LanguageCode.cc:304
+msgid "Avaric"
+msgstr ""
+
+#. language code: ave ae
+#: ../zypp/LanguageCode.cc:306
+msgid "Avestan"
+msgstr ""
+
+#. language code: awa
+#: ../zypp/LanguageCode.cc:308
+msgid "Awadhi"
+msgstr ""
+
+#. language code: aym ay
+#: ../zypp/LanguageCode.cc:310
+msgid "Aymara"
+msgstr ""
+
+#. language code: aze az
+#: ../zypp/LanguageCode.cc:312
+msgid "Azerbaijani"
+msgstr ""
+
+#. language code: bad
+#: ../zypp/LanguageCode.cc:314
+msgid "Banda"
+msgstr ""
+
+#. language code: bai
+#: ../zypp/LanguageCode.cc:316
+msgid "Bamileke Languages"
+msgstr ""
+
+#. language code: bak ba
+#: ../zypp/LanguageCode.cc:318
+msgid "Bashkir"
+msgstr ""
+
+#. language code: bal
+#: ../zypp/LanguageCode.cc:320
+msgid "Baluchi"
+msgstr ""
+
+#. language code: bam bm
+#: ../zypp/LanguageCode.cc:322
+msgid "Bambara"
+msgstr ""
+
+#. language code: ban
+#: ../zypp/LanguageCode.cc:324
+msgid "Balinese"
+msgstr ""
+
+#. language code: baq eus eu
+#: ../zypp/LanguageCode.cc:326 ../zypp/LanguageCode.cc:328
+msgid "Basque"
+msgstr ""
+
+#. language code: bas
+#: ../zypp/LanguageCode.cc:330
+msgid "Basa"
+msgstr ""
+
+#. language code: bat
+#: ../zypp/LanguageCode.cc:332
+msgid "Baltic (Other)"
+msgstr ""
+
+#. language code: bej
+#: ../zypp/LanguageCode.cc:334
+msgid "Beja"
+msgstr ""
+
+#. language code: bel be
+#: ../zypp/LanguageCode.cc:336
+msgid "Belarusian"
+msgstr ""
+
+#. language code: bem
+#: ../zypp/LanguageCode.cc:338
+msgid "Bemba"
+msgstr ""
+
+#. language code: ben bn
+#: ../zypp/LanguageCode.cc:340
+msgid "Bengali"
+msgstr ""
+
+#. language code: ber
+#: ../zypp/LanguageCode.cc:342
+msgid "Berber (Other)"
+msgstr ""
+
+#. language code: bho
+#: ../zypp/LanguageCode.cc:344
+msgid "Bhojpuri"
+msgstr ""
+
+#. language code: bih bh
+#: ../zypp/LanguageCode.cc:346
+msgid "Bihari"
+msgstr ""
+
+#. language code: bik
+#: ../zypp/LanguageCode.cc:348
+msgid "Bikol"
+msgstr ""
+
+#. language code: bin
+#: ../zypp/LanguageCode.cc:350
+msgid "Bini"
+msgstr ""
+
+#. language code: bis bi
+#: ../zypp/LanguageCode.cc:352
+msgid "Bislama"
+msgstr ""
+
+#. language code: bla
+#: ../zypp/LanguageCode.cc:354
+msgid "Siksika"
+msgstr ""
+
+#. language code: bnt
+#: ../zypp/LanguageCode.cc:356
+msgid "Bantu (Other)"
+msgstr ""
+
+#. language code: bos bs
+#: ../zypp/LanguageCode.cc:358
+msgid "Bosnian"
+msgstr ""
+
+#. language code: bra
+#: ../zypp/LanguageCode.cc:360
+msgid "Braj"
+msgstr ""
+
+#. language code: bre br
+#: ../zypp/LanguageCode.cc:362
+msgid "Breton"
+msgstr ""
+
+#. language code: btk
+#: ../zypp/LanguageCode.cc:364
+msgid "Batak (Indonesia)"
+msgstr ""
+
+#. language code: bua
+#: ../zypp/LanguageCode.cc:366
+msgid "Buriat"
+msgstr ""
+
+#. language code: bug
+#: ../zypp/LanguageCode.cc:368
+msgid "Buginese"
+msgstr ""
+
+#. language code: bul bg
+#: ../zypp/LanguageCode.cc:370
+msgid "Bulgarian"
+msgstr ""
+
+#. language code: bur mya my
+#: ../zypp/LanguageCode.cc:372 ../zypp/LanguageCode.cc:374
+msgid "Burmese"
+msgstr ""
+
+#. language code: byn
+#: ../zypp/LanguageCode.cc:376
+msgid "Blin"
+msgstr ""
+
+#. language code: cad
+#: ../zypp/LanguageCode.cc:378
+msgid "Caddo"
+msgstr ""
+
+#. language code: cai
+#: ../zypp/LanguageCode.cc:380
+msgid "Central American Indian (Other)"
+msgstr ""
+
+#. language code: car
+#: ../zypp/LanguageCode.cc:382
+msgid "Carib"
+msgstr ""
+
+#. language code: cat ca
+#: ../zypp/LanguageCode.cc:384
+msgid "Catalan"
+msgstr ""
+
+#. language code: cau
+#: ../zypp/LanguageCode.cc:386
+msgid "Caucasian (Other)"
+msgstr ""
+
+#. language code: ceb
+#: ../zypp/LanguageCode.cc:388
+msgid "Cebuano"
+msgstr ""
+
+#. language code: cel
+#: ../zypp/LanguageCode.cc:390
+msgid "Celtic (Other)"
+msgstr ""
+
+#. language code: cha ch
+#: ../zypp/LanguageCode.cc:392
+msgid "Chamorro"
+msgstr ""
+
+#. language code: chb
+#: ../zypp/LanguageCode.cc:394
+msgid "Chibcha"
+msgstr ""
+
+#. language code: che ce
+#: ../zypp/LanguageCode.cc:396
+msgid "Chechen"
+msgstr ""
+
+#. language code: chg
+#: ../zypp/LanguageCode.cc:398
+msgid "Chagatai"
+msgstr ""
+
+#. language code: chi zho zh
+#: ../zypp/LanguageCode.cc:400 ../zypp/LanguageCode.cc:402
+msgid "Chinese"
+msgstr ""
+
+#. language code: chk
+#: ../zypp/LanguageCode.cc:404
+msgid "Chuukese"
+msgstr ""
+
+#. language code: chm
+#: ../zypp/LanguageCode.cc:406
+msgid "Mari"
+msgstr ""
+
+#. language code: chn
+#: ../zypp/LanguageCode.cc:408
+msgid "Chinook Jargon"
+msgstr ""
+
+#. language code: cho
+#: ../zypp/LanguageCode.cc:410
+msgid "Choctaw"
+msgstr ""
+
+#. language code: chp
+#: ../zypp/LanguageCode.cc:412
+msgid "Chipewyan"
+msgstr ""
+
+#. language code: chr
+#: ../zypp/LanguageCode.cc:414
+msgid "Cherokee"
+msgstr ""
+
+#. language code: chu cu
+#: ../zypp/LanguageCode.cc:416
+msgid "Church Slavic"
+msgstr ""
+
+#. language code: chv cv
+#: ../zypp/LanguageCode.cc:418
+msgid "Chuvash"
+msgstr ""
+
+#. language code: chy
+#: ../zypp/LanguageCode.cc:420
+msgid "Cheyenne"
+msgstr ""
+
+#. language code: cmc
+#: ../zypp/LanguageCode.cc:422
+msgid "Chamic Languages"
+msgstr ""
+
+#. language code: cop
+#: ../zypp/LanguageCode.cc:424
+msgid "Coptic"
+msgstr ""
+
+#. language code: cor kw
+#: ../zypp/LanguageCode.cc:426
+msgid "Cornish"
+msgstr ""
+
+#. language code: cos co
+#: ../zypp/LanguageCode.cc:428
+msgid "Corsican"
+msgstr ""
+
+#. language code: cpe
+#: ../zypp/LanguageCode.cc:430
+msgid "Creoles and Pidgins, English-Based (Other)"
+msgstr ""
+
+#. language code: cpf
+#: ../zypp/LanguageCode.cc:432
+msgid "Creoles and Pidgins, French-Based (Other)"
+msgstr ""
+
+#. language code: cpp
+#: ../zypp/LanguageCode.cc:434
+msgid "Creoles and Pidgins, Portuguese-Based (Other)"
+msgstr ""
+
+#. language code: cre cr
+#: ../zypp/LanguageCode.cc:436
+msgid "Cree"
+msgstr ""
+
+#. language code: crh
+#: ../zypp/LanguageCode.cc:438
+msgid "Crimean Tatar"
+msgstr ""
+
+#. language code: crp
+#: ../zypp/LanguageCode.cc:440
+msgid "Creoles and Pidgins (Other)"
+msgstr ""
+
+#. language code: csb
+#: ../zypp/LanguageCode.cc:442
+msgid "Kashubian"
+msgstr ""
+
+#. language code: cus
+#: ../zypp/LanguageCode.cc:444
+msgid "Cushitic (Other)"
+msgstr ""
+
+#. language code: cze ces cs
+#: ../zypp/LanguageCode.cc:446 ../zypp/LanguageCode.cc:448
+msgid "Czech"
+msgstr ""
+
+#. language code: dak
+#: ../zypp/LanguageCode.cc:450
+msgid "Dakota"
+msgstr ""
+
+#. language code: dan da
+#: ../zypp/LanguageCode.cc:452
+msgid "Danish"
+msgstr ""
+
+#. language code: dar
+#: ../zypp/LanguageCode.cc:454
+msgid "Dargwa"
+msgstr ""
+
+#. language code: day
+#: ../zypp/LanguageCode.cc:456
+msgid "Dayak"
+msgstr ""
+
+#. language code: del
+#: ../zypp/LanguageCode.cc:458
+msgid "Delaware"
+msgstr ""
+
+#. language code: den
+#: ../zypp/LanguageCode.cc:460
+msgid "Slave (Athapascan)"
+msgstr ""
+
+#. language code: dgr
+#: ../zypp/LanguageCode.cc:462
+msgid "Dogrib"
+msgstr ""
+
+#. language code: din
+#: ../zypp/LanguageCode.cc:464
+msgid "Dinka"
+msgstr ""
+
+#. language code: div dv
+#: ../zypp/LanguageCode.cc:466
+msgid "Divehi"
+msgstr ""
+
+#. language code: doi
+#: ../zypp/LanguageCode.cc:468
+msgid "Dogri"
+msgstr ""
+
+#. language code: dra
+#: ../zypp/LanguageCode.cc:470
+msgid "Dravidian (Other)"
+msgstr ""
+
+#. language code: dsb
+#: ../zypp/LanguageCode.cc:472
+msgid "Lower Sorbian"
+msgstr ""
+
+#. language code: dua
+#: ../zypp/LanguageCode.cc:474
+msgid "Duala"
+msgstr ""
+
+#. language code: dum
+#: ../zypp/LanguageCode.cc:476
+msgid "Dutch, Middle (ca.1050-1350)"
+msgstr ""
+
+#. language code: dut nld nl
+#: ../zypp/LanguageCode.cc:478 ../zypp/LanguageCode.cc:480
+msgid "Dutch"
+msgstr ""
+
+#. language code: dyu
+#: ../zypp/LanguageCode.cc:482
+msgid "Dyula"
+msgstr ""
+
+#. language code: dzo dz
+#: ../zypp/LanguageCode.cc:484
+msgid "Dzongkha"
+msgstr ""
+
+#. language code: efi
+#: ../zypp/LanguageCode.cc:486
+msgid "Efik"
+msgstr ""
+
+#. language code: egy
+#: ../zypp/LanguageCode.cc:488
+msgid "Egyptian (Ancient)"
+msgstr ""
+
+#. language code: eka
+#: ../zypp/LanguageCode.cc:490
+msgid "Ekajuk"
+msgstr ""
+
+#. language code: elx
+#: ../zypp/LanguageCode.cc:492
+msgid "Elamite"
+msgstr ""
+
+#. language code: eng en
+#: ../zypp/LanguageCode.cc:494
+msgid "English"
+msgstr ""
+
+#. language code: enm
+#: ../zypp/LanguageCode.cc:496
+msgid "English, Middle (1100-1500)"
+msgstr ""
+
+#. language code: epo eo
+#: ../zypp/LanguageCode.cc:498
+msgid "Esperanto"
+msgstr ""
+
+#. language code: est et
+#: ../zypp/LanguageCode.cc:500
+msgid "Estonian"
+msgstr ""
+
+#. language code: ewe ee
+#: ../zypp/LanguageCode.cc:502
+msgid "Ewe"
+msgstr ""
+
+#. language code: ewo
+#: ../zypp/LanguageCode.cc:504
+msgid "Ewondo"
+msgstr ""
+
+#. language code: fan
+#: ../zypp/LanguageCode.cc:506
+msgid "Fang"
+msgstr ""
+
+#. language code: fao fo
+#: ../zypp/LanguageCode.cc:508
+msgid "Faroese"
+msgstr ""
+
+#. language code: fat
+#: ../zypp/LanguageCode.cc:510
+msgid "Fanti"
+msgstr ""
+
+#. language code: fij fj
+#: ../zypp/LanguageCode.cc:512
+msgid "Fijian"
+msgstr ""
+
+#. language code: fil
+#: ../zypp/LanguageCode.cc:514
+msgid "Filipino"
+msgstr ""
+
+#. language code: fin fi
+#: ../zypp/LanguageCode.cc:516
+msgid "Finnish"
+msgstr ""
+
+#. language code: fiu
+#: ../zypp/LanguageCode.cc:518
+msgid "Finno-Ugrian (Other)"
+msgstr ""
+
+#. language code: fon
+#: ../zypp/LanguageCode.cc:520
+msgid "Fon"
+msgstr ""
+
+#. language code: fre fra fr
+#: ../zypp/LanguageCode.cc:522 ../zypp/LanguageCode.cc:524
+msgid "French"
+msgstr ""
+
+#. language code: frm
+#: ../zypp/LanguageCode.cc:526
+msgid "French, Middle (ca.1400-1600)"
+msgstr ""
+
+#. language code: fro
+#: ../zypp/LanguageCode.cc:528
+msgid "French, Old (842-ca.1400)"
+msgstr ""
+
+#. language code: fry fy
+#: ../zypp/LanguageCode.cc:530
+msgid "Frisian"
+msgstr ""
+
+#. language code: ful ff
+#: ../zypp/LanguageCode.cc:532
+msgid "Fulah"
+msgstr ""
+
+#. language code: fur
+#: ../zypp/LanguageCode.cc:534
+msgid "Friulian"
+msgstr ""
+
+#. language code: gaa
+#: ../zypp/LanguageCode.cc:536
+msgid "Ga"
+msgstr ""
+
+#. language code: gay
+#: ../zypp/LanguageCode.cc:538
+msgid "Gayo"
+msgstr ""
+
+#. language code: gba
+#: ../zypp/LanguageCode.cc:540
+msgid "Gbaya"
+msgstr ""
+
+#. language code: gem
+#: ../zypp/LanguageCode.cc:542
+msgid "Germanic (Other)"
+msgstr ""
+
+#. language code: geo kat ka
+#: ../zypp/LanguageCode.cc:544 ../zypp/LanguageCode.cc:546
+msgid "Georgian"
+msgstr ""
+
+#. language code: ger deu de
+#: ../zypp/LanguageCode.cc:548 ../zypp/LanguageCode.cc:550
+msgid "German"
+msgstr ""
+
+#. language code: gez
+#: ../zypp/LanguageCode.cc:552
+msgid "Geez"
+msgstr ""
+
+#. language code: gil
+#: ../zypp/LanguageCode.cc:554
+msgid "Gilbertese"
+msgstr ""
+
+#. language code: gla gd
+#: ../zypp/LanguageCode.cc:556
+msgid "Gaelic"
+msgstr ""
+
+#. language code: gle ga
+#: ../zypp/LanguageCode.cc:558
+msgid "Irish"
+msgstr ""
+
+#. language code: glg gl
+#: ../zypp/LanguageCode.cc:560
+msgid "Galician"
+msgstr ""
+
+#. language code: glv gv
+#: ../zypp/LanguageCode.cc:562
+msgid "Manx"
+msgstr ""
+
+#. language code: gmh
+#: ../zypp/LanguageCode.cc:564
+msgid "German, Middle High (ca.1050-1500)"
+msgstr ""
+
+#. language code: goh
+#: ../zypp/LanguageCode.cc:566
+msgid "German, Old High (ca.750-1050)"
+msgstr ""
+
+#. language code: gon
+#: ../zypp/LanguageCode.cc:568
+msgid "Gondi"
+msgstr ""
+
+#. language code: gor
+#: ../zypp/LanguageCode.cc:570
+msgid "Gorontalo"
+msgstr ""
+
+#. language code: got
+#: ../zypp/LanguageCode.cc:572
+msgid "Gothic"
+msgstr ""
+
+#. language code: grb
+#: ../zypp/LanguageCode.cc:574
+msgid "Grebo"
+msgstr ""
+
+#. language code: grc
+#: ../zypp/LanguageCode.cc:576
+msgid "Greek, Ancient (to 1453)"
+msgstr ""
+
+#. language code: gre ell el
+#: ../zypp/LanguageCode.cc:578 ../zypp/LanguageCode.cc:580
+msgid "Greek, Modern (1453-)"
+msgstr ""
+
+#. language code: grn gn
+#: ../zypp/LanguageCode.cc:582
+msgid "Guarani"
+msgstr ""
+
+#. language code: guj gu
+#: ../zypp/LanguageCode.cc:584
+msgid "Gujarati"
+msgstr ""
+
+#. language code: gwi
+#: ../zypp/LanguageCode.cc:586
+msgid "Gwich'in"
+msgstr ""
+
+#. language code: hai
+#: ../zypp/LanguageCode.cc:588
+msgid "Haida"
+msgstr ""
+
+#. language code: hat ht
+#: ../zypp/LanguageCode.cc:590
+msgid "Haitian"
+msgstr ""
+
+#. language code: hau ha
+#: ../zypp/LanguageCode.cc:592
+msgid "Hausa"
+msgstr ""
+
+#. language code: haw
+#: ../zypp/LanguageCode.cc:594
+msgid "Hawaiian"
+msgstr ""
+
+#. language code: heb he
+#: ../zypp/LanguageCode.cc:596
+msgid "Hebrew"
+msgstr ""
+
+#. language code: her hz
+#: ../zypp/LanguageCode.cc:598
+msgid "Herero"
+msgstr ""
+
+#. language code: hil
+#: ../zypp/LanguageCode.cc:600
+msgid "Hiligaynon"
+msgstr ""
+
+#. language code: him
+#: ../zypp/LanguageCode.cc:602
+msgid "Himachali"
+msgstr ""
+
+#. language code: hin hi
+#: ../zypp/LanguageCode.cc:604
+msgid "Hindi"
+msgstr ""
+
+#. language code: hit
+#: ../zypp/LanguageCode.cc:606
+msgid "Hittite"
+msgstr ""
+
+#. language code: hmn
+#: ../zypp/LanguageCode.cc:608
+msgid "Hmong"
+msgstr ""
+
+#. language code: hmo ho
+#: ../zypp/LanguageCode.cc:610
+msgid "Hiri Motu"
+msgstr ""
+
+#. language code: hsb
+#: ../zypp/LanguageCode.cc:612
+msgid "Upper Sorbian"
+msgstr ""
+
+#. language code: hun hu
+#: ../zypp/LanguageCode.cc:614
+msgid "Hungarian"
+msgstr ""
+
+#. language code: hup
+#: ../zypp/LanguageCode.cc:616
+msgid "Hupa"
+msgstr ""
+
+#. language code: iba
+#: ../zypp/LanguageCode.cc:618
+msgid "Iban"
+msgstr ""
+
+#. language code: ibo ig
+#: ../zypp/LanguageCode.cc:620
+msgid "Igbo"
+msgstr ""
+
+#. language code: ice isl is
+#: ../zypp/LanguageCode.cc:622 ../zypp/LanguageCode.cc:624
+msgid "Icelandic"
+msgstr ""
+
+#. language code: ido io
+#: ../zypp/LanguageCode.cc:626
+msgid "Ido"
+msgstr ""
+
+#. language code: iii ii
+#: ../zypp/LanguageCode.cc:628
+msgid "Sichuan Yi"
+msgstr ""
+
+#. language code: ijo
+#: ../zypp/LanguageCode.cc:630
+msgid "Ijo"
+msgstr ""
+
+#. language code: iku iu
+#: ../zypp/LanguageCode.cc:632
+msgid "Inuktitut"
+msgstr ""
+
+#. language code: ile ie
+#: ../zypp/LanguageCode.cc:634
+msgid "Interlingue"
+msgstr ""
+
+#. language code: ilo
+#: ../zypp/LanguageCode.cc:636
+msgid "Iloko"
+msgstr ""
+
+#. language code: ina ia
+#: ../zypp/LanguageCode.cc:638
+msgid "Interlingua (International Auxiliary Language Association)"
+msgstr ""
+
+#. language code: inc
+#: ../zypp/LanguageCode.cc:640
+msgid "Indic (Other)"
+msgstr ""
+
+#. language code: ind id
+#: ../zypp/LanguageCode.cc:642
+msgid "Indonesian"
+msgstr ""
+
+#. language code: ine
+#: ../zypp/LanguageCode.cc:644
+msgid "Indo-European (Other)"
+msgstr ""
+
+#. language code: inh
+#: ../zypp/LanguageCode.cc:646
+msgid "Ingush"
+msgstr ""
+
+#. language code: ipk ik
+#: ../zypp/LanguageCode.cc:648
+msgid "Inupiaq"
+msgstr ""
+
+#. language code: ira
+#: ../zypp/LanguageCode.cc:650
+msgid "Iranian (Other)"
+msgstr ""
+
+#. language code: iro
+#: ../zypp/LanguageCode.cc:652
+msgid "Iroquoian Languages"
+msgstr ""
+
+#. language code: ita it
+#: ../zypp/LanguageCode.cc:654
+msgid "Italian"
+msgstr ""
+
+#. language code: jav jv
+#: ../zypp/LanguageCode.cc:656
+msgid "Javanese"
+msgstr ""
+
+#. language code: jbo
+#: ../zypp/LanguageCode.cc:658
+msgid "Lojban"
+msgstr ""
+
+#. language code: jpn ja
+#: ../zypp/LanguageCode.cc:660
+msgid "Japanese"
+msgstr ""
+
+#. language code: jpr
+#: ../zypp/LanguageCode.cc:662
+msgid "Judeo-Persian"
+msgstr ""
+
+#. language code: jrb
+#: ../zypp/LanguageCode.cc:664
+msgid "Judeo-Arabic"
+msgstr ""
+
+#. language code: kaa
+#: ../zypp/LanguageCode.cc:666
+msgid "Kara-Kalpak"
+msgstr ""
+
+#. language code: kab
+#: ../zypp/LanguageCode.cc:668
+msgid "Kabyle"
+msgstr ""
+
+#. language code: kac
+#: ../zypp/LanguageCode.cc:670
+msgid "Kachin"
+msgstr ""
+
+#. language code: kal kl
+#: ../zypp/LanguageCode.cc:672
+msgid "Kalaallisut"
+msgstr ""
+
+#. language code: kam
+#: ../zypp/LanguageCode.cc:674
+msgid "Kamba"
+msgstr ""
+
+#. language code: kan kn
+#: ../zypp/LanguageCode.cc:676
+msgid "Kannada"
+msgstr ""
+
+#. language code: kar
+#: ../zypp/LanguageCode.cc:678
+msgid "Karen"
+msgstr ""
+
+#. language code: kas ks
+#: ../zypp/LanguageCode.cc:680
+msgid "Kashmiri"
+msgstr ""
+
+#. language code: kau kr
+#: ../zypp/LanguageCode.cc:682
+msgid "Kanuri"
+msgstr ""
+
+#. language code: kaw
+#: ../zypp/LanguageCode.cc:684
+msgid "Kawi"
+msgstr ""
+
+#. language code: kaz kk
+#: ../zypp/LanguageCode.cc:686
+msgid "Kazakh"
+msgstr ""
+
+#. language code: kbd
+#: ../zypp/LanguageCode.cc:688
+msgid "Kabardian"
+msgstr ""
+
+#. language code: kha
+#: ../zypp/LanguageCode.cc:690
+msgid "Khasi"
+msgstr ""
+
+#. language code: khi
+#: ../zypp/LanguageCode.cc:692
+msgid "Khoisan (Other)"
+msgstr ""
+
+#. language code: khm km
+#: ../zypp/LanguageCode.cc:694
+msgid "Khmer"
+msgstr ""
+
+#. language code: kho
+#: ../zypp/LanguageCode.cc:696
+msgid "Khotanese"
+msgstr ""
+
+#. language code: kik ki
+#: ../zypp/LanguageCode.cc:698
+msgid "Kikuyu"
+msgstr ""
+
+#. language code: kin rw
+#: ../zypp/LanguageCode.cc:700
+msgid "Kinyarwanda"
+msgstr ""
+
+#. language code: kir ky
+#: ../zypp/LanguageCode.cc:702
+msgid "Kirghiz"
+msgstr ""
+
+#. language code: kmb
+#: ../zypp/LanguageCode.cc:704
+msgid "Kimbundu"
+msgstr ""
+
+#. language code: kok
+#: ../zypp/LanguageCode.cc:706
+msgid "Konkani"
+msgstr ""
+
+#. language code: kom kv
+#: ../zypp/LanguageCode.cc:708
+msgid "Komi"
+msgstr ""
+
+#. language code: kon kg
+#: ../zypp/LanguageCode.cc:710
+msgid "Kongo"
+msgstr ""
+
+#. language code: kor ko
+#: ../zypp/LanguageCode.cc:712
+msgid "Korean"
+msgstr ""
+
+#. language code: kos
+#: ../zypp/LanguageCode.cc:714
+msgid "Kosraean"
+msgstr ""
+
+#. language code: kpe
+#: ../zypp/LanguageCode.cc:716
+msgid "Kpelle"
+msgstr ""
+
+#. language code: krc
+#: ../zypp/LanguageCode.cc:718
+msgid "Karachay-Balkar"
+msgstr ""
+
+#. language code: kro
+#: ../zypp/LanguageCode.cc:720
+msgid "Kru"
+msgstr ""
+
+#. language code: kru
+#: ../zypp/LanguageCode.cc:722
+msgid "Kurukh"
+msgstr ""
+
+#. language code: kua kj
+#: ../zypp/LanguageCode.cc:724
+msgid "Kuanyama"
+msgstr ""
+
+#. language code: kum
+#: ../zypp/LanguageCode.cc:726
+msgid "Kumyk"
+msgstr ""
+
+#. language code: kur ku
+#: ../zypp/LanguageCode.cc:728
+msgid "Kurdish"
+msgstr ""
+
+#. language code: kut
+#: ../zypp/LanguageCode.cc:730
+msgid "Kutenai"
+msgstr ""
+
+#. language code: lad
+#: ../zypp/LanguageCode.cc:732
+msgid "Ladino"
+msgstr ""
+
+#. language code: lah
+#: ../zypp/LanguageCode.cc:734
+msgid "Lahnda"
+msgstr ""
+
+#. language code: lam
+#: ../zypp/LanguageCode.cc:736
+msgid "Lamba"
+msgstr ""
+
+#. language code: lao lo
+#: ../zypp/LanguageCode.cc:738
+msgid "Lao"
+msgstr ""
+
+#. language code: lat la
+#: ../zypp/LanguageCode.cc:740
+msgid "Latin"
+msgstr ""
+
+#. language code: lav lv
+#: ../zypp/LanguageCode.cc:742
+msgid "Latvian"
+msgstr ""
+
+#. language code: lez
+#: ../zypp/LanguageCode.cc:744
+msgid "Lezghian"
+msgstr ""
+
+#. language code: lim li
+#: ../zypp/LanguageCode.cc:746
+msgid "Limburgan"
+msgstr ""
+
+#. language code: lin ln
+#: ../zypp/LanguageCode.cc:748
+msgid "Lingala"
+msgstr ""
+
+#. language code: lit lt
+#: ../zypp/LanguageCode.cc:750
+msgid "Lithuanian"
+msgstr ""
+
+#. language code: lol
+#: ../zypp/LanguageCode.cc:752
+msgid "Mongo"
+msgstr ""
+
+#. language code: loz
+#: ../zypp/LanguageCode.cc:754
+msgid "Lozi"
+msgstr ""
+
+#. language code: ltz lb
+#: ../zypp/LanguageCode.cc:756
+msgid "Luxembourgish"
+msgstr ""
+
+#. language code: lua
+#: ../zypp/LanguageCode.cc:758
+msgid "Luba-Lulua"
+msgstr ""
+
+#. language code: lub lu
+#: ../zypp/LanguageCode.cc:760
+msgid "Luba-Katanga"
+msgstr ""
+
+#. language code: lug lg
+#: ../zypp/LanguageCode.cc:762
+msgid "Ganda"
+msgstr ""
+
+#. language code: lui
+#: ../zypp/LanguageCode.cc:764
+msgid "Luiseno"
+msgstr ""
+
+#. language code: lun
+#: ../zypp/LanguageCode.cc:766
+msgid "Lunda"
+msgstr ""
+
+#. language code: luo
+#: ../zypp/LanguageCode.cc:768
+msgid "Luo (Kenya and Tanzania)"
+msgstr ""
+
+#. language code: lus
+#: ../zypp/LanguageCode.cc:770
+msgid "Lushai"
+msgstr ""
+
+#. language code: mac mkd mk
+#: ../zypp/LanguageCode.cc:772 ../zypp/LanguageCode.cc:774
+msgid "Macedonian"
+msgstr ""
+
+#. language code: mad
+#: ../zypp/LanguageCode.cc:776
+msgid "Madurese"
+msgstr ""
+
+#. language code: mag
+#: ../zypp/LanguageCode.cc:778
+msgid "Magahi"
+msgstr ""
+
+#. language code: mah mh
+#: ../zypp/LanguageCode.cc:780
+msgid "Marshallese"
+msgstr ""
+
+#. language code: mai
+#: ../zypp/LanguageCode.cc:782
+msgid "Maithili"
+msgstr ""
+
+#. language code: mak
+#: ../zypp/LanguageCode.cc:784
+msgid "Makasar"
+msgstr ""
+
+#. language code: mal ml
+#: ../zypp/LanguageCode.cc:786
+msgid "Malayalam"
+msgstr ""
+
+#. language code: man
+#: ../zypp/LanguageCode.cc:788
+msgid "Mandingo"
+msgstr ""
+
+#. language code: mao mri mi
+#: ../zypp/LanguageCode.cc:790 ../zypp/LanguageCode.cc:792
+msgid "Maori"
+msgstr ""
+
+#. language code: map
+#: ../zypp/LanguageCode.cc:794
+msgid "Austronesian (Other)"
+msgstr ""
+
+#. language code: mar mr
+#: ../zypp/LanguageCode.cc:796
+msgid "Marathi"
+msgstr ""
+
+#. language code: mas
+#: ../zypp/LanguageCode.cc:798
+msgid "Masai"
+msgstr ""
+
+#. language code: may msa ms
+#: ../zypp/LanguageCode.cc:800 ../zypp/LanguageCode.cc:802
+msgid "Malay"
+msgstr ""
+
+#. language code: mdf
+#: ../zypp/LanguageCode.cc:804
+msgid "Moksha"
+msgstr ""
+
+#. language code: mdr
+#: ../zypp/LanguageCode.cc:806
+msgid "Mandar"
+msgstr ""
+
+#. language code: men
+#: ../zypp/LanguageCode.cc:808
+msgid "Mende"
+msgstr ""
+
+#. language code: mga
+#: ../zypp/LanguageCode.cc:810
+msgid "Irish, Middle (900-1200)"
+msgstr ""
+
+#. language code: mic
+#: ../zypp/LanguageCode.cc:812
+msgid "Mi'kmaq"
+msgstr ""
+
+#. language code: min
+#: ../zypp/LanguageCode.cc:814
+msgid "Minangkabau"
+msgstr ""
+
+#. language code: mis
+#: ../zypp/LanguageCode.cc:816
+msgid "Miscellaneous Languages"
+msgstr ""
+
+#. language code: mkh
+#: ../zypp/LanguageCode.cc:818
+msgid "Mon-Khmer (Other)"
+msgstr ""
+
+#. language code: mlg mg
+#: ../zypp/LanguageCode.cc:820
+msgid "Malagasy"
+msgstr ""
+
+#. language code: mlt mt
+#: ../zypp/LanguageCode.cc:822
+msgid "Maltese"
+msgstr ""
+
+#. language code: mnc
+#: ../zypp/LanguageCode.cc:824
+msgid "Manchu"
+msgstr ""
+
+#. language code: mni
+#: ../zypp/LanguageCode.cc:826
+msgid "Manipuri"
+msgstr ""
+
+#. language code: mno
+#: ../zypp/LanguageCode.cc:828
+msgid "Manobo Languages"
+msgstr ""
+
+#. language code: moh
+#: ../zypp/LanguageCode.cc:830
+msgid "Mohawk"
+msgstr ""
+
+#. language code: mol mo
+#: ../zypp/LanguageCode.cc:832
+msgid "Moldavian"
+msgstr ""
+
+#. language code: mon mn
+#: ../zypp/LanguageCode.cc:834
+msgid "Mongolian"
+msgstr ""
+
+#. language code: mos
+#: ../zypp/LanguageCode.cc:836
+msgid "Mossi"
+msgstr ""
+
+#. language code: mul
+#: ../zypp/LanguageCode.cc:838
+msgid "Multiple Languages"
+msgstr ""
+
+#. language code: mun
+#: ../zypp/LanguageCode.cc:840
+msgid "Munda languages"
+msgstr ""
+
+#. language code: mus
+#: ../zypp/LanguageCode.cc:842
+msgid "Creek"
+msgstr ""
+
+#. language code: mwl
+#: ../zypp/LanguageCode.cc:844
+msgid "Mirandese"
+msgstr ""
+
+#. language code: mwr
+#: ../zypp/LanguageCode.cc:846
+msgid "Marwari"
+msgstr ""
+
+#. language code: myn
+#: ../zypp/LanguageCode.cc:848
+msgid "Mayan Languages"
+msgstr ""
+
+#. language code: myv
+#: ../zypp/LanguageCode.cc:850
+msgid "Erzya"
+msgstr ""
+
+#. language code: nah
+#: ../zypp/LanguageCode.cc:852
+msgid "Nahuatl"
+msgstr ""
+
+#. language code: nai
+#: ../zypp/LanguageCode.cc:854
+msgid "North American Indian"
+msgstr ""
+
+#. language code: nap
+#: ../zypp/LanguageCode.cc:856
+msgid "Neapolitan"
+msgstr ""
+
+#. language code: nau na
+#. :NPL:524:
+#: ../zypp/LanguageCode.cc:858 ../zypp/CountryCode.cc:380
+msgid "Nauru"
+msgstr ""
+
+#. language code: nav nv
+#: ../zypp/LanguageCode.cc:860
+msgid "Navajo"
+msgstr ""
+
+#. language code: nbl nr
+#: ../zypp/LanguageCode.cc:862
+msgid "Ndebele, South"
+msgstr ""
+
+#. language code: nde nd
+#: ../zypp/LanguageCode.cc:864
+msgid "Ndebele, North"
+msgstr ""
+
+#. language code: ndo ng
+#: ../zypp/LanguageCode.cc:866
+msgid "Ndonga"
+msgstr ""
+
+#. language code: nds
+#: ../zypp/LanguageCode.cc:868
+msgid "Low German"
+msgstr ""
+
+#. language code: nep ne
+#: ../zypp/LanguageCode.cc:870
+msgid "Nepali"
+msgstr ""
+
+#. language code: new
+#: ../zypp/LanguageCode.cc:872
+msgid "Nepal Bhasa"
+msgstr ""
+
+#. language code: nia
+#: ../zypp/LanguageCode.cc:874
+msgid "Nias"
+msgstr ""
+
+#. language code: nic
+#: ../zypp/LanguageCode.cc:876
+msgid "Niger-Kordofanian (Other)"
+msgstr ""
+
+#. language code: niu
+#: ../zypp/LanguageCode.cc:878
+msgid "Niuean"
+msgstr ""
+
+#. language code: nno nn
+#: ../zypp/LanguageCode.cc:880
+msgid "Norwegian Nynorsk"
+msgstr ""
+
+#. language code: nob nb
+#: ../zypp/LanguageCode.cc:882
+msgid "Norwegian Bokmal"
+msgstr ""
+
+#. language code: nog
+#: ../zypp/LanguageCode.cc:884
+msgid "Nogai"
+msgstr ""
+
+#. language code: non
+#: ../zypp/LanguageCode.cc:886
+msgid "Norse, Old"
+msgstr ""
+
+#. language code: nor no
+#: ../zypp/LanguageCode.cc:888
+msgid "Norwegian"
+msgstr ""
+
+#. language code: nso
+#: ../zypp/LanguageCode.cc:890
+msgid "Northern Sotho"
+msgstr ""
+
+#. language code: nub
+#: ../zypp/LanguageCode.cc:892
+msgid "Nubian Languages"
+msgstr ""
+
+#. language code: nwc
+#: ../zypp/LanguageCode.cc:894
+msgid "Classical Newari"
+msgstr ""
+
+#. language code: nya ny
+#: ../zypp/LanguageCode.cc:896
+msgid "Chichewa"
+msgstr ""
+
+#. language code: nym
+#: ../zypp/LanguageCode.cc:898
+msgid "Nyamwezi"
+msgstr ""
+
+#. language code: nyn
+#: ../zypp/LanguageCode.cc:900
+msgid "Nyankole"
+msgstr ""
+
+#. language code: nyo
+#: ../zypp/LanguageCode.cc:902
+msgid "Nyoro"
+msgstr ""
+
+#. language code: nzi
+#: ../zypp/LanguageCode.cc:904
+msgid "Nzima"
+msgstr ""
+
+#. language code: oci oc
+#: ../zypp/LanguageCode.cc:906
+msgid "Occitan (post 1500)"
+msgstr ""
+
+#. language code: oji oj
+#: ../zypp/LanguageCode.cc:908
+msgid "Ojibwa"
+msgstr ""
+
+#. language code: ori or
+#: ../zypp/LanguageCode.cc:910
+msgid "Oriya"
+msgstr ""
+
+#. language code: orm om
+#: ../zypp/LanguageCode.cc:912
+msgid "Oromo"
+msgstr ""
+
+#. language code: osa
+#: ../zypp/LanguageCode.cc:914
+msgid "Osage"
+msgstr ""
+
+#. language code: oss os
+#: ../zypp/LanguageCode.cc:916
+msgid "Ossetian"
+msgstr ""
+
+#. language code: ota
+#: ../zypp/LanguageCode.cc:918
+msgid "Turkish, Ottoman (1500-1928)"
+msgstr ""
+
+#. language code: oto
+#: ../zypp/LanguageCode.cc:920
+msgid "Otomian Languages"
+msgstr ""
+
+#. language code: paa
+#: ../zypp/LanguageCode.cc:922
+msgid "Papuan (Other)"
+msgstr ""
+
+#. language code: pag
+#: ../zypp/LanguageCode.cc:924
+msgid "Pangasinan"
+msgstr ""
+
+#. language code: pal
+#: ../zypp/LanguageCode.cc:926
+msgid "Pahlavi"
+msgstr ""
+
+#. language code: pam
+#: ../zypp/LanguageCode.cc:928
+msgid "Pampanga"
+msgstr ""
+
+#. language code: pan pa
+#: ../zypp/LanguageCode.cc:930
+msgid "Panjabi"
+msgstr ""
+
+#. language code: pap
+#: ../zypp/LanguageCode.cc:932
+msgid "Papiamento"
+msgstr ""
+
+#. language code: pau
+#: ../zypp/LanguageCode.cc:934
+msgid "Palauan"
+msgstr ""
+
+#. language code: peo
+#: ../zypp/LanguageCode.cc:936
+msgid "Persian, Old (ca.600-400 B.C.)"
+msgstr ""
+
+#. language code: per fas fa
+#: ../zypp/LanguageCode.cc:938 ../zypp/LanguageCode.cc:940
+msgid "Persian"
+msgstr ""
+
+#. language code: phi
+#: ../zypp/LanguageCode.cc:942
+msgid "Philippine (Other)"
+msgstr ""
+
+#. language code: phn
+#: ../zypp/LanguageCode.cc:944
+msgid "Phoenician"
+msgstr ""
+
+#. language code: pli pi
+#: ../zypp/LanguageCode.cc:946
+msgid "Pali"
+msgstr ""
+
+#. language code: pol pl
+#: ../zypp/LanguageCode.cc:948
+msgid "Polish"
+msgstr ""
+
+#. language code: pon
+#: ../zypp/LanguageCode.cc:950
+msgid "Pohnpeian"
+msgstr ""
+
+#. language code: por pt
+#: ../zypp/LanguageCode.cc:952
+msgid "Portuguese"
+msgstr ""
+
+#. language code: pra
+#: ../zypp/LanguageCode.cc:954
+msgid "Prakrit Languages"
+msgstr ""
+
+#. language code: pro
+#: ../zypp/LanguageCode.cc:956
+msgid "Provencal, Old (to 1500)"
+msgstr ""
+
+#. language code: pus ps
+#: ../zypp/LanguageCode.cc:958
+msgid "Pushto"
+msgstr ""
+
+#. language code: que qu
+#: ../zypp/LanguageCode.cc:960
+msgid "Quechua"
+msgstr ""
+
+#. language code: raj
+#: ../zypp/LanguageCode.cc:962
+msgid "Rajasthani"
+msgstr ""
+
+#. language code: rap
+#: ../zypp/LanguageCode.cc:964
+msgid "Rapanui"
+msgstr ""
+
+#. language code: rar
+#: ../zypp/LanguageCode.cc:966
+msgid "Rarotongan"
+msgstr ""
+
+#. language code: roa
+#: ../zypp/LanguageCode.cc:968
+msgid "Romance (Other)"
+msgstr ""
+
+#. language code: roh rm
+#: ../zypp/LanguageCode.cc:970
+msgid "Raeto-Romance"
+msgstr ""
+
+#. language code: rom
+#: ../zypp/LanguageCode.cc:972
+msgid "Romany"
+msgstr ""
+
+#. language code: rum ron ro
+#: ../zypp/LanguageCode.cc:974 ../zypp/LanguageCode.cc:976
+msgid "Romanian"
+msgstr ""
+
+#. language code: run rn
+#: ../zypp/LanguageCode.cc:978
+msgid "Rundi"
+msgstr ""
+
+#. language code: rus ru
+#: ../zypp/LanguageCode.cc:980
+msgid "Russian"
+msgstr ""
+
+#. language code: sad
+#: ../zypp/LanguageCode.cc:982
+msgid "Sandawe"
+msgstr ""
+
+#. language code: sag sg
+#: ../zypp/LanguageCode.cc:984
+msgid "Sango"
+msgstr ""
+
+#. language code: sah
+#: ../zypp/LanguageCode.cc:986
+msgid "Yakut"
+msgstr ""
+
+#. language code: sai
+#: ../zypp/LanguageCode.cc:988
+msgid "South American Indian (Other)"
+msgstr ""
+
+#. language code: sal
+#: ../zypp/LanguageCode.cc:990
+msgid "Salishan Languages"
+msgstr ""
+
+#. language code: sam
+#: ../zypp/LanguageCode.cc:992
+msgid "Samaritan Aramaic"
+msgstr ""
+
+#. language code: san sa
+#: ../zypp/LanguageCode.cc:994
+msgid "Sanskrit"
+msgstr ""
+
+#. language code: sas
+#: ../zypp/LanguageCode.cc:996
+msgid "Sasak"
+msgstr ""
+
+#. language code: sat
+#: ../zypp/LanguageCode.cc:998
+msgid "Santali"
+msgstr ""
+
+#. language code: scc srp sr
+#: ../zypp/LanguageCode.cc:1000 ../zypp/LanguageCode.cc:1002
+msgid "Serbian"
+msgstr ""
+
+#. language code: scn
+#: ../zypp/LanguageCode.cc:1004
+msgid "Sicilian"
+msgstr ""
+
+#. language code: sco
+#: ../zypp/LanguageCode.cc:1006
+msgid "Scots"
+msgstr ""
+
+#. language code: scr hrv hr
+#: ../zypp/LanguageCode.cc:1008 ../zypp/LanguageCode.cc:1010
+msgid "Croatian"
+msgstr ""
+
+#. language code: sel
+#: ../zypp/LanguageCode.cc:1012
+msgid "Selkup"
+msgstr ""
+
+#. language code: sem
+#: ../zypp/LanguageCode.cc:1014
+msgid "Semitic (Other)"
+msgstr ""
+
+#. language code: sga
+#: ../zypp/LanguageCode.cc:1016
+msgid "Irish, Old (to 900)"
+msgstr ""
+
+#. language code: sgn
+#: ../zypp/LanguageCode.cc:1018
+msgid "Sign Languages"
+msgstr ""
+
+#. language code: shn
+#: ../zypp/LanguageCode.cc:1020
+msgid "Shan"
+msgstr ""
+
+#. language code: sid
+#: ../zypp/LanguageCode.cc:1022
+msgid "Sidamo"
+msgstr ""
+
+#. language code: sin si
+#: ../zypp/LanguageCode.cc:1024
+msgid "Sinhala"
+msgstr ""
+
+#. language code: sio
+#: ../zypp/LanguageCode.cc:1026
+msgid "Siouan Languages"
+msgstr ""
+
+#. language code: sit
+#: ../zypp/LanguageCode.cc:1028
+msgid "Sino-Tibetan (Other)"
+msgstr ""
+
+#. language code: sla
+#: ../zypp/LanguageCode.cc:1030
+msgid "Slavic (Other)"
+msgstr ""
+
+#. language code: slo slk sk
+#: ../zypp/LanguageCode.cc:1032 ../zypp/LanguageCode.cc:1034
+msgid "Slovak"
+msgstr ""
+
+#. language code: slv sl
+#: ../zypp/LanguageCode.cc:1036
+msgid "Slovenian"
+msgstr ""
+
+#. language code: sma
+#: ../zypp/LanguageCode.cc:1038
+msgid "Southern Sami"
+msgstr ""
+
+#. language code: sme se
+#: ../zypp/LanguageCode.cc:1040
+msgid "Northern Sami"
+msgstr ""
+
+#. language code: smi
+#: ../zypp/LanguageCode.cc:1042
+msgid "Sami Languages (Other)"
+msgstr ""
+
+#. language code: smj
+#: ../zypp/LanguageCode.cc:1044
+msgid "Lule Sami"
+msgstr ""
+
+#. language code: smn
+#: ../zypp/LanguageCode.cc:1046
+msgid "Inari Sami"
+msgstr ""
+
+#. language code: smo sm
+#: ../zypp/LanguageCode.cc:1048
+msgid "Samoan"
+msgstr ""
+
+#. language code: sms
+#: ../zypp/LanguageCode.cc:1050
+msgid "Skolt Sami"
+msgstr ""
+
+#. language code: sna sn
+#: ../zypp/LanguageCode.cc:1052
+msgid "Shona"
+msgstr ""
+
+#. language code: snd sd
+#: ../zypp/LanguageCode.cc:1054
+msgid "Sindhi"
+msgstr ""
+
+#. language code: snk
+#: ../zypp/LanguageCode.cc:1056
+msgid "Soninke"
+msgstr ""
+
+#. language code: sog
+#: ../zypp/LanguageCode.cc:1058
+msgid "Sogdian"
+msgstr ""
+
+#. language code: som so
+#: ../zypp/LanguageCode.cc:1060
+msgid "Somali"
+msgstr ""
+
+#. language code: son
+#: ../zypp/LanguageCode.cc:1062
+msgid "Songhai"
+msgstr ""
+
+#. language code: sot st
+#: ../zypp/LanguageCode.cc:1064
+msgid "Sotho, Southern"
+msgstr ""
+
+#. language code: spa es
+#: ../zypp/LanguageCode.cc:1066
+msgid "Spanish"
+msgstr ""
+
+#. language code: srd sc
+#: ../zypp/LanguageCode.cc:1068
+msgid "Sardinian"
+msgstr ""
+
+#. language code: srr
+#: ../zypp/LanguageCode.cc:1070
+msgid "Serer"
+msgstr ""
+
+#. language code: ssa
+#: ../zypp/LanguageCode.cc:1072
+msgid "Nilo-Saharan (Other)"
+msgstr ""
+
+#. language code: ssw ss
+#: ../zypp/LanguageCode.cc:1074
+msgid "Swati"
+msgstr ""
+
+#. language code: suk
+#: ../zypp/LanguageCode.cc:1076
+msgid "Sukuma"
+msgstr ""
+
+#. language code: sun su
+#: ../zypp/LanguageCode.cc:1078
+msgid "Sundanese"
+msgstr ""
+
+#. language code: sus
+#: ../zypp/LanguageCode.cc:1080
+msgid "Susu"
+msgstr ""
+
+#. language code: sux
+#: ../zypp/LanguageCode.cc:1082
+msgid "Sumerian"
+msgstr ""
+
+#. language code: swa sw
+#: ../zypp/LanguageCode.cc:1084
+msgid "Swahili"
+msgstr ""
+
+#. language code: swe sv
+#: ../zypp/LanguageCode.cc:1086
+msgid "Swedish"
+msgstr ""
+
+#. language code: syr
+#: ../zypp/LanguageCode.cc:1088
+msgid "Syriac"
+msgstr ""
+
+#. language code: tah ty
+#: ../zypp/LanguageCode.cc:1090
+msgid "Tahitian"
+msgstr ""
+
+#. language code: tai
+#: ../zypp/LanguageCode.cc:1092
+msgid "Tai (Other)"
+msgstr ""
+
+#. language code: tam ta
+#: ../zypp/LanguageCode.cc:1094
+msgid "Tamil"
+msgstr ""
+
+#. language code: tat tt
+#: ../zypp/LanguageCode.cc:1096
+msgid "Tatar"
+msgstr ""
+
+#. language code: tel te
+#: ../zypp/LanguageCode.cc:1098
+msgid "Telugu"
+msgstr ""
+
+#. language code: tem
+#: ../zypp/LanguageCode.cc:1100
+msgid "Timne"
+msgstr ""
+
+#. language code: ter
+#: ../zypp/LanguageCode.cc:1102
+msgid "Tereno"
+msgstr ""
+
+#. language code: tet
+#: ../zypp/LanguageCode.cc:1104
+msgid "Tetum"
+msgstr ""
+
+#. language code: tgk tg
+#: ../zypp/LanguageCode.cc:1106
+msgid "Tajik"
+msgstr ""
+
+#. language code: tgl tl
+#: ../zypp/LanguageCode.cc:1108
+msgid "Tagalog"
+msgstr ""
+
+#. language code: tha th
+#: ../zypp/LanguageCode.cc:1110
+msgid "Thai"
+msgstr ""
+
+#. language code: tib bod bo
+#: ../zypp/LanguageCode.cc:1112 ../zypp/LanguageCode.cc:1114
+msgid "Tibetan"
+msgstr ""
+
+#. language code: tig
+#: ../zypp/LanguageCode.cc:1116
+msgid "Tigre"
+msgstr ""
+
+#. language code: tir ti
+#: ../zypp/LanguageCode.cc:1118
+msgid "Tigrinya"
+msgstr ""
+
+#. language code: tiv
+#: ../zypp/LanguageCode.cc:1120
+msgid "Tiv"
+msgstr ""
+
+#. language code: tkl
+#. :TJK:762:
+#: ../zypp/LanguageCode.cc:1122 ../zypp/CountryCode.cc:428
+msgid "Tokelau"
+msgstr ""
+
+#. language code: tlh
+#: ../zypp/LanguageCode.cc:1124
+msgid "Klingon"
+msgstr ""
+
+#. language code: tli
+#: ../zypp/LanguageCode.cc:1126
+msgid "Tlingit"
+msgstr ""
+
+#. language code: tmh
+#: ../zypp/LanguageCode.cc:1128
+msgid "Tamashek"
+msgstr ""
+
+#. language code: tog
+#: ../zypp/LanguageCode.cc:1130
+msgid "Tonga (Nyasa)"
+msgstr ""
+
+#. language code: ton to
+#: ../zypp/LanguageCode.cc:1132
+msgid "Tonga (Tonga Islands)"
+msgstr ""
+
+#. language code: tpi
+#: ../zypp/LanguageCode.cc:1134
+msgid "Tok Pisin"
+msgstr ""
+
+#. language code: tsi
+#: ../zypp/LanguageCode.cc:1136
+msgid "Tsimshian"
+msgstr ""
+
+#. language code: tsn tn
+#: ../zypp/LanguageCode.cc:1138
+msgid "Tswana"
+msgstr ""
+
+#. language code: tso ts
+#: ../zypp/LanguageCode.cc:1140
+msgid "Tsonga"
+msgstr ""
+
+#. language code: tuk tk
+#: ../zypp/LanguageCode.cc:1142
+msgid "Turkmen"
+msgstr ""
+
+#. language code: tum
+#: ../zypp/LanguageCode.cc:1144
+msgid "Tumbuka"
+msgstr ""
+
+#. language code: tup
+#: ../zypp/LanguageCode.cc:1146
+msgid "Tupi Languages"
+msgstr ""
+
+#. language code: tur tr
+#: ../zypp/LanguageCode.cc:1148
+msgid "Turkish"
+msgstr ""
+
+#. language code: tut
+#: ../zypp/LanguageCode.cc:1150
+msgid "Altaic (Other)"
+msgstr ""
+
+#. language code: tvl
+#. :TTO:780:
+#: ../zypp/LanguageCode.cc:1152 ../zypp/CountryCode.cc:435
+msgid "Tuvalu"
+msgstr ""
+
+#. language code: twi tw
+#: ../zypp/LanguageCode.cc:1154
+msgid "Twi"
+msgstr ""
+
+#. language code: tyv
+#: ../zypp/LanguageCode.cc:1156
+msgid "Tuvinian"
+msgstr ""
+
+#. language code: udm
+#: ../zypp/LanguageCode.cc:1158
+msgid "Udmurt"
+msgstr ""
+
+#. language code: uga
+#: ../zypp/LanguageCode.cc:1160
+msgid "Ugaritic"
+msgstr ""
+
+#. language code: uig ug
+#: ../zypp/LanguageCode.cc:1162
+msgid "Uighur"
+msgstr ""
+
+#. language code: ukr uk
+#: ../zypp/LanguageCode.cc:1164
+msgid "Ukrainian"
+msgstr ""
+
+#. language code: umb
+#: ../zypp/LanguageCode.cc:1166
+msgid "Umbundu"
+msgstr ""
+
+#. language code: und
+#: ../zypp/LanguageCode.cc:1168
+msgid "Undetermined"
+msgstr ""
+
+#. language code: urd ur
+#: ../zypp/LanguageCode.cc:1170
+msgid "Urdu"
+msgstr ""
+
+#. language code: uzb uz
+#: ../zypp/LanguageCode.cc:1172
+msgid "Uzbek"
+msgstr ""
+
+#. language code: vai
+#: ../zypp/LanguageCode.cc:1174
+msgid "Vai"
+msgstr ""
+
+#. language code: ven ve
+#: ../zypp/LanguageCode.cc:1176
+msgid "Venda"
+msgstr ""
+
+#. language code: vie vi
+#: ../zypp/LanguageCode.cc:1178
+msgid "Vietnamese"
+msgstr ""
+
+#. language code: vol vo
+#: ../zypp/LanguageCode.cc:1180
+msgid "Volapuk"
+msgstr ""
+
+#. language code: vot
+#: ../zypp/LanguageCode.cc:1182
+msgid "Votic"
+msgstr ""
+
+#. language code: wak
+#: ../zypp/LanguageCode.cc:1184
+msgid "Wakashan Languages"
+msgstr ""
+
+#. language code: wal
+#: ../zypp/LanguageCode.cc:1186
+msgid "Walamo"
+msgstr ""
+
+#. language code: war
+#: ../zypp/LanguageCode.cc:1188
+msgid "Waray"
+msgstr ""
+
+#. language code: was
+#: ../zypp/LanguageCode.cc:1190
+msgid "Washo"
+msgstr ""
+
+#. language code: wel cym cy
+#: ../zypp/LanguageCode.cc:1192 ../zypp/LanguageCode.cc:1194
+msgid "Welsh"
+msgstr ""
+
+#. language code: wen
+#: ../zypp/LanguageCode.cc:1196
+msgid "Sorbian Languages"
+msgstr ""
+
+#. language code: wln wa
+#: ../zypp/LanguageCode.cc:1198
+msgid "Walloon"
+msgstr ""
+
+#. language code: wol wo
+#: ../zypp/LanguageCode.cc:1200
+msgid "Wolof"
+msgstr ""
+
+#. language code: xal
+#: ../zypp/LanguageCode.cc:1202
+msgid "Kalmyk"
+msgstr ""
+
+#. language code: xho xh
+#: ../zypp/LanguageCode.cc:1204
+msgid "Xhosa"
+msgstr ""
+
+#. language code: yao
+#: ../zypp/LanguageCode.cc:1206
+msgid "Yao"
+msgstr ""
+
+#. language code: yap
+#: ../zypp/LanguageCode.cc:1208
+msgid "Yapese"
+msgstr ""
+
+#. language code: yid yi
+#: ../zypp/LanguageCode.cc:1210
+msgid "Yiddish"
+msgstr ""
+
+#. language code: yor yo
+#: ../zypp/LanguageCode.cc:1212
+msgid "Yoruba"
+msgstr ""
+
+#. language code: ypk
+#: ../zypp/LanguageCode.cc:1214
+msgid "Yupik Languages"
+msgstr ""
+
+#. language code: zap
+#: ../zypp/LanguageCode.cc:1216
+msgid "Zapotec"
+msgstr ""
+
+#. language code: zen
+#: ../zypp/LanguageCode.cc:1218
+msgid "Zenaga"
+msgstr ""
+
+#. language code: zha za
+#: ../zypp/LanguageCode.cc:1220
+msgid "Zhuang"
+msgstr ""
+
+#. language code: znd
+#: ../zypp/LanguageCode.cc:1222
+msgid "Zande"
+msgstr ""
+
+#. language code: zul zu
+#: ../zypp/LanguageCode.cc:1224
+msgid "Zulu"
+msgstr ""
+
+#. language code: zun
+#: ../zypp/LanguageCode.cc:1226
+msgid "Zuni"
+msgstr ""
+
+#: ../zypp/ZYppFactory.cc:279 ../zypp/ZYppFactory.cc:334
+msgid "Software management is already running."
+msgstr ""
+
+#: ../zypp/parser/susetags/RepoParser.cc:232
+msgid "Required file is missing: "
+msgstr ""
+
+#: ../zypp/target/hal/HalContext.cc:96
+msgid "HalContext not connected"
+msgstr ""
+
+#: ../zypp/target/hal/HalContext.cc:106
+msgid "HalDrive not initialized"
+msgstr ""
+
+#: ../zypp/target/hal/HalContext.cc:116
+msgid "HalVolume not initialized"
+msgstr ""
+
+#: ../zypp/target/hal/HalContext.cc:208
+msgid "Unable to create dbus connection"
+msgstr ""
+
+#: ../zypp/target/hal/HalContext.cc:224
+msgid "libhal_ctx_new: Can't create libhal context"
+msgstr ""
+
+#: ../zypp/target/hal/HalContext.cc:239
+msgid "libhal_set_dbus_connection: Can't set dbus connection"
+msgstr ""
+
+#: ../zypp/target/hal/HalContext.cc:254
+msgid "Unable to initalize HAL context -- hald not running?"
+msgstr ""
+
+#: ../zypp/target/hal/HalContext.cc:843
+msgid "Not a CDROM drive"
+msgstr ""
+
+#: ../zypp/target/hal/HalException.h:46 ../zypp/target/hal/HalException.h:55
+#: ../zypp/target/hal/HalException.h:64
+msgid "Hal Exception"
+msgstr ""
+
+#. Translator: %s = name of an rpm package. A list of diffs follows
+#. this message.
+#: ../zypp/target/rpm/RpmDb.cc:1779
+#, c-format
+msgid "Changed configuration files for %s:"
+msgstr ""
+
+#. %s = filenames
+#: ../zypp/target/rpm/RpmDb.cc:1943
+#, c-format
+msgid "rpm saved %s as %s, but it was impossible to determine the difference"
+msgstr ""
+
+#. %s = filenames
+#: ../zypp/target/rpm/RpmDb.cc:1945
+#, c-format
+msgid ""
+"rpm saved %s as %s.\n"
+"Here are the first 25 lines of difference:\n"
+msgstr ""
+
+#. %s = filenames
+#: ../zypp/target/rpm/RpmDb.cc:1948
+#, c-format
+msgid "rpm created %s as %s, but it was impossible to determine the difference"
+msgstr ""
+
+#. %s = filenames
+#: ../zypp/target/rpm/RpmDb.cc:1950
+#, c-format
+msgid ""
+"rpm created %s as %s.\n"
+"Here are the first 25 lines of difference:\n"
+msgstr ""
+
+#. %s = filename of rpm package
+#. timestamp
+#: ../zypp/target/rpm/RpmDb.cc:1956
+#, c-format
+msgid "%s install failed"
+msgstr ""
+
+#: ../zypp/target/rpm/RpmDb.cc:1957 ../zypp/target/rpm/RpmDb.cc:2075
+msgid "rpm output:"
+msgstr ""
+
+#. %s = filename of rpm package
+#. timestamp
+#: ../zypp/target/rpm/RpmDb.cc:1963
+#, c-format
+msgid "%s installed ok"
+msgstr ""
+
+#: ../zypp/target/rpm/RpmDb.cc:1966 ../zypp/target/rpm/RpmDb.cc:2083
+msgid "Additional rpm output:"
+msgstr ""
+
+#. %s = name of rpm package
+#. timestamp
+#: ../zypp/target/rpm/RpmDb.cc:2074
+#, c-format
+msgid "%s remove failed"
+msgstr ""
+
+#. timestamp
+#: ../zypp/target/rpm/RpmDb.cc:2080
+#, c-format
+msgid "%s remove ok"
+msgstr ""
+
+#. timestamp
+#: ../zypp/target/rpm/RpmDb.cc:2225
+#, c-format
+msgid "created backup %s"
+msgstr ""
+
+#: ../zypp/target/TargetImpl.cc:731
+msgid "Installation has been aborted as directed."
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,....
+#: ../zypp/solver/detail/ResolverInfoObsoletes.cc:55
+#, c-format
+msgid "%s is replaced by %s"
+msgstr ""
+
+#. TranslatorExplanation: 1.%s name of package, 2.%s list of names
+#. TranslatorExplanation: 1.%s is replaced by others
+#: ../zypp/solver/detail/ResolverInfoObsoletes.cc:69
+#, c-format
+msgid "%s replaced by %s"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/Resolver_problems.cc:263
+#, c-format
+msgid "%s will be deleted by the user.\n"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/Resolver_problems.cc:268
+#, c-format
+msgid "%s will be deleted by another application. (ApplLow/ApplHigh)\n"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/Resolver_problems.cc:274
+#, c-format
+msgid "%s will be installed by the user.\n"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/Resolver_problems.cc:279
+#, c-format
+msgid "%s will be installed by another application. (ApplLow/ApplHigh)\n"
+msgstr ""
+
+#. This can be generated by a timout only
+#: ../zypp/solver/detail/Resolver_problems.cc:356
+#, c-format
+msgid "No valid solution found within %d seconds"
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:357
+msgid "The solver has reached a defined timout"
+msgstr ""
+
+#. a second run with ALL possibilities has not been tried
+#. possible other solutions skipped
+#. give the user an additional solution for trying all branches
+#: ../zypp/solver/detail/Resolver_problems.cc:383
+msgid "No valid solution found with just resolvables of best architecture."
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:384
+msgid "With this run only resolvables with the best architecture have been regarded.\n"
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:385
+msgid "Regarding all possible resolvables takes time, but can come to a valid result."
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:411
+msgid "Invalid information"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:418
+#, c-format
+msgid "%s is needed by other resolvables"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/Resolver_problems.cc:421
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:90
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:140
+#, c-format
+msgid "%s is needed by %s"
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:422
+#, c-format
+msgid ""
+"%s is needed by:\n"
+"%s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:429
+#, c-format
+msgid "%s conflicts with other resolvables"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#. Translator: all.%s = name of package, patch,...
+#. TranslatorExplanation: 1.%s name of package, 2.%s list of names
+#. TranslatorExplanation: 1.%s is conflicting with multiple others
+#: ../zypp/solver/detail/Resolver_problems.cc:432
+#: ../zypp/solver/detail/ResolverInfoConflictsWith.cc:55
+#: ../zypp/solver/detail/ResolverInfoConflictsWith.cc:70
+#, c-format
+msgid "%s conflicts with %s"
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:434
+#, c-format
+msgid ""
+"%s conflicts with:\n"
+"%s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:463
+#, c-format
+msgid "%s obsoletes other resolvables"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:466
+#, c-format
+msgid "%s obsoletes %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:468
+#, c-format
+msgid "%s obsoletes:%s"
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:469
+msgid ""
+"\n"
+"These resolvables will be deleted from the system."
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:477
+#, c-format
+msgid "%s depends on other resolvables"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#. TranslatorExplanation: 1.%s name of package, 2.%s list of names
+#. TranslatorExplanation: 1.%s is dependent on list of names
+#: ../zypp/solver/detail/Resolver_problems.cc:481
+#: ../zypp/solver/detail/ResolverInfoDependsOn.cc:69
+#, c-format
+msgid "%s depends on %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:484
+#, c-format
+msgid "%s depends on:%s"
+msgstr ""
+
+#. TranslatorExplanation: currently it is unused.
+#: ../zypp/solver/detail/Resolver_problems.cc:490
+msgid "Child of"
+msgstr ""
+
+#. TranslatorExplanation %s = dependency
+#. TranslatorExplanation %s = name of package,patch,...
+#: ../zypp/solver/detail/Resolver_problems.cc:496
+#: ../zypp/solver/detail/Resolver_problems.cc:580
+#, c-format
+msgid "Cannot install %s"
+msgstr ""
+
+#. TranslatorExplanation %s = capability
+#: ../zypp/solver/detail/Resolver_problems.cc:498
+#, c-format
+msgid "None provides %s"
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:499
+msgid ""
+"\n"
+"There is no resource available which supports this requirement."
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:507
+msgid "Due to the problems described above/below, this resolution will not solve all dependencies"
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:518
+#: ../zypp/solver/detail/Resolver_problems.cc:900
+#, c-format
+msgid "Cannot install %s, because it is conflicting with %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package,patch,...
+#: ../zypp/solver/detail/Resolver_problems.cc:536
+#, c-format
+msgid "%s is not installed and has been marked as uninstallable"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package,patch,...
+#: ../zypp/solver/detail/Resolver_problems.cc:548
+#, c-format
+msgid "Cannot install %s due to dependency problems"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:590
+#: ../zypp/solver/detail/Resolver_problems.cc:600
+#: ../zypp/solver/detail/ProblemSolutionUninstall.cc:64
+#: ../zypp/solver/detail/ProblemSolutionUninstall.cc:66
+#, c-format
+msgid "delete %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:593
+#: ../zypp/solver/detail/Resolver_problems.cc:603
+#: ../zypp/solver/detail/ProblemSolutionUninstall.cc:69
+#: ../zypp/solver/detail/ProblemSolutionUninstall.cc:71
+#, c-format
+msgid "do not install %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:616
+#, c-format
+msgid "%s has unfulfilled requirements"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:655
+#, c-format
+msgid "%s has missing dependencies"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:703
+#, c-format
+msgid "%s cannot be installed due to missing dependencies"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:760
+#, c-format
+msgid "%s fulfills dependencies of %s but will be uninstalled"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:770
+#, c-format
+msgid "%s fulfills dependencies of %s but will be kept on your system"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:780
+#, c-format
+msgid "No need to install %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:788
+#, c-format
+msgid "Cannot install %s to fulfill the dependencies of %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:803
+#, c-format
+msgid "Cannot install %s to fulfil the dependencies of %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:841
+#: ../zypp/solver/detail/Resolver_problems.cc:849
+#, c-format
+msgid "%s will not be uninstalled, because it is still required"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:872
+#, c-format
+msgid "%s obsoletes %s. But %s cannot be deleted, because it is locked."
+msgstr ""
+
+#: ../zypp/solver/detail/Resolver_problems.cc:904
+#, c-format
+msgid "Cannot install %s, because it is conflicting"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/Resolver_problems.cc:926
+#, c-format
+msgid "%s is uninstallable due to conflicts with %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name requirement ...
+#: ../zypp/solver/detail/Resolver_problems.cc:940
+#, c-format
+msgid "Requirememt %s cannot be fulfilled."
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:55
+msgid "Ignore this requirement just here"
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:64
+msgid "Generally ignore this requirement"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:76
+#, c-format
+msgid "Install %s although it would change the architecture"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:79
+#, c-format
+msgid "%s provides this dependency, but would change the architecture of the installed item"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:89
+#, c-format
+msgid "Install %s although it would change the vendor"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:92
+#, c-format
+msgid "%s provides this dependency, but would change the vendor of the installed item"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:104
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:116
+#, c-format
+msgid "Ignore this conflict of %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:131
+#, c-format
+msgid "Ignore the obsolete %s in %s"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionIgnore.cc:144
+#, c-format
+msgid "Ignore that %s is already set to install"
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionUninstall.cc:81
+msgid "Do not install or delete the resolvables concerned"
+msgstr ""
+
+#. Translator: 1.%s = dependency; 2.%s and 3.%s = name of package,patch,...
+#: ../zypp/solver/detail/QueueItemRequire.cc:791
+#, c-format
+msgid "for requiring %s for %s when upgrading %s"
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,...; 2.%s = dependency
+#: ../zypp/solver/detail/ResolverInfoMissingReq.cc:64
+#, c-format
+msgid "%s is lacking the requirement %s"
+msgstr ""
+
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:56
+msgid ", Action: "
+msgstr ""
+
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:58
+msgid ", Trigger: "
+msgstr ""
+
+#. Translator: Notation for (RPM) package
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:90
+msgid "package"
+msgstr ""
+
+#. Translator: Notation for SuSE package selection (set of packages)
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:94
+msgid "selection"
+msgstr ""
+
+#. Translator: Notation for SuSE installation pattern (set of packages, describing use of system)
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:98
+msgid "pattern"
+msgstr ""
+
+#. Translator: Notation for product
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:102
+msgid "product"
+msgstr ""
+
+#. Translator: Notation for patch
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:106
+msgid "patch"
+msgstr ""
+
+#. Translator: Notation for script (part of a patch)
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:110
+msgid "script"
+msgstr ""
+
+#. Translator: Notation for message (part of a patch)
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:114
+msgid "message"
+msgstr ""
+
+#. Translator: Notation for atom (part of a patch)
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:118
+msgid "atom"
+msgstr ""
+
+#. Translator: Notation for computer system
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:122
+msgid "system"
+msgstr ""
+
+#. Translator: Generic term for an item with dependencies, please leave untranslated for now
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:126
+msgid "Resolvable"
+msgstr ""
+
+#. TranslatorExplanation: Additional information to dependency solver result, no solution could be found
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:144
+msgid "Marking this resolution attempt as invalid."
+msgstr ""
+
+#. Translator: %s = name of packages,patch,...
+#. TranslatorExplanation: Additional information to dependency solver result.
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:151
+#, c-format
+msgid "Marking resolvable %s as uninstallable"
+msgstr ""
+
+#. Translator: %s = name of packages,patch,...
+#. TranslatorExplanation: Additional information to dependency solver result.
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:159
+#, c-format
+msgid "%s is scheduled to be installed, but this is impossible due to dependency problems."
+msgstr ""
+
+#. Translator: %s = name of package,patch,...
+#. TranslatorExplanation: Additional information to dependency solver result.
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:167
+#, c-format
+msgid "Can't install %s since it is already marked as needed to be uninstalled"
+msgstr ""
+
+#. Translator: %s = name of patch
+#. TranslatorExplanation: A patch which is not needed (does not apply) cant be installed
+#. TranslatorExplanation: Patches contain updates (bug fixes) to packages. Such fixes
+#. TranslatorExplanation: do only apply if the package to-be-fixed is actually installed.
+#. TranslatorExplanation: Here a patch was selected for installation but the to-be-fixed
+#. TranslatorExplanation: package is not installed.
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:179
+#, c-format
+msgid "Can't install %s, because it does not apply to this system."
+msgstr ""
+
+#. affected() = item 1 which has to be installed
+#. _capability =
+#. other() = item 2 which has to be installed
+#. other_capability() =
+#. Translator: %s = name of package,patch,...
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:190
+#, c-format
+msgid "Can't install %s, because %s is already marked as needed to for installation"
+msgstr ""
+
+#. Translator: %s = name of patch,product
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:198
+#, c-format
+msgid "This would invalidate %s."
+msgstr ""
+
+#. Translator: %s = name of patch, pattern, ...
+#. TranslatorExplanation: Establishing is the process of computing which patches are needed
+#. TranslatorExplanation: This is just a progress indicator
+#. TranslatorExplanation: It is also used for other types of resolvables in order to verify
+#. TranslatorExplanation: the completeness of their dependencies
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:214
+#, c-format
+msgid "Establishing %s"
+msgstr ""
+
+#. affected() = resolvable to be installed
+#. _capability =
+#. other() =
+#. other_capability() =
+#. Translator: %s = name of package,patch,...
+#. TranslatorExample: Installing foo
+#. TranslatorExplanation: Just a progress indicator that something is scheduled for installation
+#. Translator: %s = packagename
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:235
+#, c-format
+msgid "Installing %s"
+msgstr ""
+
+#. affected() = updated resolvable
+#. _capability =
+#. other() = currently installed, being updated resolvable
+#. other_capability() =
+#. Translator: 1.%s and 2.%s = name of package
+#. TranslatorExample: Updating foo-1.1 to foo-1.2
+#. TranslatorExplanation: Just a progress indicator that something is scheduled for upgrade
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:252
+#, c-format
+msgid "Updating %s to %s"
+msgstr ""
+
+#. affected() =
+#. _capability =
+#. other() =
+#. other_capability() =
+#. Translator: %s = name of package,patch,...
+#. TranslatorExample: Skipping foo: already installed
+#. TranslatorExplanation: An installation request for foo is skipped since foo is already installed
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:270
+#, c-format
+msgid "Skipping %s: already installed"
+msgstr ""
+
+#. affected() = is set
+#. _capability = is set
+#. other() =
+#. other_capability() =
+#. Translator: 1.%s = dependency
+#. TranslatorExample: There are no alternative installed providers of foo
+#. TranslatorExplanation: A resolvable is to be uninstalled. It provides 'foo' which is needed by others
+#. TranslatorExplanation: We just found out that 'foo' is not provided by anything else (an alternative)
+#. TranslatorExplanation: removal of this resolvable would therefore break dependency
+#. TranslatorExplanation: This is an error message explaining that the resolvable cannot be uninstalled
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:292
+#, c-format
+msgid "There are no alternative providers of %s installed"
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch....
+#. TranslatorExample: for bar
+#. TranslatorExplanation: extension to previous message if we know what the resolvable is
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:298
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:323
+#, c-format
+msgid "for %s"
+msgstr ""
+
+#. affected() =
+#. _capability =
+#. other() =
+#. other_capability() =
+#. Translator: 1.%s = dependency
+#. TranslatorExample: There are no installable providers of foo
+#. TranslatorExplanation: A resolvable is to be installed which requires foo
+#. TranslatorExplanation: But there is nothing available to fulfill this requirement
+#. TranslatorExplanation: This is an error message explaining that the resolvable cannot be installed
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:317
+#, c-format
+msgid "There are no installable providers of %s"
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,..., 2.%s = name of package,patch,...
+#. TranslatorExample: Upgrade to foo to avoid removing bar is not possible
+#. TranslatorExplanation: bar requires something from foo
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:341
+#, c-format
+msgid "Upgrading to %s to avoid removing %s is not possible."
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:359
+#, c-format
+msgid "%s provides %s, but is scheduled to be uninstalled."
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,...; 2.%s = dependency; 3.%s type (package, patch, ...)
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:377
+#, c-format
+msgid "%s provides %s, but another version of that %s is already installed."
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:396
+#, c-format
+msgid "%s provides %s, but it is uninstallable. Try installing it on its own for more details."
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:414
+#, c-format
+msgid "%s provides %s, but it is locked."
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:432
+#, c-format
+msgid "%s provides %s, but is scheduled to be kept."
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:451
+#, c-format
+msgid "%s provides %s, but has another architecture."
+msgstr ""
+
+#. Translator: 1.%s = name of package,patch,...; 2.%s = dependency; 3.%s = vendor ID
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:469
+#, c-format
+msgid "%s provides %s, but has another vendor (%s)."
+msgstr ""
+
+#. Translator: 1.%s = dependency. 2.%s name of package, patch, ...
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:487
+#, c-format
+msgid "Can't satisfy requirement %s for %s"
+msgstr ""
+
+#. affected() = to-be-installed resolvable which was scheduled to be uninstalled
+#. _capability =
+#. other() =
+#. other_capability() =
+#. Translator: %s = name of package,patch,...
+#. TranslatorExample: foo is required by other to-be-installed resolvable, so it won't be unlinked.
+#. TranslatorExplanation: Cant uninstall foo since it is required by an to-be-installed resolvable
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:508
+#, c-format
+msgid "%s is required by another resolvable selected for installation, so it won't be unlinked."
+msgstr ""
+
+#. affected() = provider of cap
+#. _capability =
+#. other() =
+#. other_capability() =
+#. Translator: %s = name of package,patch,...
+#. TranslatorExample: foo is required by other installed resolvable, so it won't be unlinked.
+#. TranslatorExplanation: Cant uninstall foo since it is required by an installed resolvable
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:525
+#, c-format
+msgid "%s is required by another installed resolvable, so it won't be unlinked."
+msgstr ""
+
+#. affected() = to-be-uninstalled resolvable which is locked
+#. _capability =
+#. other() =
+#. other_capability() =
+#. Translator: %s = name of package,patch,...
+#. TranslatorExample: foo is locked and cannot be uninstalled.
+#. TranslatorExplanation: foo is to-be-uninstalled but it is locked
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:542
+#, c-format
+msgid "%s is locked and cannot be uninstalled."
+msgstr ""
+
+#. affected() = provider of capability
+#. _capability = provided by provider
+#. other() = conflict issuer
+#. other_capability() = conflict capability
+#. Translator: 1.%s and 2.%s = Dependency; 4.%s = name of package,patch,...
+#. TranslatorExample: A conflict over foo (bar) requires the removal of to-be-installed xyz
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:561
+#, c-format
+msgid "A conflict over %s (%s) requires the removal of %s which is scheduled for installation"
+msgstr ""
+
+#. affected() = provider of capability
+#. _capability = provided by provider
+#. other() = conflict issuer
+#. other_capability() = conflict capability from issuer
+#. Translator: 1.%s = name of package,patch,...; 3.%s and 4.%s = Dependency;
+#. TranslatorExample: Marking xyz as uninstallable due to conflicts over foo (bar)
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:579
+#, c-format
+msgid "Marking %s as uninstallable due to conflicts over %s"
+msgstr ""
+
+#. Translator: %s = name of package,patch
+#. TranslatorExample: from abc
+#: ../zypp/solver/detail/ResolverInfoMisc.cc:587
+#, c-format
+msgid "from %s"
+msgstr ""
+
+#: ../zypp/solver/detail/ResolverInfo.cc:195
+msgid " Error!"
+msgstr ""
+
+#: ../zypp/solver/detail/ResolverInfo.cc:196
+msgid " Important!"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionKeep.cc:53
+#: ../zypp/solver/detail/ProblemSolutionKeep.cc:55
+#, c-format
+msgid "keep %s"
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionKeep.cc:65
+msgid "Keep resolvables"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionInstall.cc:54
+#: ../zypp/solver/detail/ProblemSolutionInstall.cc:56
+#, c-format
+msgid "install %s"
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionInstall.cc:66
+msgid "Install missing resolvables"
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionAllBranches.cc:53
+msgid "Make a solver run with ALL possibilities."
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionAllBranches.cc:54
+msgid "Regarding all resolvables with a compatible architecture."
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionAllBranches.cc:57
+msgid "Make a solver run with best architecture only."
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionAllBranches.cc:58
+msgid "Regarding resolvables with best architecture only."
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,....
+#: ../zypp/solver/detail/ResolverInfoDependsOn.cc:55
+#, c-format
+msgid "%s depended on %s"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:60
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:110
+#, c-format
+msgid "%s is recommended by %s"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:66
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:116
+#, c-format
+msgid "%s is suggested by %s"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:72
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:122
+#, c-format
+msgid "%s will be evaluated for installation (freshened) by %s"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:78
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:128
+#, c-format
+msgid "%s is enhanced by %s"
+msgstr ""
+
+#. Translator: all.%s = name of package,patch,...
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:84
+#: ../zypp/solver/detail/ResolverInfoNeededBy.cc:134
+#, c-format
+msgid "%s is supplemented by %s"
+msgstr ""
+
+#. Translator all.%s = name of packages,patches,....
+#. TranslatorExplanation: 1.%s name of package, 2.%s list of names
+#. TranslatorExplanation: 1.%s is part of 'bundles', the bundles are listed in 2.%s
+#: ../zypp/solver/detail/ResolverInfoChildOf.cc:56
+#: ../zypp/solver/detail/ResolverInfoChildOf.cc:71
+#, c-format
+msgid "%s part of %s"
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionDoubleTimeout.cc:50
+msgid "Double timeout"
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionDoubleTimeout.cc:51
+msgid "Start the next solver run with doubled timeout."
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionUnlock.cc:70
+msgid "unlock all resolvables"
+msgstr ""
+
+#. TranslatorExplanation %s = name of package, patch, selection ...
+#: ../zypp/solver/detail/ProblemSolutionUnlock.cc:83
+#, c-format
+msgid "unlock %s"
+msgstr ""
+
+#: ../zypp/solver/detail/ProblemSolutionUnlock.cc:92
+msgid "Unlock these resolvables"
+msgstr ""
+
+#: ../zypp/thread/Mutex.cc:33
+msgid "Can't initialize mutex attributes"
+msgstr ""
+
+#: ../zypp/thread/Mutex.cc:40
+msgid "Can't set recursive mutex attribute"
+msgstr ""
+
+#: ../zypp/thread/Mutex.cc:47
+msgid "Can't initialize recursive mutex"
+msgstr ""
+
+#: ../zypp/thread/Mutex.cc:77
+msgid "Can't acquire the mutex lock"
+msgstr ""
+
+#: ../zypp/thread/Mutex.cc:87
+msgid "Can't release the mutex lock"
+msgstr ""
+
+#: ../zypp/CountryCode.cc:135
+msgid "Unknown country: "
+msgstr ""
+
+#: ../zypp/CountryCode.cc:217
+msgid "Andorra"
+msgstr ""
+
+#. :AND:020:
+#: ../zypp/CountryCode.cc:218
+msgid "United Arab Emirates"
+msgstr ""
+
+#. :ARE:784:
+#: ../zypp/CountryCode.cc:219
+msgid "Afghanistan"
+msgstr ""
+
+#. :AFG:004:
+#: ../zypp/CountryCode.cc:220
+msgid "Antigua and Barbuda"
+msgstr ""
+
+#. :ATG:028:
+#: ../zypp/CountryCode.cc:221
+msgid "Anguilla"
+msgstr ""
+
+#. :AIA:660:
+#: ../zypp/CountryCode.cc:222
+msgid "Albania"
+msgstr ""
+
+#. :ALB:008:
+#: ../zypp/CountryCode.cc:223
+msgid "Armenia"
+msgstr ""
+
+#. :ARM:051:
+#: ../zypp/CountryCode.cc:224
+msgid "Netherlands Antilles"
+msgstr ""
+
+#. :ANT:530:
+#: ../zypp/CountryCode.cc:225
+msgid "Angola"
+msgstr ""
+
+#. :AGO:024:
+#: ../zypp/CountryCode.cc:226
+msgid "Antarctica"
+msgstr ""
+
+#. :ATA:010:
+#: ../zypp/CountryCode.cc:227
+msgid "Argentina"
+msgstr ""
+
+#. :ARG:032:
+#: ../zypp/CountryCode.cc:228
+msgid "American Samoa"
+msgstr ""
+
+#. :ASM:016:
+#: ../zypp/CountryCode.cc:229
+msgid "Austria"
+msgstr ""
+
+#. :AUT:040:
+#: ../zypp/CountryCode.cc:230
+msgid "Australia"
+msgstr ""
+
+#. :AUS:036:
+#: ../zypp/CountryCode.cc:231
+msgid "Aruba"
+msgstr ""
+
+#. :ABW:533:
+#: ../zypp/CountryCode.cc:232
+msgid "Aland Islands"
+msgstr ""
+
+#. :ALA:248:
+#: ../zypp/CountryCode.cc:233
+msgid "Azerbaijan"
+msgstr ""
+
+#. :AZE:031:
+#: ../zypp/CountryCode.cc:234
+msgid "Bosnia and Herzegovina"
+msgstr ""
+
+#. :BIH:070:
+#: ../zypp/CountryCode.cc:235
+msgid "Barbados"
+msgstr ""
+
+#. :BRB:052:
+#: ../zypp/CountryCode.cc:236
+msgid "Bangladesh"
+msgstr ""
+
+#. :BGD:050:
+#: ../zypp/CountryCode.cc:237
+msgid "Belgium"
+msgstr ""
+
+#. :BEL:056:
+#: ../zypp/CountryCode.cc:238
+msgid "Burkina Faso"
+msgstr ""
+
+#. :BFA:854:
+#: ../zypp/CountryCode.cc:239
+msgid "Bulgaria"
+msgstr ""
+
+#. :BGR:100:
+#: ../zypp/CountryCode.cc:240
+msgid "Bahrain"
+msgstr ""
+
+#. :BHR:048:
+#: ../zypp/CountryCode.cc:241
+msgid "Burundi"
+msgstr ""
+
+#. :BDI:108:
+#: ../zypp/CountryCode.cc:242
+msgid "Benin"
+msgstr ""
+
+#. :BEN:204:
+#: ../zypp/CountryCode.cc:243
+msgid "Bermuda"
+msgstr ""
+
+#. :BMU:060:
+#: ../zypp/CountryCode.cc:244
+msgid "Brunei Darussalam"
+msgstr ""
+
+#. :BRN:096:
+#: ../zypp/CountryCode.cc:245
+msgid "Bolivia"
+msgstr ""
+
+#. :BOL:068:
+#: ../zypp/CountryCode.cc:246
+msgid "Brazil"
+msgstr ""
+
+#. :BRA:076:
+#: ../zypp/CountryCode.cc:247
+msgid "Bahamas"
+msgstr ""
+
+#. :BHS:044:
+#: ../zypp/CountryCode.cc:248
+msgid "Bhutan"
+msgstr ""
+
+#. :BTN:064:
+#: ../zypp/CountryCode.cc:249
+msgid "Bouvet Island"
+msgstr ""
+
+#. :BVT:074:
+#: ../zypp/CountryCode.cc:250
+msgid "Botswana"
+msgstr ""
+
+#. :BWA:072:
+#: ../zypp/CountryCode.cc:251
+msgid "Belarus"
+msgstr ""
+
+#. :BLR:112:
+#: ../zypp/CountryCode.cc:252
+msgid "Belize"
+msgstr ""
+
+#. :BLZ:084:
+#: ../zypp/CountryCode.cc:253
+msgid "Canada"
+msgstr ""
+
+#. :CAN:124:
+#: ../zypp/CountryCode.cc:254
+msgid "Cocos (Keeling) Islands"
+msgstr ""
+
+#. :CCK:166:
+#. :CAF:140:
+#: ../zypp/CountryCode.cc:255 ../zypp/CountryCode.cc:257
+msgid "Congo"
+msgstr ""
+
+#. :COD:180:
+#: ../zypp/CountryCode.cc:256
+msgid "Central African Republic"
+msgstr ""
+
+#. :COG:178:
+#: ../zypp/CountryCode.cc:258
+msgid "Switzerland"
+msgstr ""
+
+#. :CHE:756:
+#: ../zypp/CountryCode.cc:259
+msgid "Cote D'Ivoire"
+msgstr ""
+
+#. :CIV:384:
+#: ../zypp/CountryCode.cc:260
+msgid "Cook Islands"
+msgstr ""
+
+#. :COK:184:
+#: ../zypp/CountryCode.cc:261
+msgid "Chile"
+msgstr ""
+
+#. :CHL:152:
+#: ../zypp/CountryCode.cc:262
+msgid "Cameroon"
+msgstr ""
+
+#. :CMR:120:
+#: ../zypp/CountryCode.cc:263
+msgid "China"
+msgstr ""
+
+#. :CHN:156:
+#: ../zypp/CountryCode.cc:264
+msgid "Colombia"
+msgstr ""
+
+#. :COL:170:
+#: ../zypp/CountryCode.cc:265
+msgid "Costa Rica"
+msgstr ""
+
+#. :CRI:188:
+#: ../zypp/CountryCode.cc:266
+msgid "Serbia and Montenegro"
+msgstr ""
+
+#. :SCG:891:
+#: ../zypp/CountryCode.cc:267
+msgid "Cuba"
+msgstr ""
+
+#. :CUB:192:
+#: ../zypp/CountryCode.cc:268
+msgid "Cape Verde"
+msgstr ""
+
+#. :CPV:132:
+#: ../zypp/CountryCode.cc:269
+msgid "Christmas Island"
+msgstr ""
+
+#. :CXR:162:
+#: ../zypp/CountryCode.cc:270
+msgid "Cyprus"
+msgstr ""
+
+#. :CYP:196:
+#: ../zypp/CountryCode.cc:271
+msgid "Czech Republic"
+msgstr ""
+
+#. :CZE:203:
+#: ../zypp/CountryCode.cc:272
+msgid "Germany"
+msgstr ""
+
+#. :DEU:276:
+#: ../zypp/CountryCode.cc:273
+msgid "Djibouti"
+msgstr ""
+
+#. :DJI:262:
+#: ../zypp/CountryCode.cc:274
+msgid "Denmark"
+msgstr ""
+
+#. :DNK:208:
+#: ../zypp/CountryCode.cc:275
+msgid "Dominica"
+msgstr ""
+
+#. :DMA:212:
+#: ../zypp/CountryCode.cc:276
+msgid "Dominican Republic"
+msgstr ""
+
+#. :DOM:214:
+#: ../zypp/CountryCode.cc:277
+msgid "Algeria"
+msgstr ""
+
+#. :DZA:012:
+#: ../zypp/CountryCode.cc:278
+msgid "Ecuador"
+msgstr ""
+
+#. :ECU:218:
+#: ../zypp/CountryCode.cc:279
+msgid "Estonia"
+msgstr ""
+
+#. :EST:233:
+#: ../zypp/CountryCode.cc:280
+msgid "Egypt"
+msgstr ""
+
+#. :EGY:818:
+#: ../zypp/CountryCode.cc:281
+msgid "Western Sahara"
+msgstr ""
+
+#. :ESH:732:
+#: ../zypp/CountryCode.cc:282
+msgid "Eritrea"
+msgstr ""
+
+#. :ERI:232:
+#: ../zypp/CountryCode.cc:283
+msgid "Spain"
+msgstr ""
+
+#. :ESP:724:
+#: ../zypp/CountryCode.cc:284
+msgid "Ethiopia"
+msgstr ""
+
+#. :ETH:231:
+#: ../zypp/CountryCode.cc:285
+msgid "Finland"
+msgstr ""
+
+#. :FIN:246:
+#: ../zypp/CountryCode.cc:286
+msgid "Fiji"
+msgstr ""
+
+#. :FJI:242:
+#: ../zypp/CountryCode.cc:287
+msgid "Falkland Islands (Malvinas)"
+msgstr ""
+
+#. :FLK:238:
+#: ../zypp/CountryCode.cc:288
+msgid "Federated States of Micronesia"
+msgstr ""
+
+#. :FSM:583:
+#: ../zypp/CountryCode.cc:289
+msgid "Faroe Islands"
+msgstr ""
+
+#. :FRO:234:
+#: ../zypp/CountryCode.cc:290
+msgid "France"
+msgstr ""
+
+#. :FRA:250:
+#: ../zypp/CountryCode.cc:291
+msgid "Metropolitan France"
+msgstr ""
+
+#. :FXX:249:
+#: ../zypp/CountryCode.cc:292
+msgid "Gabon"
+msgstr ""
+
+#. :GAB:266:
+#: ../zypp/CountryCode.cc:293
+msgid "United Kingdom"
+msgstr ""
+
+#. :GBR:826:
+#: ../zypp/CountryCode.cc:294
+msgid "Grenada"
+msgstr ""
+
+#. :GRD:308:
+#: ../zypp/CountryCode.cc:295
+msgid "Georgia"
+msgstr ""
+
+#. :GEO:268:
+#: ../zypp/CountryCode.cc:296
+msgid "French Guiana"
+msgstr ""
+
+#. :GUF:254:
+#: ../zypp/CountryCode.cc:297
+msgid "Ghana"
+msgstr ""
+
+#. :GHA:288:
+#: ../zypp/CountryCode.cc:298
+msgid "Gibraltar"
+msgstr ""
+
+#. :GIB:292:
+#: ../zypp/CountryCode.cc:299
+msgid "Greenland"
+msgstr ""
+
+#. :GRL:304:
+#: ../zypp/CountryCode.cc:300
+msgid "Gambia"
+msgstr ""
+
+#. :GMB:270:
+#: ../zypp/CountryCode.cc:301
+msgid "Guinea"
+msgstr ""
+
+#. :GIN:324:
+#: ../zypp/CountryCode.cc:302
+msgid "Guadeloupe"
+msgstr ""
+
+#. :GLP:312:
+#: ../zypp/CountryCode.cc:303
+msgid "Equatorial Guinea"
+msgstr ""
+
+#. :GNQ:226:
+#: ../zypp/CountryCode.cc:304
+msgid "Greece"
+msgstr ""
+
+#. :GRC:300:
+#: ../zypp/CountryCode.cc:305
+msgid "South Georgia and the South Sandwich Islands"
+msgstr ""
+
+#. :SGS:239:
+#: ../zypp/CountryCode.cc:306
+msgid "Guatemala"
+msgstr ""
+
+#. :GTM:320:
+#: ../zypp/CountryCode.cc:307
+msgid "Guam"
+msgstr ""
+
+#. :GUM:316:
+#: ../zypp/CountryCode.cc:308
+msgid "Guinea-Bissau"
+msgstr ""
+
+#. :GNB:624:
+#: ../zypp/CountryCode.cc:309
+msgid "Guyana"
+msgstr ""
+
+#. :GUY:328:
+#: ../zypp/CountryCode.cc:310
+msgid "Hong Kong"
+msgstr ""
+
+#. :HKG:344:
+#: ../zypp/CountryCode.cc:311
+msgid "Heard Island and McDonald Islands"
+msgstr ""
+
+#. :HMD:334:
+#: ../zypp/CountryCode.cc:312
+msgid "Honduras"
+msgstr ""
+
+#. :HND:340:
+#: ../zypp/CountryCode.cc:313
+msgid "Croatia"
+msgstr ""
+
+#. :HRV:191:
+#: ../zypp/CountryCode.cc:314
+msgid "Haiti"
+msgstr ""
+
+#. :HTI:332:
+#: ../zypp/CountryCode.cc:315
+msgid "Hungary"
+msgstr ""
+
+#. :HUN:348:
+#: ../zypp/CountryCode.cc:316
+msgid "Indonesia"
+msgstr ""
+
+#. :IDN:360:
+#: ../zypp/CountryCode.cc:317
+msgid "Ireland"
+msgstr ""
+
+#. :IRL:372:
+#: ../zypp/CountryCode.cc:318
+msgid "Israel"
+msgstr ""
+
+#. :ISR:376:
+#: ../zypp/CountryCode.cc:319
+msgid "India"
+msgstr ""
+
+#. :IND:356:
+#: ../zypp/CountryCode.cc:320
+msgid "British Indian Ocean Territory"
+msgstr ""
+
+#. :IOT:086:
+#: ../zypp/CountryCode.cc:321
+msgid "Iraq"
+msgstr ""
+
+#. :IRQ:368:
+#: ../zypp/CountryCode.cc:322
+msgid "Iran"
+msgstr ""
+
+#. :IRN:364:
+#: ../zypp/CountryCode.cc:323
+msgid "Iceland"
+msgstr ""
+
+#. :ISL:352:
+#: ../zypp/CountryCode.cc:324
+msgid "Italy"
+msgstr ""
+
+#. :ITA:380:
+#: ../zypp/CountryCode.cc:325
+msgid "Jamaica"
+msgstr ""
+
+#. :JAM:388:
+#: ../zypp/CountryCode.cc:326
+msgid "Jordan"
+msgstr ""
+
+#. :JOR:400:
+#: ../zypp/CountryCode.cc:327
+msgid "Japan"
+msgstr ""
+
+#. :JPN:392:
+#: ../zypp/CountryCode.cc:328
+msgid "Kenya"
+msgstr ""
+
+#. :KEN:404:
+#: ../zypp/CountryCode.cc:329
+msgid "Kyrgyzstan"
+msgstr ""
+
+#. :KGZ:417:
+#: ../zypp/CountryCode.cc:330
+msgid "Cambodia"
+msgstr ""
+
+#. :KHM:116:
+#: ../zypp/CountryCode.cc:331
+msgid "Kiribati"
+msgstr ""
+
+#. :KIR:296:
+#: ../zypp/CountryCode.cc:332
+msgid "Comoros"
+msgstr ""
+
+#. :COM:174:
+#: ../zypp/CountryCode.cc:333
+msgid "Saint Kitts and Nevis"
+msgstr ""
+
+#. :KNA:659:
+#: ../zypp/CountryCode.cc:334
+msgid "North Korea"
+msgstr ""
+
+#. :PRK:408:
+#: ../zypp/CountryCode.cc:335
+msgid "South Korea"
+msgstr ""
+
+#. :KOR:410:
+#: ../zypp/CountryCode.cc:336
+msgid "Kuwait"
+msgstr ""
+
+#. :KWT:414:
+#: ../zypp/CountryCode.cc:337
+msgid "Cayman Islands"
+msgstr ""
+
+#. :CYM:136:
+#: ../zypp/CountryCode.cc:338
+msgid "Kazakhstan"
+msgstr ""
+
+#. :KAZ:398:
+#: ../zypp/CountryCode.cc:339
+msgid "Lao People's Democratic Republic"
+msgstr ""
+
+#. :LAO:418:
+#: ../zypp/CountryCode.cc:340
+msgid "Lebanon"
+msgstr ""
+
+#. :LBN:422:
+#: ../zypp/CountryCode.cc:341
+msgid "Saint Lucia"
+msgstr ""
+
+#. :LCA:662:
+#: ../zypp/CountryCode.cc:342
+msgid "Liechtenstein"
+msgstr ""
+
+#. :LIE:438:
+#: ../zypp/CountryCode.cc:343
+msgid "Sri Lanka"
+msgstr ""
+
+#. :LKA:144:
+#: ../zypp/CountryCode.cc:344
+msgid "Liberia"
+msgstr ""
+
+#. :LBR:430:
+#: ../zypp/CountryCode.cc:345
+msgid "Lesotho"
+msgstr ""
+
+#. :LSO:426:
+#: ../zypp/CountryCode.cc:346
+msgid "Lithuania"
+msgstr ""
+
+#. :LTU:440:
+#: ../zypp/CountryCode.cc:347
+msgid "Luxembourg"
+msgstr ""
+
+#. :LUX:442:
+#: ../zypp/CountryCode.cc:348
+msgid "Latvia"
+msgstr ""
+
+#. :LVA:428:
+#: ../zypp/CountryCode.cc:349
+msgid "Libya"
+msgstr ""
+
+#. :LBY:434:
+#: ../zypp/CountryCode.cc:350
+msgid "Morocco"
+msgstr ""
+
+#. :MAR:504:
+#: ../zypp/CountryCode.cc:351
+msgid "Monaco"
+msgstr ""
+
+#. :MCO:492:
+#: ../zypp/CountryCode.cc:352
+msgid "Moldova"
+msgstr ""
+
+#. :MDA:498:
+#: ../zypp/CountryCode.cc:353
+msgid "Madagascar"
+msgstr ""
+
+#. :MDG:450:
+#: ../zypp/CountryCode.cc:354
+msgid "Marshall Islands"
+msgstr ""
+
+#. :MHL:584:
+#: ../zypp/CountryCode.cc:355
+msgid "Macedonia"
+msgstr ""
+
+#. :MKD:807:
+#: ../zypp/CountryCode.cc:356
+msgid "Mali"
+msgstr ""
+
+#. :MLI:466:
+#: ../zypp/CountryCode.cc:357
+msgid "Myanmar"
+msgstr ""
+
+#. :MMR:104:
+#: ../zypp/CountryCode.cc:358
+msgid "Mongolia"
+msgstr ""
+
+#. :MNG:496:
+#: ../zypp/CountryCode.cc:359
+msgid "Macao"
+msgstr ""
+
+#. :MAC:446:
+#: ../zypp/CountryCode.cc:360
+msgid "Northern Mariana Islands"
+msgstr ""
+
+#. :MNP:580:
+#: ../zypp/CountryCode.cc:361
+msgid "Martinique"
+msgstr ""
+
+#. :MTQ:474:
+#: ../zypp/CountryCode.cc:362
+msgid "Mauritania"
+msgstr ""
+
+#. :MRT:478:
+#: ../zypp/CountryCode.cc:363
+msgid "Montserrat"
+msgstr ""
+
+#. :MSR:500:
+#: ../zypp/CountryCode.cc:364
+msgid "Malta"
+msgstr ""
+
+#. :MLT:470:
+#: ../zypp/CountryCode.cc:365
+msgid "Mauritius"
+msgstr ""
+
+#. :MUS:480:
+#: ../zypp/CountryCode.cc:366
+msgid "Maldives"
+msgstr ""
+
+#. :MDV:462:
+#: ../zypp/CountryCode.cc:367
+msgid "Malawi"
+msgstr ""
+
+#. :MWI:454:
+#: ../zypp/CountryCode.cc:368
+msgid "Mexico"
+msgstr ""
+
+#. :MEX:484:
+#: ../zypp/CountryCode.cc:369
+msgid "Malaysia"
+msgstr ""
+
+#. :MYS:458:
+#: ../zypp/CountryCode.cc:370
+msgid "Mozambique"
+msgstr ""
+
+#. :MOZ:508:
+#: ../zypp/CountryCode.cc:371
+msgid "Namibia"
+msgstr ""
+
+#. :NAM:516:
+#: ../zypp/CountryCode.cc:372
+msgid "New Caledonia"
+msgstr ""
+
+#. :NCL:540:
+#: ../zypp/CountryCode.cc:373
+msgid "Niger"
+msgstr ""
+
+#. :NER:562:
+#: ../zypp/CountryCode.cc:374
+msgid "Norfolk Island"
+msgstr ""
+
+#. :NFK:574:
+#: ../zypp/CountryCode.cc:375
+msgid "Nigeria"
+msgstr ""
+
+#. :NGA:566:
+#: ../zypp/CountryCode.cc:376
+msgid "Nicaragua"
+msgstr ""
+
+#. :NIC:558:
+#: ../zypp/CountryCode.cc:377
+msgid "Netherlands"
+msgstr ""
+
+#. :NLD:528:
+#: ../zypp/CountryCode.cc:378
+msgid "Norway"
+msgstr ""
+
+#. :NOR:578:
+#: ../zypp/CountryCode.cc:379
+msgid "Nepal"
+msgstr ""
+
+#. :NRU:520:
+#: ../zypp/CountryCode.cc:381
+msgid "Niue"
+msgstr ""
+
+#. :NIU:570:
+#: ../zypp/CountryCode.cc:382
+msgid "New Zealand"
+msgstr ""
+
+#. :NZL:554:
+#: ../zypp/CountryCode.cc:383
+msgid "Oman"
+msgstr ""
+
+#. :OMN:512:
+#: ../zypp/CountryCode.cc:384
+msgid "Panama"
+msgstr ""
+
+#. :PAN:591:
+#: ../zypp/CountryCode.cc:385
+msgid "Peru"
+msgstr ""
+
+#. :PER:604:
+#: ../zypp/CountryCode.cc:386
+msgid "French Polynesia"
+msgstr ""
+
+#. :PYF:258:
+#: ../zypp/CountryCode.cc:387
+msgid "Papua New Guinea"
+msgstr ""
+
+#. :PNG:598:
+#: ../zypp/CountryCode.cc:388
+msgid "Philippines"
+msgstr ""
+
+#. :PHL:608:
+#: ../zypp/CountryCode.cc:389
+msgid "Pakistan"
+msgstr ""
+
+#. :PAK:586:
+#: ../zypp/CountryCode.cc:390
+msgid "Poland"
+msgstr ""
+
+#. :POL:616:
+#: ../zypp/CountryCode.cc:391
+msgid "Saint Pierre and Miquelon"
+msgstr ""
+
+#. :SPM:666:
+#: ../zypp/CountryCode.cc:392
+msgid "Pitcairn"
+msgstr ""
+
+#. :PCN:612:
+#: ../zypp/CountryCode.cc:393
+msgid "Puerto Rico"
+msgstr ""
+
+#. :PRI:630:
+#: ../zypp/CountryCode.cc:394
+msgid "Palestinian Territory"
+msgstr ""
+
+#. :PSE:275:
+#: ../zypp/CountryCode.cc:395
+msgid "Portugal"
+msgstr ""
+
+#. :PRT:620:
+#: ../zypp/CountryCode.cc:396
+msgid "Palau"
+msgstr ""
+
+#. :PLW:585:
+#: ../zypp/CountryCode.cc:397
+msgid "Paraguay"
+msgstr ""
+
+#. :PRY:600:
+#: ../zypp/CountryCode.cc:398
+msgid "Qatar"
+msgstr ""
+
+#. :QAT:634:
+#: ../zypp/CountryCode.cc:399
+msgid "Reunion"
+msgstr ""
+
+#. :REU:638:
+#: ../zypp/CountryCode.cc:400
+msgid "Romania"
+msgstr ""
+
+#. :ROU:642:
+#: ../zypp/CountryCode.cc:401
+msgid "Russian Federation"
+msgstr ""
+
+#. :RUS:643:
+#: ../zypp/CountryCode.cc:402
+msgid "Rwanda"
+msgstr ""
+
+#. :RWA:646:
+#: ../zypp/CountryCode.cc:403
+msgid "Saudi Arabia"
+msgstr ""
+
+#. :SAU:682:
+#: ../zypp/CountryCode.cc:404
+msgid "Solomon Islands"
+msgstr ""
+
+#. :SLB:090:
+#: ../zypp/CountryCode.cc:405
+msgid "Seychelles"
+msgstr ""
+
+#. :SYC:690:
+#: ../zypp/CountryCode.cc:406
+msgid "Sudan"
+msgstr ""
+
+#. :SDN:736:
+#: ../zypp/CountryCode.cc:407
+msgid "Sweden"
+msgstr ""
+
+#. :SWE:752:
+#: ../zypp/CountryCode.cc:408
+msgid "Singapore"
+msgstr ""
+
+#. :SGP:702:
+#: ../zypp/CountryCode.cc:409
+msgid "Saint Helena"
+msgstr ""
+
+#. :SHN:654:
+#: ../zypp/CountryCode.cc:410
+msgid "Slovenia"
+msgstr ""
+
+#. :SVN:705:
+#: ../zypp/CountryCode.cc:411
+msgid "Svalbard and Jan Mayen"
+msgstr ""
+
+#. :SJM:744:
+#: ../zypp/CountryCode.cc:412
+msgid "Slovakia"
+msgstr ""
+
+#. :SVK:703:
+#: ../zypp/CountryCode.cc:413
+msgid "Sierra Leone"
+msgstr ""
+
+#. :SLE:694:
+#: ../zypp/CountryCode.cc:414
+msgid "San Marino"
+msgstr ""
+
+#. :SMR:674:
+#: ../zypp/CountryCode.cc:415
+msgid "Senegal"
+msgstr ""
+
+#. :SEN:686:
+#: ../zypp/CountryCode.cc:416
+msgid "Somalia"
+msgstr ""
+
+#. :SOM:706:
+#: ../zypp/CountryCode.cc:417
+msgid "Suriname"
+msgstr ""
+
+#. :SUR:740:
+#: ../zypp/CountryCode.cc:418
+msgid "Sao Tome and Principe"
+msgstr ""
+
+#. :STP:678:
+#: ../zypp/CountryCode.cc:419
+msgid "El Salvador"
+msgstr ""
+
+#. :SLV:222:
+#: ../zypp/CountryCode.cc:420
+msgid "Syria"
+msgstr ""
+
+#. :SYR:760:
+#: ../zypp/CountryCode.cc:421
+msgid "Swaziland"
+msgstr ""
+
+#. :SWZ:748:
+#: ../zypp/CountryCode.cc:422
+msgid "Turks and Caicos Islands"
+msgstr ""
+
+#. :TCA:796:
+#: ../zypp/CountryCode.cc:423
+msgid "Chad"
+msgstr ""
+
+#. :TCD:148:
+#: ../zypp/CountryCode.cc:424
+msgid "French Southern Territories"
+msgstr ""
+
+#. :ATF:260:
+#: ../zypp/CountryCode.cc:425
+msgid "Togo"
+msgstr ""
+
+#. :TGO:768:
+#: ../zypp/CountryCode.cc:426
+msgid "Thailand"
+msgstr ""
+
+#. :THA:764:
+#: ../zypp/CountryCode.cc:427
+msgid "Tajikistan"
+msgstr ""
+
+#. :TKL:772:
+#: ../zypp/CountryCode.cc:429
+msgid "Turkmenistan"
+msgstr ""
+
+#. :TKM:795:
+#: ../zypp/CountryCode.cc:430
+msgid "Tunisia"
+msgstr ""
+
+#. :TUN:788:
+#: ../zypp/CountryCode.cc:431
+msgid "Tonga"
+msgstr ""
+
+#. :TON:776:
+#: ../zypp/CountryCode.cc:432
+msgid "East Timor"
+msgstr ""
+
+#. :TLS:626:
+#: ../zypp/CountryCode.cc:433
+msgid "Turkey"
+msgstr ""
+
+#. :TUR:792:
+#: ../zypp/CountryCode.cc:434
+msgid "Trinidad and Tobago"
+msgstr ""
+
+#. :TUV:798:
+#: ../zypp/CountryCode.cc:436
+msgid "Taiwan"
+msgstr ""
+
+#. :TWN:158:
+#: ../zypp/CountryCode.cc:437
+msgid "Tanzania"
+msgstr ""
+
+#. :TZA:834:
+#: ../zypp/CountryCode.cc:438
+msgid "Ukraine"
+msgstr ""
+
+#. :UKR:804:
+#: ../zypp/CountryCode.cc:439
+msgid "Uganda"
+msgstr ""
+
+#. :UGA:800:
+#: ../zypp/CountryCode.cc:440
+msgid "United States Minor Outlying Islands"
+msgstr ""
+
+#. :UMI:581:
+#: ../zypp/CountryCode.cc:441
+msgid "United States"
+msgstr ""
+
+#. :USA:840:
+#: ../zypp/CountryCode.cc:442
+msgid "Uruguay"
+msgstr ""
+
+#. :URY:858:
+#: ../zypp/CountryCode.cc:443
+msgid "Uzbekistan"
+msgstr ""
+
+#. :UZB:860:
+#: ../zypp/CountryCode.cc:444
+msgid "Holy See (Vatican City State)"
+msgstr ""
+
+#. :VAT:336:
+#: ../zypp/CountryCode.cc:445
+msgid "Saint Vincent and the Grenadines"
+msgstr ""
+
+#. :VCT:670:
+#: ../zypp/CountryCode.cc:446
+msgid "Venezuela"
+msgstr ""
+
+#. :VEN:862:
+#: ../zypp/CountryCode.cc:447
+msgid "British Virgin Islands"
+msgstr ""
+
+#. :VGB:092:
+#: ../zypp/CountryCode.cc:448
+msgid "Virgin Islands, U.S."
+msgstr ""
+
+#. :VIR:850:
+#: ../zypp/CountryCode.cc:449
+msgid "Vietnam"
+msgstr ""
+
+#. :VNM:704:
+#: ../zypp/CountryCode.cc:450
+msgid "Vanuatu"
+msgstr ""
+
+#. :VUT:548:
+#: ../zypp/CountryCode.cc:451
+msgid "Wallis and Futuna"
+msgstr ""
+
+#. :WLF:876:
+#: ../zypp/CountryCode.cc:452
+msgid "Samoa"
+msgstr ""
+
+#. :WSM:882:
+#: ../zypp/CountryCode.cc:453
+msgid "Yemen"
+msgstr ""
+
+#. :YEM:887:
+#: ../zypp/CountryCode.cc:454
+msgid "Mayotte"
+msgstr ""
+
+#. :MYT:175:
+#: ../zypp/CountryCode.cc:455
+msgid "South Africa"
+msgstr ""
+
+#. :ZAF:710:
+#: ../zypp/CountryCode.cc:456
+msgid "Zambia"
+msgstr ""
+
+#. :ZMB:894:
+#: ../zypp/CountryCode.cc:457
+msgid "Zimbabwe"
+msgstr ""
+
+#: ../devel/devel.mvidner/installation_sources.cc:56
+#, c-format
+msgid ""
+"File %s is not signed.\n"
+"Use it anyway?"
+msgstr ""
+
+#: ../devel/devel.mvidner/installation_sources.cc:65
+#, c-format
+msgid ""
+"File %s is signed with an unknown key:\n"
+"%s|%s|%s\n"
+"Use the file anyway?"
+msgstr ""
+
+#: ../devel/devel.mvidner/installation_sources.cc:75
+#, c-format
+msgid ""
+"Untrusted key found:\n"
+"%s|%s|%s\n"
+"Trust key?"
+msgstr ""
+
+#: ../devel/devel.mvidner/installation_sources.cc:85
+#, c-format
+msgid ""
+"File %s failed integrity check with the folowing key:\n"
+"%s|%s|%s\n"
+"Use the file anyway?"
+msgstr ""
+
+#: ../devel/devel.mvidner/installation_sources.cc:99
+#, c-format
+msgid ""
+"File %s does not have a checksum.\n"
+"Use the file anyway?"
+msgstr ""
+
+#: ../devel/devel.mvidner/installation_sources.cc:108
+#, c-format
+msgid ""
+"File %s has an unknown checksum %s.\n"
+"Use the file anyway?"
+msgstr ""
+
+#: ../devel/devel.mvidner/installation_sources.cc:117
+#, c-format
+msgid ""
+"File %s has an invalid checksum.\n"
+"Expected %s, found %s\n"
+"Use the file anyway?"
+msgstr ""
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/tests/cache/CacheStore_test.cc new/libzypp-3.22.1/tests/cache/CacheStore_test.cc
--- old/libzypp-3.22.1/tests/cache/CacheStore_test.cc 2007-09-03 17:18:13.000000000 +0200
+++ new/libzypp-3.22.1/tests/cache/CacheStore_test.cc 2007-09-07 14:53:33.000000000 +0200
@@ -387,6 +387,45 @@
check_tables_clean(tmpdir);
}
+/**
+ * \short Test that a susetags repo reads shared attributes
+ */
+void cache_write_shared_attributes(const Pathname &repodir)
+{
+ ZConfig::instance().overrideSystemArchitecture( Arch( "x86_64" ) );
+ data::RecordId repository_id;
+ filesystem::TmpDir tmpdir;
+ string alias = "novell.com";
+ write_susetags_repo( alias, repodir, tmpdir );
+
+ ResStore dbres = get_resolvables( alias, tmpdir);;
+ //read_resolvables( alias, tmpdir, std::inserter(dbres, dbres.end()));
+ MIL << dbres.size() << " resolvables" << endl;
+
+ // 2 packages and a product
+ BOOST_CHECK_EQUAL( dbres.size(), (unsigned)3);
+
+ for ( ResStore::const_iterator it = dbres.begin();
+ it != dbres.end();
+ ++it )
+ {
+ MIL << *it << endl;
+ if ( isKind<Package>(*it) )
+ {
+ Package::Ptr p = asKind<Package>(*it);
+ if ( (p->name() == "foo") && p->arch() == Arch("x86_64") )
+ {
+ BOOST_CHECK_EQUAL( p->description(), "This is the description");
+ }
+ if ( (p->name() == "foo") && p->arch() == Arch("i586") )
+ {
+ BOOST_CHECK_EQUAL( p->description(), "This is the description");
+ }
+ }
+ }
+ check_tables_clean(tmpdir);
+}
+
void cache_write_susetags_normal_test(const std::string &dir)
{
Pathname repodir = Pathname(dir) + "/repo/susetags/data/stable-x86-subset";
@@ -399,6 +438,12 @@
cache_write_susetags(repodir);
}
+void cache_write_shared_attributes_test(const std::string &dir)
+{
+ Pathname repodir = Pathname(dir) + "/repo/susetags/data/shared_attributes";
+ cache_write_shared_attributes(repodir);
+}
+
test_suite*
init_unit_test_suite( int argc, char *argv[] )
{
@@ -437,8 +482,8 @@
(std::string const*)params, params+1));
test->add(BOOST_PARAM_TEST_CASE(&cache_write_susetags_gz_test,
(std::string const*)params, params+1));
- //test->add(BOOST_PARAM_TEST_CASE(&cache_write_test2,
- // (std::string const*)params, params+1));
+ test->add(BOOST_PARAM_TEST_CASE(&cache_write_shared_attributes_test,
+ (std::string const*)params, params+1));
return test;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/content new/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/content
--- old/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/content 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/content 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,30 @@
+PRODUCT openSUSE-factory
+VERSION 10.3
+DISTPRODUCT SuSE-Linux-STABLE-X86
+DISTVERSION 10.2.42-factory
+VENDOR SUSE LINUX Products GmbH, Nuernberg, Germany
+RELNOTESURL http://www.suse.com/relnotes/i386/openSUSE/FACTORY/release-notes.rpm
+ARCH.x86_64 x86_64 i686 i586 i486 i386 noarch
+ARCH.i686 i686 i586 i486 i386 noarch
+ARCH.i586 i586 i486 i386 noarch
+ARCH.i486 i486 i386 noarch
+ARCH.i386 i386 noarch
+DEFAULTBASE i586
+REQUIRES openSUSE-release = 10.3 pattern:basesystem
+PROVIDES product:openSUSE = 10.2.42
+OBSOLETES product:SUSE_LINUX product:openSUSE <= 10.2
+LINGUAS cs da de en en_GB es fi fr hu it ja km nl nb pl pt_BR zh_CN zh_TW
+SHORTLABEL FACTORY
+LABEL openSUSE FACTORY 10.3
+LABEL.de openSUSE FACTORY 10.3
+EXTRAURLS http://download.opensuse.org/distribution/10.2/repo/oss/
+OPTIONALURLS http://download.opensuse.org/distribution/10.2/repo/non-oss/ http://download.opensuse.org/distribution/10.2/repo/debug/
+DESCRDIR suse/setup/descr
+DATADIR suse
+FLAGS update
+LANGUAGE en_US
+META SHA1 cec02abacb62fce2964a787d516879822691be6e packages
+META SHA1 2664997a3bae2679cf1395a81d54a7dd4532c276 packages.DU
+META SHA1 1c539c3fe4a8ec5fbe96ce3b559fc952124f9acd packages.en
+
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages new/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages
--- old/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,32 @@
+##----------------------------------------
+=Pkg: foo 1.0 1 i586
+=Cks: SHA1 05f0647241433d01636785fd282cc824a6527269
++Req:
+bar > 1.0
+-Req:
+=Grp: Bar
+=Lic: BSD License and BSD-like, GNU General Public License (GPL)
+=Src: foo 1.0 1 src
+=Tim: 1183399094
+=Loc: 1 foo-1.0-1.i586.rpm
+=Siz: 16356019 38850584
++Aut:
+Foo Bar
+-Aut:
+##----------------------------------------
+=Pkg: foo 1.0 1 x86_64
+=Cks: SHA1 05f0647241433d01636785fd282cc824a6527269
++Req:
+bar > 1.0
+-Req:
+=Grp: Bar
+=Lic: BSD License and BSD-like, GNU General Public License (GPL)
+=Src: foo 1.0 1 src
+=Tim: 1183399094
+=Loc: 1 foo-1.0-1.x86_64.rpm
+=Siz: 16356019 38850584
++Aut:
+Foo Bar
+-Aut:
+=Shr: foo 1.0 1 i586
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU new/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU
--- old/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,7 @@
+##----------------------------------------
+=Pkg: foo 1.0 1 i586
++Dir:
+/ 0 39444 0 3068
+usr/share/ 11 0 1 0
+-Dir:
+##----------------------------------------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en new/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en
--- old/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en 2007-09-07 14:53:33.000000000 +0200
@@ -0,0 +1,7 @@
+##----------------------------------------
+=Pkg: foo 1.0 1 i586
+=Sum: Foo program
++Des:
+This is the description
+-Des:
+##----------------------------------------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/tests/zypp/TranslatedText.cc new/libzypp-3.22.1/tests/zypp/TranslatedText.cc
--- old/libzypp-3.22.1/tests/zypp/TranslatedText.cc 2007-09-03 17:18:13.000000000 +0200
+++ new/libzypp-3.22.1/tests/zypp/TranslatedText.cc 2007-09-07 14:53:33.000000000 +0200
@@ -26,32 +26,32 @@
void test_tt()
{
ZYpp::Ptr god;
-
+
god = getZYpp();
-
+
TranslatedText testTT;
MIL << "Locale: en" << std::endl;
god->setTextLocale(Locale("en"));
testTT.setText("default");
MIL << "value: '" << testTT.text() << "'" << std::endl;
BOOST_CHECK_EQUAL( testTT.text(), "default" );
-
+
testTT.setText("default english", Locale("en"));
BOOST_CHECK_EQUAL( testTT.text(), "default english" );
-
+
MIL << "Locale: es_ES" << std::endl;
god->setTextLocale(Locale("es_ES"));
-
+
BOOST_CHECK_EQUAL( testTT.text(), "default english" );
-
+
testTT.setText("hola esto es neutro", Locale("es"));
testTT.setText("this is neutral", Locale("en"));
-
+
BOOST_CHECK_EQUAL( testTT.text(), "hola esto es neutro" );
-
+
testTT.setText("hola Spain", Locale("es_ES"));
BOOST_CHECK_EQUAL( testTT.text(), "hola Spain" );
-
+
MIL << "Locale: null" << std::endl;
god->setTextLocale(Locale());
BOOST_CHECK_EQUAL( testTT.text(), "default" );
@@ -63,4 +63,4 @@
test_suite* test= BOOST_TEST_SUITE( "TranslatedText" );
test->add( BOOST_TEST_CASE( &test_tt ), 0 /* expected zero error */ );
return test;
-}
\ No newline at end of file
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/CMakeLists.txt.bak new/libzypp-3.22.1/zypp/CMakeLists.txt.bak
--- old/libzypp-3.22.1/zypp/CMakeLists.txt.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/CMakeLists.txt.bak 2007-09-07 14:53:30.000000000 +0200
@@ -0,0 +1,1166 @@
+####################################################################
+# SOURCES #
+####################################################################
+
+ADD_DEFINITIONS(-DLOCALEDIR=\\\"/usr/share/libzypp\\\" -DTEXTDOMAIN=\\\"zypp\\\" )
+
+ADD_EXECUTABLE(mkarray ${CMAKE_SOURCE_DIR}/zypp/cache/schema/mkarray.c )
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+#FILE(WRITE filename "message to write"... )
+
+ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_BINARY_DIR}/zypp/sqlite-schema.h PRE_BUILD COMMAND "${CMAKE_BINARY_DIR}/zypp/mkarray" ARGS "${CMAKE_SOURCE_DIR}/zypp/cache/schema/schema.sql" "schemaData" "${CMAKE_BINARY_DIR}/zypp/sqlite-schema.h" DEPENDS mkarray DEPENDS ${CMAKE_SOURCE_DIR}/zypp/cache/schema/schema.sql )
+
+SET( zypp_SRCS
+ ZConfig.cc
+ LanguageCode.cc
+ Arch.cc
+ Atom.cc
+ ByteCount.cc
+ Capability.cc
+ CapFactory.cc
+ CapMatch.cc
+ CapSet.cc
+ CheckSum.cc
+ CountryCode.cc
+ Date.cc
+ Dep.cc
+ Dependencies.cc
+ Edition.cc
+ Language.cc
+ Locale.cc
+ NVR.cc
+ NVRA.cc
+ NVRAD.cc
+ Range.cc
+ Rel.cc
+ ResObject.cc
+ SystemResObject.cc
+ Resolvable.cc
+ ResTraits.cc
+ ResStatus.cc
+ ResStore.cc
+ PoolItem.cc
+ ResPool.cc
+ NameKindProxy.cc
+ ResPoolProxy.cc
+ ResPoolManager.cc
+ Resolver.cc
+ ResolverProblem.cc
+ ProblemSolution.cc
+ Package.cc
+ Pathname.cc
+ ProgressData.cc
+ SrcPackage.cc
+ SysContent.cc
+ Target.cc
+ Selection.cc
+ Pattern.cc
+ Message.cc
+ Script.cc
+ Patch.cc
+ Product.cc
+ Changelog.cc
+ ExternalProgram.cc
+ PathInfo.cc
+ Digest.cc
+ Url.cc
+ TmpPath.cc
+ DiskUsage.cc
+ DiskUsageCounter.cc
+ VendorAttr.cc
+ UpgradeStatistics.cc
+ ZYpp.cc
+ ZYppCommitPolicy.cc
+ ZYppCommitResult.cc
+ TranslatedText.cc
+ ZYppFactory.cc
+ PublicKey.cc
+ Signature.cc
+ KeyRing.cc
+ MediaSetAccess.cc
+ ProvideFilePolicy.cc
+ OnMediaLocation.cc
+ Fetcher.cc
+ FileChecker.cc
+ Repository.cc
+ RepoInfo.cc
+ RepoStatus.cc
+ RepoManager.cc
+ MediaProducts.cc
+ Locks.cc
+)
+
+SET( zypp_HEADERS
+ ZConfig.h
+ Arch.h
+ Atom.h
+ AutoDispose.h
+ Bit.h
+ ByteCount.h
+ Callback.h
+ CapAndItem.h
+ CapFactory.h
+ CapFilters.h
+ CapMatch.h
+ CapMatchHelper.h
+ CapSet.h
+ CapSetFwd.h
+ Capability.h
+ Changelog.h
+ CheckSum.h
+ CountryCode.h
+ Date.h
+ Dep.h
+ Dependencies.h
+ Digest.h
+ DiskUsage.h
+ DiskUsageCounter.h
+ Edition.h
+ ExternalProgram.h
+ Fetcher.h
+ KVMap.h
+ KeyRing.h
+ Language.h
+ LanguageCode.h
+ Locale.h
+ ManagedFile.h
+ MediaSetAccess.h
+ Message.h
+ NVR.h
+ NVRA.h
+ NVRAD.h
+ NameKindProxy.h
+ NeedAType.h
+ OnMediaLocation.h
+ Package.h
+ PackageKeyword.h
+ Patch.h
+ PathInfo.h
+ Pathname.h
+ ProgressData.h
+ Pattern.h
+ PoolItem.h
+ ProblemSolution.h
+ ProblemTypes.h
+ Product.h
+ ProvideFilePolicy.h
+ PublicKey.h
+ Range.h
+ Rel.h
+ RelCompare.h
+ ResFilters.h
+ ResObject.h
+ ResPool.h
+ ResPoolManager.h
+ ResPoolProxy.h
+ ResStatus.h
+ ResStore.h
+ ResTraits.h
+ Resolvable.h
+ Resolver.h
+ ResolverProblem.h
+ Script.h
+ Selection.h
+ Signature.h
+ SilentCallbacks.h
+ SrcPackage.h
+ SysContent.h
+ SystemResObject.h
+ Target.h
+ TmpPath.h
+ TranslatedText.h
+ TriBool.h
+ UpgradeStatistics.h
+ Url.h
+ VendorAttr.h
+ ZYpp.h
+ ZYppCallbacks.h
+ ZYppCommit.h
+ ZYppCommitPolicy.h
+ ZYppCommitResult.h
+ ZYppFactory.h
+ FileChecker.h
+ Repository.h
+ RepoInfo.h
+ RepoStatus.h
+ RepoManager.h
+ MediaProducts.h
+ Locks.h
+)
+
+INSTALL( FILES ${zypp_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/zypp" )
+
+SET( zypp_base_SRCS
+ base/SerialNumber.cc
+ base/Random.cc
+ base/Measure.cc
+ base/Fd.cc
+ base/Gettext.cc
+ base/GzStream.cc
+ base/IOStream.cc
+ base/InputStream.cc
+ base/ReferenceCounted.cc
+ base/String.cc
+ base/Regex.cc
+ base/Unit.cc
+ base/ExternalDataSource.cc
+ base/Exception.cc
+ base/UserRequestException.cc
+ base/Sysconfig.cc
+ base/ProfilingFormater.cc
+ base/LogControl.cc
+)
+
+SET( zypp_base_HEADERS
+ base/SerialNumber.h
+ base/Easy.h
+ base/Random.h
+ base/Algorithm.h
+ base/Counter.h
+ base/Debug.h
+ base/DefaultFalseBool.h
+ base/DefaultIntegral.h
+ base/Deprecated.h
+ base/DtorReset.h
+ base/Exception.h
+ base/UserRequestException.h
+ base/ExternalDataSource.h
+ base/Fd.h
+ base/Function.h
+ base/Functional.h
+ base/Gettext.h
+ base/GzStream.h
+ base/Hash.h
+ base/IOStream.h
+ base/InputStream.h
+ base/Iterator.h
+ base/KindOf.h
+ base/LogControl.h
+ base/LogTools.h
+ base/Logger.h
+ base/Measure.h
+ base/NonCopyable.h
+ base/ProfilingFormater.h
+ base/ProvideNumericId.h
+ base/PtrTypes.h
+ base/ReferenceCounted.h
+ base/SafeBool.h
+ base/String.h
+ base/Regex.h
+ base/Sysconfig.h
+ base/UniqueString.h
+ base/Unit.h
+ base/WatchFile.h
+)
+
+INSTALL( FILES
+ ${zypp_base_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/base
+)
+
+SET( zypp_capability_SRCS
+ capability/CapTraits.cc
+ capability/CapabilityImpl.cc
+ capability/FileCap.cc
+ capability/HalCap.cc
+ capability/ModaliasCap.cc
+ capability/FilesystemCap.cc
+ capability/NamedCap.cc
+ capability/NullCap.cc
+ capability/SplitCap.cc
+ capability/VersionedCap.cc
+)
+
+SET( zypp_capability_HEADERS
+ capability/CapTraits.h
+ capability/Capabilities.h
+ capability/CapabilityImpl.h
+ capability/ConditionalCap.h
+ capability/FileCap.h
+ capability/HalCap.h
+ capability/ModaliasCap.h
+ capability/FilesystemCap.h
+ capability/NamedCap.h
+ capability/NullCap.h
+ capability/OrCap.h
+ capability/SplitCap.h
+ capability/VersionedCap.h
+)
+
+INSTALL( FILES
+ ${zypp_capability_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/capability
+)
+
+SET( zypp_data_SRCS
+ data/ResolvableData.cc
+ data/RecordId.cc
+ data/ResolvableDataConsumer.cc
+)
+
+SET( zypp_data_HEADERS
+ data/ResolvableData.h
+ data/RecordId.h
+ data/ResolvableDataConsumer.h
+)
+
+INSTALL( FILES
+ ${zypp_data_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/data
+)
+
+SET( zypp_detail_SRCS
+ detail/AtomImpl.cc
+ detail/AtomImplIf.cc
+ detail/MessageImpl.cc
+ detail/MessageImplIf.cc
+ detail/PackageImpl.cc
+ detail/PackageImplIf.cc
+ detail/PatchImpl.cc
+ detail/PatchImplIf.cc
+ detail/PatternImpl.cc
+ detail/PatternImplIf.cc
+ detail/ProductImpl.cc
+ detail/ProductImplIf.cc
+ detail/ResObjectImplIf.cc
+ detail/ResolvableImpl.cc
+ detail/ScriptImpl.cc
+ detail/ScriptImplIf.cc
+ detail/SelectionImpl.cc
+ detail/SelectionImplIf.cc
+ detail/SrcPackageImpl.cc
+ detail/SrcPackageImplIf.cc
+)
+
+SET( zypp_detail_HEADERS
+ detail/AtomImpl.h
+ detail/AtomImplIf.h
+ detail/ImplConnect.h
+ detail/MessageImpl.h
+ detail/MessageImplIf.h
+ detail/PackageImpl.h
+ detail/PackageImplIf.h
+ detail/PatchImpl.h
+ detail/PatchImplIf.h
+ detail/PatternImpl.h
+ detail/PatternImplIf.h
+ detail/ProductImpl.h
+ detail/ProductImplIf.h
+ detail/ResImplTraits.h
+ detail/ResObjectFactory.h
+ detail/ResObjectImplIf.h
+ detail/ResolvableImpl.h
+ detail/ScriptImpl.h
+ detail/ScriptImplIf.h
+ detail/SelectionImpl.h
+ detail/SelectionImplIf.h
+ detail/SrcPackageImpl.h
+ detail/SrcPackageImplIf.h
+)
+
+INSTALL( FILES
+ ${zypp_detail_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/detail
+)
+
+SET( zypp_media_SRCS
+ media/MediaException.cc
+ media/MediaAccess.cc
+ media/MediaHandler.cc
+ media/Mount.cc
+ media/MediaNFS.cc
+ media/MediaCD.cc
+ media/MediaDIR.cc
+ media/MediaDISK.cc
+ media/MediaSMB.cc
+ media/MediaCIFS.cc
+ media/ProxyInfo.cc
+ media/MediaCurl.cc
+ media/MediaISO.cc
+ media/MediaManager.cc
+ media/MediaUserAuth.cc
+)
+
+SET( zypp_media_HEADERS
+ media/MediaAccess.h
+ media/MediaCD.h
+ media/MediaCIFS.h
+ media/MediaCurl.h
+ media/MediaDIR.h
+ media/MediaDISK.h
+ media/MediaException.h
+ media/MediaHandler.h
+ media/MediaISO.h
+ media/MediaManager.h
+ media/MediaNFS.h
+ media/MediaSMB.h
+ media/MediaSource.h
+ media/MediaUserAuth.h
+ media/Mount.h
+ media/ProxyInfo.h
+)
+
+INSTALL( FILES
+ ${zypp_media_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/media
+)
+
+SET( zypp_media_proxyinfo_SRCS
+ media/proxyinfo/ProxyInfoSysconfig.cc
+)
+
+SET( zypp_media_proxyinfo_HEADERS
+ media/proxyinfo/ProxyInfoImpl.h
+ media/proxyinfo/ProxyInfoSysconfig.h
+ media/proxyinfo/ProxyInfos.h
+)
+
+INSTALL( FILES
+ ${zypp_media_proxyinfo_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/media/proxyinfo
+)
+
+SET( zypp_parser_SRCS
+ parser/ParseException.cc
+ parser/TagParser.cc
+ parser/IniParser.cc
+ parser/IniDict.cc
+ parser/LibXMLHelper.cc
+ parser/XMLNodeIterator.cc
+ parser/RepoFileReader.cc
+)
+
+SET( zypp_parser_HEADERS
+ parser/ParseException.h
+ parser/TagParser.h
+ parser/IniParser.h
+ parser/IniDict.h
+ parser/LibXMLHelper.h
+ parser/ParserProgress.h
+ parser/XMLNodeIterator.h
+ parser/xml_parser_assert.h
+ parser/RepoFileReader.h
+)
+
+INSTALL( FILES
+ ${zypp_parser_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser
+)
+
+SET( zypp_parser_susetags_SRCS
+ parser/susetags/RepoIndex.cc
+ parser/susetags/ContentFileReader.cc
+ parser/susetags/PackagesFileReader.cc
+ parser/susetags/PackagesLangFileReader.cc
+ parser/susetags/PackagesDuFileReader.cc
+ parser/susetags/PatternFileReader.cc
+ parser/susetags/RepoParser.cc
+)
+
+SET( zypp_parser_susetags_HEADERS
+ parser/susetags/RepoIndex.h
+ parser/susetags/ContentFileReader.h
+ parser/susetags/FileReaderBase.h
+ parser/susetags/FileReaderBaseImpl.h
+ parser/susetags/PackagesFileReader.h
+ parser/susetags/PackagesLangFileReader.h
+ parser/susetags/PackagesDuFileReader.h
+ parser/susetags/PatternFileReader.h
+ parser/susetags/RepoParser.h
+)
+
+INSTALL( FILES
+ ${zypp_parser_susetags_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/susetags
+)
+
+SET( zypp_parser_plaindir_SRCS
+ parser/plaindir/RepoParser.cc
+)
+
+SET( zypp_parser_plaindir_HEADERS
+ parser/plaindir/RepoParser.h
+)
+
+INSTALL( FILES
+ ${zypp_parser_plaindir_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/plaindir
+)
+
+SET( zypp_parser_xml_SRCS
+ parser/xml/Node.cc
+ parser/xml/ParseDef.cc
+ parser/xml/ParseDefConsume.cc
+ parser/xml/ParseDefException.cc
+ parser/xml/Reader.cc
+ parser/xml/XmlString.cc
+ parser/xml/libxmlfwd.cc
+)
+
+SET( zypp_parser_xml_HEADERS
+ parser/xml/Node.h
+ parser/xml/ParseDef.h
+ parser/xml/ParseDefConsume.h
+ parser/xml/ParseDefException.h
+ parser/xml/ParseDefTraits.h
+ parser/xml/Reader.h
+ parser/xml/XmlString.h
+ parser/xml/libxmlfwd.h
+)
+
+INSTALL( FILES
+ ${zypp_parser_xml_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/xml
+)
+
+SET( zypp_parser_xmlstore_SRCS
+ parser/xmlstore/XMLLanguageParser.cc
+ parser/xmlstore/XMLParserData.cc
+ parser/xmlstore/XMLPatchParser.cc
+ parser/xmlstore/XMLPatternParser.cc
+ parser/xmlstore/XMLProductParser.cc
+ parser/xmlstore/XMLResObjectParser.cc
+ parser/xmlstore/XMLSourceCacheParser.cc
+)
+
+SET( zypp_parser_xmlstore_HEADERS
+ parser/xmlstore/XMLLanguageParser.h
+ parser/xmlstore/XMLParserData.h
+ parser/xmlstore/XMLPatchParser.h
+ parser/xmlstore/XMLPatternParser.h
+ parser/xmlstore/XMLProductParser.h
+ parser/xmlstore/XMLResObjectParser.h
+ parser/xmlstore/XMLSourceCacheParser.h
+ parser/xmlstore/schemanames.h
+)
+
+INSTALL( FILES
+ ${zypp_parser_xmlstore_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/xmlstore
+)
+
+SET( zypp_parser_yum_SRCS
+ parser/yum/RepoParser.cc
+ parser/yum/FileReaderBaseImpl.cc
+ parser/yum/RepomdFileReader.cc
+ parser/yum/PatchesFileReader.cc
+ parser/yum/PrimaryFileReader.cc
+ parser/yum/OtherFileReader.cc
+ parser/yum/FilelistsFileReader.cc
+ parser/yum/PatchFileReader.cc
+ parser/yum/PatternFileReader.cc
+ parser/yum/ProductFileReader.cc
+)
+
+SET( zypp_parser_yum_HEADERS
+ parser/yum/RepoParser.h
+ parser/yum/RepoParserOpts.h
+ parser/yum/FileReaderBase.h
+ parser/yum/FileReaderBaseImpl.h
+ parser/yum/RepomdFileReader.h
+ parser/yum/PatchesFileReader.h
+ parser/yum/PrimaryFileReader.h
+ parser/yum/OtherFileReader.h
+ parser/yum/FilelistsFileReader.h
+ parser/yum/PatchFileReader.h
+ parser/yum/PatternFileReader.h
+ parser/yum/ProductFileReader.h
+ parser/yum/schemanames.h
+)
+
+INSTALL( FILES
+ ${zypp_parser_yum_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/yum
+)
+
+SET( zypp_pool_SRCS
+ pool/GetResolvablesToInsDel.cc
+ pool/PoolImpl.cc
+ pool/PoolStats.cc
+)
+
+SET( zypp_pool_HEADERS
+ pool/GetResolvablesToInsDel.h
+ pool/PoolImpl.h
+ pool/PoolStats.h
+ pool/PoolTraits.h
+)
+
+INSTALL( FILES
+ ${zypp_pool_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/pool
+)
+
+SET( zypp_solver_detail_SRCS
+ solver/detail/Helper.cc
+ solver/detail/Importance.cc
+ solver/detail/InstallOrder.cc
+ solver/detail/Pending.cc
+ solver/detail/ProblemSolutionIgnore.cc
+ solver/detail/ProblemSolutionInstall.cc
+ solver/detail/ProblemSolutionKeep.cc
+ solver/detail/ProblemSolutionUninstall.cc
+ solver/detail/ProblemSolutionUnlock.cc
+ solver/detail/ProblemSolutionAllBranches.cc
+ solver/detail/QueueItem.cc
+ solver/detail/QueueItemBranch.cc
+ solver/detail/QueueItemConflict.cc
+ solver/detail/QueueItemEstablish.cc
+ solver/detail/QueueItemGroup.cc
+ solver/detail/QueueItemInstall.cc
+ solver/detail/QueueItemRequire.cc
+ solver/detail/QueueItemUninstall.cc
+ solver/detail/Resolver.cc
+ solver/detail/ResolverContext.cc
+ solver/detail/ResolverInfo.cc
+ solver/detail/ResolverInfoChildOf.cc
+ solver/detail/ResolverInfoConflictsWith.cc
+ solver/detail/ResolverInfoContainer.cc
+ solver/detail/ResolverInfoDependsOn.cc
+ solver/detail/ResolverInfoMisc.cc
+ solver/detail/ResolverInfoMissingReq.cc
+ solver/detail/ResolverInfoNeededBy.cc
+ solver/detail/ResolverInfoObsoletes.cc
+ solver/detail/ResolverQueue.cc
+ solver/detail/ResolverUpgrade.cc
+ solver/detail/Resolver_problems.cc
+ solver/detail/SolutionAction.cc
+ solver/detail/Testcase.cc
+ solver/detail/ContextPool.cc
+)
+
+SET( zypp_solver_detail_HEADERS
+ solver/detail/Helper.h
+ solver/detail/Importance.h
+ solver/detail/InstallOrder.h
+ solver/detail/Pending.h
+ solver/detail/ProblemSolutionIgnore.h
+ solver/detail/ProblemSolutionInstall.h
+ solver/detail/ProblemSolutionKeep.h
+ solver/detail/ProblemSolutionUninstall.h
+ solver/detail/ProblemSolutionUnlock.h
+ solver/detail/ProblemSolutionAllBranches.h
+ solver/detail/QueueItem.h
+ solver/detail/QueueItemBranch.h
+ solver/detail/QueueItemConflict.h
+ solver/detail/QueueItemEstablish.h
+ solver/detail/QueueItemGroup.h
+ solver/detail/QueueItemInstall.h
+ solver/detail/QueueItemRequire.h
+ solver/detail/QueueItemUninstall.h
+ solver/detail/Resolver.h
+ solver/detail/ResolverContext.h
+ solver/detail/ResolverInfo.h
+ solver/detail/ResolverInfoChildOf.h
+ solver/detail/ResolverInfoConflictsWith.h
+ solver/detail/ResolverInfoContainer.h
+ solver/detail/ResolverInfoDependsOn.h
+ solver/detail/ResolverInfoMisc.h
+ solver/detail/ResolverInfoMissingReq.h
+ solver/detail/ResolverInfoNeededBy.h
+ solver/detail/ResolverInfoObsoletes.h
+ solver/detail/ResolverQueue.h
+ solver/detail/SolutionAction.h
+ solver/detail/Testcase.h
+ solver/detail/Types.h
+ solver/detail/ContextPool.h
+)
+
+INSTALL( FILES
+ ${zypp_solver_detail_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/solver/detail
+)
+
+SET( zypp_target_SRCS
+ target/CommitLog.cc
+ target/CommitPackageCache.cc
+ target/CommitPackageCacheImpl.cc
+ target/CommitPackageCacheReadAhead.cc
+ target/TargetCallbackReceiver.cc
+ target/TargetException.cc
+ target/TargetImpl.cc
+)
+
+SET( zypp_target_HEADERS
+ target/CommitLog.h
+ target/CommitPackageCache.h
+ target/CommitPackageCacheImpl.h
+ target/CommitPackageCacheReadAhead.h
+ target/TargetCallbackReceiver.h
+ target/TargetException.h
+ target/TargetImpl.h
+)
+
+INSTALL( FILES
+ ${zypp_target_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target
+)
+
+SET( zypp_target_hal_SRCS
+ target/hal/Hal.cc
+ target/hal/HalContext.cc
+)
+
+SET( zypp_target_hal_HEADERS
+ target/hal/Hal.h
+ target/hal/HalContext.h
+ target/hal/HalException.h
+)
+
+INSTALL( FILES
+ ${zypp_target_hal_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target/hal
+)
+
+SET( zypp_target_modalias_SRCS
+ target/modalias/Modalias.cc
+)
+
+SET( zypp_target_modalias_HEADERS
+ target/modalias/Modalias.h
+)
+
+INSTALL( FILES
+ ${zypp_target_modalias_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target/modalias
+)
+
+SET( zypp_target_rpm_SRCS
+ target/rpm/BinHeader.cc
+ target/rpm/RpmCallbacks.cc
+ target/rpm/RpmDb.cc
+ target/rpm/RpmException.cc
+ target/rpm/RpmHeader.cc
+ target/rpm/RpmPackageImpl.cc
+ target/rpm/librpmDb.cc
+ target/rpm/librpmDb.cv3.cc
+)
+
+SET( zypp_target_rpm_HEADERS
+ target/rpm/BinHeader.h
+ target/rpm/RpmCallbacks.h
+ target/rpm/RpmDb.h
+ target/rpm/RpmException.h
+ target/rpm/RpmHeader.h
+ target/rpm/RpmPackageImpl.h
+ target/rpm/librpm.h
+ target/rpm/librpmDb.h
+)
+
+INSTALL( FILES
+ ${zypp_target_rpm_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target/rpm
+)
+
+SET( zypp_target_store_SRCS
+ target/store/Backend.cc
+ target/store/PersistentStorage.cc
+ target/store/XMLFilesBackend.cc
+ target/store/serialize.cc
+ target/store/xml_escape_parser.cpp
+)
+
+SET( zypp_target_store_HEADERS
+ target/store/Backend.h
+ target/store/PersistentStorage.h
+ target/store/XMLFilesBackend.h
+ target/store/parser_utils.hpp
+ target/store/serialize.h
+ target/store/xml_escape_parser.hpp
+)
+
+INSTALL( FILES
+ ${zypp_target_store_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target/store
+)
+
+SET( zypp_target_store_xml_SRCS
+ target/store/xml/XMLAtomImpl.cc
+ target/store/xml/XMLMessageImpl.cc
+ target/store/xml/XMLPatchImpl.cc
+ target/store/xml/XMLPatternImpl.cc
+ target/store/xml/XMLProductImpl.cc
+ target/store/xml/XMLScriptImpl.cc
+ target/store/xml/XMLSelectionImpl.cc
+)
+
+SET( zypp_target_store_xml_HEADERS
+ target/store/xml/XMLAtomImpl.h
+ target/store/xml/XMLMessageImpl.h
+ target/store/xml/XMLPatchImpl.h
+ target/store/xml/XMLPatternImpl.h
+ target/store/xml/XMLProductImpl.h
+ target/store/xml/XMLScriptImpl.h
+ target/store/xml/XMLSelectionImpl.h
+)
+
+INSTALL( FILES
+ ${zypp_target_store_xml_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target/store/xml
+)
+
+SET( zypp_thread_SRCS
+ thread/Mutex.cc
+)
+
+SET( zypp_thread_HEADERS
+ thread/Mutex.h
+ thread/MutexException.h
+ thread/MutexLock.h
+ thread/Once.h
+)
+
+INSTALL( FILES
+ ${zypp_thread_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/thread
+)
+
+SET( zypp_ui_SRCS
+ ui/PatchContents.cc
+ ui/PatchContentsImpl.cc
+ ui/PatternContents.cc
+ ui/PatternContentsImpl.cc
+ ui/PatternExpander.cc
+ ui/Selectable.cc
+ ui/SelectableImpl.cc
+ ui/Status.cc
+ ui/UserWantedPackages.cc
+)
+
+SET( zypp_ui_HEADERS
+ ui/PatchContents.h
+ ui/PatchContentsImpl.h
+ ui/PatternContents.h
+ ui/PatternContentsImpl.h
+ ui/PatternExpander.h
+ ui/SelFilters.h
+ ui/Selectable.h
+ ui/SelectableImpl.h
+ ui/SelectableTraits.h
+ ui/Status.h
+ ui/UserWantedPackages.h
+)
+
+INSTALL( FILES
+ ${zypp_ui_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/ui
+)
+
+SET( zypp_url_SRCS
+ url/UrlUtils.cc
+ url/UrlBase.cc
+)
+
+SET( zypp_url_HEADERS
+ url/UrlBase.h
+ url/UrlException.h
+ url/UrlUtils.h
+)
+
+INSTALL( FILES
+ ${zypp_url_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/url
+)
+
+SET( zypp_zypp_detail_SRCS
+ zypp_detail/ZYppImpl.cc
+)
+
+SET( zypp_zypp_detail_HEADERS
+ zypp_detail/ZYppImpl.h
+ zypp_detail/ZYppReadOnlyHack.h
+)
+
+INSTALL( FILES
+ ${zypp_zypp_detail_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/zypp_detail
+)
+
+SET( zypp_cache_SRCS
+ ${CMAKE_BINARY_DIR}/zypp/sqlite-schema.h
+ cache/CacheInitializer.cc
+ cache/CacheException.cc
+ cache/Attribute.cc
+ cache/CacheTypes.cc
+ cache/ResolvableQuery.cc
+ cache/CacheStore.cc
+ cache/CacheFSCK.cc
+ cache/Utils.cc
+)
+
+SET( zypp_cache_HEADERS
+ cache/Attribute.h
+ cache/CacheAttributes.h
+ cache/CacheTypes.h
+ cache/CacheInitializer.h
+ cache/CacheException.h
+ cache/CacheStore.h
+ cache/CacheFSCK.h
+ cache/ResolvableQuery.h
+ cache/Utils.h
+)
+
+INSTALL( FILES
+ ${zypp_cache_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/cache
+)
+
+SET( zypp_cache_sqlite3x_SRCS
+ cache/sqlite3x/sqlite3x_command.cpp
+ cache/sqlite3x/sqlite3x_connection.cpp
+ cache/sqlite3x/sqlite3x_exception.cpp
+ cache/sqlite3x/sqlite3x_reader.cpp
+ cache/sqlite3x/sqlite3x_transaction.cpp
+)
+
+SET( zypp_cache_sqlite3x_HEADERS
+ cache/sqlite3x/sqlite3x.hpp
+)
+
+#INSTALL( FILES
+# ${zypp_cache_sqlite3x_HEADERS}
+# DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/cache/sqlite3x
+#)
+
+SET( zypp_repo_SRCS
+ repo/dummy.cc
+ repo/RepositoryImpl.cc
+ repo/RepoException.cc
+ repo/RepoType.cc
+ repo/PackageProvider.cc
+ repo/SrcPackageProvider.cc
+ repo/ScriptProvider.cc
+ repo/RepoProvideFile.cc
+ repo/DeltaCandidates.cc
+ repo/Applydeltarpm.cc
+ repo/PackageDelta.cc
+ repo/SUSEMediaVerifier.cc
+ repo/MediaInfoDownloader.cc
+ repo/Downloader.cc
+ repo/RepoVariables.cc
+)
+
+SET( zypp_repo_HEADERS
+ repo/RepositoryImpl.h
+ repo/RepoException.h
+ repo/RepoType.h
+ repo/PackageProvider.h
+ repo/SrcPackageProvider.h
+ repo/ScriptProvider.h
+ repo/RepoProvideFile.h
+ repo/DeltaCandidates.h
+ repo/Applydeltarpm.h
+ repo/PackageDelta.h
+ repo/SUSEMediaVerifier.h
+ repo/MediaInfoDownloader.h
+ repo/Downloader.h
+ repo/RepoVariables.h
+)
+
+INSTALL( FILES
+ ${zypp_repo_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/repo
+)
+
+SET( zypp_repo_cached_SRCS
+ repo/cached/RepoImpl.cc
+ repo/cached/PackageImpl.cc
+ repo/cached/SrcPackageImpl.cc
+ repo/cached/PatchImpl.cc
+ repo/cached/PatternImpl.cc
+ repo/cached/ProductImpl.cc
+ repo/cached/MessageImpl.cc
+ repo/cached/ScriptImpl.cc
+ repo/cached/AtomImpl.cc
+)
+
+SET( zypp_repo_cached_HEADERS
+ repo/cached/RepoImpl.h
+ repo/cached/PackageImpl.h
+ repo/cached/SrcPackageImpl.h
+ repo/cached/PatchImpl.h
+ repo/cached/PatternImpl.h
+ repo/cached/ProductImpl.h
+ repo/cached/MessageImpl.h
+ repo/cached/ScriptImpl.h
+ repo/cached/AtomImpl.h
+)
+
+SET( zypp_repo_yum_SRCS
+ repo/yum/Downloader.cc
+ repo/yum/ResourceType.cc
+)
+
+SET( zypp_repo_yum_HEADERS
+ repo/yum/Downloader.h
+ repo/yum/ResourceType.h
+)
+
+SET( zypp_repo_susetags_SRCS
+ repo/susetags/Downloader.cc
+)
+
+SET( zypp_repo_susetags_HEADERS
+ repo/susetags/Downloader.h
+)
+
+
+SET( zypp_repo_data_SRCS
+ repo/memory/ScriptImpl.cc
+ repo/memory/MessageImpl.cc
+ repo/memory/PackageImpl.cc
+ repo/memory/PatternImpl.cc
+ repo/memory/ProductImpl.cc
+ repo/memory/PatchImpl.cc
+ repo/memory/RepoImpl.cc
+ repo/memory/AtomImpl.cc
+ repo/memory/SrcPackageImpl.cc
+)
+
+SET( zypp_repo_data_HEADERS
+ repo/memory/PackageImpl.h
+ repo/memory/PatternImpl.h
+ repo/memory/ProductImpl.h
+ repo/memory/PatchImpl.h
+ repo/memory/RepoImpl.h
+ repo/memory/AtomImpl.h
+ repo/memory/SrcPackageImpl.h
+)
+
+SET( zypp_lib_SRCS
+${zypp_detail_SRCS}
+${zypp_capability_SRCS}
+${zypp_cache_SRCS}
+${zypp_cache_sqlite3x_SRCS}
+${zypp_pool_SRCS}
+${zypp_parser_susetags_SRCS}
+${zypp_parser_xmlstore_SRCS}
+${zypp_parser_xml_SRCS}
+${zypp_parser_yum_SRCS}
+${zypp_parser_plaindir_SRCS}
+${zypp_parser_SRCS}
+${zypp_data_SRCS}
+${zypp_media_proxyinfo_SRCS}
+${zypp_media_SRCS}
+${zypp_url_SRCS}
+${zypp_repo_SRCS}
+${zypp_repo_cached_SRCS}
+${zypp_repo_yum_SRCS}
+${zypp_repo_susetags_SRCS}
+${zypp_repo_data_SRCS}
+${zypp_target_store_xml_SRCS}
+${zypp_target_store_SRCS}
+${zypp_target_rpm_SRCS}
+${zypp_target_hal_SRCS}
+${zypp_target_modalias_SRCS}
+${zypp_target_SRCS}
+${zypp_solver_detail_SRCS}
+${zypp_ui_SRCS}
+${zypp_zypp_detail_SRCS}
+${zypp_thread_SRCS}
+${zypp_SRCS}
+${zypp_base_SRCS}
+)
+
+SET( zypp_lib_HEADERS
+${zypp_target_store_xml_HEADERS}
+${zypp_target_rpm_HEADERS}
+${zypp_parser_tagfile_HEADERS}
+${zypp_parser_susetags_HEADERS}
+${zypp_parser_yum_HEADERS}
+${zypp_parser_plaindir_HEADERS}
+${zypp_parser_xml_HEADERS}
+${zypp_parser_HEADERS}
+${zypp_capability_HEADERS}
+${zypp_cache_HEADERS}
+${zypp_cache_sqlite3x_HEADERS}
+${zypp_ui_HEADERS}
+${zypp_parser_xmlstore_HEADERS}
+${zypp_data_HEADERS}
+${zypp_media_HEADERS}
+${zypp_target_hal_HEADERS}
+${zypp_media_proxyinfo_HEADERS}
+${zypp_base_HEADERS}
+${zypp_solver_detail_HEADERS}
+${zypp_target_store_HEADERS}
+${zypp_url_HEADERS}
+${zypp_HEADERS}
+${zypp_zypp_detail_HEADERS}
+${zypp_thread_HEADERS}
+${zypp_repo_HEADERS}
+${zypp_source_susetags_HEADERS}
+${zypp_target_modalias_HEADERS}
+${zypp_target_HEADERS}
+${zypp_detail_HEADERS}
+${zypp_pool_HEADERS}
+)
+
+#
+# Macro to set the log group for a list of files
+#
+MACRO( SET_LOGGROUP _group _files )
+ SET_SOURCE_FILES_PROPERTIES( ${_files} COMPILE_FLAGS -DZYPP_BASE_LOGGER_LOGGROUP=\\"${_group}\\" )
+ FOREACH (_currentFile ${ARGN})
+#MESSAGE( STATUS "setting loggroup to \"${_group}\" for ${_currentFile}" )
+ SET_SOURCE_FILES_PROPERTIES( ${_currentFile} COMPILE_FLAGS -DZYPP_BASE_LOGGER_LOGGROUP=\\"${_group}\\" )
+ ENDFOREACH (_currentFile ${ARGN})
+ENDMACRO( SET_LOGGROUP )
+
+# Default loggroup for all files
+SET_LOGGROUP( "zypp" ${zypp_lib_SRCS} )
+
+# override some defaults
+SET_LOGGROUP( "xmlstore" ${zypp_target_store_xml_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_target_rpm_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_parser_yum2_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_capability_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_ui_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_parser_xmlstore_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_data_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_media_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_target_hal_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_parser_xml_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_media_proxyinfo_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_source_yum_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_base_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_solver_detail_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_target_store_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_url_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_source_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_parser_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_zypp_detail_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_thread_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_source_susetags_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_target_modalias_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_target_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_parser_yum_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_detail_SRCS} )
+#SET_LOGGROUP( "group" ${zypp_pool_SRCS} )
+
+
+ADD_LIBRARY(zypp SHARED ${zypp_lib_SRCS})
+SET_TARGET_PROPERTIES( zypp PROPERTIES VERSION "${LIBZYPP_VERSION_INFO}" )
+ADD_DEPENDENCIES(zypp schema_header)
+# System libraries
+TARGET_LINK_LIBRARIES(zypp boost_filesystem util )
+TARGET_LINK_LIBRARIES(zypp ${DBUS_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp dbus-glib-1 )
+TARGET_LINK_LIBRARIES(zypp ${GLIB_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp ${RPM_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp ${GETTEXT_LIBRARIES} )
+TARGET_LINK_LIBRARIES(zypp ${HAL_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp ${HAL_STORAGE_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp ${CURL_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp ${LIBXML_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp ${SQLITE_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp ${ZLIB_LIBRARY} )
+
+INSTALL(TARGETS zypp LIBRARY DESTINATION ${LIB_INSTALL_DIR} )
+
+# install XML schemas
+FILE( GLOB YUM_SCHEMA_FILES ${CMAKE_SOURCE_DIR}/zypp/parser/yum/schema/*.rng )
+INSTALL(FILES ${YUM_SCHEMA_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/zypp/schema/yum" )
+
+FILE( GLOB XMLSTORE_SCHEMA_FILES ${CMAKE_SOURCE_DIR}/zypp/parser/xmlstore/schema/*.rng )
+INSTALL(FILES ${XMLSTORE_SCHEMA_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/zypp/schema/xmlstore" )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/ProblemSolution.cc.bak new/libzypp-3.22.1/zypp/ProblemSolution.cc.bak
--- old/libzypp-3.22.1/zypp/ProblemSolution.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/ProblemSolution.cc.bak 2007-09-07 14:53:30.000000000 +0200
@@ -0,0 +1,125 @@
+
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ProblemSolution.cc
+ *
+ * Easy-to use interface to the ZYPP dependency resolver
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+#include "zypp/solver/detail/Types.h"
+#include "zypp/solver/detail/SolutionAction.h"
+#include "zypp/ProblemSolution.h"
+#include "zypp/base/Logger.h"
+#include "zypp/solver/detail/Resolver.h"
+
+using namespace std;
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+
+IMPL_PTR_TYPE(ProblemSolution);
+
+//---------------------------------------------------------------------------
+
+ostream&
+operator<<( ostream& os, const ProblemSolution & solution)
+{
+ os << "Solution:" << endl;
+ os << solution._description << endl;
+ os << solution._details << endl;
+ os << solution._actions;
+ return os;
+}
+
+ostream&
+operator<<( ostream& os, const ProblemSolutionList & solutionlist)
+{
+ for (ProblemSolutionList::const_iterator iter = solutionlist.begin(); iter != solutionlist.end(); ++iter) {
+ os << *(*iter) << endl;
+ }
+ return os;
+}
+
+ostream&
+operator<<( ostream& os, const CProblemSolutionList & solutionlist)
+{
+ for (CProblemSolutionList::const_iterator iter = solutionlist.begin(); iter != solutionlist.end(); ++iter) {
+ os << *(*iter) << endl;
+ }
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+ProblemSolution::ProblemSolution( ResolverProblem_Ptr parent, const string & description, const string & details )
+ : _problem (parent)
+ , _description (description)
+ , _details (details)
+{
+}
+
+
+ProblemSolution::~ProblemSolution()
+{
+}
+
+
+/**
+ * Apply this solution, i.e. execute all of its actions.
+ *
+ * Returns 'true' on success, 'false' if actions could not be performed.
+ **/
+
+bool
+ProblemSolution::apply (solver::detail::Resolver & resolver)
+{
+ DBG << "apply solution " << *this << endl;
+ bool ret = true;
+ for (solver::detail::CSolutionActionList::const_iterator iter = _actions.begin();
+ iter != _actions.end(); ++iter) {
+ solver::detail::SolutionAction_constPtr action = *iter;
+ if (! action->execute (resolver))
+ {
+ ret = false;
+ break;
+ }
+ }
+ return true;
+}
+
+
+/**
+ * Add an action to the actions list.
+ **/
+void
+ProblemSolution::addAction (solver::detail::SolutionAction_constPtr action)
+{
+ _actions.push_back (action);
+}
+
+
+void
+ProblemSolution::clear()
+{
+ _actions.clear();
+}
+
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/RepoManager.cc new/libzypp-3.22.1/zypp/RepoManager.cc
--- old/libzypp-3.22.1/zypp/RepoManager.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/RepoManager.cc 2007-09-07 14:53:30.000000000 +0200
@@ -327,7 +327,8 @@
case RepoType::YAST2_e :
{
- status = (RepoStatus( rawpath + "/media.1/media") && RepoStatus( rawpath + "/content") );
+ // the order of RepoStatus && RepoStatus matters! (#304310)
+ status = RepoStatus( rawpath + "/content") && (RepoStatus( rawpath + "/media.1/media"));
}
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/Resolver.cc.bak new/libzypp-3.22.1/zypp/Resolver.cc.bak
--- old/libzypp-3.22.1/zypp/Resolver.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/Resolver.cc.bak 2007-09-07 14:53:30.000000000 +0200
@@ -0,0 +1,128 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/Resolver.cc
+ *
+*/
+#include <iostream>
+
+#include "zypp/Resolver.h"
+#include "zypp/UpgradeStatistics.h"
+#include "zypp/solver/detail/Resolver.h"
+#include "zypp/solver/detail/Testcase.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ IMPL_PTR_TYPE(Resolver);
+#if 0
+ Resolver_Ptr Resolver::_resolver = NULL;
+ Resolver_Ptr Resolver::resolver()
+ {
+ if (_resolver == NULL) {
+ _resolver = new Resolver();
+ }
+ return _resolver;
+ }
+#endif
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : Resolver::Resolver
+ // METHOD TYPE : Ctor
+ //
+ Resolver::Resolver( const ResPool & pool )
+ {
+ _pimpl = new solver::detail::Resolver(pool);
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : Resolver::~Resolver
+ // METHOD TYPE : Dtor
+ //
+ Resolver::~Resolver()
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // Resolver interface forwarded to implementation
+ //
+ ///////////////////////////////////////////////////////////////////
+ bool Resolver::verifySystem ()
+ { return _pimpl->verifySystem(false); }
+ bool Resolver::verifySystem (bool considerNewHardware)
+ { return _pimpl->verifySystem(considerNewHardware); }
+ bool Resolver::establishPool ()
+ { return _pimpl->establishPool(); }
+ bool Resolver::freshenPool ()
+ { return _pimpl->freshenPool(); }
+ bool Resolver::resolvePool ()
+ { return _pimpl->resolvePool( false ); }// do not try all possibilities
+ bool Resolver::resolvePool( bool tryAllPossibilities, bool keepExtras )
+ { return _pimpl->resolvePool( tryAllPossibilities, keepExtras ); }
+ bool Resolver::resolveDependencies( void )
+ { return _pimpl->resolveDependencies( ); }
+ void Resolver::undo()
+ { _pimpl->undo(); }
+ solver::detail::ResolverContext_Ptr Resolver::context (void) const
+ { return _pimpl->context(); }
+ ResolverProblemList Resolver::problems ()
+ { return _pimpl->problems (); }
+ std::liststd::string Resolver::problemDescription( void ) const
+ { return _pimpl->problemDescription (); }
+ void Resolver::applySolutions( const ProblemSolutionList & solutions )
+ { _pimpl->applySolutions (solutions); }
+ void Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
+ { _pimpl->doUpgrade(opt_stats_r); }
+ Arch Resolver::architecture() const
+ { return _pimpl->architecture(); }
+ void Resolver::setArchitecture( const Arch & arch )
+ { _pimpl->setArchitecture( arch ); }
+ void Resolver::setForceResolve( const bool force )
+ { _pimpl->setForceResolve( force ); }
+ const bool Resolver::forceResolve()
+ { return _pimpl->forceResolve(); }
+ void Resolver::setPreferHighestVersion( const bool highestVersion )
+ { _pimpl->setPreferHighestVersion( highestVersion ); }
+ const bool Resolver::preferHighestVersion()
+ { return _pimpl->preferHighestVersion(); }
+ bool Resolver::transactResObject( ResObject::constPtr robj, bool install)
+ { return _pimpl->transactResObject( robj, install ); }
+ bool Resolver::transactResKind( Resolvable::Kind kind )
+ { return _pimpl->transactResKind( kind ); }
+ void Resolver::transactReset( ResStatus::TransactByValue causer )
+ { _pimpl->transactReset( causer ); }
+ void Resolver::addRequire (const Capability & capability)
+ { _pimpl->addExtraCapability( capability ); }
+ void Resolver::addConflict (const Capability & capability)
+ { _pimpl->addExtraConflict( capability ); }
+ std::list Resolver::problematicUpdateItems( void ) const
+ { return _pimpl->problematicUpdateItems(); }
+ void Resolver::setTimeout( int seconds )
+ { _pimpl->setTimeout( seconds ); }
+ void Resolver::setMaxSolverPasses (int count)
+ { _pimpl->setMaxSolverPasses( count ); }
+ int Resolver::timeout()
+ { return _pimpl->timeout(); }
+ int Resolver::maxSolverPasses()
+ { return _pimpl->maxSolverPasses(); }
+ bool Resolver::createSolverTestcase (const std::string & dumpPath)
+ { solver::detail::Testcase testcase (dumpPath);
+ return testcase.createTestcase(*_pimpl);}
+ const solver::detail::ItemCapKindList Resolver::isInstalledBy (const PoolItem_Ref item)
+ { return _pimpl->isInstalledBy (item); }
+ const solver::detail::ItemCapKindList Resolver::installs (const PoolItem_Ref item)
+ { return _pimpl->installs (item); }
+
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/Resolver.h.bak new/libzypp-3.22.1/zypp/Resolver.h.bak
--- old/libzypp-3.22.1/zypp/Resolver.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/Resolver.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,331 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/Resolver.h
+ *
+*/
+#ifndef ZYPP_RESOLVER_H
+#define ZYPP_RESOLVER_H
+
+#include <iosfwd>
+#include <functional>
+
+#include "zypp/base/ReferenceCounted.h"
+#include "zypp/base/PtrTypes.h"
+
+#include "zypp/ResPool.h"
+#include "zypp/UpgradeStatistics.h"
+#include "zypp/solver/detail/Resolver.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/ProblemTypes.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : Resolver
+ //
+ /** Resolver interface.
+ */
+ class Resolver : public base::ReferenceCounted, private base::NonCopyable
+ {
+ public:
+
+ /** Ctor */
+ Resolver( const ResPool & pool );
+ /** Dtor */
+ virtual ~Resolver();
+
+ /**
+ * Resolve package dependencies:
+ *
+ * Verify consistency of system
+ *
+ **/
+ bool verifySystem ();
+
+ /**
+ * Resolve package dependencies:
+ *
+ * Verify consistency of system
+ * considerNewHardware = install packages which depends on
+ * new hardware
+ *
+ **/
+ bool verifySystem (bool considerNewHardware);
+
+ /**
+ * Establish state of 'higher level' Resolvables in Pool
+ *
+ * Must be called when dealing with non-package resolvables,
+ * like Patches, Patterns, and Products
+ *
+ * Must be called with a 'plain' pool, e.g. no additonal
+ * transacts set.
+ *
+ * return true if it was successful
+ * return false if not (this will only happen if other
+ * transactions are in the pool which will lead to
+ * no solution)
+ **/
+ bool establishPool (void);
+
+ /**
+ * go through all package 'freshen' dependencies and
+ * schedule matches for installation.
+ *
+ * To be called at begin of installation and upgrade.
+ * Probably also useful after adding a new package
+ * repository.
+ *
+ * return true if it was successful
+ * return false if not (this will only happen if other
+ * transactions are in the pool which will lead to
+ * no solution)
+ **/
+ bool freshenPool (void);
+
+ /**
+ * Resolve package dependencies:
+ *
+ * Try to execute all pending transactions (there may be more than
+ * one!).
+ * The solver pays attention to the BEST packages only in order to
+ * come to a solution.
+ * If there has not been found a valid results all other branches
+ * (e.G. packages with older version numbers, worse architecture)
+ * will be regarded.
+ *
+ * Returns "true" on success (i.e., if there were no problems that
+ * need user interaction) and "false" if there were problems. In
+ * the latter case, use problems() and later applySolutions()
+ * below.
+ **/
+ bool resolvePool (void);
+
+ /**
+ * Resolve package dependencies:
+ *
+ * Try to execute all pending transactions (there may be more than
+ * one!).
+ * If tryAllPossibilities is false, restrict searches for matching
+ * requirements to best architecture, highest version.
+ * If tryAllPossibilities is true, evaluate all possible matches
+ * for a requirement.
+ *
+ * Returns "true" on success (i.e., if there were no problems that
+ * need user interaction) and "false" if there were problems. In
+ * the latter case, use problems() and later applySolutions()
+ * below.
+ **/
+ bool resolvePool (bool tryAllPossibilities, bool keepExtras = false );
+
+ bool resolveDependencies( void );
+
+ /*
+ * Undo solver changes done in resolvePool()
+ * Throwing away all ignored dependencies.
+ */
+ void undo( void );
+
+ /*
+ * Get the most recent resolver context
+ *
+ * It will be NULL if resolvePool() or establishPool() was never called.
+ * Depending on the return code of the last resolvePool() call,
+ * it _either_ points to a valid or an invalid solution.
+ */
+ solver::detail::ResolverContext_Ptr context (void) const;
+
+ /**
+ * Do an distribution upgrade
+ *
+ * This will run a full upgrade on the pool, taking all upgrade
+ * dependencies (provide/obsolete for package renames, split-
+ * provides, etc.) into account and actually removing installed
+ * packages if no upgrade exists.
+ *
+ * To be run with great caution. It basically brings your
+ * system 'back to start'.
+ * Quite helpful to get back to a 'sane state'. Quite disastrous
+ * since you'll loose all non-distribution packages
+ **/
+ void doUpgrade( UpgradeStatistics & opt_stats_r );
+
+ /**
+ * Return the list of problematic update items
+ * i.e. locked ones (due to foreign vendor)
+ **/
+ std::list problematicUpdateItems( void ) const;
+
+ /**
+ * Return the dependency problems found by the last call to
+ * resolveDependencies(). If there were no problems, the returned
+ * list will be empty.
+ **/
+ ResolverProblemList problems();
+
+ /**
+ * Return more solver information if an error has happened.
+ **/
+
+ std::liststd::string problemDescription( void ) const;
+
+ /**
+ * Apply problem solutions. No more than one solution per problem
+ * can be applied.
+ **/
+ void applySolutions( const ProblemSolutionList & solutions );
+
+ Arch architecture() const;
+ void setArchitecture( const Arch & arch);
+
+ /**
+ * Remove resolvables which are conflicts with others or
+ * have unfulfilled requirements.
+ * This behaviour is favourited by ZMD.
+ **/
+ void setForceResolve (const bool force);
+ const bool forceResolve();
+
+ /**
+ * Prefer the result with the newest version if there are more solver
+ * results.
+ **/
+ void setPreferHighestVersion (const bool highestVersion);
+ const bool preferHighestVersion();
+
+ /**
+ * transact a single ResObject
+ *
+ * Installs (install == true) or removes (install == false) all required
+ * and recommended packages(!) of \c robj
+ * (More or less a 'single step' resolver call)
+ *
+ * returns false if requirements are not all fulfillable
+ *
+ */
+ bool transactResObject( ResObject::constPtr robj, bool install = true);
+
+ /**
+ * transact all objects of this kind
+ *
+ * Look through the pool and runs transactResObject, first for removes
+ * then for installs
+ * (More or less a 'single step' resolver call)
+ *
+ * returns false if any transactResObject() call returned false.
+ *
+ */
+ bool transactResKind( Resolvable::Kind kind );
+
+ /**
+ * reset any transact states
+ *
+ * Look through the pool and clear transact state.
+ * It will only reset states which have an equal or
+ * lower causer
+ *
+ */
+ void transactReset( ResStatus::TransactByValue causer );
+
+ /**
+ * Adding additional requirement
+ *
+ */
+ void addRequire (const Capability & capability);
+
+ /**
+ * Adding additional conflict
+ *
+ */
+ void addConflict (const Capability & capability);
+
+ /**
+ * Setting solver timeout
+ *
+ * Stop solving after a given timeframe (seconds)
+ * seconds = 0 : No timeout
+ *
+ */
+ void setTimeout( int seconds );
+
+ /**
+ * Getting solver timeout in seconds
+ *
+ */
+ int timeout();
+
+ /**
+ * Restricting solver passes
+ *
+ * Stop solving after a given amount of passes
+ * count = 0 : No restriction
+ *
+ */
+ void setMaxSolverPasses (int count);
+
+ /**
+ * Count of max solver passes
+ *
+ */
+ int maxSolverPasses ();
+
+ /**
+ * Generates a solver Testcase of the current state
+ *
+ * \parame dumpPath destination directory of the created directory
+ * \return true if it was successful
+ */
+ bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase");
+
+
+ /**
+ * Gives information about WHO has pused an installation of an given item.
+ *
+ * \param item Evaluate additional information for this resolvable.
+ * \return A list of structures which contains:
+ * item Item which has triggered the installation of the given param item.
+ * cap Capability which has triggerd this installation
+ * capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )
+ *
+ * Note: In order to have a result start a solver run before. Not matter if it is valid or invalid.
+ *
+ */
+ const solver::detail::ItemCapKindList isInstalledBy (const PoolItem_Ref item);
+
+ /**
+ * Gives information about WHICH additional items will be installed due the installation of an item.
+ *
+ * \param item Evaluate additional information for this resolvable.
+ * \return A list of structures which contains:
+ * item Item which will be installed due to the installation of the given param item too.
+ * cap Capability which causes the installation
+ * capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )
+ *
+ * Note: In order to have a result start a solver run before. Not matter if it is valid or invalid.
+ *
+ */
+ const solver::detail::ItemCapKindList installs (const PoolItem_Ref item);
+
+
+ protected:
+
+ private:
+ solver::detail::Resolver_Ptr _pimpl;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_RESOLVER_H
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/VendorAttr.cc new/libzypp-3.22.1/zypp/VendorAttr.cc
--- old/libzypp-3.22.1/zypp/VendorAttr.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/VendorAttr.cc 2007-09-07 14:53:30.000000000 +0200
@@ -147,18 +147,27 @@
bool VendorAttr::autoProtect( const Vendor & vendor_r ) const
{ return( ZConfig::instance().autolock_untrustedvendor() && ! trusted( vendor_r ) ); }
- bool VendorAttr::equivalent( const Vendor & lhs, const Vendor & rhs ) const
+ /** Helper: Lowercase prefix */
+ inline bool hasLcPrefix( const std::string & str_r, const std::string & pref_r )
+ { return str::toLower( str_r.substr( 0, pref_r.size() ) ) == pref_r; }
+
+ /** Helper: SuSE and equivalent vendors */
+ inline bool isSUSE( const Vendor & vnd_r )
{
- static const std::string defSUSE( "suse" );
+ static const std::string defSUSE ( "suse" );
+ static const std::string defopenSUSE( "opensuse" );
- if ( lhs == rhs )
- return true;
- // By now handcrafted equivalence definition:
- if ( str::toLower( lhs.substr( 0, 4 ) ) == defSUSE
- && str::toLower( rhs.substr( 0, 4 ) ) == defSUSE )
+ return( hasLcPrefix( vnd_r, defSUSE )
+ || hasLcPrefix( vnd_r, defopenSUSE ) );
+ }
+
+ bool VendorAttr::equivalent( const Vendor & lhs, const Vendor & rhs ) const
+ {
+ if ( lhs == rhs )
return true;
- return false;
+ // By now handcrafted equivalence definition:
+ return( isSUSE( lhs ) && isSUSE( rhs ) );
}
/////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/cache/CacheStore.cc new/libzypp-3.22.1/zypp/cache/CacheStore.cc
--- old/libzypp-3.22.1/zypp/cache/CacheStore.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/cache/CacheStore.cc 2007-09-07 14:53:30.000000000 +0200
@@ -275,7 +275,7 @@
const data::Package_Ptr & package )
{
RecordId id = appendResolvable( repository_id, ResTraits<Package>::kind,
- NVRA( package->name, package->edition, package->arch ), package->deps );
+ NVRA( package->name, package->edition, package->arch ), package->deps, package->shareDataWith );
appendResObjectAttributes( id, package );
appendPackageBaseAttributes( id, package );
@@ -292,7 +292,7 @@
const data::SrcPackage_Ptr & package )
{
RecordId id = appendResolvable( repository_id, ResTraits<SrcPackage>::kind,
- NVRA( package->name, package->edition, package->arch ), package->deps );
+ NVRA( package->name, package->edition, package->arch ), package->deps, package->shareDataWith );
appendResObjectAttributes( id, package );
appendOnMediaLocation( id, attrSrcPackageLocation, package->repositoryLocation );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/cache/ResolvableQuery.cc new/libzypp-3.22.1/zypp/cache/ResolvableQuery.cc
--- old/libzypp-3.22.1/zypp/cache/ResolvableQuery.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/cache/ResolvableQuery.cc 2007-09-07 14:53:30.000000000 +0200
@@ -25,6 +25,7 @@
sqlite3_command_ptr _cmd_attr_tstr;
sqlite3_command_ptr _cmd_attr_num;
sqlite3_command_ptr _cmd_disk_usage;
+ sqlite3_command_ptr _cmd_shared_id;
Impl( const Pathname &dbdir)
: _dbdir(dbdir)
@@ -33,6 +34,8 @@
_con.open((dbdir + "zypp.db").asString().c_str());
_con.executenonquery("PRAGMA cache_size=8000;");
+ _cmd_shared_id.reset( new sqlite3_command( _con, "select shared_id from resolvables where id=:rid;") );
+
_cmd_attr_tstr.reset( new sqlite3_command( _con, "select a.text, l.name from text_attributes a,types l,types t where a.weak_resolvable_id=:rid and a.lang_id=l.id and a.attr_id=t.id and l.class=:lclass and t.class=:tclass and t.name=:tname;") );
@@ -322,6 +325,18 @@
sqlite3_reader reader = _cmd_attr_num->executereader();
if ( reader.read() )
return reader.getint(0);
+ else
+ {
+ reader.close();
+ sqlite3_reader idreader = _cmd_shared_id->executereader();
+ if ( idreader.read() )
+ {
+ _cmd_shared_id->bind(":rid", record_id);
+ data::RecordId sid = idreader.getint(0);
+ idreader.close();
+ return queryNumericAttributeInternal(con, sid, klass, name, default_value);
+ }
+ }
return default_value;
}
@@ -353,7 +368,19 @@
if ( c>0 )
return result;
-
+ else
+ {
+ reader.close();
+ _cmd_shared_id->bind(":rid", record_id);
+ sqlite3_reader idreader = _cmd_shared_id->executereader();
+ if ( idreader.read() )
+ {
+ data::RecordId sid = idreader.getint(0);
+ idreader.close();
+ return queryTranslatedStringAttributeInternal(con, sid, klass, name, default_value);
+ }
+ }
+
return default_value;
}
@@ -388,7 +415,19 @@
if ( reader.read() )
return reader.getstring(0);
-
+ else
+ {
+ reader.close();
+ _cmd_shared_id->bind(":rid", record_id);
+ sqlite3_reader idreader = _cmd_shared_id->executereader();
+ if ( idreader.read() )
+ {
+ data::RecordId sid = idreader.getint(0);
+ idreader.close();
+ return queryStringAttributeTranslationInternal( con, sid, locale, klass, name, default_value );
+ }
+ }
+
return default_value;
}
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/pool/GetResolvablesToInsDel.cc.bak new/libzypp-3.22.1/zypp/pool/GetResolvablesToInsDel.cc.bak
--- old/libzypp-3.22.1/zypp/pool/GetResolvablesToInsDel.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/pool/GetResolvablesToInsDel.cc.bak 2007-09-07 14:53:29.000000000 +0200
@@ -0,0 +1,358 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/pool/GetResolvablesToInsDel.cc
+ *
+*/
+#include <iostream>
+#include <set>
+
+#include "zypp/base/Logger.h"
+
+#include "zypp/pool/GetResolvablesToInsDel.h"
+#include "zypp/pool/PoolStats.h"
+
+#include "zypp/solver/detail/InstallOrder.h"
+
+using std::endl;
+using zypp::solver::detail::InstallOrder;
+
+#undef ZYPP_BASE_LOGGER_LOGGROUP
+#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::GetResolvablesToInsDel"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace pool
+ { /////////////////////////////////////////////////////////////////
+
+ /******************************************************************
+ **
+ ** FUNCTION NAME : strip_obsoleted_to_delete
+ ** FUNCTION TYPE : void
+ **
+ ** strip packages to_delete which get obsoleted by
+ ** to_install (i.e. delay deletion in case the
+ ** obsoleting package likes to save whatever...
+ */
+
+ static void
+ strip_obsoleted_to_delete( GetResolvablesToInsDel::PoolItemList & deleteList_r,
+ const GetResolvablesToInsDel::PoolItemList & instlist_r )
+ {
+ if ( deleteList_r.size() == 0 || instlist_r.size() == 0 )
+ return; // ---> nothing to do
+
+ // build obsoletes from instlist_r
+ CapSet obsoletes;
+ for ( GetResolvablesToInsDel::PoolItemList::const_iterator it = instlist_r.begin();
+ it != instlist_r.end(); ++it )
+ {
+ PoolItem_Ref item( *it );
+ obsoletes.insert( item->dep(Dep::OBSOLETES).begin(), item->dep(Dep::OBSOLETES).end() );
+ }
+ if ( obsoletes.size() == 0 )
+ return; // ---> nothing to do
+
+ // match them... ;(
+ GetResolvablesToInsDel::PoolItemList undelayed;
+ // forall applDelete Packages...
+ for ( GetResolvablesToInsDel::PoolItemList::iterator it = deleteList_r.begin();
+ it != deleteList_r.end(); ++it )
+ {
+ PoolItem_Ref ipkg( *it );
+ bool delayPkg = false;
+ // ...check whether an obsoletes....
+ for ( CapSet::iterator obs = obsoletes.begin();
+ ! delayPkg && obs != obsoletes.end(); ++obs )
+ {
+ // ...matches anything provided by the package?
+ for ( CapSet::const_iterator prov = ipkg->dep(Dep::PROVIDES).begin();
+ prov != ipkg->dep(Dep::PROVIDES).end(); ++prov )
+ {
+ if ( obs->matches( *prov ) == CapMatch::yes )
+ {
+ // if so, delay package deletion
+ DBG << "Ignore appl_delete (should be obsoleted): " << ipkg << endl;
+ delayPkg = true;
+ ipkg.status().resetTransact( ResStatus::USER );
+ break;
+ }
+ }
+ }
+ if ( ! delayPkg ) {
+ DBG << "undelayed " << ipkg << endl;
+ undelayed.push_back( ipkg );
+ }
+ }
+ // Puhh...
+ deleteList_r.swap( undelayed );
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : GetResolvablesToInsDel::GetResolvablesToInsDel
+ // METHOD TYPE : Ctor
+ //
+ GetResolvablesToInsDel::GetResolvablesToInsDel( ResPool pool_r, Order order_r )
+ {
+ typedef std::set PoolItemSet;
+
+ PoolItemList & dellist_r( _toDelete );
+ PoolItemList & instlist_r( _toInstall );
+ PoolItemList & srclist_r( _toSrcinstall );
+
+ for ( ResPool::const_iterator it = pool_r.begin(); it != pool_r.end(); ++it )
+ {
+ if (it->status().isToBeInstalled())
+ {
+ if ((*it)->kind() == ResTraits<SrcPackage>::kind) {
+ srclist_r.push_back( *it );
+ }
+ else
+ instlist_r.push_back( *it );
+ }
+ else if (it->status().isToBeUninstalled())
+ {
+ if ( it->status().isToBeUninstalledDueToObsolete() )
+ {
+ DBG << "Ignore auto_delete (should be obsoleted): " << *it << endl;
+ }
+ else if ( it->status().isToBeUninstalledDueToUpgrade() )
+ {
+ DBG << "Ignore auto_delete (should be upgraded): " << *it << endl;
+ }
+ else {
+ dellist_r.push_back( *it );
+ }
+ }
+ }
+
+ MIL << "ResolvablesToInsDel: delete " << dellist_r.size()
+ << ", install " << instlist_r.size()
+ << ", srcinstall " << srclist_r.size() << endl;
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // strip packages to_delete which get obsoleted by
+ // to_install (i.e. delay deletion in case the
+ // obsoleting package likes to save whatever...
+ //
+ ///////////////////////////////////////////////////////////////////
+ strip_obsoleted_to_delete( dellist_r, instlist_r );
+
+ if ( dellist_r.size() ) {
+ ///////////////////////////////////////////////////////////////////
+ //
+ // sort delete list...
+ //
+ ///////////////////////////////////////////////////////////////////
+ PoolItemSet delset( dellist_r.begin(), dellist_r.end() ); // for delete order
+ PoolItemSet dummy; // dummy, empty, should contain already installed
+
+ InstallOrder order( pool_r, delset, dummy ); // sort according top prereq
+ order.init();
+ const PoolItemList dsorted( order.getTopSorted() );
+
+ dellist_r.clear();
+ for ( PoolItemList::const_reverse_iterator cit = dsorted.rbegin();
+ cit != dsorted.rend(); ++cit )
+ {
+ dellist_r.push_back( *cit );
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // sort installed list...
+ //
+ ///////////////////////////////////////////////////////////////////
+ if ( instlist_r.empty() )
+ return;
+
+ ///////////////////////////////////////////////////////////////////
+ // Compute install order according to packages prereq.
+ // Try to group packages with respect to the desired install order
+ ///////////////////////////////////////////////////////////////////
+ // backup list for debug purpose.
+ // You can as well build the set, clear the list and rebuild it in install order.
+ PoolItemList instbackup_r;
+ instbackup_r.swap( instlist_r );
+
+ PoolItemSet insset( instbackup_r.begin(), instbackup_r.end() ); // for install order
+ PoolItemSet installed; // dummy, empty, should contain already installed
+
+ InstallOrder order( pool_r, insset, installed );
+ // start recursive depth-first-search
+ order.init();
+ MIL << "order.init() done" << endl;
+ order.printAdj( XXX, false );
+ ///////////////////////////////////////////////////////////////////
+ // build install list in install order
+ ///////////////////////////////////////////////////////////////////
+ PoolItemList best_list;
+ unsigned best_prio = 0;
+ unsigned best_medianum = 0;
+
+ PoolItemList last_list;
+ unsigned last_prio = 0;
+ unsigned last_medianum = 0;
+
+ PoolItemList other_list;
+
+ for ( PoolItemList items = order.computeNextSet(); ! items.empty(); items = order.computeNextSet() )
+ {
+ XXX << "order.computeNextSet: " << items.size() << " resolvables" << endl;
+ ///////////////////////////////////////////////////////////////////
+ // items contains all objects we could install now. Pick all objects
+ // from current media, or best media if none for current. Alwayys pick
+ // objects that do not require media access.
+ ///////////////////////////////////////////////////////////////////
+
+ best_list.clear();
+ last_list.clear();
+ other_list.clear();
+
+ for ( PoolItemList::iterator cit = items.begin(); cit != items.end(); ++cit )
+ {
+ ResObject::constPtr cobj( cit->resolvable() );
+ if (!cobj)
+ continue;
+
+ if ( ! cobj->mediaNr() ) {
+ XXX << "No media access required for " << *cit << endl;
+ order.setInstalled( *cit );
+ other_list.push_back( *cit );
+ continue;
+ }
+
+ if ( cobj->repository().numericId() == last_prio &&
+ cobj->mediaNr() == last_medianum ) {
+ // prefer packages on current media.
+ XXX << "Stay with current media " << *cit << endl;
+ last_list.push_back( *cit );
+ continue;
+ }
+
+ if ( last_list.empty() ) {
+ // check for best media as long as there are no packages for current media.
+
+ if ( ! best_list.empty() ) {
+
+ if ( order_r == ORDER_BY_MEDIANR )
+ {
+ if ( cobj->mediaNr() < best_medianum ) {
+ best_list.clear(); // new best
+ } else if ( cobj->mediaNr() == best_medianum ) {
+ if ( cobj->repository().numericId() < best_prio ) {
+ best_list.clear(); // new best
+ } else if ( cobj->repository().numericId() == best_prio ) {
+ XXX << "Add to best list " << *cit << endl;
+ best_list.push_back( *cit ); // same as best -> add
+ continue;
+ } else {
+ continue; // worse
+ }
+ } else {
+ continue; // worse
+ }
+ }
+ else // default: ORDER_BY_SOURCE
+ {
+ if ( cobj->repository().numericId() < best_prio ) {
+ best_list.clear(); // new best
+ } else if ( cobj->repository().numericId() == best_prio ) {
+ if ( cobj->mediaNr() < best_medianum ) {
+ best_list.clear(); // new best
+ } else if ( cobj->mediaNr() == best_medianum ) {
+ XXX << "Add to best list " << *cit << endl;
+ best_list.push_back( *cit ); // same as best -> add
+ continue;
+ } else {
+ continue; // worse
+ }
+ } else {
+ continue; // worse
+ }
+ }
+ }
+
+ if ( best_list.empty() )
+ {
+ XXX << "NEW BEST LIST [S" << cobj->repository().numericId() << ":" << cobj->mediaNr()
+ << "] (last [S" << best_prio << ":" << best_medianum << "])" << endl;
+ best_prio = cobj->repository().numericId();
+ best_medianum = cobj->mediaNr();
+ // first package or new best
+ XXX << "Add to best list " << *cit << endl;
+ best_list.push_back( *cit );
+ continue;
+ }
+ }
+
+ } // for all objects in current set
+
+ ///////////////////////////////////////////////////////////////////
+ // remove objects picked from install order and append them to
+ // install list.
+ ///////////////////////////////////////////////////////////////////
+ PoolItemList & take_list( last_list.empty() ? best_list : last_list );
+ if ( last_list.empty() )
+ {
+ MIL << "SET NEW media [S" << best_prio << ":" << best_medianum << "]" << endl;
+ last_prio = best_prio;
+ last_medianum = best_medianum;
+ }
+ else
+ {
+ XXX << "SET CONTINUE [S" << best_prio << ":" << best_medianum << "]" << endl;
+ }
+
+ for ( PoolItemList::iterator it = take_list.begin(); it != take_list.end(); ++it )
+ {
+ order.setInstalled( *it );
+ XXX << "SET collect " << (*it) << endl;
+ }
+ // move everthing from take_list to the end of instlist_r, clean take_list
+ instlist_r.splice( instlist_r.end(), take_list );
+ // same for other_list
+ instlist_r.splice( instlist_r.end(), other_list );
+
+ } // for all sets computed
+
+
+ MIL << "order done" << endl;
+ if ( instbackup_r.size() != instlist_r.size() )
+ {
+ ERR << "***************** Lost packages in InstallOrder sort." << endl;
+ }
+
+ }
+
+ /******************************************************************
+ **
+ ** FUNCTION NAME : operator<<
+ ** FUNCTION TYPE : std::ostream &
+ */
+ std::ostream & operator<<( std::ostream & str, const GetResolvablesToInsDel & obj )
+ {
+ dumpPoolStats( str << "toInstall: " << endl,
+ obj._toInstall.begin(), obj._toInstall.end() ) << endl;
+ dumpPoolStats( str << "toDelete: " << endl,
+ obj._toDelete.begin(), obj._toDelete.end() ) << endl;
+ return str;
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace pool
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ContextPool.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ContextPool.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ContextPool.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ContextPool.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,329 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverQueue.cc
+ *
+ * Copyright (C) 2007 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/base/Logger.h"
+#include "zypp/solver/detail/ContextPool.h"
+#include "zypp/solver/detail/ResolverContext.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(ContextPool);
+
+#define MAXCONTEXT 10
+
+//---------------------------------------------------------------------------
+
+void dumpTaskList(const PoolItemList &list )
+{
+ for (PoolItemList::const_iterator iter = list.begin();
+ iter != list.end(); iter++) {
+ DBG << " " << *iter << endl;
+ }
+}
+
+//---------------------------------------------------------------------------
+
+ostream&
+operator<<( ostream& os, const ContextPool & contextPool)
+{
+ os << str::form ("ContextPool [entries: %d]", contextPool.contextListSize()) << endl;
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+ContextPool::ContextPool (const int maxCount)
+ : maxContext (maxCount)
+{
+ _XDEBUG("ContextPool::ContextPool(" << maxContext << ")");
+}
+
+
+ContextPool::ContextPool ()
+ : maxContext (MAXCONTEXT)
+{
+ _XDEBUG("ContextPool::ContextPool(" << MAXCONTEXT << ")");
+}
+
+ContextPool::~ContextPool()
+{
+}
+
+//---------------------------------------------------------------------------
+void ContextPool::addContext (ResolverContext_Ptr context,
+ const PoolItemList & installItems,
+ const PoolItemList & deleteItems,
+ const PoolItemList & lockUninstalledItems)
+{
+ if ((installItems.size() == 0
+ && deleteItems.size() == 0)
+ || context == NULL )
+ return; // empty context is useless
+
+ // make an copy
+ ResolverContext_Ptr new_context = new ResolverContext (context->pool(), context->architecture(),
+ context);
+
+ new_context->setUserInstallItems (installItems);
+ new_context->setUserDeleteItems (deleteItems);
+ new_context->setUserLockUninstalledItems (lockUninstalledItems);
+
+ if (contextList.size() <= 0) {
+ contextList.push_front (new_context);
+ } else {
+ // does context already exists in the list ?
+ bool exists = false;
+
+ for ( ResolverContextList::iterator it = contextList.begin(); it != contextList.end(); ++it ) {
+ // checking installed items
+ PoolItemList left = (*it)->userInstallItems();
+ PoolItemList right = context->userInstallItems();
+ if (left.size() != right.size())
+ continue;
+ bool found = true;
+ for (PoolItemList::iterator itleft = left.begin();
+ (itleft != left.end()) && found ; ++itleft) {
+ found = false;
+ for (PoolItemList::iterator itright = right.begin(); itright != right.end(); ++itright) {
+ if (*itleft == *itright) {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ if (!found ) continue;
+
+ // checking deleted items
+ left = (*it)->userDeleteItems();
+ right = context->userDeleteItems();
+ if (left.size() != right.size())
+ continue;
+ found = true;
+ for (PoolItemList::iterator itleft = left.begin();
+ (itleft != left.end()) && found ; ++itleft) {
+ found = false;
+ for (PoolItemList::iterator itright = right.begin(); itright != right.end(); ++itright) {
+ if (*itleft == *itright) {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ if (!found ) continue;
+
+ // checking locked items
+ left = (*it)->userLockUninstalledItems();
+ right = context->userLockUninstalledItems();
+ if (left.size() != right.size())
+ continue;
+ found = true;
+ for (PoolItemList::iterator itleft = left.begin();
+ (itleft != left.end()) && found ; ++itleft) {
+ found = false;
+ for (PoolItemList::iterator itright = right.begin(); itright != right.end(); ++itright) {
+ if (*itleft == *itright) {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ if (found) {
+ exists = true;
+ break;
+ }
+ }
+
+ if (!exists) {
+ contextList.push_front (new_context);
+ } else {
+ _XDEBUG("----------------------");
+ _XDEBUG("ContextPool::addContext Context ALREADY INSERTED ");
+ _XDEBUG("----------------------");
+ }
+ }
+
+ if (contextList.size() > 0
+ && contextList.size() > maxContext)
+ {
+ // keep max size
+ contextList.remove (contextList.back());
+ }
+
+ _XDEBUG("----------------------");
+ _XDEBUG("ContextPool::addContext latest context with ");
+ _XDEBUG(" installed:");
+ dumpTaskList (new_context->userInstallItems());
+ _XDEBUG(" deleted:");
+ dumpTaskList (new_context->userDeleteItems());
+ _XDEBUG(" locked:");
+ dumpTaskList (new_context->userLockUninstalledItems());
+#if 0
+ _XDEBUG("CONTEXT : " << endl << *new_context );
+#endif
+ _XDEBUG("----------------------");
+#if 0
+ int count = 0;
+ for ( ResolverContextList::iterator it = contextList.begin(); it != contextList.end(); ++it ) {
+
+ PoolItemList contextInstall = (*it)->userInstallItems();
+ _XDEBUG(" inserted CONTEXT Nr " << count++ << " of " << contextList.size() << " : " << endl << **it );
+ _XDEBUG(" with entries");
+ dumpTaskList (contextInstall);
+ _XDEBUG("----------------------");
+ }
+#endif
+
+}
+
+ResolverContext_Ptr ContextPool::findContext (PoolItemList & installItems,
+ PoolItemList & deleteItems,
+ const PoolItemList & lockUninstalledItems)
+{
+ // searching for context with same entries
+ int counter = 1;
+ for ( ResolverContextList::iterator it = contextList.begin(); it != contextList.end(); ++it ) {
+
+ PoolItemList contextInstall = (*it)->userInstallItems();
+ PoolItemList contextDelete = (*it)->userDeleteItems();
+ PoolItemList contextLockUninstalled = (*it)->userLockUninstalledItems();
+
+ _XDEBUG("ContextPool::findContext() trying " << counter++ << ". of " << contextList.size() );
+ _XDEBUG(" comparing");
+ _XDEBUG(" installed:");
+ dumpTaskList (contextInstall);
+ _XDEBUG(" deleted:");
+ dumpTaskList (contextDelete);
+ _XDEBUG(" lockedUninstalled:");
+ dumpTaskList (contextLockUninstalled);
+
+ _XDEBUG(" with needed");
+ _XDEBUG(" installed:");
+ dumpTaskList (installItems);
+ _XDEBUG(" deleted:");
+ dumpTaskList (deleteItems);
+ _XDEBUG(" lockedUninstalled:");
+ dumpTaskList (lockUninstalledItems);
+
+ if (contextInstall.size() > installItems.size()
+ || contextDelete.size() > deleteItems.size()
+ || contextLockUninstalled.size() != lockUninstalledItems.size())
+ continue; // cannot fit at all
+
+ bool found = true;
+
+ found = true;
+ // check if the lock of unistalled items are the same.
+ // If not --> try the next context
+ for (PoolItemList::iterator itContext = contextLockUninstalled.begin();
+ (itContext != contextLockUninstalled.end()) && found; ++itContext) {
+ found = false;
+ for (PoolItemList::const_iterator itInstall = lockUninstalledItems.begin();
+ itInstall != lockUninstalledItems.end(); ++itInstall) {
+ if (*itContext == *itInstall) {
+ found = true;
+ break;
+ }
+ }
+ }
+ if (!found) continue;
+
+ // checking items which will be installed
+ PoolItemList addInsItems = installItems;
+ for (PoolItemList::iterator itContext = contextInstall.begin();
+ (itContext != contextInstall.end()) && found; ++itContext) {
+ found = false;
+ for (PoolItemList::iterator itInstall = addInsItems.begin();
+ itInstall != addInsItems.end(); ++itInstall) {
+ if (*itContext == *itInstall) {
+ found = true;
+ addInsItems.remove (*itInstall);
+ break;
+ }
+ }
+ }
+
+ PoolItemList addDelItems = deleteItems;
+ if (found) {
+ // checking items which will be deleted
+ PoolItemList addDelItems = deleteItems;
+ for (PoolItemList::iterator itContext = contextDelete.begin();
+ (itContext != contextDelete.end()) && found; ++itContext) {
+ found = false;
+ for (PoolItemList::iterator itInstall = addDelItems.begin();
+ itInstall != addDelItems.end(); ++itInstall) {
+ if (*itContext == *itInstall) {
+ found = true;
+ addDelItems.remove (*itInstall);
+ break;
+ }
+ }
+ }
+ }
+
+ if (found) {
+ if (addInsItems.size() > 0
+ || addDelItems.size() > 0) {
+ _XDEBUG("ContextPool::findContext() found one with following additional install/delete items: ");
+ _XDEBUG(" installed:");
+ dumpTaskList (addInsItems);
+ _XDEBUG(" deleted:");
+ dumpTaskList (addDelItems);
+ } else {
+ _XDEBUG("ContextPool::findContext() found with the SAME selected entries. ");
+ }
+ installItems = addInsItems; // Rest of items which has to be installed additionally
+ deleteItems = addDelItems; // Rest of items which has to be deleted additionally
+#if 0
+ _XDEBUG("----------------------");
+ _XDEBUG(" returned CONTEXT : " << endl << **it );
+ _XDEBUG("----------------------");
+#endif
+ return *it;
+ }
+ }
+ // nothing found
+ _XDEBUG("ContextPool::findContext() have not found a proper context. Solving completely");
+ return NULL;
+}
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Helper.cc new/libzypp-3.22.1/zypp/solver/detail/Helper.cc
--- old/libzypp-3.22.1/zypp/solver/detail/Helper.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/solver/detail/Helper.cc 2007-09-07 14:53:31.000000000 +0200
@@ -27,7 +27,7 @@
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
#include "zypp/base/Gettext.h"
-
+#include "zypp/VendorAttr.h"
#include "zypp/base/Algorithm.h"
#include "zypp/ResPool.h"
#include "zypp/ResFilters.h"
@@ -134,7 +134,7 @@
if ( installed.resolvable() )
{
- if ( installed->vendor() != provider->vendor() )
+ if ( !VendorAttr::instance().equivalent(installed->vendor(),provider->vendor()) )
{
MIL << "Discarding '" << provider << "' from vendor '"
<< provider->vendor() << "' different to uninstalled '"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Helper.cc.bak new/libzypp-3.22.1/zypp/solver/detail/Helper.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/Helper.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/Helper.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,272 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* Helper.cc
+ *
+ * Static helpers
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/solver/detail/Helper.h"
+
+#include "zypp/CapSet.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+
+using namespace std;
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+ostream &
+operator<< (ostream & os, const PoolItemList & itemlist)
+{
+ for (PoolItemList::const_iterator iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
+ if (iter != itemlist.begin())
+ os << ", ";
+ os << *iter;
+ }
+ return os;
+}
+
+
+class LookFor : public resfilter::PoolItemFilterFunctor
+{
+ public:
+ PoolItem_Ref item;
+
+ bool operator()( PoolItem_Ref provider )
+ {
+ item = provider;
+ return false; // stop here, we found it
+ }
+};
+
+
+// just find installed item with same kind/name as item
+
+PoolItem_Ref
+Helper::findInstalledByNameAndKind (const ResPool & pool, const string & name, const Resolvable::Kind & kind)
+{
+ LookFor info;
+
+ invokeOnEach( pool.byNameBegin( name ),
+ pool.byNameEnd( name ),
+ functor::chain (resfilter::ByInstalled (), // ByInstalled
+ resfilter::ByKind( kind ) ), // equal kind
+ functor::functorRef (info) );
+
+ _XDEBUG("Helper::findInstalledByNameAndKind (" << name << ", " << kind << ") => " << info.item);
+ return info.item;
+}
+
+
+// just find uninstalled item with same kind/name as item
+
+PoolItem_Ref
+Helper::findUninstalledByNameAndKind (const ResPool & pool, const string & name, const Resolvable::Kind & kind)
+{
+ LookFor info;
+
+ invokeOnEach( pool.byNameBegin( name ),
+ pool.byNameEnd( name ),
+ functor::chain (resfilter::ByUninstalled (), // ByUninstalled
+ resfilter::ByKind( kind ) ), // equal kind
+ functor::functorRef (info) );
+
+ _XDEBUG("Helper::findUninstalledByNameAndKind (" << name << ", " << kind << ") => " << info.item);
+ return info.item;
+}
+
+
+// just find installed item with same kind/name as item
+// does *NOT* check edition
+
+PoolItem_Ref
+Helper::findInstalledItem (const ResPool & pool, PoolItem_Ref item)
+{
+ return findInstalledByNameAndKind (pool, item->name(), item->kind() );
+}
+
+//----------------------------------------------------------------------------
+
+class LookForUpdate : public resfilter::PoolItemFilterFunctor
+{
+ public:
+ PoolItem_Ref uninstalled;
+ PoolItem_Ref installed;
+
+ bool operator()( PoolItem_Ref provider )
+ {
+ // is valid
+ if ( ! provider.resolvable() )
+ {
+ WAR << "Warning: '" << provider << "' not valid" << endl;
+ return true;
+ }
+
+ if ( installed.resolvable() )
+ {
+ if ( installed->vendor() != provider->vendor() )
+ {
+ MIL << "Discarding '" << provider << "' from vendor '"
+ << provider->vendor() << "' different to uninstalled '"
+ << installed->vendor() << "' vendor." << endl;
+ return true;
+ }
+ }
+
+ if ((!uninstalled // none yet
+ || (uninstalled->edition().compare( provider->edition() ) < 0) // or a better edition
+ || (uninstalled->arch().compare( provider->arch() ) < 0) ) // or a better architecture
+ && !provider.status().isLocked() ) // is not locked
+ {
+ uninstalled = provider; // store
+ }
+ return true;
+ }
+};
+
+
+// just find best (according to edition) uninstalled item with same kind/name as item
+// *DOES* check edition
+
+PoolItem_Ref
+Helper::findUpdateItem (const ResPool & pool, PoolItem_Ref item)
+{
+ LookForUpdate info;
+ info.installed = item;
+
+ invokeOnEach( pool.byNameBegin( item->name() ),
+ pool.byNameEnd( item->name() ),
+ functor::chain (functor::chain (resfilter::ByUninstalled (), // ByUninstalled
+ resfilter::ByKind( item->kind() ) ), // equal kind
+ resfilter::byEdition( item->edition() )), // only look at better editions
+ functor::functorRef (info) );
+
+ _XDEBUG("Helper::findUpdateItem(" << item << ") => " << info.uninstalled);
+ return info.uninstalled;
+}
+
+
+//----------------------------------------------------------------------------
+
+class LookForReinstall : public resfilter::PoolItemFilterFunctor
+{
+ public:
+ PoolItem_Ref uninstalled;
+
+ bool operator()( PoolItem_Ref provider )
+ {
+ if (provider.status().isLocked()) {
+ return true; // search next
+ } else {
+ uninstalled = provider;
+ return false; // stop here, we found it
+ }
+ }
+};
+
+
+PoolItem_Ref
+Helper::findReinstallItem (const ResPool & pool, PoolItem_Ref item)
+{
+ LookForReinstall info;
+
+ invokeOnEach( pool.byNameBegin( item->name() ),
+ pool.byNameEnd( item->name() ),
+ functor::chain (functor::chain (resfilter::ByUninstalled (), // ByUninstalled
+ resfilter::ByKind( item->kind() ) ), // equal kind
+ resfilter::byEdition( item->edition() )),
+ functor::functorRef (info) );
+
+ _XDEBUG("Helper::findReinstallItem(" << item << ") => " << info.uninstalled);
+ return info.uninstalled;
+}
+
+//----------------------------------------------------------------------------
+
+class CheckIfBest : public resfilter::PoolItemFilterFunctor
+{
+ public:
+ PoolItem_Ref _item;
+ bool is_best;
+
+ CheckIfBest( PoolItem_Ref item )
+ : _item( item )
+ , is_best( true ) // assume we already have the best
+ {}
+
+ // check if provider is better. If yes, end the search.
+
+ bool operator()( PoolItem_Ref provider )
+ {
+ int archcmp = _item->arch().compare( provider->arch() );
+ if (((archcmp < 0) // provider has a better architecture
+ || ((archcmp == 0)
+ && (_item->edition().compare( provider->edition() ) < 0))) // or a better edition
+ && !provider.status().isLocked()) // and is not locked
+ {
+ is_best = false;
+ return false;
+ }
+ return true;
+ }
+};
+
+
+// check if the given item is the best one of the pool
+
+bool
+Helper::isBestUninstalledItem (const ResPool & pool, PoolItem_Ref item)
+{
+ CheckIfBest info( item );
+
+ invokeOnEach( pool.byNameBegin( item->name() ),
+ pool.byNameEnd( item->name() ),
+ functor::chain( resfilter::ByUninstalled(), // ByUninstalled
+ resfilter::ByKind( item->kind() ) ), // equal kind
+ functor::functorRef( info ) );
+
+ _XDEBUG("Helper::isBestUninstalledItem(" << item << ") => " << info.is_best);
+ return info.is_best;
+}
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionAllBranches.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionAllBranches.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionAllBranches.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionAllBranches.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,72 @@
+
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ProblemSolution.cc
+ *
+ * Easy-to use interface to the ZYPP dependency resolver
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <sstream>
+
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/solver/detail/ProblemSolutionAllBranches.h"
+
+using namespace std;
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+IMPL_PTR_TYPE(ProblemSolutionAllBranches);
+
+//---------------------------------------------------------------------------
+
+ProblemSolutionAllBranches::ProblemSolutionAllBranches( ResolverProblem_Ptr parent,
+ const bool takeAll)
+ : ProblemSolution (parent, "", "")
+ ,all(takeAll)
+{
+ if (all) {
+ _description = _("Make a solver run with ALL possibilities.");
+ _details = _("Regarding all resolvables with a compatible architecture.");
+ addAction ( new TransactionSolutionAction (ALLBRANCHES_ON));
+ } else {
+ _description = _("Make a solver run with best architecture only.");
+ _details = _("Regarding resolvables with best architecute only.");
+ addAction ( new TransactionSolutionAction (ALLBRANCHES_OFF));
+ }
+
+}
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionAllBranches.h.bak new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionAllBranches.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionAllBranches.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionAllBranches.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* Resolver_problems.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONALLBRANCHES_H
+#define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONALLBRANCHES_H
+
+#include "zypp/ProblemSolution.h"
+#include "zypp/solver/detail/Types.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+ /**
+ * Class representing one possible solution to one problem found during resolving
+ * Make the next solver run with ALL branches which are available.
+ * (Not regarding the best architecture only)
+ *
+ **/
+ class ProblemSolutionAllBranches : public ProblemSolution
+ {
+ privat:
+ bool all;
+ public:
+
+ /**
+ * Constructor.
+ **/
+ ProblemSolutionAllBranches( ResolverProblem_Ptr parent, const bool takeAll = true);
+ };
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONALLBRANCHES_H
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionDoubleTimeout.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionDoubleTimeout.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionDoubleTimeout.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionDoubleTimeout.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,64 @@
+
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ProblemSolution.cc
+ *
+ * Easy-to use interface to the ZYPP dependency resolver
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <sstream>
+
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/solver/detail/ProblemSolutionAllBranches.h"
+
+using namespace std;
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+IMPL_PTR_TYPE(ProblemSolutionAllBranches);
+
+//---------------------------------------------------------------------------
+
+ProblemSolutionAllBranches::ProblemSolutionAllBranches( ResolverProblem_Ptr parent)
+ : ProblemSolution (parent, "", "")
+{
+ _description = _("Make a solver run with ALL possibilities.");
+ _details = _("Regarding all resolvables with a compatible architecture.");
+
+ addAction ( new TransactionSolutionAction (ALLBRANCHES));
+}
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionDoubleTimeout.h.bak new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionDoubleTimeout.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionDoubleTimeout.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionDoubleTimeout.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* Resolver_problems.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONALLBRANCHES_H
+#define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONALLBRANCHES_H
+
+#include "zypp/ProblemSolution.h"
+#include "zypp/solver/detail/Types.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+ /**
+ * Class representing one possible solution to one problem found during resolving
+ * Make the next solver run with ALL branches which are available.
+ * (Not regarding the best architecture only)
+ *
+ **/
+ class ProblemSolutionAllBranches : public ProblemSolution
+ {
+ public:
+
+ /**
+ * Constructor.
+ **/
+ ProblemSolutionAllBranches( ResolverProblem_Ptr parent);
+ };
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONALLBRANCHES_H
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionIgnore.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionIgnore.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionIgnore.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionIgnore.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,143 @@
+
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ProblemSolution.cc
+ *
+ * Easy-to use interface to the ZYPP dependency resolver
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/base/Logger.h"
+#include "zypp/solver/detail/ProblemSolutionIgnore.h"
+
+using namespace std;
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+IMPL_PTR_TYPE(ProblemSolutionIgnoreConflicts);
+IMPL_PTR_TYPE(ProblemSolutionIgnoreRequires);
+IMPL_PTR_TYPE(ProblemSolutionIgnoreArchitecture);
+IMPL_PTR_TYPE(ProblemSolutionIgnoreInstalled);
+
+//---------------------------------------------------------------------------
+
+ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ const Capability & capability)
+ : ProblemSolution (parent, "", "")
+{
+ _description = _("Ignore this requirement just here");
+ addAction ( new InjectSolutionAction (item, capability, REQUIRES));
+}
+
+ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
+ PoolItemList itemList,
+ const Capability & capability)
+ : ProblemSolution (parent, "", "")
+{
+ _description = _("Generally ignore this requirement");
+ for (PoolItemList::const_iterator iter = itemList.begin();
+ iter != itemList.end(); iter++) {
+ addAction ( new InjectSolutionAction (*iter, capability, REQUIRES));
+ }
+}
+
+ProblemSolutionIgnoreArchitecture::ProblemSolutionIgnoreArchitecture( ResolverProblem_Ptr parent,
+ PoolItem_Ref item)
+ : ProblemSolution (parent, "", "")
+{
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ _description = str::form(_("Install %s although it would change the architecture"),
+ item->name().c_str());
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ _details = str::form(_("%s provides this dependency, but would change the architecture of the installed item"),
+ ResolverInfo::toString (item).c_str());
+ addAction ( new InjectSolutionAction (item, ARCHITECTURE));
+}
+
+ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ const Capability & capability,
+ PoolItem_Ref otherItem)
+ : ProblemSolution (parent, "", "")
+{
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ _description = str::form (_("Ignore this conflict of %s"),
+ item->name().c_str());
+ addAction (new InjectSolutionAction (item, capability, CONFLICTS, otherItem));
+}
+
+ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ const Capability & capability,
+ PoolItemList itemList)
+ : ProblemSolution (parent, "", "")
+{
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ _description = str::form (_("Ignore this conflict of %s"),
+ item->name().c_str());
+ for (PoolItemList::const_iterator iter = itemList.begin();
+ iter != itemList.end(); iter++) {
+ addAction (new InjectSolutionAction (item, capability, CONFLICTS, *iter));
+ }
+}
+
+ProblemSolutionIgnoreObsoletes::ProblemSolutionIgnoreObsoletes( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ const Capability & capability,
+ PoolItem_Ref otherItem)
+ : ProblemSolution (parent, "", "")
+{
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ _description = str::form (_("Ignore the obsolete %s in %s"),
+ ResolverInfo::toString (capability).c_str(),
+ otherItem->name().c_str());
+ addAction (new InjectSolutionAction (item, capability, OBSOLETES, otherItem));
+}
+
+
+ProblemSolutionIgnoreInstalled::ProblemSolutionIgnoreInstalled( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ PoolItem_Ref otherItem)
+ : ProblemSolution (parent, "", "")
+{
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ _description = str::form (_("Ignore that %s is already set to install"),
+ item->name().c_str());
+ addAction (new InjectSolutionAction (item, Capability(), INSTALLED, otherItem));
+}
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionIgnore.h.bak new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionIgnore.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionIgnore.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ProblemSolutionIgnore.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* Resolver_problems.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONIGNORE_H
+#define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONIGNORE_H
+
+#include "zypp/solver/detail/Types.h"
+#include "zypp/ProblemSolution.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+ /**
+ * Class representing one possible solution to one problem found during resolving
+ * This problem solution ignores one or more items
+ *
+ **/
+ class ProblemSolutionIgnoreConflicts : public ProblemSolution
+ {
+ public:
+
+ /**
+ * Constructor.
+ **/
+ ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ const Capability & capability,
+ PoolItem_Ref otherItem);
+ ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ const Capability & capability,
+ PoolItemList itemList);
+ };
+
+ class ProblemSolutionIgnoreRequires : public ProblemSolution
+ {
+ public:
+
+ /**
+ * Constructor.
+ **/
+ ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ const Capability & capability);
+ ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
+ PoolItemList itemList,
+ const Capability & capability);
+ };
+
+ class ProblemSolutionIgnoreArchitecture : public ProblemSolution
+ {
+ public:
+
+ /**
+ * Constructor.
+ **/
+ ProblemSolutionIgnoreArchitecture( ResolverProblem_Ptr parent,
+ PoolItem_Ref item);
+ };
+
+ class ProblemSolutionIgnoreObsoletes : public ProblemSolution
+ {
+ public:
+
+ /**
+ * Constructor.
+ **/
+ ProblemSolutionIgnoreObsoletes( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ const Capability & capability,
+ PoolItem_Ref otherItem);
+ };
+
+ class ProblemSolutionIgnoreInstalled : public ProblemSolution
+ {
+ public:
+
+ /**
+ * Constructor.
+ **/
+ ProblemSolutionIgnoreInstalled( ResolverProblem_Ptr parent,
+ PoolItem_Ref item,
+ PoolItem_Ref otherItem);
+ };
+
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONIGNORE_H
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItem.cc.bak new/libzypp-3.22.1/zypp/solver/detail/QueueItem.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItem.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItem.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,125 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* QueueItem.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/base/Logger.h"
+#include "zypp/solver/detail/QueueItem.h"
+#include "zypp/solver/detail/ResolverContext.h"
+
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(QueueItem);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+QueueItem::dumpOn( std::ostream & os ) const
+{
+ switch (_type) {
+ case QUEUE_ITEM_TYPE_UNKNOWN: os << "unknown"; break;
+ case QUEUE_ITEM_TYPE_INSTALL: os << "install"; break;
+ case QUEUE_ITEM_TYPE_REQUIRE: os << "require"; break;
+ case QUEUE_ITEM_TYPE_BRANCH: os << "branch"; break;
+ case QUEUE_ITEM_TYPE_GROUP: os << "group"; break;
+ case QUEUE_ITEM_TYPE_CONFLICT: os << "conflict"; break;
+ case QUEUE_ITEM_TYPE_UNINSTALL: os << "uninstall"; break;
+ case QUEUE_ITEM_TYPE_ESTABLISH: os << "establish"; break;
+ case QUEUE_ITEM_TYPE_LAST: os << "last"; break;
+ default: os << "?queueitem?"; break;
+ }
+ return os;
+}
+
+
+ostream&
+operator<<( ostream & os, const QueueItemList & itemlist )
+{
+ for (QueueItemList::const_iterator iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
+ if (iter != itemlist.begin())
+ os << "," << endl << "\t";
+ os << **iter;
+ }
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+QueueItem::QueueItem (QueueItemType type, const ResPool & pool)
+ : _type (type)
+ , _pool (pool)
+ , _priority (0)
+ , _size (0)
+{
+}
+
+
+QueueItem::~QueueItem()
+{
+}
+
+//---------------------------------------------------------------------------
+
+void
+QueueItem::copy (const QueueItem *from)
+{
+ _priority = from->_priority;
+ _size = from->_size;
+ _pending_info = ResolverInfoList (from->_pending_info.begin(), from->_pending_info.end());
+}
+
+
+//---------------------------------------------------------------------------
+
+void
+QueueItem::addInfo (ResolverInfo_Ptr info)
+{
+ _pending_info.push_back (info);
+}
+
+
+void
+QueueItem::logInfo (ResolverContext_Ptr context)
+{
+ for (ResolverInfoList::const_iterator iter = _pending_info.begin(); iter != _pending_info.end(); iter++) {
+ context->addInfo (*iter);
+ }
+ _pending_info.clear();
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItem.h.bak new/libzypp-3.22.1/zypp/solver/detail/QueueItem.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItem.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItem.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,142 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* QueueItem.h
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_QUEUEITEM_H
+#define ZYPP_SOLVER_DETAIL_QUEUEITEM_H
+
+#include <iosfwd>
+#include <list>
+#include <string>
+
+#include "zypp/base/ReferenceCounted.h"
+#include "zypp/base/NonCopyable.h"
+#include "zypp/base/PtrTypes.h"
+
+#include "zypp/ResPool.h"
+
+#include "zypp/solver/detail/Types.h"
+#include "zypp/solver/detail/ResolverInfo.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+typedef enum {
+ QUEUE_ITEM_TYPE_UNKNOWN = 0, // ordering is important !
+ QUEUE_ITEM_TYPE_INSTALL,
+ QUEUE_ITEM_TYPE_REQUIRE,
+ QUEUE_ITEM_TYPE_BRANCH,
+ QUEUE_ITEM_TYPE_GROUP,
+ QUEUE_ITEM_TYPE_CONFLICT,
+ QUEUE_ITEM_TYPE_UNINSTALL,
+ QUEUE_ITEM_TYPE_ESTABLISH,
+ QUEUE_ITEM_TYPE_LAST
+} QueueItemType;
+
+
+typedef std::list QueueItemList;
+
+#define CMP(a,b) (((a) < (b)) - ((b) < (a)))
+#define DEFAULTPRIO
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : QueueItem
+
+class QueueItem : public base::ReferenceCounted, private base::NonCopyable {
+
+ private:
+
+ QueueItemType _type;
+ ResPool _pool;
+
+ int _priority;
+ size_t _size;
+ ResolverInfoList _pending_info;
+
+ protected:
+
+ QueueItem (QueueItemType type, const ResPool & pool);
+
+ public:
+
+ virtual ~QueueItem();
+
+ // ---------------------------------- I/O
+
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ friend std::ostream& operator<<(std::ostream & str, const QueueItem & obj)
+ { return obj.dumpOn (str); }
+ friend std::ostream& operator<<(std::ostream & str, const QueueItemList & itemlist);
+
+ // ---------------------------------- accessors
+
+ ResPool pool (void) const { return _pool; }
+ int priority (void) const { return _priority; }
+ void setPriority (int priority) { _priority = priority; }
+ int size (void) const { return _size; }
+
+ // ---------------------------------- methods
+
+ void copy (const QueueItem *from);
+
+ bool isBranch (void) const { return _type == QUEUE_ITEM_TYPE_BRANCH; }
+ bool isConflict (void) const { return _type == QUEUE_ITEM_TYPE_CONFLICT; }
+ bool isGroup (void) const { return _type == QUEUE_ITEM_TYPE_GROUP; }
+ bool isInstall (void) const { return _type == QUEUE_ITEM_TYPE_INSTALL; }
+ bool isRequire (void) const { return _type == QUEUE_ITEM_TYPE_REQUIRE; }
+ bool isUninstall (void) const { return _type == QUEUE_ITEM_TYPE_UNINSTALL; }
+ bool isEstablish (void) const { return _type == QUEUE_ITEM_TYPE_ESTABLISH; }
+
+ virtual bool process (ResolverContext_Ptr context, QueueItemList & qil) = 0;
+ virtual QueueItem_Ptr copy (void) const = 0;
+ virtual int cmp (QueueItem_constPtr item) const = 0;
+ int compare (QueueItem_constPtr item) const { return CMP(_type, item->_type); }
+
+ // isRedundant true == can be dropped from any branch
+ virtual bool isRedundant (ResolverContext_Ptr context) const = 0;
+
+ // isSatisfied true == can be dropped from any queue, and any
+ // branch containing it can also be dropped
+ virtual bool isSatisfied (ResolverContext_Ptr context) const = 0;
+
+ void addInfo (ResolverInfo_Ptr);
+ void logInfo (ResolverContext_Ptr);
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_QUEUEITEM_H
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItemConflict.cc.bak new/libzypp-3.22.1/zypp/solver/detail/QueueItemConflict.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItemConflict.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItemConflict.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,393 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* QueueItemConflict.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/CapFactory.h"
+#include "zypp/CapSet.h"
+#include "zypp/CapMatch.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/base/Exception.h"
+
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+#include "zypp/CapAndItem.h"
+
+#include "zypp/solver/detail/Types.h"
+
+#include "zypp/solver/detail/QueueItemConflict.h"
+#include "zypp/solver/detail/QueueItemBranch.h"
+#include "zypp/solver/detail/QueueItemInstall.h"
+#include "zypp/solver/detail/QueueItemUninstall.h"
+#include "zypp/solver/detail/QueueItem.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/solver/detail/ResolverInfoConflictsWith.h"
+#include "zypp/solver/detail/ResolverInfoMisc.h"
+#include "zypp/solver/detail/ResolverInfoObsoletes.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(QueueItemConflict);
+
+#define PHI 1
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+QueueItemConflict::dumpOn( std::ostream & os ) const
+{
+ os << "[" << (_soft?"Soft":"") << "Conflict: ";
+ os << _capability;
+ os << ", Triggered by ";
+ os << _conflicting_item;
+ if (_actually_an_obsolete) os << ", Obsolete !";
+ if (_explicitly_requested) os << ", Explicit";
+ os << "]";
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+QueueItemConflict::QueueItemConflict (const ResPool & pool, const Capability & cap, PoolItem_Ref item, bool soft)
+ : QueueItem (QUEUE_ITEM_TYPE_CONFLICT, pool)
+ , _capability (cap)
+ , _conflicting_item (item)
+ , _soft (soft)
+ , _actually_an_obsolete (false)
+ , _explicitly_requested (false)
+{
+ _XDEBUG("QueueItemConflict::QueueItemConflict(" << cap << ", " << item << (soft?", soft":"") << ")");
+}
+
+
+QueueItemConflict::~QueueItemConflict()
+{
+}
+
+//---------------------------------------------------------------------------
+
+#if PHI
+
+// on conflict, try to find upgrade candidates for the installed item triggering the conflict
+// there are cases where upgrading prevents the conflict
+// rc tends to uninstall the item
+// phi tends to upgrade the item
+// testcases: exercise-02conflict-08-test.xml, exercise-02conflict-09-test.xml
+
+struct UpgradeCandidate
+{
+ PoolItem_Ref item; // the conflicting resolvable, used to filter upgrades with an identical resolvable
+ ResolverContext_Ptr context;
+ PoolItemList upgrades;
+
+ UpgradeCandidate (PoolItem_Ref pi, ResolverContext_Ptr ctx)
+ : item (pi)
+ , context (ctx)
+ { }
+
+ bool operator() (const CapAndItem & cai)
+ {
+
+ PoolItem candidate = cai.item;
+
+//MIL << "UpgradeCandidate? " << candidate << ":[" << context->getStatus (candidate) << "]" << (item->edition().compare(candidate->edition())) << "<" << item->arch() << "," << candidate->arch() << ">" << endl;
+// FIXME put this in the resfilter chain
+ ResStatus status = context->getStatus (candidate);
+ if ((item->edition().compare(candidate->edition()) < 0) // look at real upgrades
+ && item->arch() == candidate->arch() // keep the architecture
+ && (status.isUninstalled()
+ || status.isToBeUninstalled()) // FIXME: just for exercise-02conflict-03-test.xml
+ // the original solver found the uninstalled foo-2.0.1 first, this solver
+ // finds the uninstallable first. In the end, we had a duplicate solution
+ // now we have no solution. Both results are right.
+ && (!status.isImpossible()) )
+ {
+//MIL << "UpgradeCandidate! " << candidate << endl;
+ upgrades.push_back (candidate);
+ }
+ return true;
+ }
+};
+
+#endif // PHI
+
+
+//---------------------------------------------------------------------------------------
+
+struct ConflictProcess
+{
+ ResPool pool;
+ PoolItem_Ref conflict_issuer; // the item which issues 'conflicts:'
+ const Capability conflict_capability; // the capability mentioned in the 'conflicts'
+ ResolverContext_Ptr context;
+ QueueItemList & new_items;
+ bool actually_an_obsolete;
+
+ ConflictProcess (const ResPool & pl, PoolItem_Ref ci, const Capability & cc, ResolverContext_Ptr ct, QueueItemList & ni, bool ao)
+ : pool (pl)
+ , conflict_issuer (ci)
+ , conflict_capability (cc)
+ , context (ct)
+ , new_items (ni)
+ , actually_an_obsolete (ao)
+ { }
+
+ bool operator()( const CapAndItem & cai )
+ {
+ ResStatus status;
+ ResolverInfo_Ptr log_info;
+ CapFactory factory;
+
+ PoolItem provider = cai.item;
+ Capability provides = cai.cap;
+
+ _XDEBUG("conflict_process_cb (resolvable[" << provider <<"], provides[" << provides << "], conflicts with [" <<
+ conflict_issuer << " conflicts: " << conflict_capability);
+
+ /* We conflict with ourself. For the purpose of installing ourself, we
+ * just ignore it, but it's Debian's way of saying that one and only one
+ * item with this provide may exist on the system at a time. */
+
+ if (conflict_issuer
+ && compareByNVRA (provider.resolvable(), conflict_issuer.resolvable()) == 0)
+ {
+ _XDEBUG("self-conflict");
+ return true;
+ }
+
+#if 0 // Bug 220999; RPM does obsolete virtual provides too
+
+
+ /* FIXME: This should probably be a GVersion capability. */
+ /* Obsoletes don't apply to virtual provides, only the items
+ * themselves. A provide is "virtual" if it's not the same spec
+ * as the item that's providing it. This, of course, only
+ * applies to RPM, since it's the only one with obsoletes right
+ * now. */
+ Capability capTest = factory.parse ( provider->kind(), provider->name(), Rel::EQ, provider->edition());
+
+ if (actually_an_obsolete
+ && capTest.matches (provides) != CapMatch::yes )
+ {
+ _XDEBUG("obsolete to virtual provide - ignoring");
+ return true;
+ }
+
+#endif // Bug 220999; RPM does obsolete virtual provides too
+
+ status = context->getStatus(provider);
+
+ _XDEBUG("ConflictProcess (provider[" << provider << "]<" << status << ">");
+
+ if (status.staysInstalled()
+ || status.isToBeInstalledSoft())
+ {
+ ResolverInfo_Ptr log_info;
+
+#if PHI
+ _XDEBUG("Provider is installed - try upgrade");
+
+ // maybe an upgrade can resolve the conflict ?
+ // check if other item is available which upgrades
+
+ // find non-installed packages which provide the conflicting name
+
+ UpgradeCandidate upgrade_info (provider, context);
+
+ Capability maybe_upgrade_cap = factory.parse ( provider->kind(), provider->name(), Rel::ANY, Edition::noedition );
+
+ // pool->foreachProvidingResItem (maybe_upgrade_dep, upgrade_candidates_cb, (void *)&upgrade_info);
+ Dep dep( Dep::PROVIDES );
+
+ if (!actually_an_obsolete) { // The resolvable will be obsoleted by another. So it is useless finding an update candidate.
+ invokeOnEach( pool.byCapabilityIndexBegin( maybe_upgrade_cap.index(), dep ),
+ pool.byCapabilityIndexEnd( maybe_upgrade_cap.index(), dep ),
+ resfilter::ByCapMatch( maybe_upgrade_cap ),
+ functor::functorRef(upgrade_info) );
+
+ _XDEBUG("found " << upgrade_info.upgrades.size() << " upgrade candidates");
+ }
+#endif
+
+ QueueItemUninstall_Ptr uninstall = new QueueItemUninstall (pool, provider, actually_an_obsolete ? QueueItemUninstall::OBSOLETE : QueueItemUninstall::CONFLICT);
+ uninstall->setCapability (conflict_capability);
+ if (_explicitly_requested)
+ uninstall->setExplicitlyRequested();
+
+ if (actually_an_obsolete) {
+ uninstall->setDueToObsolete (conflict_issuer);
+ log_info = new ResolverInfoObsoletes (provider,
+ conflict_issuer);
+ } else {
+ uninstall->setDueToConflict ();
+ log_info = new ResolverInfoConflictsWith (provider,
+ conflict_issuer,
+ conflict_capability);
+ }
+
+ uninstall->addInfo (log_info);
+
+#if PHI
+ if (upgrade_info.upgrades.empty ()) {
+#endif
+
+ new_items.push_back (uninstall);
+
+#if PHI
+ }
+ else {
+ // there are upgrade candidates for the conflicting item
+ // branch to: 1. uninstall, 2. upgrade (for each upgrading item)
+ _DEBUG("Branching: uninstall vs. upgrade");
+ QueueItemBranch_Ptr branch = new QueueItemBranch (pool);
+
+ branch->addItem (uninstall); // try uninstall
+
+ for (PoolItemList::const_iterator iter = upgrade_info.upgrades.begin(); iter != upgrade_info.upgrades.end(); iter++) {
+ QueueItemInstall_Ptr upgrade = new QueueItemInstall (pool, *iter);
+ upgrade->setUpgrades (provider);
+ branch->addItem (upgrade); // try upgrade
+ }
+ new_items.push_back (branch);
+ }
+#endif
+
+ }
+ else if (status.isToBeInstalled()) {
+ ResolverInfoMisc_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL, provider, RESOLVER_INFO_PRIORITY_VERBOSE, provides);
+ if (conflict_issuer) {
+ misc_info->setOtherPoolItem (conflict_issuer);
+ misc_info->setOtherCapability (conflict_capability);
+ }
+ context->addError (misc_info);
+
+ }
+ else if (status.wasUninstalled()) {
+
+ context->setStatus (provider, ResStatus::impossible);
+
+ ResolverInfoMisc_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_CONFLICT_UNINSTALLABLE, provider, RESOLVER_INFO_PRIORITY_VERBOSE, provides);
+
+ misc_info->setOtherPoolItem (conflict_issuer);
+ misc_info->setOtherCapability (conflict_capability);
+
+ context->addInfo (misc_info);
+
+ }
+ else if (status.isToBeUninstalled()
+ || status.isImpossible()
+ || status.isToBeUninstalledDueToObsolete()) {
+
+ /* This is the easy case -- we do nothing. */
+ }
+ else {
+ ERR << "Unhandled status in ConflictProcess; item: " << provider << " : " << status << endl;
+ }
+
+ return true;
+
+ } // operator ()
+
+}; // struct ConflictProcess
+
+
+bool
+QueueItemConflict::process (ResolverContext_Ptr context, QueueItemList & new_items)
+{
+ _XDEBUG("QueueItemConflict::process(" << *this << ")");
+
+ // checking for ignoring dependencies
+ IgnoreMap ignoreMap = context->getIgnoreConflicts();
+ for (IgnoreMap::iterator it = ignoreMap.begin();
+ it != ignoreMap.end(); it++) {
+ if (it->first == _conflicting_item
+ && it->second == _capability) {
+ _XDEBUG("Found ignoring requires " << _capability << " for " << _conflicting_item);
+ return true;
+ } else {
+ _XDEBUG("Ignoring requires " << it->second << " for " << it->first << " does not fit");
+ }
+ }
+
+ ConflictProcess info (pool(), _conflicting_item, _capability, context, new_items, _actually_an_obsolete);
+
+ // world()->foreachProvidingPoolItem (_capability, conflict_process_cb, (void *)&info);
+
+ Dep dep( Dep::PROVIDES );
+ invokeOnEach( pool().byCapabilityIndexBegin( _capability.index(), dep ),
+ pool().byCapabilityIndexEnd( _capability.index(), dep ),
+ resfilter::ByCapMatch( _capability ),
+ functor::functorRef(info) );
+
+ return true;
+}
+
+
+//---------------------------------------------------------------------------
+
+QueueItem_Ptr
+QueueItemConflict::copy (void) const
+{
+ QueueItemConflict_Ptr new_conflict = new QueueItemConflict (pool(), _capability, _conflicting_item);
+ new_conflict->QueueItem::copy(this);
+
+ // _actually_an_obsolete is not being copied !
+ new_uninstall->_explicitly_requested = _explicitly_requested;
+
+ return new_conflict;
+}
+
+
+int
+QueueItemConflict::cmp (QueueItem_constPtr item) const
+{
+ int cmp = this->compare (item); // assures equal type
+ if (cmp != 0)
+ return cmp;
+
+ QueueItemConflict_constPtr conflict = dynamic_pointer_cast<const QueueItemConflict>(item);
+ if ( _capability != conflict->capability())
+ cmp = -1;
+
+ return cmp;
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItemConflict.h.bak new/libzypp-3.22.1/zypp/solver/detail/QueueItemConflict.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItemConflict.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItemConflict.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* QueueItemConflict.h
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_QUEUEITEMCONFLICT_H
+#define ZYPP_SOLVER_DETAIL_QUEUEITEMCONFLICT_H
+
+#include <iosfwd>
+#include <list>
+#include <string>
+
+#include "zypp/solver/detail/Types.h"
+#include "zypp/solver/detail/QueueItem.h"
+
+#include "zypp/Capability.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : QueueItemConflict
+
+class QueueItemConflict : public QueueItem {
+
+
+ private:
+ const Capability _capability; // the conflicting capability
+ PoolItem_Ref _conflicting_item; // the item which issued the conflict, can be 'empty' for 'extraConflicts'
+ bool _soft;
+
+ bool _actually_an_obsolete;
+
+ public:
+
+ QueueItemConflict (const ResPool & pool, const Capability & capability, PoolItem_Ref item, bool soft = false);
+ virtual ~QueueItemConflict();
+
+ // ---------------------------------- I/O
+
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ friend std::ostream& operator<<(std::ostream & str, const QueueItemConflict & obj)
+ { return obj.dumpOn (str); }
+
+ // ---------------------------------- accessors
+
+ const Capability & capability (void) const { return _capability; }
+ bool isSoft (void) const { return _soft; }
+ bool actuallyAnObsolete (void) const { return _actually_an_obsolete; }
+ void setActuallyAnObsolete (void) { _actually_an_obsolete = true; }
+
+ // ---------------------------------- methods
+
+ virtual bool process (ResolverContext_Ptr context, QueueItemList & qil);
+ virtual QueueItem_Ptr copy (void) const;
+ virtual int cmp (QueueItem_constPtr item) const;
+ virtual bool isRedundant (ResolverContext_Ptr context) const { return false; }
+ virtual bool isSatisfied (ResolverContext_Ptr context) const { return false; }
+
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOLVER_DETAIL_QUEUEITEMCONFLICT_H
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItemEstablish.cc.bak new/libzypp-3.22.1/zypp/solver/detail/QueueItemEstablish.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItemEstablish.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItemEstablish.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,288 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* QueueItemEstablish.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/solver/detail/Types.h"
+
+#include "zypp/solver/detail/QueueItemEstablish.h"
+#include "zypp/solver/detail/QueueItemInstall.h"
+#include "zypp/solver/detail/QueueItemRequire.h"
+#include "zypp/solver/detail/QueueItemConflict.h"
+#include "zypp/solver/detail/QueueItem.h"
+#include "zypp/solver/detail/Helper.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/solver/detail/ResolverInfoConflictsWith.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
+#include "zypp/solver/detail/ResolverInfoMisc.h"
+
+#include "zypp/CapSet.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(QueueItemEstablish);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+QueueItemEstablish::dumpOn( std::ostream & os ) const
+{
+ os <<"[Establish: ";
+ os << _item;
+ if (_explicitly_requested) os << ", Explicit !";
+ os << "]";
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+QueueItemEstablish::QueueItemEstablish (const ResPool & pool, PoolItem_Ref item, bool soft)
+ : QueueItem (QUEUE_ITEM_TYPE_ESTABLISH, pool)
+ , _item(item)
+ , _soft(soft)
+ , _channel_priority (0)
+ , _other_penalty (0)
+ , _explicitly_requested (false)
+{
+ _XDEBUG("QueueItemEstablish::QueueItemEstablish (" << item << ")");
+
+}
+
+
+QueueItemEstablish::~QueueItemEstablish()
+{
+}
+
+//---------------------------------------------------------------------------
+
+bool
+QueueItemEstablish::isSatisfied (ResolverContext_Ptr context) const
+{
+ return context->isPresent (_item);
+}
+
+
+//---------------------------------------------------------------------------
+
+
+bool
+QueueItemEstablish::process (ResolverContext_Ptr context, QueueItemList & qil)
+{
+ _XDEBUG("QueueItemEstablish::process(" << *this << ")");
+
+ ResStatus status = context->getStatus(_item);
+
+ if (_item.status().isLocked()
+ || status.isLocked()) {
+ _XDEBUG("Item " << _item << " is locked. --> NO establish");
+ return true;
+ }
+ if ( ! _item->arch().compatibleWith( context->architecture() ) ) {
+ context->unneeded (_item, _other_penalty);
+ _XDEBUG( _item << " has incompatible architecture, unneeded" );
+ return true;
+ }
+
+ _item.status().setUndetermined(); // reset any previous establish state
+
+ CapSet freshens = _item->dep(Dep::FRESHENS);
+
+ _XDEBUG("simple establish of " << _item << " with " << freshens.size() << " freshens");
+
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_ESTABLISHING, _item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ context->addInfo (misc_info);
+ logInfo (context);
+
+ /* Loop through all freshen dependencies. If one is satisfied, queue the _item for installation. */
+
+ CapSet::const_iterator iter;
+ for (iter = freshens.begin(); iter != freshens.end(); iter++) {
+ const Capability cap = *iter;
+ bool dummy1, dummy2;
+ if (context->requirementIsMet (cap, _item, Dep::FRESHENS, dummy1, dummy2, true)) { //true =installInfoFlag
+ _XDEBUG("this freshens " << cap);
+ break;
+ }
+ }
+
+ // if we have freshens but none of the freshen deps were met, mark the _item as unneeded
+ // else we look at its supplements as an additional condition
+ // (freshens AND supplements must be true. true means either empty or at least one match)
+ //
+ // else we look at its requires to set it to satisfied or incomplete
+
+ if (freshens.size() > 0 // have freshens !
+ && iter == freshens.end()) // but none matched
+ {
+ _XDEBUG(_item << " freshens nothing -> unneeded");
+ if (_item->kind() != ResTraits<Package>::kind)
+ context->unneeded (_item, _other_penalty);
+ }
+ else { // installed or no freshens or triggered freshens
+
+ CapSet supplements = _item->dep(Dep::SUPPLEMENTS);
+ if (supplements.size() != 0) { // if we have supplements, they must _also_ trigger
+ CapSet::const_iterator iter;
+ for (iter = supplements.begin(); iter != supplements.end(); iter++) {
+ const Capability cap = *iter;
+ bool dummy1, dummy2;
+ if (context->requirementIsMet (cap, _item, Dep::SUPPLEMENTS, dummy1, dummy2, true)) { //true =installInfoFlag
+ _XDEBUG("this supplements " << cap);
+ break;
+ }
+ }
+ if (iter == supplements.end()) {
+ _XDEBUG(_item << " none of the supplements match -> unneeded");
+ if (_item->kind() != ResTraits<Package>::kind)
+ context->unneeded (_item, _other_penalty);
+ return true;
+ }
+
+ PoolItem_Ref installed = Helper::findInstalledItem( pool(), _item );
+ if (!installed // not installed
+ && Helper::isBestUninstalledItem( pool(), _item )) // and no better available -> install
+ {
+ // not yet installed, have supplements, and at least one triggers -> install
+ _DEBUG("Uninstalled " << _item << " supplements " << *iter << " -> install");
+ QueueItemInstall_Ptr install_item = new QueueItemInstall( pool(), _item, true );
+ qil.push_front( install_item );
+ return true;
+ }
+ }
+
+ // the conditions (freshens, supplements) are true (either empty or at least one match)
+ // for a package, these are sufficient to trigger its installation. (packages only get
+ // 'established' if they have freshens or supplements).
+ // While this is fine for e.g. fonts etc. its problematic for kernel driver packages.
+ // We must not install kernel driver packages which (via their dependencies) will install
+ // additional kernels. So for kernel driver packages, checking their requires is indeed
+ // the right thing. (see #178721)
+
+ // So the current code checks all requirements and only triggers an install if
+ // - all requirements are already fulfilled
+ // - the package is not already installed (so we do only fresh installs, no upgrades here)
+
+ // for other kind of resolvables, we now look at their requirements and set their
+ // 'state modifier' accordingly.
+
+
+ CapSet requires = _item->dep(Dep::REQUIRES); // check requirements
+ Capability missing;
+ bool all_unneeded = true; // check if all are met because of unneeded
+ for (iter = requires.begin(); iter != requires.end(); iter++) {
+ missing = *iter;
+ bool unneeded;
+ if (!context->requirementIsMet (missing, _item, Dep::REQUIRES, &unneeded)) {
+ all_unneeded = false;
+ break;
+ }
+ if (!unneeded) all_unneeded = false;
+ }
+ if (iter == requires.end()) { // all are met
+ if (all_unneeded
+ && _item->kind() == ResTraits<Patch>::kind) // unneeded is transitive only for patches (#171590)
+ {
+ _XDEBUG("all requirements of " << _item << " unneeded -> unneeded");
+ context->unneeded( _item, _other_penalty );
+ }
+ else if (_item->kind() == ResTraits<Package>::kind) // install package if not installed yet.
+ {
+ PoolItem_Ref installed = Helper::findInstalledItem( pool(), _item );
+ if (!installed // not installed
+ && Helper::isBestUninstalledItem( pool(), _item )) // and no better available -> install
+ {
+ // freshens and at least one triggers -> install
+ _DEBUG("Uninstalled " << _item << " freshens -> install");
+ QueueItemInstall_Ptr install_item = new QueueItemInstall( pool(), _item, true );
+ qil.push_front( install_item );
+ return true;
+ }
+ }
+ else
+ {
+ _XDEBUG("all requirements of " << _item << " met -> satisfied");
+ context->satisfy( _item, _other_penalty );
+ }
+ }
+ else { // some requirements are unfulfilled
+ // If the item stays installed, blame the user
+ if ((_item->kind() == ResTraits<Patch>::kind // bug 198379, set incomplete for all patches, installed or uninstalled
+ || _item->kind() == ResTraits<Atom>::kind) // Bug 190272, - same for atoms
+ || status.staysInstalled())
+ {
+ _XDEBUG("Atom/Patch/Installed/Establishing " << _item << " has unfulfilled requirement " << *iter << " -> incomplete");
+ context->incomplete( _item, _other_penalty );
+ }
+ else {
+ _XDEBUG("Transacted " << _item << " has unfulfilled requirement " << *iter << " -> leave");
+ // do nothing, because its either toBeInstalled or toBeUninstalled
+ }
+ }
+ }
+
+ return true;
+}
+
+
+QueueItem_Ptr
+QueueItemEstablish::copy (void) const
+{
+ QueueItemEstablish_Ptr new_install = new QueueItemEstablish (pool(), _item, _soft);
+ new_install->QueueItem::copy(this);
+
+ new_install->_channel_priority = _channel_priority;
+ new_install->_other_penalty = _other_penalty;
+ new_install->_explicitly_requested = _explicitly_requested;
+
+ return new_install;
+}
+
+
+int
+QueueItemEstablish::cmp (QueueItem_constPtr item) const
+{
+ int cmp = this->compare (item);
+ if (cmp != 0)
+ return cmp;
+ QueueItemEstablish_constPtr establish = dynamic_pointer_cast<const QueueItemEstablish>(item);
+ return compareByNVR(_item.resolvable(), establish->_item.resolvable());
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItemInstall.cc.bak new/libzypp-3.22.1/zypp/solver/detail/QueueItemInstall.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItemInstall.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItemInstall.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,615 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* QueueItemInstall.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/CapFactory.h"
+#include "zypp/CapSet.h"
+#include "zypp/Package.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+#include "zypp/CapMatchHelper.h"
+
+#include "zypp/solver/detail/QueueItemInstall.h"
+#include "zypp/solver/detail/QueueItemEstablish.h"
+#include "zypp/solver/detail/QueueItemUninstall.h"
+#include "zypp/solver/detail/QueueItemRequire.h"
+#include "zypp/solver/detail/QueueItemConflict.h"
+#include "zypp/solver/detail/QueueItem.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/solver/detail/ResolverInfoConflictsWith.h"
+#include "zypp/solver/detail/ResolverInfoMisc.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
+#include "zypp/solver/detail/Helper.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(QueueItemInstall);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+QueueItemInstall::dumpOn( std::ostream & os ) const
+{
+ os << "[" << (_soft?"Soft":"") << "Install: ";
+ os << _item;
+ if (_upgrades) {
+ os << ", Upgrades ";
+ os << _upgrades;
+ }
+ if (_dep_satisfied_by_this_install != Capability::noCap) {
+ os << ", Satisfies [" << _dep_satisfied_by_this_install << "]";
+ }
+ if (_needed_by) {
+ os << ", Needed by " << _needed_by;
+ }
+ if (_explicitly_requested) os << ", Explicit !";
+ os << "]";
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+QueueItemInstall::QueueItemInstall (const ResPool & pool, PoolItem_Ref item, bool soft)
+ : QueueItem (QUEUE_ITEM_TYPE_INSTALL, pool)
+ , _item (item)
+ , _soft (soft)
+ , _dep_satisfied_by_this_install (Capability::noCap)
+ , _needed_by (PoolItem_Ref())
+ , _channel_priority (0)
+ , _other_penalty (0)
+ , _explicitly_requested (false)
+{
+ Resolvable::constPtr res = item.resolvable();
+
+ // Atoms are by default parallel installable (cf #181103)
+ bool install_in_parallel = isKind<Atom>( res );
+
+ // if its not an atom, check if its a package with 'install-only' set
+ if (!install_in_parallel) {
+ Package::constPtr pkg = asKind<Package>( res );
+ install_in_parallel = (pkg != NULL) && pkg->installOnly();
+ }
+
+ // if its not parallel installable
+ // check if this install upgrades anything
+
+ if (!install_in_parallel) {
+ _upgrades = Helper::findInstalledItem (pool, item);
+ }
+
+ _XDEBUG("QueueItemInstall::QueueItemInstall(" << item << (soft?", soft":"") << ") upgrades " << _upgrades);
+}
+
+
+QueueItemInstall::~QueueItemInstall()
+{
+}
+
+//---------------------------------------------------------------------------
+
+bool
+QueueItemInstall::isSatisfied (ResolverContext_Ptr context) const
+{
+ return context->isPresent (_item);
+}
+
+
+//---------------------------------------------------------------------------
+
+// Handle items which freshen or supplement us -> re-establish them
+
+// see also FreshenState in Resolver.cc
+// see also UninstallEstablishItem in QueueItemUninstall.cc
+
+typedef map EstablishMap;
+
+struct InstallEstablishItem
+{
+ EstablishMap establishmap;
+
+ InstallEstablishItem ()
+ { }
+
+
+ // provider has a freshens on a just to-be-installed item
+ // re-establish provider, maybe its incomplete now
+
+ bool operator()( const CapAndItem & cai )
+ {
+ _XDEBUG("QueueItemInstall::InstallEstablishItem (" << cai.item << ", " << cai.cap << ")");
+
+ // only consider best architecture, best edition
+
+ PoolItem_Ref item( cai.item );
+
+ EstablishMap::iterator it = establishmap.find( item->name() );
+
+ if (it != establishmap.end()) { // item with same name found
+ int cmp = it->second->arch().compare( item->arch() );
+ if (cmp < 0) { // new item has better arch
+ it->second = item;
+ }
+ else if (cmp == 0) { // new item has equal arch
+ if (it->second->edition().compare( item->edition() ) < 0) {
+ it->second = item; // new item has better edition
+ }
+ }
+ }
+ else {
+ establishmap[item->name()] = item;
+ }
+ return true;
+ }
+};
+
+
+
+//---------------------------------------------------------------------------
+
+// Handle items which conflict us -> uninstall them
+
+struct UninstallConflicting
+{
+ ResolverContext_Ptr _context;
+ const Capability _provided_cap;
+ PoolItem _install_item; // the to-be-installed item issuing the conflict
+ PoolItem _upgrade_item; // the installed, to-be-upgraded item (might be empty if its a fresh install)
+ QueueItemList & _qil;
+ bool ignored;
+
+ UninstallConflicting( ResolverContext_Ptr ctx, const Capability & provided_cap, PoolItem install_item, PoolItem upgrade_item, QueueItemList & qil )
+ : _context( ctx )
+ , _provided_cap( provided_cap )
+ , _install_item( install_item )
+ , _upgrade_item( upgrade_item )
+ , _qil( qil )
+ , ignored( false )
+ { }
+
+
+ // conflicting_item provides a capability (conflicting_cap), _install_item lists as conflicts.
+
+ bool operator()( const CapAndItem & cai)
+ {
+ PoolItem_Ref conflicting_item = cai.item;
+
+ _XDEBUG("UninstallConflicting(" << conflicting_item << ", cap " << cai.cap << ")");
+
+ if (conflicting_item == _install_item) { // self conflict ?
+ WAR << "Ignoring self-conflicts" << endl;
+ return true;
+ }
+ if (conflicting_item == _upgrade_item) { // upgrade conflict ?
+ _XDEBUG("We're upgrading the conflicting item");
+ return true;
+ }
+
+ const Capability conflicting_cap = cai.cap;
+ ResolverInfo_Ptr log_info;
+ QueueItemUninstall_Ptr uninstall_item;
+
+ IgnoreMap ignoreMap = _context->getIgnoreConflicts(); // ignored conflict ?
+ // checking for ignoring dependencies
+ for (IgnoreMap::iterator it = ignoreMap.begin(); it != ignoreMap.end(); it++) {
+ if (it->first == conflicting_item
+ && it->second == conflicting_cap)
+ {
+ _XDEBUG("Found ignoring conflicts " << conflicting_cap << " for " << conflicting_item);
+ ignored = true;
+ return false; // stop iteration
+ } else {
+ _XDEBUG("Ignoring conflict " << it->second << " for " << it->first << " does not fit");
+ }
+ }
+
+ /* Check to see if we conflict with ourself and don't create
+ * an uninstall item for it if we do. This is Debian's way of
+ * saying that one and only one item with this provide may
+ * exist on the system at a time.
+ */
+
+ if (compareByNVR (conflicting_item.resolvable(), _install_item.resolvable()) == 0) {
+ return true;
+ }
+
+#warning Make behaviour configurable
+ // If the package is installed or is set to be installed by the user,
+ // let the user decide deleting conflicting package. This is only an info.
+ // Try at first updating packages.
+ //
+ ResStatus confl_status = _context->getStatus( conflicting_item );
+ if (confl_status.isToBeInstalled() // scheduled for installation
+ || confl_status.staysInstalled()) // not scheduled at all but installed
+ {
+ ResolverInfoMisc_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL,
+ _install_item, RESOLVER_INFO_PRIORITY_VERBOSE, _provided_cap);
+ misc_info->setOtherPoolItem (conflicting_item);
+ misc_info->setOtherCapability (conflicting_cap);
+ _context->addInfo (misc_info);
+ }
+
+ _XDEBUG("because: '" << conflicting_item << "'conflicts " << conflicting_cap);
+
+ QueueItemUninstall_Ptr uninstall_qitem = new QueueItemUninstall (_context->pool(), conflicting_item, QueueItemUninstall::CONFLICT);
+ uninstall_qitem->setDueToConflict ();
+ uninstall_qitem->setPriority(-1); // evaluate explizit uninstall first (greater priority) in order
+ // to be sure, that this item still exist after the solver run would be finished. Bug 273918
+ log_info = new ResolverInfoConflictsWith (conflicting_item, _install_item,
+ conflicting_cap);
+ uninstall_qitem->addInfo (log_info);
+ _qil.push_front (uninstall_qitem);
+
+ return true;
+ }
+};
+
+//---------------------------------------------------------------------------------------
+
+bool
+QueueItemInstall::process (ResolverContext_Ptr context, QueueItemList & qil)
+{
+ ResStatus status = context->getStatus(_item);
+
+ _XDEBUG( "QueueItemInstall::process(" << *this << "):" << status);
+
+ /* Log which item need this install */
+
+ if (_needed_by) {
+
+ ResolverInfoNeededBy_Ptr info;
+
+ info = new ResolverInfoNeededBy (_item);
+ info->addRelatedPoolItem (_needed_by);
+ info->setCapability (_dep_satisfied_by_this_install, _soft?Dep::RECOMMENDS:Dep::REQUIRES);
+ info->setInitialInstallation (true);
+ context->addInfo (info);
+ }
+
+ /* If we are trying to upgrade item A with item B and they both have the
+ same version number, do nothing. This shouldn't happen in general with
+ zypp, but can come up with the installer & autopull. */
+
+ if (_upgrades
+ && compareByNVRA(_item.resolvable(), _upgrades.resolvable()) == 0)
+ {
+ if (_item->kind() == ResTraits<Package>::kind) {
+ ResolverInfo_Ptr info;
+ _DEBUG("install of " << _item << " upgrades itself, skipping");
+
+ info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_SKIPPING, _item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ context->addInfo (info);
+ goto finished;
+ }
+ else {
+ _DEBUG("re-install " << _item);
+ }
+ }
+
+ // check if this install is still needed
+ // (maybe other resolver processing made this install obsolete
+
+ if (_needed_by) {
+ _XDEBUG( "still needed ");
+
+ ResStatus status = _needed_by.status();
+ _XDEBUG("by: [status: " << status << "] " << _needed_by);
+ if ( status.isToBeUninstalled()
+ || status.isImpossible())
+ {
+ goto finished;
+ }
+ }
+
+ /* If we are in verify mode and this install is about to fail, don't let it happen...
+ instead, we try to back out of the install by removing whatever it was that
+ needed this. */
+
+ if (context->verifying()
+ && (status.isToBeUninstalled() || status.isImpossible())
+ && _needed_by) {
+
+ QueueItemUninstall_Ptr uninstall_item;
+ uninstall_item = new QueueItemUninstall (pool(), _needed_by, QueueItemUninstall::BACKOUT);
+ qil.push_front (uninstall_item);
+
+ goto finished;
+ }
+
+ // If this install is due to a needed, convert it to a normal install
+
+ if (status.isNeeded()) {
+ context->setStatus (_item, _soft ? ResStatus::toBeInstalledSoft : ResStatus::toBeInstalled);
+ }
+
+
+ // if this install upgrades an installed resolvable, explicitly uninstall this one
+ // in order to ensure that all dependencies are still met after the upgrade
+
+ if (!_upgrades) {
+
+ _XDEBUG("trying simple install of " << _item);
+ if (!context->install (_item, context->verifying() || _soft, _other_penalty))
+ goto finished;
+
+ }
+ else {
+
+ QueueItemUninstall_Ptr uninstall_item;
+
+ _XDEBUG("trying upgrade install of " << _item);
+
+ if (!context->upgrade (_item, _upgrades, context->verifying() || _soft, _other_penalty)) {
+ // invalid solution
+ ResolverInfo_Ptr info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INVALID_SOLUTION, PoolItem_Ref(), RESOLVER_INFO_PRIORITY_VERBOSE);
+ context->addError (info);
+ goto finished;
+ }
+
+ // the upgrade will uninstall the installed one, take care of this
+
+ uninstall_item = new QueueItemUninstall (pool(), _upgrades, QueueItemUninstall::UPGRADE );
+ uninstall_item->setUpgradedTo (_item);
+
+ if (_explicitly_requested)
+ uninstall_item->setExplicitlyRequested ();
+
+ qil.push_front (uninstall_item);
+
+ }
+
+
+ // we're done if this isn't currently uninstalled or incomplete
+
+ if (! (status.staysUninstalled()
+ || status.isToBeUninstalledDueToUnlink()
+ || status.isIncomplete()
+ || status.isSatisfied()))
+ {
+ _XDEBUG("status " << status << " -> finished");
+ goto finished;
+ }
+
+ _XDEBUG("status " << status << " -> NOT finished");
+ { // just a block for local initializers, the goto above makes this necessary
+
+ ResolverInfoMisc_Ptr misc_info;
+
+ if (_upgrades) {
+
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UPDATING, _item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ misc_info->setOtherPoolItem (_upgrades);
+
+ } else {
+
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INSTALLING, _item, RESOLVER_INFO_PRIORITY_VERBOSE);
+
+ }
+
+ context->addInfo (misc_info);
+ logInfo (context);
+
+ /* Construct require items for each of the item's requires that is still unsatisfied. */
+
+ CapSet caps;
+
+ caps = _item->dep (Dep::REQUIRES);
+
+ for (CapSet::const_iterator iter = caps.begin(); iter != caps.end(); iter++) {
+
+ const Capability cap = *iter;
+ _XDEBUG("this requires " << cap);
+ bool fulfilled = false;
+
+ fulfilled = context->requirementIsInstalledOrUnneeded (cap, _item, Dep::REQUIRES);
+
+ if (!fulfilled) {
+ _XDEBUG("this requirement is still unfulfilled");
+ QueueItemRequire_Ptr req_item = new QueueItemRequire (pool(), cap );
+ req_item->addPoolItem (_item);
+ qil.push_front (req_item);
+ }
+ }
+
+ caps = _item->dep (Dep::RECOMMENDS);
+
+ for (CapSet::const_iterator iter = caps.begin(); iter != caps.end(); iter++) {
+
+ const Capability cap = *iter;
+ _XDEBUG("this recommends " << cap);
+
+ if (!context->requirementIsMet (cap, _item, Dep::RECOMMENDS)) {
+ _XDEBUG("this recommends is still unfulfilled");
+ QueueItemRequire_Ptr req_item = new QueueItemRequire (pool(), cap, true); // this is a soft requires
+ req_item->addPoolItem (_item);
+ qil.push_front (req_item);
+ }
+
+ }
+
+ /* Construct conflict items for each of the item's conflicts. */
+
+ caps = _item->dep (Dep::CONFLICTS);
+ for (CapSet::const_iterator iter = caps.begin(); iter != caps.end(); iter++) {
+ const Capability cap = *iter;
+ _XDEBUG("this conflicts with '" << cap << "'");
+ QueueItemConflict_Ptr conflict_item = new QueueItemConflict (pool(), cap, _item );
+ // Push the QueueItem at the END of the list in order to favourite conflicts caused
+ // by obsolating this item.
+ qil.push_back (conflict_item);
+ }
+
+ /* Construct conflict items for each of the item's obsoletes. */
+
+ caps = _item->dep (Dep::OBSOLETES);
+ IgnoreMap ignoreMap = context->getIgnoreObsoletes();
+
+ for (CapSet::const_iterator iter = caps.begin(); iter != caps.end(); iter++) {
+ const Capability cap = *iter;
+ bool found = false;
+ for (IgnoreMap::iterator it = ignoreMap.begin();
+ it != ignoreMap.end(); it++) {
+ if (it->first == _item
+ && it->second == cap) {
+ _XDEBUG("Found ignoring obsoletes " << cap << " for " << _item);
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ _XDEBUG("this obsoletes " << cap);
+ QueueItemConflict_Ptr conflict_item = new QueueItemConflict (pool(), cap, _item );
+ conflict_item->setActuallyAnObsolete();
+ // Push the QueueItem at the BEGIN of the list in order to favourite this confict
+ // comparing to "normal" conflicts, cause this item will be deleted. So other
+ // conflicts will not be regarded in the future.
+ qil.push_front (conflict_item);
+ }
+ }
+
+ // Go over each provides of the to-be-uninstalled item and
+ // - re-establish any freshens
+ // - re-establish any supplements
+ // - find items that conflict with us and try to uninstall it if it is useful
+
+ InstallEstablishItem establish;
+
+ caps = _item->dep (Dep::PROVIDES);
+ bool ignored = false;
+
+ for (CapSet::const_iterator iter = caps.begin(); iter != caps.end(); iter++) {
+ const Capability cap = *iter;
+
+ /* Construct establish items for each of those which
+ freshen or supplement and provides of this resolvable. */
+
+ _XDEBUG("Re-establish all freshens on " << cap);
+ // pool ()->foreachFresheningResItem (cap, establish_freshens_cb, &info);
+
+ Dep dep( Dep::FRESHENS);
+ invokeOnEach( pool().byCapabilityIndexBegin( cap.index(), dep ), // begin()
+ pool().byCapabilityIndexEnd( cap.index(), dep ), // end()
+ resfilter::ByCapMatch( cap ),
+ functor::functorRef( establish ) );
+
+ dep = Dep::SUPPLEMENTS;
+ invokeOnEach( pool().byCapabilityIndexBegin( cap.index(), dep ), // begin()
+ pool().byCapabilityIndexEnd( cap.index(), dep ), // end()
+ resfilter::ByCapMatch( cap ),
+ functor::functorRef( establish ) );
+
+ if (!ignored) {
+ // Search items that conflict with us and try to uninstall it if it is useful
+
+ UninstallConflicting info( context, cap, _item, _upgrades, qil );
+
+ Dep dep( Dep::CONFLICTS );
+ invokeOnEach( pool().byCapabilityIndexBegin( cap.index(), dep ),
+ pool().byCapabilityIndexEnd( cap.index(), dep ),
+ resfilter::ByCapMatch( cap ),
+ functor::functorRef( info ) );
+
+ ignored = info.ignored; // user choose to ignore these conflitcs
+ }
+
+ } // iterate over all provides
+
+ // schedule all collected items for establish
+
+ for (EstablishMap::iterator firstIt = establish.establishmap.begin(); firstIt != establish.establishmap.end(); ++firstIt) {
+ bool conflictFound = false;
+ CapSet provides = firstIt->second.resolvable()->deps()[Dep::PROVIDES];
+ // It is useless to establish items which are conflicting with eachother. So they will
+ // be filtered out. bug 243595
+ for (EstablishMap::iterator secondIt = firstIt; secondIt != establish.establishmap.end() && !conflictFound; ++secondIt) {
+ CapSet conflicts = secondIt->second.resolvable()->deps()[Dep::CONFLICTS];
+ if (hasMatches (provides,conflicts)) {
+ conflictFound = true;
+ _XDEBUG("Do not establish " << firstIt->second << " cause it is conflicting with " << secondIt->second );
+ }
+ }
+
+ if (!conflictFound) {
+ QueueItemEstablish_Ptr establish_item = new QueueItemEstablish (pool(), firstIt->second, true);
+ qil.push_front( establish_item );
+ }
+ }
+
+ } // end of goto-over-definitions-to-finished block
+
+ finished:
+
+ return true;
+}
+
+
+QueueItem_Ptr
+QueueItemInstall::copy (void) const
+{
+ QueueItemInstall_Ptr new_install = new QueueItemInstall (pool(), _item);
+ new_install->QueueItem::copy(this);
+
+ new_install->_upgrades = _upgrades;
+ new_install->_dep_satisfied_by_this_install = _dep_satisfied_by_this_install;
+ new_install->_needed_by = _needed_by;
+ new_install->_channel_priority = _channel_priority;
+ new_install->_other_penalty = _other_penalty;
+ new_install->_explicitly_requested = _explicitly_requested;
+
+ return new_install;
+}
+
+
+int
+QueueItemInstall::cmp (QueueItem_constPtr item) const
+{
+ int cmp = this->compare (item);
+ if (cmp != 0)
+ return cmp;
+ QueueItemInstall_constPtr install = dynamic_pointer_cast<const QueueItemInstall>(item);
+ return compareByNVRA (_item.resolvable(), install->_item.resolvable());
+}
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItemRequire.cc new/libzypp-3.22.1/zypp/solver/detail/QueueItemRequire.cc
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItemRequire.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItemRequire.cc 2007-09-07 14:53:31.000000000 +0200
@@ -25,7 +25,7 @@
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
#include "zypp/base/Gettext.h"
-
+#include "zypp/VendorAttr.h"
#include "zypp/base/Algorithm.h"
#include "zypp/ResPool.h"
#include "zypp/ResFilters.h"
@@ -221,10 +221,10 @@
bool vendorFit = true;
if ( provider
&& upgrades
- && provider->vendor() != upgrades->vendor()) {
+ && !VendorAttr::instance().equivalent(provider->vendor(), upgrades->vendor())) {
// checking if there is already an ignore
MIL << "provider " << provider << " has ANOTHER vendor '" << provider->vendor() << "' than the updated item "
- << upgrades << endl;
+ << upgrades << "(vendor: " << upgrades->vendor() << ")" << endl;
PoolItemList ignore = _context->getIgnoreVendorItem();
PoolItemList::iterator it;
for (it = ignore.begin(); it != ignore.end(); ++it) {
@@ -348,7 +348,9 @@
} else if (provider.status().isKept() && provider.status().isByUser()) {
misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_KEEP_PROVIDER, requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
misc_info->setOtherPoolItem (provider);
- } else if (provider->vendor() != requirer->vendor()) {
+ } else if (provider
+ && requirer
+ && !VendorAttr::instance().equivalent(provider->vendor(), requirer->vendor())) {
misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_OTHER_VENDOR_PROVIDER,
requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
misc_info->setOtherPoolItem (provider);
@@ -615,7 +617,6 @@
}
// now check if a provider supplements or enhances an installed or to-be-installed resolvable
-
if (hint_match( item->dep( Dep::SUPPLEMENTS ), pool() )
|| hint_match( item->dep( Dep::ENHANCES ), pool() ))
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItemRequire.cc.bak new/libzypp-3.22.1/zypp/solver/detail/QueueItemRequire.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItemRequire.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItemRequire.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,1059 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* QueueItemRequire.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <sstream>
+
+#include "zypp/CapSet.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/VendorAttr.h"
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+#include "zypp/ResStatus.h"
+#include "zypp/Dep.h"
+
+#include "zypp/ZYppFactory.h"
+
+#include "zypp/solver/detail/QueueItemRequire.h"
+#include "zypp/solver/detail/QueueItemBranch.h"
+#include "zypp/solver/detail/QueueItemUninstall.h"
+#include "zypp/solver/detail/QueueItemInstall.h"
+#include "zypp/solver/detail/QueueItem.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/solver/detail/ResolverInfoDependsOn.h"
+#include "zypp/solver/detail/ResolverInfoMisc.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
+#include "zypp/solver/detail/ResolverInfoMissingReq.h"
+#include "zypp/solver/detail/Helper.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(QueueItemRequire);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+QueueItemRequire::dumpOn( std::ostream & os ) const
+{
+ os << "[" << (_soft?"Soft":"") << "Require: ";
+ os << _capability;
+ if (_requiring_item) {
+ os << ", Required by " << _requiring_item;
+ }
+ if (_upgraded_item) {
+ os << ", Upgrades " << _upgraded_item;
+ }
+ if (_lost_item) {
+ os << ", Lost " << _lost_item;
+ }
+ if (_remove_only) os << ", Remove Only";
+ return os << "]";
+}
+
+//---------------------------------------------------------------------------
+
+QueueItemRequire::QueueItemRequire (const ResPool & pool, const Capability & cap, bool soft)
+ : QueueItem (QUEUE_ITEM_TYPE_REQUIRE, pool)
+ , _capability (cap)
+ , _soft (soft)
+ , _remove_only (false)
+{
+ _XDEBUG("QueueItemRequire::QueueItemRequire(" << cap << (soft?", soft":"") << ")");
+}
+
+
+QueueItemRequire::~QueueItemRequire()
+{
+}
+
+//---------------------------------------------------------------------------
+
+void
+QueueItemRequire::addPoolItem (PoolItem_Ref item)
+{
+ assert (!_requiring_item);
+ _requiring_item = item;
+}
+
+
+//---------------------------------------------------------------------------
+struct UniqTable
+{
+ /** Order PoolItems based on name and edition only. */
+ struct Order
+ {
+ /** 'less then' based on name and edition */
+ bool operator()( PoolItem_Ref lhs, PoolItem_Ref rhs ) const
+ {
+ int res = lhs->name().compare( rhs->name() );
+ if ( res )
+ return res == -1; // lhs < rhs ?
+ // here: lhs == rhs, so compare edition:
+ return lhs->edition() < rhs->edition();
+ }
+ };
+ /** Set of PoolItems unified by Order. */
+ typedef std::set UTable;
+
+
+ /** Test whether a matching PoolItem_Ref is in the table. */
+ bool has( PoolItem_Ref item_r ) const
+ { return _table.find( item_r ) != _table.end(); }
+
+ /** Remember \a item_r (unless another matching PoolItem
+ * is already in the table)
+ */
+ void remember( PoolItem_Ref item_r )
+ { _table.insert( item_r ); }
+
+
+ /** The set. */
+ UTable _table;
+};
+//---------------------------------------------------------------------------
+
+struct RequireProcess
+{
+ PoolItem_Ref _requirer;
+ const Capability _capability;
+ ResolverContext_Ptr _context;
+ ResPool _pool;
+
+ PoolItemList providers; // the provider which matched
+
+ // only keep 'best' candidate for a package name
+ typedef map UniqMap;
+ UniqMap uniq;
+
+ RequireProcess (PoolItem_Ref r, const Capability & c, ResolverContext_Ptr ctx, const ResPool & p)
+ : _requirer (r)
+ , _capability (c)
+ , _context (ctx)
+ , _pool (p)
+ { }
+
+ bool operator()( const CapAndItem & cai )
+ {
+ PoolItem provider = cai.item;
+ Capability match = cai.cap;
+
+ ResStatus status = _context->getStatus( provider );
+ PoolItem_Ref upgrades = Helper::findInstalledItem (_pool, provider);
+
+ XXX << "RequireProcessInfo (" << provider << " provides " << match << ", is " << status << ")" << endl;
+// ERR << "RequireProcessInfo(required: " << *capability << ")" << endl;
+// ERR << "require_process_cb(itemIsPossible -> " << context->itemIsPossible (*provider) << ")" << endl;
+
+ /* capability is set for item set childern only. If it is set
+ allow only exactly required version */
+
+ if (_capability != Capability()
+ && _capability != match) { // exact match required
+ return true;
+ }
+
+ if (!provider->arch().compatibleWith( _context->architecture() )) {
+ MIL << "provider " << provider << " has incompatible arch '" << provider->arch() << "'" << endl;
+ return true;
+ }
+
+ if ( upgrades
+ && upgrades.resolvable()->arch() != provider->arch()
+ && provider->kind() != ResTraits<Atom>::kind ) // if patch provides arch upgrade, allow it (#266178)
+ // (because of #168840 and #170098, the patch parser grabs the 'best' atom
+ // and does not have knowledge about already installed atom with the same name.
+ // The problem #266178 shows is a previously installed patch (noarch) and atom (ppc)
+ // conflict with a later patch which offers an arch upgrade (ppc -> ppc64)
+ // This has no effect on the patch, since the patch is noarch. But is has effect
+ // on the atom, since it is installed as ppc and the upgrade is ppc64.
+ // Here, we look at arch changes only if they don't affect an atom. So atoms are
+ // allowed for arch upgrades.
+ // However, this only applies to atoms, not to packages. The package will stay
+ // at its architecture. Not doing arch upgrades was one of the requirements for Code10.)
+ {
+
+ MIL << "provider " << provider << " has OTHER arch '" << provider->arch() << "' than the updated item "
+ << upgrades << endl;
+ PoolItemList ignore = _context->getIgnoreArchitectureItem();
+ PoolItemList::iterator it;
+ for (it = ignore.begin(); it != ignore.end(); ++it) {
+ if (provider == *it) break;
+ }
+ if (it != ignore.end()) {
+ MIL << " ---> will be ignored " << endl;
+ } else {
+ return true;
+ }
+ }
+
+ // checking vendor
+ bool vendorFit = true;
+ if ( provider
+ && upgrades
+ && !VendorAttr::instance().equivalent(provider->vendor(), upgrades->vendor())) {
+ // checking if there is already an ignore
+ MIL << "provider " << provider << " has ANOTHER vendor '" << provider->vendor() << "' than the updated item "
+ << upgrades << endl;
+ PoolItemList ignore = _context->getIgnoreVendorItem();
+ PoolItemList::iterator it;
+ for (it = ignore.begin(); it != ignore.end(); ++it) {
+ if (provider == *it) break;
+ }
+ if (it != ignore.end()) {
+ MIL << " ---> will be ignored " << endl;
+ } else {
+ vendorFit = false;
+ }
+ }
+
+ Capability failed_cap;
+
+ if (! (status.isToBeUninstalled() || status.isImpossible())
+ && ! _context->isParallelInstall( provider )
+ && _context->itemIsPossible( provider, failed_cap )
+ && ! provider.status().isLocked()
+ && vendorFit
+ && ! (provider.status().isKept()
+ &&provider.status().isByUser())
+ ) {
+
+ // if we found a to-be-installed provider, choose this and drop all others
+ if (status.isToBeInstalled() // scheduled for install
+ || (status.isUninstalled()
+ && provider.status().isToBeInstalled())) // or will-be-scheduled
+ {
+ providers.clear();
+ providers.push_front( provider );
+ return false;
+ }
+
+
+ if (!_context->tryAllPossibilities()) {
+ // if we already have same name
+ // check for better architecture, then edition
+ // see yast2-pkg-bindings, Package.cc, ProvideProcess
+
+ UniqMap::iterator upos = uniq.find( provider->name() );
+
+ if (upos != uniq.end()) {
+ if ((upos->second->arch().compare( provider->arch() ) < 0) // better arch
+ || ((upos->second->arch().compare( provider->arch() ) == 0) // or same arch
+ && (upos->second->edition().compare( provider->edition() ) < 0) ) ) // and better edition
+ {
+ // new provider is 'better'
+
+ // erase the old provider
+ for (PoolItemList::iterator it = providers.begin(); it != providers.end(); ++it) {
+ if (*it == upos->second) {
+ // which we are currently ignore
+ _XDEBUG("Kicking " << *it << " for " << provider);
+ providers.erase( it );
+ _context->setSkippedPossibilities( true ); // Flag that there are other possibilities
+ break;
+ }
+ }
+ upos = uniq.end(); // trigger insertion of new provider below
+ } else {
+ if (upos->second != provider) {
+ // which we are currently ignore
+ _XDEBUG("Ignoring " << provider);
+ _context->setSkippedPossibilities( true ); // Flag that there are other possibilities
+ }
+ }
+ }
+ if (upos == uniq.end()) {
+ providers.push_front( provider );
+ uniq[provider->name()] = provider;
+ }
+ } else {
+ // try all alternatives
+ providers.push_front( provider );
+ }
+ }
+
+ return true;
+ }
+};
+
+
+struct NoInstallableProviders
+{
+ PoolItem_Ref requirer;
+ ResolverContext_Ptr context;
+
+ bool operator()( const CapAndItem cai)
+ {
+ PoolItem provider = cai.item;
+ Capability match = cai.cap;
+
+ string msg_str;
+ //const Capability match;
+
+ ResStatus status = context->getStatus( provider );
+
+ ResolverInfoMisc_Ptr misc_info;
+ Capability failed_cap;
+
+ if (status.isToBeUninstalled()) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UNINSTALL_PROVIDER, requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
+ misc_info->setOtherPoolItem (provider);
+ } else if (context->isParallelInstall (provider)) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_PARALLEL_PROVIDER, requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
+ misc_info->setOtherPoolItem (provider);
+ } else if (status.isImpossible()
+ || ! context->itemIsPossible( provider, failed_cap )) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_NOT_INSTALLABLE_PROVIDER, requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
+ misc_info->setOtherPoolItem (provider);
+ if (!requirer // user initiated the request
+ && failed_cap != Capability::noCap) // solver knows why it failed
+ {
+ ResolverInfoMissingReq_Ptr missing = new ResolverInfoMissingReq( provider, failed_cap );
+ missing->flagAsImportant();
+ context->addInfo( missing );
+ }
+ } else if (provider.status().isLocked()) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_LOCKED_PROVIDER, requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
+ misc_info->setOtherPoolItem (provider);
+ } else if (provider.status().isKept() && provider.status().isByUser()) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_KEEP_PROVIDER, requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
+ misc_info->setOtherPoolItem (provider);
+ } else if (provider
+ && requirer
+ && !VendorAttr::instance().equivalent(provider->vendor(), requirer->vendor())) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_OTHER_VENDOR_PROVIDER,
+ requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
+ misc_info->setOtherPoolItem (provider);
+ }
+ else if (provider->arch().compatibleWith( context->architecture() )) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_OTHER_ARCH_PROVIDER,
+ requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
+ misc_info->setOtherPoolItem (provider);
+ }
+
+ if (misc_info != NULL) {
+ context->addInfo (misc_info);
+ }
+
+ return true;
+ }
+};
+
+typedef map UpgradesMap;
+
+struct LookForUpgrades
+{
+ PoolItem_Ref installed;
+ ResolverContext_Ptr _context;
+ UpgradesMap upgrades;
+
+ LookForUpgrades (PoolItem_Ref i, ResolverContext_Ptr ctx)
+ : installed (i)
+ , _context (ctx)
+ { }
+
+ bool operator()( PoolItem_Ref provider )
+ {
+ if ( provider.status().maySetToBeInstalled( ResStatus::SOLVER )) {
+ // Take canditates only which are really installable. Bug 292077
+ UpgradesMap::iterator it = upgrades.find( provider->name() );
+
+ if (it != upgrades.end()) { // provider with same name found
+ if (!_context->upgradeMode()
+ && it->second->arch() != installed->arch()
+ && provider->arch() == installed->arch()) {
+ // prefering the same architecture as the installed item
+ // NOT in upgrade mode
+ it->second = provider;
+ } else {
+ int cmp = it->second->arch().compare( provider->arch() );
+ if ((_context->upgradeMode() // only in upgrade mode
+ || it->second->arch() != installed->arch()) // or have not found the same arch as installed item
+ && cmp < 0) { // new provider has better arch
+ it->second = provider;
+ }
+ else if (cmp == 0) { // new provider has equal arch
+ if (it->second->edition().compare( provider->edition() ) < 0) {
+ it->second = provider; // new provider has better edition
+ }
+ }
+ }
+ } else {
+ upgrades[provider->name()] = provider;
+ }
+ }
+ return true;
+ }
+};
+
+
+// check for an installed or to-be-installed item
+// (used to match supplements/enhances of multiple providers)
+
+struct HintItem
+{
+ PoolItem_Ref match;
+
+ bool operator()( const CapAndItem & cai )
+ {
+ if (cai.item.status().staysInstalled()
+ || cai.item.status().isToBeInstalled())
+ {
+ match = cai.item;
+ return false; // have one, we're done
+ }
+ return true;
+ }
+};
+
+
+// check 'codependent' items
+// by looking at the name prefix: 'foo' and 'foo-bar' are codependent
+
+static bool
+codependent_items (const PoolItem_Ref item1, const PoolItem_Ref item2)
+{
+ string name1 = item1->name();
+ string name2 = item2->name();
+ string::size_type len1 = name1.size();
+ string::size_type len2 = name2.size();
+
+ if (len2 < len1) {
+ string swap = name1;
+ string::size_type swap_len = len1;
+ name1 = name2;
+ name2 = swap;
+ len1 = len2;
+ len2 = swap_len;
+ }
+
+ // foo and foo-bar are automatically co-dependent
+ if (len1 < len2
+ && name1.compare (0, len1, name2) == 0
+ && name2[len1] == '-') {
+ return true;
+ }
+
+ return false;
+}
+
+
+// check if we have a match for a (supplements/enhances) hint
+
+static bool
+hint_match( const CapSet & cset, ResPool pool )
+{
+ HintItem info;
+
+ for (CapSet::const_iterator cit = cset.begin(); cit != cset.end(); ++cit) {
+ Dep dep( Dep::PROVIDES );
+ invokeOnEach( pool.byCapabilityIndexBegin( cit->index(), dep ),
+ pool.byCapabilityIndexEnd( cit->index(), dep ),
+ resfilter::ByCapMatch( *cit ),
+ functor::functorRef(info) );
+ }
+ if (info.match) MIL << "hint_match(" << info.match << ")" << endl;
+ return info.match; // as bool !
+}
+
+//----------------------------------------------------------------------------
+
+bool
+QueueItemRequire::process (ResolverContext_Ptr context, QueueItemList & new_items)
+{
+ _XDEBUG("QueueItemRequire::process(" << *this << ")");
+
+ bool fulfilled = false;
+
+ if (_requiring_item)
+ {
+ fulfilled = context->requirementIsInstalledOrUnneeded (_capability, _requiring_item,
+ _soft?Dep::RECOMMENDS:Dep::REQUIRES);
+ } else {
+ fulfilled = context->requirementIsMet (_capability, PoolItem_Ref(), Dep::REQUIRES);
+ }
+
+ if (fulfilled) {
+ _XDEBUG("requirement is already met in current context");
+ return true;
+ }
+
+ // checking for ignoring dependencies
+ IgnoreMap ignoreMap = context->getIgnoreRequires();
+ for (IgnoreMap::iterator it = ignoreMap.begin();
+ it != ignoreMap.end(); it++) {
+ if ( (!(it->first) // ignore ALL requirements on this capability
+ || it->first == _requiring_item)
+ && it->second == _capability) {
+ _XDEBUG("Found ignoring requires " << _capability << " for " << _requiring_item);
+ return true;
+ } else {
+ _XDEBUG("Ignoring requires " << it->second << " for " << it->first << " does not fit");
+ }
+ }
+
+ RequireProcess info (_requiring_item, Capability(), context, pool());
+
+ int num_providers = 0;
+
+ if (! _remove_only) {
+
+ Dep dep( Dep::PROVIDES );
+ XXX << "Look for providers of " << _capability << endl;
+ // world->foreachProvidingResItem (_capability, require_process_cb, &info);
+ invokeOnEach( pool().byCapabilityIndexBegin( _capability.index(), dep ),
+ pool().byCapabilityIndexEnd( _capability.index(), dep ),
+ resfilter::ByCapMatch( _capability ),
+ functor::functorRef(info) );
+
+ _XDEBUG("Look for providers of " << _capability);
+
+ num_providers = info.providers.size();
+
+ _XDEBUG( "requirement is met by " << num_providers << " resolvable");
+
+
+ // if there are multiple providers, try to reduce branching by cleaning up the providers list
+ // first check all providers if they are to-be-installed or uninstalled
+ // if there are to-be-installed providers, erase all uninstalled providers
+ // if there are locale providers and none match, try a language fallback
+ // prefer providers which enhance an installed or to-be-installed resolvables
+
+ if (num_providers > 1) { // prefer to-be-installed providers
+#if 1 // see also line 618
+ // if there are exactly two providers which differ in architecture
+ // prefer the better arch
+ // this will reduce the number of branches for X-32bit.x86_64 vs. X.i586 dramatically
+ //
+ // - left commented out as advised by mls@suse.de, might be problematic on non-x86 archs
+ // - Due the new behaviour of the solver this code will be executed.
+ // New: If there is no solution for the "best-architecture" way the solver tries
+ // the other branches too.
+
+ if (num_providers == 2) {
+ PoolItemList::iterator it = info.providers.begin();
+ PoolItem first( *it++ );
+ PoolItem second( *it );
+
+ if (NVRA(first.resolvable()) == NVRA(second.resolvable()))
+ {
+ // regarding items with the same NVRA only. Bug238284
+ int cmp = first->arch().compare( second->arch() );
+ if (cmp < 0) { // second is better
+ --it;
+ }
+
+ if (cmp != 0) {
+ info.providers.erase( it ); // erase one of both
+ num_providers = 1;
+ goto provider_done;
+ }
+ }
+ }
+#endif
+ MIL << "Have " << num_providers << " providers for " << _capability << endl;
+ int to_be_installed = 0;
+ int uninstalled = 0;
+ std::mapstd::string,PoolItem language_freshens;
+ ZYpp::Ptr z = zypp::getZYpp();
+ ZYpp::LocaleSet requested_locales = z->getRequestedLocales();
+ bool requested_locale_match = false;
+ PoolItem requested_locale_item;
+ PoolItemSet hints; // those which supplement or enhance an installed or to-be-installed
+
+ for (PoolItemList::iterator it = info.providers.begin(); it != info.providers.end(); ++it) {
+ PoolItem item = *it;
+ if (item.status().isToBeInstalled()) {
+ to_be_installed++;
+ }
+ if (item.status().staysUninstalled()) {
+ uninstalled++;
+ }
+ CapSet freshens( item->dep( Dep::FRESHENS ) );
+
+ // try to find a match of the locale freshens with one of the requested locales
+
+ for (CapSet::const_iterator cit = freshens.begin(); cit != freshens.end(); ++cit) {
+ if (cit->refers() == ResTraits<Language>::kind) {
+ string loc = cit->index();
+ MIL << "Look for language fallback " << loc << ":" << item << endl;
+ if (requested_locales.find( Locale( loc ) ) != requested_locales.end()) {
+ MIL << "Locale '" << loc << "' is requested" << endl;
+ requested_locale_match = true;
+ requested_locale_item = item;
+ }
+ language_freshens[loc] = item;
+ }
+ }
+
+ // now check if a provider supplements or enhances an installed or to-be-installed resolvable
+ if (hint_match( item->dep( Dep::SUPPLEMENTS ), pool() )
+ || hint_match( item->dep( Dep::ENHANCES ), pool() ))
+ {
+ hints.insert( item );
+ }
+
+ } // for
+
+ if (hints.empty()
+ && to_be_installed == 0
+ && !requested_locale_match)
+ {
+ // loop over requested locales, loop over their fallbacks, and try to find a matching provider
+
+ for (ZYpp::LocaleSet::const_iterator rit = requested_locales.begin(); rit != requested_locales.end(); ++rit) {
+
+ // loop over possible fallbacks
+ Locale l = *rit;
+ for (;;) {
+ Locale fallback = l.fallback();
+ if (fallback == Locale::noCode
+ || fallback == l)
+ {
+ break;
+ }
+ MIL << "requested " << l << " fallback " << fallback << endl;
+ std::mapstd::string,PoolItem::const_iterator match = language_freshens.find( fallback.code() );
+ if (match != language_freshens.end()) {
+ MIL << match->second << " matches the fallback" << endl;
+ info.providers.clear();
+ info.providers.push_back( match->second );
+ break;
+ }
+ l = fallback;
+ }
+ }
+#if 0 // just debug
+ std::string mil = "language_freshens ";
+ for (std::mapstd::string,PoolItem::const_iterator it = language_freshens.begin(); it != language_freshens.end(); ++it) {
+ if (it != language_freshens.begin()) mil += ", ";
+ mil += it->first;
+ }
+ MIL << mil << endl;
+#endif
+ }
+ else if (to_be_installed == 0
+ && !hints.empty())
+ {
+ MIL << "Have " << hints.size() << " hints" << endl;
+ info.providers.clear();
+ for (PoolItemSet::const_iterator it = hints.begin(); it != hints.end(); ++it) {
+ if (*it == requested_locale_item) {
+ // This is the requested language item
+ info.providers.push_back( *it );
+ } else {
+ // go through the list of language items and check if they are exists
+ std::mapstd::string,PoolItem::const_iterator itFr;
+
+ for (itFr = language_freshens.begin(); itFr != language_freshens.end(); ++itFr) {
+ if (*it == itFr->second) break;
+ }
+ if (itFr == language_freshens.end()) {
+ // item was only in the supplements --> branch for it
+ info.providers.push_back( *it );
+ }
+ }
+ }
+ if (info.providers.empty()) {
+ // they are all language items which does not fit in the required language
+ // So take the firstone to fulfill the requirement. Should never happens
+ info.providers.push_back( *(hints.begin()) );
+ }
+ }
+ else {
+
+ // if we have one or more to-be-installed, erase all uninstalled (if there are any)
+
+ MIL << to_be_installed << " to-be-installed, " << uninstalled << " uninstalled" << endl;
+
+ if (to_be_installed > 0
+ && uninstalled > 0)
+ {
+ PoolItemList::iterator next;
+ for (PoolItemList::iterator it = info.providers.begin(); it != info.providers.end(); ++it) {
+ next = it; ++next;
+ if (it->status().staysUninstalled()) {
+ MIL << "Not considering " << *it << endl;
+ info.providers.erase (it);
+ }
+ it = next;
+ }
+ }
+ }
+
+ num_providers = info.providers.size();
+
+ } // num_providers > 1
+#if 1 // see also line 474
+provider_done:;
+#endif
+ } // !_remove_only
+
+ //
+ // No providers found
+ //
+
+ if (num_providers == 0) {
+
+ if (_soft) goto finished; // don't care for soft requires
+
+ _DEBUG( "Unfulfilled requirement '" << _capability << "'. trying different solution");
+
+ QueueItemUninstall_Ptr uninstall_item = NULL;
+ QueueItemBranch_Ptr branch_item = NULL;
+ bool explore_uninstall_branch = true;
+
+
+
+ if (!_upgraded_item
+ || _lost_item)
+ {
+ ResolverInfo_Ptr err_info;
+ NoInstallableProviders info;
+ info.requirer = _requiring_item;
+ info.context = context;
+
+ // Maybe we can add some extra info on why none of the providers are suitable.
+
+ // pool()->foreachProvidingResItem (_capability, no_installable_providers_info_cb, (void *)&info);
+
+ Dep dep( Dep::PROVIDES );
+
+ invokeOnEach( pool().byCapabilityIndexBegin( _capability.index(), dep ), // begin()
+ pool().byCapabilityIndexEnd( _capability.index(), dep ), // end()
+ resfilter::ByCapMatch( _capability ),
+ functor::functorRef(info) );
+
+ }
+ //
+ // If this is an upgrade, we might be able to avoid removing stuff by upgrading it instead.
+ //
+
+ if ((_upgraded_item
+ || _lost_item // foo-devel requires foo; foo is lost due obsolete --> try to upgrade foo-devel
+ || context->verifying()) // We are in the verify mode. So there could be already missing requirements
+ // So try to solve it via update
+ && _requiring_item)
+ {
+
+ LookForUpgrades info (_requiring_item, context);
+
+// pool()->foreachUpgrade (_requiring_item, new Channel(CHANNEL_TYPE_ANY), look_for_upgrades_cb, (void *)&upgrade_list);
+
+ invokeOnEach( pool().byNameBegin( _requiring_item->name() ), pool().byNameEnd( _requiring_item->name() ),
+ functor::chain (resfilter::ByKind( _requiring_item->kind() ),
+ resfilter::byEdition( _requiring_item->edition() ) ),
+ functor::functorRef(info) );
+
+ if (!info.upgrades.empty()) {
+ string label;
+
+ branch_item = new QueueItemBranch (pool());
+
+ ostringstream req_str; req_str << _requiring_item;
+ ostringstream up_str;
+ if (_upgraded_item)
+ up_str << _upgraded_item;
+ else
+ up_str << _requiring_item;
+ ostringstream cap_str; cap_str << _capability;
+
+ // Translator: 1.%s = dependency; 2.%s and 3.%s = name of package,patch,...
+ label = str::form (_("for requiring %s for %s when upgrading %s"),
+ cap_str.str().c_str(), req_str.str().c_str(), up_str.str().c_str());
+ branch_item->setLabel (label);
+ _DEBUG("Branching: " + label)
+
+ for (UpgradesMap::const_iterator iter = info.upgrades.begin(); iter != info.upgrades.end(); ++iter) {
+ PoolItem_Ref upgrade_item = iter->second;
+ QueueItemInstall_Ptr install_item;
+ Capability failed_cap;
+
+ if (context->itemIsPossible( upgrade_item, failed_cap )) {
+
+ install_item = new QueueItemInstall (pool(), upgrade_item, _soft);
+ install_item->setUpgrades (_requiring_item);
+ branch_item->addItem (install_item);
+
+ ResolverInfoNeededBy_Ptr upgrade_info = new ResolverInfoNeededBy (upgrade_item);
+ if (_upgraded_item)
+ upgrade_info->addRelatedPoolItem (_upgraded_item);
+ upgrade_info->setCapability (_capability, Dep::REQUIRES);
+ install_item->addInfo (upgrade_info);
+
+ // If an upgrade item has its requirements met, don't do the uninstall branch.
+ // FIXME: should we also look at conflicts here?
+
+ if (explore_uninstall_branch) {
+ CapSet requires = upgrade_item->dep (Dep::REQUIRES);
+ CapSet::const_iterator iter = requires.begin();
+ for (; iter != requires.end(); iter++) {
+ const Capability req = *iter;
+ if (! context->requirementIsMet (req, upgrade_item, Dep::REQUIRES)) {
+ break;
+ }
+ }
+ if (iter == requires.end()) {
+ explore_uninstall_branch = false;
+ }
+ }
+
+ } /* if (context->itemIsPossible ( ... */
+ } /* for (iter = upgrade_list; ... */
+ } /* if (info.upgrades) ... */
+
+ if (!info.upgrades.empty()
+ && branch_item->isEmpty ())
+ {
+
+ for (UpgradesMap::const_iterator iter = info.upgrades.begin(); iter != info.upgrades.end(); ++iter) {
+ ResolverInfoMisc_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_NO_UPGRADE, _requiring_item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ if (iter == info.upgrades.begin()) {
+ misc_info->setOtherPoolItem( iter->second );
+ }
+ misc_info->addRelatedPoolItem( iter->second );
+ context->addInfo( misc_info );
+
+ explore_uninstall_branch = true;
+ }
+
+ //
+ // The exception: we always want to consider uninstalling
+ // when the requirement has resulted from a item losing
+ // one of it's provides.
+
+ } else if (!info.upgrades.empty()
+ && explore_uninstall_branch
+ && _requiring_item
+ && _upgraded_item
+ && codependent_items (_requiring_item, _upgraded_item)
+ && !_lost_item)
+ {
+ explore_uninstall_branch = false;
+ }
+
+ } /* if (_upgrade_item && _requiring_item) ... */
+
+ ResStatus status = context->getStatus(_requiring_item);
+
+ if (context->verifying()) {
+ // We always consider uninstalling when in verification mode.
+ explore_uninstall_branch = true;
+ }
+ else if (status.isToBeInstalled() // scheduled for installation
+ && !status.isToBeUninstalled() // not scheduled for uninstallation
+ || _requiring_item.status().staysInstalled()) // not scheduled at all but installed
+ {
+ // The item has to be set for installing/updating explicity.
+ // So the uninstall branch could be not useful if upgrade is not successful.
+ // Adding the info for solution handling at the end of solving
+ ResolverInfo_Ptr misc_info;
+ if (!_upgraded_item) {
+ if (_remove_only) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER,
+ _requiring_item, RESOLVER_INFO_PRIORITY_VERBOSE, _capability);
+ } else {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_NO_PROVIDER,
+ _requiring_item, RESOLVER_INFO_PRIORITY_VERBOSE, _capability);
+ }
+ } else {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_CANT_SATISFY,
+ _requiring_item, RESOLVER_INFO_PRIORITY_VERBOSE,
+ _capability);
+ }
+ context->addInfo (misc_info);
+ }
+
+ if (explore_uninstall_branch && _requiring_item) {
+ ResolverInfo_Ptr log_info;
+ uninstall_item = new QueueItemUninstall (pool(), _requiring_item, QueueItemUninstall::UNSATISFIED);
+ uninstall_item->setPriority(0); // evaluate explizit uninstall first (greater priority) in order
+ // to be sure, that this item still exist after the solver run would be finished. Bug 273918
+ uninstall_item->setCapability (_capability);
+
+ if (_lost_item) {
+ log_info = new ResolverInfoDependsOn (_requiring_item, _lost_item);
+ uninstall_item->addInfo (log_info);
+ }
+
+ if (_remove_only)
+ uninstall_item->setRemoveOnly ();
+ }
+
+ if (uninstall_item && branch_item) {
+ branch_item->addItem (uninstall_item);
+ new_items.push_back (branch_item);
+ } else if (uninstall_item) {
+ new_items.push_front (uninstall_item);
+ } else if (branch_item) {
+ new_items.push_back (branch_item);
+ } else {
+ // We can't do anything to resolve the missing requirement, so we fail.
+ ResolverInfo_Ptr misc_info;
+ if (!_upgraded_item) {
+ if (_remove_only) {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER,
+ _requiring_item, RESOLVER_INFO_PRIORITY_VERBOSE, _capability);
+ } else {
+ misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_NO_PROVIDER,
+ _requiring_item, RESOLVER_INFO_PRIORITY_VERBOSE, _capability);
+ }
+ } else {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_CANT_SATISFY,
+ _requiring_item, RESOLVER_INFO_PRIORITY_VERBOSE,
+ _capability);
+ }
+ context->addError (misc_info);
+ }
+
+ }
+
+ //
+ // exactly 1 provider found
+ //
+
+ else if (num_providers == 1) {
+
+ _XDEBUG( "Found exactly one resolvable, installing it.");
+
+ PoolItem item = info.providers.front();
+
+ // if this a soft require (a recommends), don't override a KEEP_STATE (-> bug #154650)
+ // see also below
+ if (_soft
+ && item.status().isUninstalled()
+ && !item.status().maySetSoftTransact( true, ResStatus::SOLVER ) )
+ {
+ _DEBUG("Can't soft-transact " << item);
+ goto finished;
+ }
+ QueueItemInstall_Ptr install_item = new QueueItemInstall (pool(), item, _soft);
+ install_item->setDependency (_capability);
+
+ // The requiring item could be NULL if the requirement was added as an extra dependency.
+ if (_requiring_item) {
+ install_item->setNeededBy (_requiring_item);
+ }
+ new_items.push_front (install_item);
+
+ }
+
+ //
+ // multiple providers found
+ //
+
+ else if (num_providers > 1) {
+
+ _DEBUG( "Branching: Found more than one provider of " << _capability);
+
+ QueueItemBranch_Ptr branch_item = new QueueItemBranch( pool() );
+
+ for (PoolItemList::const_iterator iter = info.providers.begin(); iter != info.providers.end(); iter++) {
+
+ PoolItem item = *iter;
+
+ // if this a soft require (a recommends), don't override a KEEP_STATE (-> bug #154650)
+ // see also above
+ if (_soft
+ && item.status().isUninstalled()
+ && !item.status().maySetSoftTransact( true, ResStatus::SOLVER ) )
+ {
+ _DEBUG("Can't soft-transact " << item);
+ continue;
+ }
+
+ QueueItemInstall_Ptr install_item = new QueueItemInstall( pool(), item, _soft );
+ install_item->setDependency( _capability );
+ branch_item->addItem( install_item );
+
+ // The requiring item could be NULL if the requirement was added as an extra dependency.
+ if (_requiring_item) {
+ install_item->setNeededBy( _requiring_item );
+ }
+ }
+
+ if (!branch_item->isEmpty())
+ new_items.push_back (branch_item);
+
+ } else {
+ abort ();
+ }
+
+finished:
+
+ return true;
+}
+
+//---------------------------------------------------------------------------
+
+QueueItem_Ptr
+QueueItemRequire::copy (void) const
+{
+ QueueItemRequire_Ptr new_require = new QueueItemRequire (pool(), _capability);
+
+ new_require->QueueItem::copy(this);
+
+ new_require->_requiring_item = _requiring_item;
+ new_require->_upgraded_item = _upgraded_item;
+ new_require->_remove_only = _remove_only;
+
+ return new_require;
+}
+
+
+int
+QueueItemRequire::cmp (QueueItem_constPtr item) const
+{
+ int cmp = this->compare (item); // assures equal type
+ if (cmp != 0)
+ return cmp;
+
+ QueueItemRequire_constPtr require = dynamic_pointer_cast<const QueueItemRequire>(item);
+
+ if (_capability != require->capability())
+ {
+ cmp = -1;
+ }
+ return cmp;
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/QueueItemUninstall.cc.bak new/libzypp-3.22.1/zypp/solver/detail/QueueItemUninstall.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/QueueItemUninstall.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/QueueItemUninstall.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,540 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* QueueItemUninstall.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/CapSet.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+#include "zypp/CapFactory.h"
+#include "zypp/Patch.h"
+
+#include "zypp/solver/detail/QueueItemUninstall.h"
+#include "zypp/solver/detail/QueueItemEstablish.h"
+#include "zypp/solver/detail/QueueItemRequire.h"
+#include "zypp/solver/detail/QueueItem.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/solver/detail/ResolverInfoMisc.h"
+#include "zypp/solver/detail/ResolverInfoMissingReq.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(QueueItemUninstall);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+QueueItemUninstall::dumpOn( std::ostream & os ) const
+{
+ os << "[" << (_soft?"Soft":"") << "Uninstall: ";
+
+ os << _item;
+ os << " (";
+ switch (_reason) {
+ case QueueItemUninstall::CONFLICT: os << "conflicts"; break;
+ case QueueItemUninstall::OBSOLETE: os << "obsoletes"; break;
+ case QueueItemUninstall::UNSATISFIED: os << "unsatisfied dependency"; break;
+ case QueueItemUninstall::BACKOUT: os << "uninstallable"; break;
+ case QueueItemUninstall::UPGRADE: os << "upgrade"; break;
+ case QueueItemUninstall::DUPLICATE: os << "duplicate"; break;
+ case QueueItemUninstall::EXPLICIT: os << "explicit"; break;
+ }
+ os << ")";
+ if (_cap_leading_to_uninstall != Capability::noCap) {
+ os << ", Triggered By ";
+ os << _cap_leading_to_uninstall;
+ }
+ if (_upgraded_to) {
+ os << ", Upgraded To ";
+ os << _upgraded_to;
+ }
+ if (_explicitly_requested) os << ", Explicit";
+ if (_remove_only) os << ", Remove Only";
+ if (_due_to_conflict) os << ", Due To Conflict";
+ if (_due_to_obsolete)
+ os << ", Due To Obsolete:" << _obsoletes_item;
+ if (_unlink) os << ", Unlink";
+ os << "]";
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+QueueItemUninstall::QueueItemUninstall (const ResPool & pool, PoolItem_Ref item, UninstallReason reason, bool soft)
+ : QueueItem (QUEUE_ITEM_TYPE_UNINSTALL, pool)
+ , _item (item)
+ , _reason (reason)
+ , _soft (soft)
+ , _cap_leading_to_uninstall (Capability())
+ , _upgraded_to (NULL)
+ , _explicitly_requested (false)
+ , _remove_only (false)
+ , _due_to_conflict (false)
+ , _due_to_obsolete (false)
+ , _unlink (false)
+ , _obsoletes_item (NULL)
+{
+ _XDEBUG("QueueItemUninstall::QueueItemUninstall(" << item << ")");
+}
+
+
+QueueItemUninstall::~QueueItemUninstall()
+{
+}
+
+//---------------------------------------------------------------------------
+
+void
+QueueItemUninstall::setUnlink ()
+{
+ _unlink = true;
+ /* Reduce the priority so that unlink items will tend to get
+ processed later. We want to process unlinks as late as possible...
+ this will make our "is this item in use" check more accurate. */
+ setPriority (1); // Should be one more then Uninstall due dependency errors (Conflict/Unfulfilled)
+
+ return;
+}
+
+//---------------------------------------------------------------------------
+
+struct UnlinkCheck
+{
+ ResolverContext_Ptr context;
+ bool cancel_unlink;
+
+ // An item is to be uninstalled, it provides a capability
+ // which requirer needs (as match)
+ // if requirer is installed or to-be-installed:
+ // check if anyone else provides it to the requirer
+ // or if the uninstall breaks the requirer
+ // in this case, we have to cancel the uninstallation
+
+ bool operator()( const CapAndItem & cai )
+ {
+ PoolItem provider( cai.item );
+ if (cancel_unlink) // already cancelled
+ return true;
+
+ if (! context->isPresent (cai.item)) // item is not (to-be-)installed
+ return true;
+
+ if (context->requirementIsMet (cai.cap, provider, Dep::REQUIRES)) // another resolvable provided match
+ return true;
+
+ cancel_unlink = true; // cancel, as this would break dependencies
+
+ return true;
+ }
+};
+
+//---------------------------------------------------------------------------
+
+
+struct UninstallProcess
+{
+ ResPool pool;
+ ResolverContext_Ptr context;
+ PoolItem_Ref uninstalled_item;
+ PoolItem_Ref upgraded_item;
+ QueueItemList & qil;
+ bool remove_only;
+ bool soft;
+
+ UninstallProcess (const ResPool & p, ResolverContext_Ptr ct, PoolItem_Ref u1, PoolItem_Ref u2, QueueItemList & l, bool ro, bool s)
+ : pool (p)
+ , context (ct)
+ , uninstalled_item (u1)
+ , upgraded_item (u2)
+ , qil (l)
+ , remove_only (ro)
+ , soft (s)
+ { }
+
+ // the uninstall of uninstalled_item breaks the dependency 'match' of resolvable 'requirer'
+
+ bool operator()( const CapAndItem & cai )
+ {
+ PoolItem requirer( cai.item );
+ if (! context->isPresent (requirer)) // its not installed -> dont care
+ return true;
+
+ if (context->requirementIsMet( cai.cap, requirer, Dep::REQUIRES )) // its provided by another installed resolvable -> dont care
+ return true;
+
+ if (context->getStatus(requirer).isSatisfied()) { // it is just satisfied, check freshens and supplements
+#warning If an uninstall incompletes a satisfied, the uninstall should be cancelled
+ QueueItemEstablish_Ptr establish_item = new QueueItemEstablish (pool, requirer, soft); // re-check if its still needed
+ qil.push_back (establish_item);
+ return true;
+ }
+ QueueItemRequire_Ptr require_item = new QueueItemRequire( pool, cai.cap ); // issue a new require to fulfill this dependency
+ require_item->addPoolItem (requirer);
+ if (remove_only) {
+ require_item->setRemoveOnly ();
+ }
+ require_item->setUpgradedPoolItem (upgraded_item);
+ require_item->setLostPoolItem (uninstalled_item); // this is what we lost, dont re-install it
+
+ qil.push_front (require_item);
+
+ return true;
+ }
+};
+
+
+// Handle items which freshen or supplement us -> re-establish them
+
+struct UninstallEstablishItem
+{
+ const ResPool & pool;
+ QueueItemList & qil;
+ bool soft;
+
+ UninstallEstablishItem (const ResPool & p, QueueItemList &l, bool s)
+ : pool(p)
+ , qil(l)
+ , soft(s)
+ { }
+
+
+ // provider has a freshens on a just to-be-installed item
+ // re-establish provider, maybe its incomplete now
+
+ bool operator()( const CapAndItem & cai )
+ {
+ _XDEBUG("QueueItemUninstall::UninstallEstablishItem (" << cai.item << ", " << cai.cap << ")");
+
+ // re-establish only installed items which are not scheduled for removal yet.
+
+ if (cai.item.status().staysInstalled()) {
+ QueueItemEstablish_Ptr establish_item = new QueueItemEstablish (pool, cai.item, soft);
+ qil.push_back (establish_item);
+ }
+ return true;
+ }
+};
+
+// Handle installed items which provides a recommend -> remove it soft
+
+struct ProvidesItem
+{
+ const ResPool & pool;
+ QueueItemList & qil;
+ bool soft;
+
+ ProvidesItem (const ResPool & p, QueueItemList &l, bool s)
+ : pool(p)
+ , qil(l)
+ , soft(s)
+ { }
+
+
+ bool operator()( const CapAndItem & cai )
+ {
+ _XDEBUG("remove soft item (" << cai.item << ", " << cai.cap << ")");
+ PoolItem_Ref item( cai.item );
+ if (!item.status().transacts() // not scheduled for transaction yet
+ && item.status().maySetToBeUninstalledSoft()) // checking the permission to delete it (Bug 217574)
+ {
+ QueueItemUninstall_Ptr uninstall_item = new QueueItemUninstall (pool, item, QueueItemUninstall::EXPLICIT, soft);
+ uninstall_item->setUnlink ();
+ qil.push_back (uninstall_item);
+ } else {
+ _XDEBUG(" ---> do not remove cause it has been set for transaction or can not set for uninstallation due right problems.");
+ }
+ return true;
+ }
+};
+
+
+// Uninstall atom of a to-be-uninstalled patch
+
+struct UninstallItem
+{
+ ResPool pool;
+ ResolverContext_Ptr context;
+ QueueItemList & qil;
+ bool soft;
+
+ UninstallItem( const ResPool & p, ResolverContext_Ptr ct, QueueItemList & l, bool s )
+ : pool( p )
+ , context( ct )
+ , qil( l )
+ , soft( s )
+ { }
+
+ bool operator()( const CapAndItem & cai )
+ {
+ PoolItem item( cai.item );
+
+ _XDEBUG( "UninstallItem (unlink) " << item );
+ QueueItemUninstall_Ptr uninstall_item = new QueueItemUninstall( pool, item, QueueItemUninstall::EXPLICIT, soft );
+ uninstall_item->setUnlink();
+ qil.push_front( uninstall_item );
+
+ return true;
+ }
+};
+
+
+//-----------------------------------------------------------------------------
+
+
+bool
+QueueItemUninstall::process (ResolverContext_Ptr context, QueueItemList & qil)
+{
+ ResStatus status = context->getStatus(_item);
+
+ _XDEBUG("QueueItemUninstall::process(<" << status << ">" << _item << ( _unlink ? "[unlink]" : ""));
+
+ /* In the case of an unlink, we only want to uninstall the item if it is
+ being used by something else. We can't really determine this with 100%
+ accuracy, since some later queue item could cause something that requires
+ the item to be uninstalled. The alternative is to try to do something
+ really clever... but I'm not clever enough to think of an algorithm that
+ (1) Would do the right thing.
+ (2) Is guaranteed to terminate. (!)
+ so this will have to do. In practice, I don't think that this is a serious
+ problem. */
+
+ if (_unlink) {
+ /* If the item is to-be-installed, obviously it is being use! */
+ if (status.isToBeInstalled()) {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UNINSTALL_TO_BE_INSTALLED, _item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ context->addInfo (misc_info);
+ goto finished;
+
+ }
+ else if (status.staysInstalled()) {
+
+ UnlinkCheck info;
+
+ /* Flag the item as to-be-uninstalled so that it won't
+ satisfy any other item's deps during this check. */
+
+ context->setStatus(_item, ResStatus::toBeUninstalled);
+
+ info.context = context;
+ info.cancel_unlink = false;
+
+ // look at the provides of the to-be-uninstalled resolvable and
+ // check if anyone (installed) needs it
+
+ CapSet provides = _item->dep(Dep::PROVIDES);
+ for (CapSet::const_iterator iter = provides.begin(); iter != provides.end() && ! info.cancel_unlink; iter++) {
+
+ //world()->foreachRequiringPoolItem (*iter, unlink_check_cb, &info);
+
+ Dep dep( Dep::REQUIRES);
+
+ invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ),
+ pool().byCapabilityIndexEnd( iter->index(), dep ),
+ resfilter::ByCapMatch( *iter ),
+ functor::functorRef(info) );
+
+ }
+
+ /* Set the status back to normal. */
+
+ context->setStatus(_item, status);
+
+ if (info.cancel_unlink) {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UNINSTALL_INSTALLED, _item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ context->addInfo (misc_info);
+ goto finished;
+ }
+ }
+
+ }
+
+ this->logInfo (context);
+
+ context->uninstall (_item, _upgraded_to , _due_to_obsolete, _unlink, _explicitly_requested);
+ if (status.staysInstalled()) {
+ if (! _explicitly_requested
+ && _item.status().isLocked()) {
+
+ ResolverInfoMisc_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UNINSTALL_LOCKED,
+ _item, RESOLVER_INFO_PRIORITY_VERBOSE,
+ _cap_leading_to_uninstall);
+ if (_due_to_obsolete)
+ {
+ misc_info->setOtherPoolItem (_obsoletes_item);
+ misc_info->addTrigger (ResolverInfoMisc::OBSOLETE);
+ } else if (_due_to_conflict)
+ {
+ misc_info->addTrigger (ResolverInfoMisc::CONFLICT);
+ }
+
+ context->addError (misc_info);
+ goto finished;
+ }
+
+ if (_cap_leading_to_uninstall != Capability() // non-empty _cap_leading_to_uninstall
+ && !_due_to_conflict
+ && !_due_to_obsolete)
+ {
+ ResolverInfo_Ptr info = new ResolverInfoMissingReq (_item, _cap_leading_to_uninstall);
+ context->addInfo (info);
+ }
+
+ // we're uninstalling an installed item
+ // loop over all its provides and check if any installed item requires
+ // one of these provides
+ CapSet provides = _item->dep(Dep::PROVIDES);
+
+ for (CapSet::const_iterator iter = provides.begin(); iter != provides.end(); iter++) {
+ UninstallProcess info ( pool(), context, _item, _upgraded_to, qil, _remove_only, _soft);
+
+ //world()->foreachRequiringPoolItem (*iter, uninstall_process_cb, &info);
+ Dep dep( Dep::REQUIRES );
+
+ invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ),
+ pool().byCapabilityIndexEnd( iter->index(), dep ),
+ resfilter::ByCapMatch( *iter ),
+ functor::functorRef(info) );
+
+ // re-establish all which supplement or freshen a provides of the just uninstalled item
+
+ UninstallEstablishItem establish( pool(), qil, _soft );
+
+ dep = Dep::SUPPLEMENTS;
+ invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ),
+ pool().byCapabilityIndexEnd( iter->index(), dep ),
+ resfilter::ByCapMatch( *iter ),
+ functor::functorRef( establish ) );
+
+ dep = Dep::FRESHENS;
+ invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ),
+ pool().byCapabilityIndexEnd( iter->index(), dep ),
+ resfilter::ByCapMatch( *iter ),
+ functor::functorRef( establish ) );
+ }
+
+ // if its a patch, uninstall all its atoms
+
+ if (_item->kind() == ResTraits<Patch>::kind) {
+ Patch::constPtr patch = asKind<Patch>( _item );
+ Patch::AtomList atoms = patch->atoms();
+ UninstallItem callback( pool(), context, qil, _soft );
+ CapFactory factory;
+ Dep dep(Dep::PROVIDES);
+
+ // loop over atom, find matching installed PoolItem and schedule this for removal
+
+ for (Patch::AtomList::const_iterator it = atoms.begin(); it != atoms.end(); ++it) {
+ Resolvable::constPtr res = *it;
+ Capability capAtom = factory.parse ( res->kind(), res->name(), Rel::EQ, res->edition());
+ invokeOnEach( pool().byCapabilityIndexBegin( capAtom.index(), dep ),
+ pool().byCapabilityIndexEnd( capAtom.index(), dep ),
+ functor::chain( resfilter::ByCaIInstalled(), resfilter::ByCapMatch( capAtom ) ),
+ functor::functorRef( callback ) );
+ }
+ }
+
+ // soft-remove the installed items which have been recommended by the to-be-uninstalled
+ // but not when upgrade, and not for packages
+
+ if (_upgraded_to // its an upgrade
+ || _item->kind() == ResTraits<Package>::kind)
+ {
+ goto finished;
+ }
+
+ CapSet recomments = _item->dep (Dep::RECOMMENDS);
+ for (CapSet::const_iterator iter = recomments.begin(); iter != recomments.end(); iter++) {
+ const Capability cap = *iter;
+ _XDEBUG("this recommends " << cap);
+ ProvidesItem provides( pool(), qil, true ); // soft
+
+ Dep dep(Dep::PROVIDES);
+ invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ),
+ pool().byCapabilityIndexEnd( iter->index(), dep ),
+ functor::chain( resfilter::ByCaIInstalled(), resfilter::ByCapMatch( *iter ) ),
+ functor::functorRef( provides ) );
+ }
+
+ }
+
+ finished:
+ return true;
+}
+
+//---------------------------------------------------------------------------
+
+int
+QueueItemUninstall::cmp (QueueItem_constPtr item) const
+{
+ int cmp = this->compare (item); // assures equal type
+ if (cmp != 0)
+ return cmp;
+
+ QueueItemUninstall_constPtr uninstall = dynamic_pointer_cast<const QueueItemUninstall>(item);
+ return compareByNVRA (_item.resolvable(), uninstall->_item.resolvable());
+}
+
+
+QueueItem_Ptr
+QueueItemUninstall::copy (void) const
+{
+ QueueItemUninstall_Ptr new_uninstall = new QueueItemUninstall (pool(), _item, _reason);
+ new_uninstall->QueueItem::copy(this);
+
+
+ new_uninstall->_item = _item;
+ new_uninstall->_cap_leading_to_uninstall = _cap_leading_to_uninstall;
+ new_uninstall->_upgraded_to = _upgraded_to;
+
+ new_uninstall->_explicitly_requested = _explicitly_requested;
+ new_uninstall->_remove_only = _remove_only;
+ new_uninstall->_due_to_conflict = _due_to_conflict;
+ new_uninstall->_due_to_obsolete = _due_to_obsolete;
+ new_uninstall->_obsoletes_item = _obsoletes_item;
+ new_uninstall->_unlink = _unlink;
+
+ return new_uninstall;
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Resolver.cc new/libzypp-3.22.1/zypp/solver/detail/Resolver.cc
--- old/libzypp-3.22.1/zypp/solver/detail/Resolver.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/solver/detail/Resolver.cc 2007-09-07 14:53:31.000000000 +0200
@@ -422,6 +422,13 @@
_extra_caps.insert (capability);
}
+void
+Resolver::removeExtraCapability (const Capability & capability)
+{
+ _extra_caps.erase (capability);
+}
+
+
void
Resolver::addExtraConflict (const Capability & capability)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Resolver.cc.bak new/libzypp-3.22.1/zypp/solver/detail/Resolver.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/Resolver.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/Resolver.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,1430 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* Resolver.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/solver/detail/Resolver.h"
+#include "zypp/solver/detail/Helper.h"
+
+#include "zypp/CapSet.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+#include "zypp/ZYppFactory.h"
+#include "zypp/SystemResObject.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
+#include "zypp/capability/FilesystemCap.h"
+
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace zypp_detail
+ { /////////////////////////////////////////////////////////////////
+ Arch defaultArchitecture();
+ /////////////////////////////////////////////////////////////////
+ } // namespace zypp_detail
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(Resolver);
+
+static const unsigned MAX_SECOND_RUNS( 3 );
+static const unsigned MAX_VALID_SOLUTIONS( 10 );
+static const unsigned TIMOUT_SECOND_RUN( 30 );
+
+static PoolItemSet triggeredSolution; // only the latest state of an item is interesting
+ // for the pool. Documents already inserted items.
+
+//---------------------------------------------------------------------------
+
+class compare_items {
+public:
+ int operator() (PoolItem_Ref p1,
+ PoolItem_Ref p2) const
+ { return compareByNVRA(p1.resolvable(),p2.resolvable()) < 0; }
+};
+
+
+std::ostream &
+Resolver::dumpOn( std::ostream & os ) const
+{
+ return os << "<resolver/>";
+}
+
+// Generating a system resolvable in the pool in order to trigger
+// modaliases and hals
+void assertSystemResObjectInPool()
+{
+ ResPool pool( getZYpp()->pool() );
+ if ( pool.byKindBegin<SystemResObject>()
+ == pool.byKindEnd<SystemResObject>() )
+ {
+ // SystemResObject is missing in the pool ==> insert
+ ResStore store;
+ store.insert( SystemResObject::instance() );
+ getZYpp()->addResolvables( store, true ); // true = is installed
+ }
+
+ // set lock
+ if ( ! pool.byKindBegin<SystemResObject>()
+ ->status().setLock( true, ResStatus::USER ) )
+ {
+ WAR << "Unable to set SystemResObject to lock" << endl;
+ }
+}
+
+//---------------------------------------------------------------------------
+
+Resolver::Resolver (const ResPool & pool)
+ : _pool (pool)
+ , _poolchanged( _pool.serial() )
+ , _timeout_seconds (0)
+ , _maxSolverPasses (0)
+ , _verifying (false)
+ , _testing (false)
+ , _tryAllPossibilities (false)
+ , _valid_solution_count (0)
+ , _best_context (NULL)
+ , _establish_context (NULL)
+ , _timed_out (false)
+ , _architecture( zypp_detail::defaultArchitecture() )
+ , _forceResolve (false)
+ , _upgradeMode (false)
+ , _preferHighestVersion (true)
+
+{
+
+}
+
+
+Resolver::~Resolver()
+{
+}
+
+//---------------------------------------------------------------------------
+
+ResPool
+Resolver::pool (void) const
+{
+ return _pool;
+}
+
+void
+Resolver::reset (bool resetValidResults, bool keepExtras )
+{
+ _verifying = false;
+
+ _initial_items.clear();
+
+ _items_to_install.clear();
+ _items_to_remove.clear();
+ _items_to_verify.clear();
+ _items_to_establish.clear();
+
+ if (!keepExtras) {
+ _extra_caps.clear();
+ _extra_conflicts.clear();
+ }
+
+ _pending_queues.clear();
+ _pruned_queues.clear();
+ _complete_queues.clear();
+ _deferred_queues.clear();
+ _invalid_queues.clear();
+
+ _valid_solution_count = 0;
+
+ _best_context = NULL;
+ _timed_out = false;
+
+ _isInstalledBy.clear();
+ _installs.clear();
+
+ if (resetValidResults)
+ contextPool.reset();
+
+}
+
+//--------------------------------------------------------------------------------------------------
+// Get more information about the solverrun
+// Which item will be installed by another item or triggers an item for installation
+typedef struct {
+ ItemCapKindMap isInstalledBy;
+ ItemCapKindMap installs;
+} Collector;
+
+
+static void
+collector_cb_needed (ResolverInfo_Ptr info, void *data)
+{
+ Collector *collector = (Collector *)data;
+ if (info->type() == RESOLVER_INFO_TYPE_NEEDED_BY) {
+ ResolverInfoNeededBy_constPtr needed_by = dynamic_pointer_cast<const ResolverInfoNeededBy>(info);
+ if (needed_by->items().size() >= 1) {
+ PoolItem_Ref item = info->affected();
+ PoolItemList itemList = needed_by->items();
+
+ for (PoolItemList::const_iterator iter = itemList.begin();
+ iter != itemList.end(); iter++) {
+ bool found = false;
+ ItemCapKindMap::const_iterator pos = collector->isInstalledBy.find(item);
+ while (pos != collector->isInstalledBy.end()
+ && pos->first == item
+ && !found) {
+ ItemCapKind capKind = pos->second;
+ if (capKind.item == *iter) found = true;
+ pos++;
+ }
+ if (!found) {
+ ItemCapKind capKind( *iter, needed_by->capability(), needed_by->capKind(), needed_by->initialInstallation() );
+ collector->isInstalledBy.insert (make_pair( item, capKind));
+ }
+ found = false;
+ pos = collector->installs.find (*iter);
+ while (pos != collector->installs.end()
+ && pos->first == *iter
+ && !found) {
+ ItemCapKind capKind = pos->second;
+ if (capKind.item == item) found = true;
+ pos++;
+ }
+ if (!found) {
+ ItemCapKind capKindReverse( item, needed_by->capability(), needed_by->capKind(), needed_by->initialInstallation() );
+ collector->installs.insert (make_pair( *iter, capKindReverse));
+ }
+ }
+
+ }
+ }
+}
+
+void
+Resolver::collectResolverInfo(void)
+{
+ ResolverContext_Ptr collectContext = context(); // best context or failed context
+ if ( collectContext != NULL
+ && _isInstalledBy.empty()
+ && _installs.empty()) {
+ Collector collector;
+ collectContext->foreachInfo (PoolItem(), RESOLVER_INFO_PRIORITY_VERBOSE, collector_cb_needed, &collector, false); // do not merge information
+ _isInstalledBy = collector.isInstalledBy;
+ _installs = collector.installs;
+ }
+}
+
+
+const ItemCapKindList Resolver::isInstalledBy (const PoolItem_Ref item) {
+ ItemCapKindList ret;
+ collectResolverInfo();
+
+ for (ItemCapKindMap::const_iterator iter = _isInstalledBy.find(item); iter != _isInstalledBy.end();) {
+ ItemCapKind info = iter->second;
+ PoolItem_Ref iterItem = iter->first;
+ if (iterItem == item) {
+ ret.push_back(info);
+ iter++;
+ } else {
+ // exit
+ iter = _isInstalledBy.end();
+ }
+ }
+ return ret;
+}
+
+const ItemCapKindList Resolver::installs (const PoolItem_Ref item) {
+ ItemCapKindList ret;
+ collectResolverInfo();
+
+ for (ItemCapKindMap::const_iterator iter = _installs.find(item); iter != _installs.end();) {
+ ItemCapKind info = iter->second;
+ PoolItem_Ref iterItem = iter->first;
+ if (iterItem == item) {
+ ret.push_back(info);
+ iter++;
+ } else {
+ // exit
+ iter = _installs.end();
+ }
+ }
+ return ret;
+}
+
+
+//----------------------------------------------------------------------------------------------------
+ResolverContext_Ptr
+Resolver::context (void) const
+{
+ if (_best_context) return _best_context;
+ if (_invalid_queues.empty()) return NULL;
+ ResolverQueue_Ptr invalid = _invalid_queues.front();
+ return invalid->context();
+}
+
+void Resolver::dumpTaskList(const PoolItemList &install, const PoolItemList &remove )
+{
+ for (PoolItemList::const_iterator iter = install.begin();
+ iter != install.end(); iter++) {
+ XXX << " to_install " << *iter << endl;
+ }
+ for (PoolItemList::const_iterator iter = remove.begin();
+ iter != remove.end(); iter++) {
+ XXX << " to_remove " << *iter << endl;
+ }
+}
+
+
+//---------------------------------------------------------------------------
+
+void
+Resolver::addSubscribedSource (Repository repo)
+{
+ _subscribed.insert(repo);
+}
+
+void
+Resolver::addPoolItemToInstall (PoolItem_Ref item)
+{
+ bool found = false;
+ for (PoolItemList::const_iterator iter = _items_to_remove.begin();
+ iter != _items_to_remove.end(); iter++) {
+ if (*iter == item) {
+ _items_to_remove.remove(*iter);
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ _items_to_install.push_back (item);
+ _items_to_install.unique ();
+ }
+}
+
+
+void
+Resolver::addPoolItemsToInstallFromList (PoolItemList & rl)
+{
+ for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
+ addPoolItemToInstall (*iter);
+ }
+}
+
+
+void
+Resolver::addPoolItemToRemove (PoolItem_Ref item)
+{
+ bool found = false;
+ for (PoolItemList::const_iterator iter = _items_to_install.begin();
+ iter != _items_to_install.end(); iter++) {
+ if (*iter == item) {
+ _items_to_install.remove(*iter);
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ _items_to_remove.push_back (item);
+ _items_to_remove.unique ();
+ }
+}
+
+
+void
+Resolver::addPoolItemsToRemoveFromList (PoolItemList & rl)
+{
+ for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
+ addPoolItemToRemove (*iter);
+ }
+}
+
+void
+Resolver::addPoolItemToLockUninstalled (PoolItem_Ref item)
+{
+ _items_to_lockUninstalled.push_back (item);
+ _items_to_lockUninstalled.unique ();
+}
+
+
+void
+Resolver::addPoolItemToEstablish (PoolItem_Ref item)
+{
+ _items_to_establish.push_back (item);
+}
+
+
+void
+Resolver::addPoolItemsToEstablishFromList (PoolItemList & rl)
+{
+ for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
+ addPoolItemToEstablish (*iter);
+ }
+}
+
+
+void
+Resolver::addPoolItemToVerify (PoolItem_Ref item)
+{
+#if 0
+ /** Order PoolItems based on name and edition only. */
+ struct {
+ /** 'less then' based on name and edition */
+ bool operator()( PoolItem_Ref lhs, PoolItem_Ref rhs ) const
+ {
+ int res = lhs->name().compare( rhs->name() );
+ if ( res )
+ return res == -1; // lhs < rhs ?
+ // here: lhs == rhs, so compare edition:
+ return lhs->edition() < rhs->edition();
+ }
+ } order;
+#endif
+
+ _items_to_verify.push_back (item);
+
+#warning Should order by name (and probably edition since with zypp we could have multiple editions installed in parallel)
+// _items_to_verify.sort (order); //(GCompareFunc) rc_item_compare_name);
+}
+
+
+void
+Resolver::addExtraCapability (const Capability & capability)
+{
+ _extra_caps.insert (capability);
+}
+
+
+void
+Resolver::addExtraConflict (const Capability & capability)
+{
+ _extra_conflicts.insert (capability);
+}
+
+
+void
+Resolver::addIgnoreConflict (const PoolItem_Ref item,
+ const Capability & capability)
+{
+ _ignoreConflicts.insert(make_pair(item, capability));
+}
+
+
+void
+Resolver::addIgnoreRequires (const PoolItem_Ref item,
+ const Capability & capability)
+{
+ _ignoreRequires.insert(make_pair(item, capability));
+}
+
+void
+Resolver::addIgnoreObsoletes (const PoolItem_Ref item,
+ const Capability & capability)
+{
+ _ignoreObsoletes.insert(make_pair(item, capability));
+}
+
+void
+Resolver::addIgnoreInstalledItem (const PoolItem_Ref item)
+{
+ _ignoreInstalledItem.push_back (item);
+}
+
+void
+Resolver::addIgnoreArchitectureItem (const PoolItem_Ref item)
+{
+ _ignoreArchitectureItem.push_back (item);
+}
+
+void
+Resolver::addIgnoreVendorItem (const PoolItem_Ref item)
+{
+ _ignoreVendorItem.push_back (item);
+}
+
+//---------------------------------------------------------------------------
+
+struct UndoTransact : public resfilter::PoolItemFilterFunctor
+{
+ ResStatus::TransactByValue resStatus;
+ UndoTransact ( const ResStatus::TransactByValue &status)
+ :resStatus(status)
+ { }
+
+ bool operator()( PoolItem_Ref item ) // only transacts() items go here
+ {
+ item.status().resetTransact( resStatus );// clear any solver/establish transactions
+ return true;
+ }
+};
+
+
+struct DoTransact : public resfilter::PoolItemFilterFunctor
+{
+ ResStatus::TransactByValue resStatus;
+ DoTransact ( const ResStatus::TransactByValue &status)
+ :resStatus(status)
+ { }
+
+ bool operator()( PoolItem_Ref item ) // only transacts() items go here
+ {
+ item.status().setTransact( true, resStatus );
+ return true;
+ }
+};
+
+
+struct VerifySystem : public resfilter::PoolItemFilterFunctor
+{
+ Resolver & resolver;
+
+ VerifySystem (Resolver & r)
+ : resolver (r)
+ { }
+
+ bool operator()( PoolItem_Ref provider )
+ {
+ resolver.addPoolItemToVerify (provider);
+ return true;
+ }
+};
+
+bool
+Resolver::verifySystem (bool considerNewHardware)
+{
+ UndoTransact resetting (ResStatus::APPL_HIGH);
+
+ _DEBUG ("Resolver::verifySystem() " << (considerNewHardware ? "consider new hardware":""));
+
+ invokeOnEach ( _pool.begin(), _pool.end(),
+ resfilter::ByTransact( ), // Resetting all transcations
+ functor::functorRef(resetting) );
+
+ VerifySystem info (*this);
+
+ invokeOnEach( pool().byKindBegin( ResTraits<Package>::kind ),
+ pool().byKindEnd( ResTraits<Package>::kind ),
+ resfilter::ByInstalled ( ),
+ functor::functorRef(info) );
+
+ invokeOnEach( pool().byKindBegin( ResTraits<Pattern>::kind ),
+ pool().byKindEnd( ResTraits<Pattern>::kind ),
+ resfilter::ByInstalled ( ),
+ functor::functorRef(info) );
+
+
+ _verifying = true;
+
+ bool success = false;
+
+ if (considerNewHardware) {
+ // evaluate all Freshens/Supplements and solve
+ success = freshenPool(false) && bestContext() && bestContext()->isValid();
+ }
+ else {
+ success = resolveDependencies (); // do solve only
+ }
+
+ DoTransact setting (ResStatus::APPL_HIGH);
+
+ invokeOnEach ( _pool.begin(), _pool.end(),
+ resfilter::ByTransact( ),
+ functor::functorRef(setting) );
+
+ return success;
+}
+
+
+//---------------------------------------------------------------------------
+
+// copy marked item from solution back to pool
+// if data != NULL, set as APPL_LOW (from establishPool())
+
+static void
+solution_to_pool (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ if (triggeredSolution.find(item) != triggeredSolution.end()) {
+ _XDEBUG("solution_to_pool(" << item << ") is already in the pool --> skip");
+ return;
+ }
+
+ triggeredSolution.insert(item);
+
+ // resetting transaction only
+ item.status().resetTransact((data != NULL) ? ResStatus::APPL_LOW : ResStatus::SOLVER );
+
+ bool r;
+
+ if (status.isToBeInstalled()) {
+ r = item.status().setToBeInstalled( (data != NULL) ? ResStatus::APPL_LOW : ResStatus::SOLVER );
+ _XDEBUG("solution_to_pool(" << item << ", " << status << ") install !" << r);
+ }
+ else if (status.isToBeUninstalledDueToUpgrade()) {
+ r = item.status().setToBeUninstalledDueToUpgrade( (data != NULL) ? ResStatus::APPL_LOW : ResStatus::SOLVER );
+ _XDEBUG("solution_to_pool(" << item << ", " << status << ") upgrade !" << r);
+ }
+ else if (status.isToBeUninstalled()) {
+ r = item.status().setToBeUninstalled( (data != NULL) ? ResStatus::APPL_LOW : ResStatus::SOLVER );
+ _XDEBUG("solution_to_pool(" << item << ", " << status << ") remove !" << r);
+ }
+ else if (status.isIncomplete()
+ || status.isNeeded()) {
+ r = item.status().setIncomplete();
+ _XDEBUG("solution_to_pool(" << item << ", " << status << ") incomplete !" << r);
+ }
+ else if (status.isUnneeded()) {
+ r = item.status().setUnneeded();
+ _XDEBUG("solution_to_pool(" << item << ", " << status << ") unneeded !" << r);
+ }
+ else if (status.isSatisfied()) {
+ r = item.status().setSatisfied();
+ _XDEBUG("solution_to_pool(" << item << ", " << status << ") satisfied !" << r);
+ } else {
+ _XDEBUG("solution_to_pool(" << item << ", " << status << ") unchanged !");
+ }
+ return;
+}
+
+
+//---------------------------------------------------------------------------
+// establish state
+
+struct EstablishState
+{
+ Resolver & resolver;
+
+ EstablishState (Resolver & r)
+ : resolver (r)
+ { }
+
+ bool operator()( PoolItem_Ref provider )
+ {
+ resolver.addPoolItemToEstablish (provider);
+ return true;
+ }
+};
+
+
+void
+Resolver::establishState( ResolverContext_Ptr context )
+{
+ _DEBUG( "Resolver::establishState ()" );
+ typedef listResolvable::Kind KindList;
+ static KindList ordered;
+ if (ordered.empty()) {
+ ordered.push_back (ResTraitszypp::Atom::kind);
+ ordered.push_back (ResTraitszypp::Message::kind);
+ ordered.push_back (ResTraitszypp::Script::kind);
+ ordered.push_back (ResTraitszypp::Patch::kind);
+ ordered.push_back (ResTraitszypp::Pattern::kind);
+ ordered.push_back (ResTraitszypp::Product::kind);
+ }
+
+ if (context == NULL)
+ context = new ResolverContext(_pool, _architecture);
+
+ context->setEstablishing (true);
+ context->setIgnoreCababilities (_ignoreConflicts,
+ _ignoreRequires,
+ _ignoreObsoletes,
+ _ignoreInstalledItem,
+ _ignoreArchitectureItem,
+ _ignoreVendorItem);
+ context->setForceResolve( _forceResolve );
+ context->setEstablishContext( _establish_context );
+ context->setPreferHighestVersion ( _preferHighestVersion );
+ context->setUpgradeMode( _upgradeMode );
+
+ for (KindList::const_iterator iter = ordered.begin(); iter != ordered.end(); iter++) {
+ const Resolvable::Kind kind = *iter;
+
+ _XDEBUG( "establishing state for kind " << kind.asString() );
+
+ //world()->foreachResItemByKind (kind, trial_establish_cb, this);
+
+ EstablishState info (*this);
+
+ invokeOnEach( pool().byKindBegin( kind ),
+ pool().byKindEnd( kind ),
+ functor::functorRef(info) );
+
+ // process the queue
+ resolveDependencies( context );
+ reset( false, true ); //resetValidResults,keepExtras
+ }
+
+ context->setEstablishing (false);
+
+ _best_context = context;
+ _establish_context = context;
+
+ return;
+}
+
+
+bool
+Resolver::establishPool ()
+{
+ MIL << "Resolver::establishPool()" << endl;
+
+ establishState (); // establish !
+ ResolverContext_Ptr solution = bestContext();
+
+ if (solution) { // copy solution back to pool
+ triggeredSolution.clear();
+ solution->foreachMarked (solution_to_pool, (void *)1); // as APPL_LOW
+ }
+ else {
+ ERR << "establishState did not return a bestContext" << endl;
+ return false;
+ }
+
+ return true;
+}
+
+
+//---------------------------------------------------------------------------
+// freshen state
+
+typedef map FreshenMap;
+
+// add item to itemmap
+// check for item with same name and only keep
+// best architecture, best version
+
+static void
+addToFreshen( PoolItem_Ref item, FreshenMap & itemmap )
+{
+ FreshenMap::iterator it = itemmap.find( item->name() );
+ if (it != itemmap.end()) { // item with same name found
+ int cmp = it->second->arch().compare( item->arch() );
+ if (cmp < 0) { // new item has better arch
+ it->second = item;
+ }
+ else if (cmp == 0) { // new item has equal arch
+ if (it->second->edition().compare( item->edition() ) < 0) {
+ it->second = item; // new item has better edition
+ }
+ }
+ }
+ else {
+ itemmap[item->name()] = item;
+ }
+ return;
+}
+
+
+struct FreshenState
+{
+ FreshenMap itemmap;
+
+ FreshenState()
+ { }
+
+ bool operator()( PoolItem_Ref item)
+ {
+ CapSet freshens( item->dep( Dep::FRESHENS ) );
+ if (!freshens.empty()) {
+ addToFreshen( item, itemmap );
+ }
+ else { // if no freshens, look at supplements
+ // Also regarding supplements e.g. in order to recognize
+ // modalias dependencies. Bug #163140
+ CapSet supplements( item->dep( Dep::SUPPLEMENTS ) );
+ if (!supplements.empty()) {
+ addToFreshen( item, itemmap );
+ }
+ }
+ return true;
+ }
+};
+
+
+void
+Resolver::freshenState( ResolverContext_Ptr context,
+ bool resetAfterSolve )
+{
+ _DEBUG( "Resolver::freshenState ()" );
+
+ if (context == NULL)
+ context = new ResolverContext( _pool, _architecture );
+
+ context->setEstablishing( true );
+ context->setIgnoreCababilities( _ignoreConflicts,
+ _ignoreRequires,
+ _ignoreObsoletes,
+ _ignoreInstalledItem,
+ _ignoreArchitectureItem,
+ _ignoreVendorItem);
+ context->setForceResolve( _forceResolve );
+ context->setEstablishContext( _establish_context );
+ context->setPreferHighestVersion( _preferHighestVersion );
+ context->setUpgradeMode( _upgradeMode );
+
+ FreshenState info;
+
+ // collect items to be established
+
+ invokeOnEach( pool().byKindBegin( ResTraitszypp::Package::kind ),
+ pool().byKindEnd( ResTraitszypp::Package::kind ),
+ functor::functorRef(info) );
+
+ // schedule all collected items for establish
+
+ for (FreshenMap::iterator it = info.itemmap.begin(); it != info.itemmap.end(); ++it) {
+ addPoolItemToEstablish( it->second );
+ }
+
+ // process the queue
+ resolveDependencies( context );
+
+ if (resetAfterSolve) {
+ reset( false, true ); //resetValidResults,keepExtras
+ context->setEstablishing( false );
+ _best_context = context;
+ }
+
+ return;
+}
+
+
+bool
+Resolver::freshenPool (bool resetAfterSolve)
+{
+ MIL << "Resolver::freshenPool()" << endl;
+
+ freshenState (NULL, resetAfterSolve); // establish all packages with freshens; (NULL)= no initial context
+ ResolverContext_Ptr solution = bestContext();
+
+ if (solution) { // copy solution back to pool
+ triggeredSolution.clear();
+ solution->foreachMarked (solution_to_pool, (void *)1); // as APPL_LOW
+ }
+ else {
+ ERR << "freshenState did not return a bestContext" << endl;
+ return false;
+ }
+
+ return true;
+}
+
+//---------------------------------------------------------------------------
+
+struct FileSystemEstablishItem
+{
+ Resolver & resolver;
+
+ FileSystemEstablishItem (Resolver & r)
+ : resolver (r)
+ { }
+
+ // items with filecaps has to be evaluate again via establish
+
+ bool operator()( const CapAndItem & cai )
+ {
+ _XDEBUG( "QueueItemInstall::FileSystemEstablishItem (" << cai.item << ", " << cai.cap << ")");
+ resolver.addPoolItemToEstablish (cai.item);
+ return true;
+ }
+};
+
+
+
+bool
+Resolver::resolveDependencies (const ResolverContext_Ptr context)
+{
+
+ time_t t_start, t_now;
+
+ MIL << "Resolver::resolveDependencies()" << endl;
+
+ _pending_queues.clear();
+ _pruned_queues.clear();
+ _complete_queues.clear();
+ _deferred_queues.clear();
+ _invalid_queues.clear();
+ _valid_solution_count = 0;
+ _best_context = NULL;
+
+#warning local items disabled
+#if 0
+ bool have_local_items = false;
+
+ /* Walk through are list of to-be-installed packages and see if any of them are local. */
+
+ for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
+ if ((*iter)->local()) {
+ have_local_items = true;
+ break;
+ }
+ }
+
+ World_Ptr the_world = world();
+ StoreWorld_Ptr local_world = NULL;
+ MultiWorld_Ptr local_multiworld = NULL;
+
+ Channel_Ptr local_channel = NULL;
+
+ if (have_local_items) {
+ local_multiworld = new MultiWorld();
+ local_world = new StoreWorld();
+
+ local_channel = new Channel ("", "Local ResItems", "@local", "");
+
+ local_world->addChannel (local_channel);
+
+ local_multiworld->addSubworld (local_world);
+ local_multiworld->addSubworld (the_world);
+
+ the_world = local_multiworld;
+ }
+#endif
+
+ // Checking if we have to make additional establish concerning filesystem capabilities
+ FileSystemEstablishItem establish(*this);
+ Dep dep( Dep::SUPPLEMENTS);
+ invokeOnEach( pool().byCapabilityIndexBegin( "filesystem()", dep ), // begin()
+ pool().byCapabilityIndexEnd( "filesystem()", dep ), // end()
+ functor::functorRef( establish ) );
+
+ // create initial_queue
+
+ ResolverQueue_Ptr initial_queue = new ResolverQueue(_pool, _architecture, context);
+
+ // adding "external" provides, the the requirements will be ignored
+ IgnoreMap ignoreRequires = _ignoreRequires;
+ ResPool::AdditionalCapSet additionalCapSet = pool().additionaProvide();
+ for (ResPool::AdditionalCapSet::const_iterator it = additionalCapSet.begin();
+ it != additionalCapSet.end(); it++) {
+ CapSet cset = it->second;
+ for (CapSet::const_iterator cit = cset.begin(); cit != cset.end(); ++cit) {
+ ignoreRequires.insert(make_pair(PoolItem_Ref(), *cit));
+ }
+ }
+
+ // Initialize all ignoring dependencies
+ initial_queue->context()->setIgnoreCababilities (_ignoreConflicts,
+ ignoreRequires,
+ _ignoreObsoletes,
+ _ignoreInstalledItem,
+ _ignoreArchitectureItem,
+ _ignoreVendorItem);
+ initial_queue->context()->setForceResolve( _forceResolve );
+ initial_queue->context()->setEstablishContext( _establish_context );
+ initial_queue->context()->setPreferHighestVersion( _preferHighestVersion );
+ initial_queue->context()->setUpgradeMode( _upgradeMode );
+ initial_queue->context()->setTryAllPossibilities( _tryAllPossibilities );
+
+ /* If this is a verify, we do a "soft resolution" */
+
+ initial_queue->context()->setVerifying( _verifying );
+
+ /* Add extra items. */
+
+ for (QueueItemList::const_iterator iter = _initial_items.begin(); iter != _initial_items.end(); iter++) {
+ initial_queue->addItem (*iter);
+ }
+
+ for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
+ PoolItem_Ref r = *iter;
+
+#warning local items disabled
+#if 0
+ /* Add local packages to our dummy channel. */
+ if (r->local()) {
+ assert (local_channel != NULL);
+ ResItem_Ptr r1 = const_pointer_cast<ResItem>(r);
+ r1->setChannel (local_channel);
+ local_world->addPoolItem_Ref (r);
+ }
+#endif
+ initial_queue->addPoolItemToInstall (r);
+ }
+
+ for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
+ if (!_upgradeMode)
+ initial_queue->addPoolItemToRemove (*iter, true /* remove-only mode */);
+ else
+ // Checking old dependencies for packages which will be updated.
+ // E.g. foo provides a dependecy which foo-new does not provides anymore.
+ // So check, if there is a packages installed which requires foo.
+ // Testcase exercise-bug150844-test.xml
+ // Testcase Bug156439-test.xml
+ initial_queue->addPoolItemToRemove (*iter, false /* no remove-only mode */);
+ }
+
+ for (PoolItemList::const_iterator iter = _items_to_verify.begin(); iter != _items_to_verify.end(); iter++) {
+ initial_queue->addPoolItemToVerify (*iter);
+ }
+
+ for (PoolItemList::const_iterator iter = _items_to_establish.begin(); iter != _items_to_establish.end(); iter++) {
+ initial_queue->addPoolItemToEstablish (*iter);
+ }
+
+ for (CapSet::const_iterator iter = _extra_caps.begin(); iter != _extra_caps.end(); iter++) {
+ initial_queue->addExtraCapability (*iter);
+ }
+
+ // adding "external" requires
+ additionalCapSet = pool().additionalRequire();
+ for (ResPool::AdditionalCapSet::const_iterator it = additionalCapSet.begin();
+ it != additionalCapSet.end(); it++) {
+ CapSet cset = it->second;
+ for (CapSet::const_iterator cit = cset.begin(); cit != cset.end(); ++cit) {
+ initial_queue->addExtraCapability (*cit);
+ }
+ }
+
+ for (CapSet::const_iterator iter = _extra_conflicts.begin(); iter != _extra_conflicts.end(); iter++) {
+ initial_queue->addExtraConflict (*iter);
+ }
+
+ // adding "external" conflicts
+ additionalCapSet = pool().additionaConflict();
+ for (ResPool::AdditionalCapSet::const_iterator it = additionalCapSet.begin();
+ it != additionalCapSet.end(); it++) {
+ CapSet cset = it->second;
+ for (CapSet::const_iterator cit = cset.begin(); cit != cset.end(); ++cit) {
+ initial_queue->addExtraConflict (*cit);
+ }
+ }
+
+ // Adding System resolvable
+ assertSystemResObjectInPool();
+
+ _XDEBUG( "Initial Queue: [" << *initial_queue << "]" );
+
+ if (initial_queue->isEmpty()) {
+ INT << "Empty Queue, nothing to resolve" << endl;
+ _best_context = context; // Taking old context
+ return true;
+ }
+
+ _best_context = NULL;
+
+ _pending_queues.push_front (initial_queue);
+
+ time (&t_start);
+
+ while (!_pending_queues.empty()) {
+
+ _DEBUG( "Pend " << (long) _pending_queues.size()
+ << " / Cmpl " << (long) _complete_queues.size()
+ << " / Prun " << (long) _pruned_queues.size()
+ << " / Defr " << (long) _deferred_queues.size()
+ << " / Invl " << (long) _invalid_queues.size() );
+
+ if (_timeout_seconds > 0) {
+ time (&t_now);
+ if (difftime (t_now, t_start) > _timeout_seconds) {
+ _timed_out = true;
+ MIL << "Timeout " << _timeout_seconds << " seconds reached"
+ << " -> exit" << endl;
+ break;
+ }
+ }
+ if (_maxSolverPasses > 0) {
+ if (_maxSolverPasses <= _complete_queues.size() +
+ _pruned_queues.size() +
+ _deferred_queues.size() +
+ _invalid_queues.size()) {
+ _timed_out = true;
+ MIL << "Max solver runs ( " << _maxSolverPasses
+ << " ) reached -> exit" << endl;
+ break;
+ }
+ }
+
+ if (_best_context != NULL
+ && _complete_queues.size() >= MAX_VALID_SOLUTIONS) {
+ MIL << "Max VALID solver runs ( " << MAX_VALID_SOLUTIONS
+ << " ) reached -> exit" << endl;
+ break;
+ }
+
+ ResolverQueue_Ptr queue = _pending_queues.front();
+ _pending_queues.pop_front();
+ ResolverContext_Ptr context = queue->context();
+
+ queue->process();
+
+ if (queue->isInvalid ()) {
+
+ _XDEBUG( "Invalid Queue\n" );
+ _invalid_queues.push_back(queue);
+
+ } else if (queue->isEmpty ()) {
+
+ _XDEBUG( "Empty Queue\n" );
+
+ _complete_queues.push_back(queue);
+
+ ++_valid_solution_count;
+
+ /* Compare this solution to our previous favorite. In the case of a tie,
+ the first solution wins --- yeah, I know this is lame, but it shouldn't
+ be an issue too much of the time. */
+
+ if (_best_context == NULL
+ || _best_context->compare (context) < 0)
+ {
+ _best_context = context;
+ }
+
+ } else if (_best_context != NULL
+ && _best_context->partialCompare (context) > 0) {
+
+ /* If we aren't currently as good as our previous best complete solution,
+ this solution gets pruned. */
+
+ _XDEBUG( "PRUNED!" );
+
+ _pruned_queues.push_back(queue);
+
+ } else {
+
+ /* If our queue is isn't empty and isn't invalid, that can only mean
+ one thing: we are down to nothing but branches. */
+
+ queue->splitFirstBranch (_pending_queues, _deferred_queues);
+ }
+
+ /* If we have run out of pending queues w/o finding any solutions,
+ and if we have deferred queues, make the first deferred queue
+ pending. */
+
+ if (_pending_queues.empty()
+ && _complete_queues.empty()
+ && !_deferred_queues.empty()) {
+ _pending_queues.push_back(_deferred_queues.front());
+ }
+ }
+ _DEBUG("Pend " << (long) _pending_queues.size()
+ << " / Cmpl " << (long) _complete_queues.size()
+ << " / Prun " << (long) _pruned_queues.size()
+ << " / Defr " << (long) _deferred_queues.size()
+ << " / Invl " << (long) _invalid_queues.size() );
+
+ return _best_context && _best_context->isValid();
+}
+
+
+//----------------------------------------------------------------------------
+// undo
+
+void
+Resolver::undo(void)
+{
+ UndoTransact info(ResStatus::APPL_LOW);
+ MIL << "*** undo ***" << endl;
+ invokeOnEach ( _pool.begin(), _pool.end(),
+ resfilter::ByTransact( ), // collect transacts from Pool to resolver queue
+ functor::functorRef(info) );
+ // These conflict should be ignored of the concering item
+ _ignoreConflicts.clear();
+ // These requires should be ignored of the concering item
+ _ignoreRequires.clear();
+ // These obsoletes should be ignored of the concering item
+ _ignoreObsoletes.clear();
+ // Ignore architecture of the item
+ _ignoreArchitecture.clear();
+ // Ignore the status "installed" of the item
+ _ignoreInstalledItem.clear();
+ // Ignore the architecture of the item
+ _ignoreArchitectureItem.clear();
+ // Ignore the vendor of the item
+ _ignoreVendorItem.clear();
+
+
+ return;
+}
+
+//----------------------------------------------------------------------------
+// resolvePool
+
+struct CollectTransact : public resfilter::PoolItemFilterFunctor
+{
+ Resolver & resolver;
+
+ CollectTransact (Resolver & r)
+ : resolver (r)
+ { }
+
+ bool operator()( PoolItem_Ref item ) // only transacts() items go here
+ {
+ ResStatus status = item.status();
+ _XDEBUG( "CollectTransact(" << item << ")" );
+ bool by_solver = (status.isBySolver() || status.isByApplLow());
+
+ if (by_solver) {
+ _XDEBUG("Resetting " << item );
+ item.status().resetTransact( ResStatus::APPL_LOW );// clear any solver/establish transactions
+ return true; // back out here, dont re-queue former solver result
+ }
+
+ if (status.isToBeInstalled()) {
+ resolver.addPoolItemToInstall(item); // -> install!
+ }
+ if (status.isToBeUninstalled()) {
+ resolver.addPoolItemToRemove(item); // -> remove !
+ }
+ if (status.isIncomplete()) { // incomplete (re-install needed)
+ PoolItem_Ref reinstall = Helper::findReinstallItem (resolver.pool(), item);
+ if (reinstall) {
+ MIL << "Reinstall " << reinstall << " for incomplete " << item << endl;
+ resolver.addPoolItemToInstall(reinstall); // -> install!
+ }
+ else {
+ WAR << "Can't find " << item << " for re-installation" << endl;
+ }
+ }
+
+ if (status.isLocked()
+ && status.isUninstalled()) {
+ // This item could be selected by solver in a former run. Now it
+ // is locked. So we will have to evaluate a new solver run.
+ resolver.addPoolItemToLockUninstalled (item);
+ }
+
+ return true;
+ }
+};
+
+
+static void
+show_pool( ResPool pool )
+{
+ int count = 1;
+ static bool full_pool_shown = true;
+
+ _XDEBUG( "---------------------------------------" );
+ for (ResPool::const_iterator it = pool.begin(); it != pool.end(); ++it, ++count) {
+
+ if (!full_pool_shown // show item if not shown all before
+ || it->status().transacts() // or transacts
+ || !it->status().isUndetermined()) // or established status
+ {
+ _DEBUG( count << ": " << *it );
+ }
+ }
+ _XDEBUG( "---------------------------------------" );
+ full_pool_shown = true;
+}
+
+// This function loops over the pool and grabs
+// all item.status().transacts() and item.status().byUser()
+// It clears all previous bySolver() states also
+//
+// Every toBeInstalled is passed to zypp::solver:detail::Resolver.addPoolItemToInstall()
+// Every toBeUninstalled is passed to zypp::solver:detail::Resolver.addPoolItemToRemove()
+//
+// Then zypp::solver:detail::Resolver.resolveDependencies() is called.
+//
+// zypp::solver:detail::Resolver then returns a ResolverContext via bestContext() which
+// describes the best solution. If bestContext() is NULL, no solution was found.
+//
+// ResolverContext has a foreachMarked() iterator function which loops over all
+// items of the solutions. These must be written back to the pool.
+
+
+bool
+Resolver::resolvePool( bool tryAllPossibilities )
+{
+ ResolverContext_Ptr saveContext = _best_context;
+ CollectTransact info (*this);
+
+ // cleanup before next run
+ if ( _poolchanged.remember( _pool.serial() ) )
+ {
+ MIL << "pool has been CHANGED --> resetting solverresults" << endl;
+ reset( true, true ); //resetValidResults,keepExtras
+ } else {
+ reset( false, true ); //resetValidResults,keepExtras
+ }
+
+ bool saveTryAllPossibilities = _tryAllPossibilities;
+
+ if (tryAllPossibilities) {
+ _tryAllPossibilities = tryAllPossibilities;
+ }
+
+ if (_tryAllPossibilities) {
+ MIL << "================================================================"
+ << endl;
+ MIL << "Solver run with ALL possibilities"
+ << endl;
+ if (_maxSolverPasses <= 0)
+ _maxSolverPasses = MAX_SECOND_RUNS;
+ if (_timeout_seconds <= 0)
+ _timeout_seconds = TIMOUT_SECOND_RUN;
+
+ MIL << "But no longer than " << MAX_SECOND_RUNS << " runs or "
+ << TIMOUT_SECOND_RUN << " seconds" << endl;
+ MIL << "================================================================" << endl;
+ }
+
+#if 1
+
+ MIL << "Resolver::resolvePool()" << endl;
+ _XDEBUG( "Pool before resolve" );
+ show_pool( _pool );
+
+#endif
+ invokeOnEach ( _pool.begin(), _pool.end(),
+ resfilter::ByTransact( ), // collect transacts from Pool to resolver queue
+ functor::functorRef(info) );
+
+ invokeOnEach ( _pool.begin(), _pool.end(),
+ resfilter::ByLock( ), // collect locks from Pool to resolver queue
+ functor::functorRef(info) );
+ // List of installing/removing items of the complete run (not regarding a recycled solver run)
+ PoolItemList _completeItems_to_install = _items_to_install;
+ PoolItemList _completeItems_to_remove = _items_to_remove;
+ PoolItemList _completeItems_to_lockUninstalled = _items_to_lockUninstalled;
+
+ // We have to find a valid context in order to recycle it.
+ saveContext = contextPool.findContext (_items_to_install, _items_to_remove, _items_to_lockUninstalled);
+ // _items_to_install, _items_to_remove contains addition items which has been selected but are
+ // not solved with that context. They will be solved now.
+ // If we have not found any former fitting context, saveContext is NULL. So the solver
+ // make a complete run
+
+ if (saveContext != NULL) {
+ // create a new context in order not overwriting the old
+ saveContext = new ResolverContext (saveContext->pool(), saveContext->architecture(), saveContext);
+ saveContext->setTryAllPossibilities( true );
+ }
+
+ bool have_solution = resolveDependencies (saveContext); // resolve !
+
+ if (have_solution) { // copy solution back to pool
+ MIL << "Have solution, copying back to pool" << endl;
+ ResolverContext_Ptr solution = bestContext();
+ triggeredSolution.clear();
+ solution->foreachMarked (solution_to_pool, NULL);
+#if 1
+ _XDEBUG( "Pool after resolve" );
+ show_pool( _pool );
+#endif
+ // insert best_context in ContextPool for further solver runs
+ contextPool.addContext( solution,_completeItems_to_install, _completeItems_to_remove, _completeItems_to_lockUninstalled);
+
+ }
+ else {
+ MIL << "!!! Have NO solution !!!" << endl;
+#if 0 // It takes too much memory for logging. Do not use it !
+ MIL << "!!! Have NO solution !!! Additional solver information:" << endl;
+ int counter = 0;
+ for (ResolverQueueList::iterator iter = _invalid_queues.begin();
+ iter != _invalid_queues.end(); iter++) {
+ counter++;
+ MIL << "-----------------------------------------------------------------" << endl;
+ MIL << counter++ << ". failed queue:" << endl;
+ ResolverQueue_Ptr invalid = *iter;
+ invalid->context()->spewInfo (); No additional information needed here
+ MIL << *invalid->context() << endl;
+ MIL << "-----------------------------------------------------------------" << endl;
+ }
+#endif
+ }
+
+ if (tryAllPossibilities) {
+ _tryAllPossibilities = saveTryAllPossibilities; // reset to old value
+ }
+
+ return have_solution;
+}
+
+
+static void
+get_info_foreach_cb (ResolverInfo_Ptr info, void *data)
+{
+ list<string> *stringList = (list<string> *)data;
+ stringList->push_back (info->message());
+}
+
+
+// returns a string list of ResolverInfo of the LAST not valid solution
+std::liststd::string Resolver::problemDescription( void ) const
+{
+ list<string> retList;
+ if (_invalid_queues.empty()) return retList;
+ ResolverQueue_Ptr invalid = _invalid_queues.front();
+ invalid->context()->foreachInfo (PoolItem_Ref(), -1, get_info_foreach_cb, (void *)&retList);;
+ return retList;
+}
+
+
+//
+// transact a single object
+// -> do a 'single step' resolving either installing or removing
+// required and recommended PoolItems
+
+bool
+Resolver::transactResObject( ResObject::constPtr robj, bool install,
+ bool recursive)
+{
+ MIL << "transactResObject()" << endl;
+ MIL << "is obsolete; use resolvePool() instead" << endl;
+
+ return true;
+}
+
+
+bool
+Resolver::transactResKind( Resolvable::Kind kind )
+{
+ MIL << "transactResKind(" << kind << ")" << endl;
+ MIL << "is obsolete; use resolvePool() instead" << endl;
+
+ return true;
+}
+
+
+void
+Resolver::transactReset( ResStatus::TransactByValue causer )
+{
+ MIL << "transactReset(" << causer << ")" << endl;
+ MIL << "is obsolete; use resolvePool() instead" << endl;
+
+ return;
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Resolver.h new/libzypp-3.22.1/zypp/solver/detail/Resolver.h
--- old/libzypp-3.22.1/zypp/solver/detail/Resolver.h 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/solver/detail/Resolver.h 2007-09-07 14:53:31.000000000 +0200
@@ -225,6 +225,7 @@
void addPoolItemToVerify (PoolItem_Ref item);
void addExtraCapability (const Capability & capability);
+ void removeExtraCapability (const Capability & capability);
void addExtraConflict (const Capability & capability);
const CapSet extraCapability () { return _extra_caps; }
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Resolver.h.bak new/libzypp-3.22.1/zypp/solver/detail/Resolver.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/Resolver.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/Resolver.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,302 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* Resolver.h
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_RESOLVER_H
+#define ZYPP_SOLVER_DETAIL_RESOLVER_H
+
+#include <iosfwd>
+#include <list>
+#include <map>
+#include <string>
+
+#include "zypp/base/ReferenceCounted.h"
+#include "zypp/base/PtrTypes.h"
+
+#include "zypp/ResPool.h"
+#include "zypp/base/SerialNumber.h"
+
+#include "zypp/solver/detail/Types.h"
+#include "zypp/solver/detail/ResolverQueue.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/solver/detail/ContextPool.h"
+
+#include "zypp/ProblemTypes.h"
+#include "zypp/ResolverProblem.h"
+#include "zypp/ProblemSolution.h"
+#include "zypp/UpgradeStatistics.h"
+
+#include "zypp/CapSet.h"
+
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ItemCapKind
+ //
+ /** */
+ struct ItemCapKind
+ {
+ public:
+ Capability cap; //Capability which has triggerd this selection
+ Dep capKind; //Kind of that capability
+ PoolItem_Ref item; //Item which has triggered this selection
+ bool initialInstallation; //This item has triggered the installation
+ //Not already fullfilled requierement only.
+
+ ItemCapKind( PoolItem i, Capability c, Dep k, bool initial)
+ : cap( c )
+ , capKind( k )
+ , item( i )
+ , initialInstallation( initial )
+ { }
+ };
+ typedef std::multimap ItemCapKindMap;
+ typedef std::list<ItemCapKind> ItemCapKindList;
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : Resolver
+
+class Resolver : public base::ReferenceCounted, private base::NonCopyable {
+
+ private:
+ ResPool _pool;
+ SerialNumberWatcher _poolchanged;
+
+ unsigned _timeout_seconds;
+ unsigned _maxSolverPasses;
+ bool _verifying;
+ bool _testing;
+
+ // In order reducing solver time we are reducing the branches
+ // by skipping resolvables which have worse architecture,edition
+ // than a resolvable which provides the same cababilities.
+ // BUT if there is no valid solution we will regard the "other"
+ // resolvables in a second solver run too.
+ bool _tryAllPossibilities; // Try ALL alternatives
+
+ // list populated by calls to addPoolItemTo*()
+ QueueItemList _initial_items;
+ PoolItemList _items_to_install;
+ PoolItemList _items_to_establish;
+ PoolItemList _items_to_remove;
+ PoolItemList _items_to_verify;
+ PoolItemList _items_to_lockUninstalled;
+
+ // pool of valid contexts which are "recycled" in order to fasten the solver
+ ContextPool contextPool;
+
+ // list of problematic items after doUpgrade()
+ PoolItemList _update_items;
+
+ // Additional information about the solverrun
+ ItemCapKindMap _isInstalledBy;
+ ItemCapKindMap _installs;
+
+ CapSet _extra_caps;
+ CapSet _extra_conflicts;
+
+ //typedef std::multimap IgnoreMap;
+
+ // These conflict should be ignored of the concering item
+ IgnoreMap _ignoreConflicts;
+ // These requires should be ignored of the concering item
+ IgnoreMap _ignoreRequires;
+ // These obsoletes should be ignored of the concering item
+ IgnoreMap _ignoreObsoletes;
+ // Ignore architecture of the item
+ PoolItemList _ignoreArchitecture;
+ // Ignore the status "installed" of the item
+ PoolItemList _ignoreInstalledItem;
+ // Ignore the architecture of the item
+ PoolItemList _ignoreArchitectureItem;
+ // Ignore the vendor of the item
+ PoolItemList _ignoreVendorItem;
+
+ ResolverQueueList _pending_queues;
+ ResolverQueueList _pruned_queues;
+ ResolverQueueList _complete_queues;
+ ResolverQueueList _deferred_queues;
+ ResolverQueueList _invalid_queues;
+
+ int _valid_solution_count;
+
+ ResolverContext_Ptr _best_context;
+ // Context of the last establishing call ( without any transaction )
+ ResolverContext_Ptr _establish_context;
+ bool _timed_out;
+
+ std::set<Repository> _subscribed;
+
+ Arch _architecture;
+
+ bool _forceResolve; // remove items which are conflicts with others or
+ // have unfulfilled requirements.
+ // This behaviour is favourited by ZMD
+ bool _upgradeMode; // Resolver has been called with doUpgrade
+ bool _preferHighestVersion; // Prefer the result with the newest version
+ //if there are more solver results.
+
+ // helpers
+ bool doesObsoleteCapability (PoolItem_Ref candidate, const Capability & cap);
+ bool doesObsoleteItem (PoolItem_Ref candidate, PoolItem_Ref installed);
+
+ void collectResolverInfo (void);
+
+
+ public:
+
+ Resolver (const ResPool & pool);
+ virtual ~Resolver();
+
+ // ---------------------------------- I/O
+
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ friend std::ostream& operator<<(std::ostream& str, const Resolver & obj)
+ { return obj.dumpOn (str); }
+ void dumpTaskList(const PoolItemList &install, const PoolItemList &remove );
+
+ // ---------------------------------- accessors
+
+ QueueItemList initialItems () const { return _initial_items; }
+
+ ResolverQueueList pendingQueues () const { return _pending_queues; }
+ ResolverQueueList prunedQueues () const { return _pruned_queues; }
+ ResolverQueueList completeQueues () const { return _complete_queues; }
+ ResolverQueueList deferredQueues () const { return _deferred_queues; }
+ ResolverQueueList invalidQueues () const { return _invalid_queues; }
+
+ ResolverContext_Ptr bestContext (void) const { return _best_context; }
+
+ /** depending on the last solver result, either return bestContext()
+ of the first invalid context */
+ ResolverContext_Ptr context (void) const;
+
+ // ---------------------------------- methods
+
+ void setTimeout (int seconds) { _timeout_seconds = seconds; }
+ void setMaxSolverPasses (int count) { _maxSolverPasses = count; }
+ int timeout () const { return _timeout_seconds; }
+ int maxSolverPasses () const { return _maxSolverPasses; }
+
+ ResPool pool (void) const;
+ void setPool (const ResPool & pool) { _pool = pool; }
+
+ void addSubscribedSource (Repository source);
+
+ void addPoolItemToInstall (PoolItem_Ref item);
+ void addPoolItemsToInstallFromList (PoolItemList & rl);
+
+ void addPoolItemToLockUninstalled (PoolItem_Ref item);
+
+ void addPoolItemToRemove (PoolItem_Ref item);
+ void addPoolItemsToRemoveFromList (PoolItemList & rl);
+
+ void addPoolItemToEstablish (PoolItem_Ref item);
+ void addPoolItemsToEstablishFromList (PoolItemList & rl);
+
+ void addPoolItemToVerify (PoolItem_Ref item);
+
+ void addExtraCapability (const Capability & capability);
+ void addExtraConflict (const Capability & capability);
+
+ const CapSet extraCapability () { return _extra_caps; }
+ const CapSet extraConflicts () { return _extra_conflicts; }
+
+ void addIgnoreConflict (const PoolItem_Ref item,
+ const Capability & capability);
+ void addIgnoreRequires (const PoolItem_Ref item,
+ const Capability & capability);
+ void addIgnoreObsoletes (const PoolItem_Ref item,
+ const Capability & capability);
+ void addIgnoreInstalledItem (const PoolItem_Ref item);
+ void addIgnoreArchitectureItem (const PoolItem_Ref item);
+ void addIgnoreVendorItem (const PoolItem_Ref item);
+
+ void setForceResolve (const bool force) { _forceResolve = force; }
+ const bool forceResolve() { return _forceResolve; }
+ void setPreferHighestVersion (const bool highestVersion) { _preferHighestVersion = highestVersion; }
+ const bool preferHighestVersion() { return _preferHighestVersion; }
+
+ void setTryAllPossibilities (const bool tryAllPossibilities) { _tryAllPossibilities = tryAllPossibilities; }
+ const bool tryAllPossibilities () const { return _tryAllPossibilities; };
+
+ bool verifySystem (bool considerNewHardware = false);
+ void establishState (ResolverContext_Ptr context = NULL);
+ bool establishPool (void);
+ void freshenState( ResolverContext_Ptr context = NULL, bool resetAfterSolve = true );
+ bool freshenPool( bool resetAfterSolve = true );
+ bool resolveDependencies (const ResolverContext_Ptr context = NULL);
+ bool resolvePool( bool tryAllPossibilities = false);
+
+ bool transactResObject( ResObject::constPtr robj,
+ bool install = true,
+ bool recursive = false);
+ bool transactResKind( Resolvable::Kind kind );
+ void transactReset( ResStatus::TransactByValue causer );
+
+ void doUpgrade( zypp::UpgradeStatistics & opt_stats_r );
+ PoolItemList problematicUpdateItems( void ) const { return _update_items; }
+
+
+ ResolverProblemList problems (const bool ignoreValidSolution = false) const;
+ void applySolutions (const ProblemSolutionList &solutions);
+ // returns a string list of ResolverInfo of the LAST not valid solution
+ std::liststd::string problemDescription( void ) const;
+
+ // reset all SOLVER transaction in pool
+ void undo(void);
+
+ // Get more information about the solverrun
+ // Which item will be installed by another item or triggers an item for
+ // installation
+ const ItemCapKindList isInstalledBy (const PoolItem_Ref item);
+ const ItemCapKindList installs (const PoolItem_Ref item);
+
+ void reset (bool resetValidResults = false, bool keepExtras = false );
+
+ Arch architecture() const { return _architecture; }
+ void setArchitecture( const Arch & arch) { _architecture = arch; }
+
+ bool testing(void) const { return _testing; }
+ void setTesting( bool testing ) { _testing = testing; }
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_RESOLVER_H
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverContext.cc new/libzypp-3.22.1/zypp/solver/detail/ResolverContext.cc
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverContext.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverContext.cc 2007-09-07 14:53:31.000000000 +0200
@@ -1507,6 +1507,7 @@
const PoolItem_Ref whoNeeds;
const Dep cap;
const bool installInfoFlag;
+ bool allAtomsSatisfied;
RequirementMet (ResolverContext_Ptr ctx, bool *inst, const PoolItem_Ref who, const Dep & capKind, const bool instFlag)
: context (ctx)
@@ -1516,6 +1517,7 @@
, whoNeeds( who )
, cap( capKind )
, installInfoFlag( instFlag )
+ , allAtomsSatisfied(true)
{ }
@@ -1548,13 +1550,18 @@
}
info->setCapability (match, cap);
context->addInfo (info);
+ } else {
+ if (isKind<Atom>(provider.resolvable()) ) {
+ allAtomsSatisfied = false;
+ }
}
// ERR << "RequirementMet(" << provider << ", " << match << ") [capability " <<
// capability << "] -> " << (flag ? "true" : "false") << endl;
- if ( installed // Checking as long as we have found an installed item
- && !*installed )
+ if ( (installed // Checking as long as we have found an installed item
+ && !*installed)
+ || isKind<Atom>(provider.resolvable())) // checking all Atoms
return true;
return ! flag;
@@ -1584,7 +1591,7 @@
_XDEBUG( "ResolverContext::requirementIsMet(" << capability << ") " << (info.flag?"Y":"N") );
if (unneeded) *unneeded = info.unneeded;
- return info.flag;
+ return info.flag && info.allAtomsSatisfied;
}
//---------------------------------------------------------------------------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverContext.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverContext.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverContext.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverContext.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,2056 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverContext.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+
+#include
+
+#include "zypp/CapSet.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/base/String.h"
+
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+#include "zypp/Package.h"
+#include "zypp/Resolvable.h"
+
+#include "zypp/solver/detail/Types.h"
+#include "zypp/solver/detail/Helper.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/solver/detail/ResolverInfoMisc.h"
+#include "zypp/solver/detail/ResolverInfoConflictsWith.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(ResolverContext);
+
+//---------------------------------------------------------------------------
+
+class compare_items {
+public:
+ int operator() (PoolItem_Ref p1,
+ PoolItem_Ref p2) const
+ { return compareByN(p1.resolvable(),p2.resolvable()) < 0 ; }
+};
+
+
+//---------------------------------------------------------------------------
+
+ostream&
+operator<<( ostream& os, const ResolverContext & context)
+{
+ if (context._parent != NULL) {
+ os << "Parent @" << context._parent << endl;
+ os << *(context._parent);
+ }
+ os << "ResolverContext with " << context._context.size() << " entries" << endl;
+ for (ResolverContext::Context::const_iterator iter = context._context.begin(); iter != context._context.end(); ++iter) {
+ os << iter->first << " : " << iter->second << endl;
+ }
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+ResolverContext::ResolverContext (const ResPool & pool, const Arch & arch, ResolverContext_Ptr parent)
+ : _parent (parent)
+ , _establish_context (NULL)
+ , _pool (pool)
+ , _download_size (0)
+ , _install_size (0)
+ , _total_priority (0)
+ , _min_priority (0)
+ , _max_priority (0)
+ , _other_penalties (0)
+ , _verifying (false)
+ , _establishing (false)
+ , _invalid (false)
+ , _askUser(false)
+ , _architecture(arch)
+ , _forceResolve(false)
+ , _upgradeMode(false)
+ , _preferHighestVersion(true)
+ , _tryAllPossibilities(false)
+ , _skippedPossibilities(false)
+
+{
+_XDEBUG( "new ResolverContext()" );
+ if (parent != NULL) {
+ _pool = parent->_pool;
+ _download_size = parent->_download_size;
+ _install_size = parent->_install_size;
+ _total_priority = parent->_total_priority;
+ _max_priority = parent->_max_priority;
+ _min_priority = parent->_min_priority;
+ _other_penalties = parent->_other_penalties;
+ _verifying = parent->_verifying;
+ _establishing = parent->_establishing;
+ _ignoreConflicts = parent->_ignoreConflicts;
+ _ignoreRequires = parent->_ignoreRequires;
+ _ignoreObsoletes = parent->_ignoreObsoletes;
+ _ignoreInstalledItem = parent->_ignoreInstalledItem;
+ _ignoreArchitectureItem = parent->_ignoreArchitectureItem;
+ _ignoreVendorItem = parent->_ignoreVendorItem;
+ _forceResolve = parent->_forceResolve;
+ _upgradeMode = parent->_upgradeMode;
+ _preferHighestVersion = parent->_preferHighestVersion;
+ _tryAllPossibilities = parent->_tryAllPossibilities;
+ _skippedPossibilities = parent->_skippedPossibilities;
+ _establish_context = parent->_establish_context;
+
+ } else {
+ _min_priority = MAXINT;
+ }
+}
+
+
+ResolverContext::~ResolverContext()
+{
+}
+
+//---------------------------------------------------------------------------
+// status retrieve
+
+ResStatus
+ResolverContext::getStatus (PoolItem_Ref item)
+{
+//_XDEBUG( "[" << this << "]getStatus(" << item << ")" );
+
+ if (item == _last_checked_item) return _last_checked_status;
+
+ _last_checked_item = item;
+
+ Context::const_iterator it;
+ ResolverContext_constPtr context = this;
+
+ while (context) { // go through the _parent chain
+
+ it = context->_context.find(item); // part of local context ?
+ if (it != context->_context.end()) {
+//_XDEBUG( "[" << context << "]:" << it->second );
+ _last_checked_status = it->second;
+ if (_last_checked_status.isUndetermined()
+ && _establish_context != NULL) {
+ // take status from the last resolver establish run
+ // in order to get the correct establishing status of the system
+ // without any transactions. Bug 191810
+ ResStatus status = _establish_context->getStatus(item);
+ _last_checked_status.setEstablishValue (status.getEstablishValue());
+ }
+ return _last_checked_status; // Y: return
+ }
+ context = context->_parent; // N: go up the chain
+ }
+
+ ResStatus status( item.status() ); // make a copy of the status
+ status.resetTransact( ResStatus::USER ); // without transaction
+#if 0
+ if (item.status().isInstalled())
+ status = ResStatus::installed; // return _is_ state, not _to be_ state
+ else
+ status = ResStatus::uninstalled; // return _is_ state, not _to be_ state
+#endif
+ _last_checked_status = status;
+//_XDEBUG( "[NULL]:" << status );
+ if (_establish_context != NULL) {
+ // take status from the last resolver establish run
+ // in order to get the correct establishing status of the system
+ // without any transactions. Bug 191810
+ ResStatus status = _establish_context->getStatus(item);
+ _last_checked_status.setEstablishValue (status.getEstablishValue());
+ }
+
+ return _last_checked_status; // Not part of context, return Pool status
+}
+
+
+//---------------------------------------------------------------------------
+// status change
+
+void
+ResolverContext::setStatus (PoolItem_Ref item, const ResStatus & status)
+{
+ if (_invalid) return;
+
+ _XDEBUG( "[" << this << "]setStatus(" << item << ", " << status << ")" );
+ ResStatus old_status = getStatus (item);
+
+ if (old_status != status) { // new status ?
+ _XDEBUG( "MARK" );
+ _context[item] = status; // set it !
+ }
+
+ _last_checked_item = item;
+ _last_checked_status = status;
+
+ return;
+}
+
+
+// change state to TO_BE_INSTALLED (does not upgrade)
+
+bool
+ResolverContext::install (PoolItem_Ref item, bool is_soft, int other_penalty)
+{
+ ResStatus status, new_status;
+ std::string msg;
+
+ status = getStatus(item);
+ _XDEBUG( "ResolverContext[" << this << "]::install(<" << status << "> " << item << ")" );
+
+ if (status.isToBeUninstalled()
+ && !status.isToBeUninstalledDueToUnlink()) {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INSTALL_TO_BE_UNINSTALLED, item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ addError (misc_info);
+ return false;
+ }
+
+ if (status.isImpossible()) {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UNINSTALLABLE, item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ // it is only an error, if the user wants to install explicity.
+ if (is_soft) {
+ addInfo (misc_info);
+ } else {
+ addError (misc_info);
+ }
+ return false;
+ }
+
+ if (status.isUnneeded()
+ && ( item->kind() == ResTraits<Patch>::kind
+ || item->kind() == ResTraits<Atom>::kind)) {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INSTALL_UNNEEDED, item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ addInfo (misc_info);
+ return false;
+ }
+
+ if (status.isToBeInstalled()) {
+ return true;
+ }
+
+ if (isParallelInstall( item )) {
+ ResolverInfoMisc_Ptr misc_info = new ResolverInfoMisc( RESOLVER_INFO_TYPE_INSTALL_PARALLEL,
+ item, RESOLVER_INFO_PRIORITY_VERBOSE );
+ PoolItem_Ref otherItem = getParallelInstall ( item );
+ ResStatus statusOtherItem = getStatus (otherItem);
+ misc_info->setOtherPoolItem (otherItem);
+ if (NVRA(item.resolvable()) == NVRA(otherItem.resolvable())
+ && status.isBySolver() && statusOtherItem.isBySolver()) {
+ // If there has already been selected another item by the solver (e.g. from another repo)
+ // we will take that.
+ // Bug 224698
+ addInfo( misc_info );
+ return true;
+ }
+ else {
+ addError( misc_info );
+ return false;
+ }
+ }
+
+ if (is_soft)
+ setStatus (item, ResStatus::toBeInstalledSoft);
+ else if (status.isToBeUninstalledDueToUnlink())
+ setStatus (item, ResStatus(true));
+ else
+ setStatus (item, ResStatus::toBeInstalled);
+
+ if (status.wasUninstalled()) {
+ Resolvable::constPtr res = item.resolvable();
+ Package::constPtr pkg = asKind<Package>(res); // try to access it as a package
+ if (pkg) { // if its !=NULL, get size information
+
+ _download_size += pkg->downloadSize();
+ _install_size += pkg->size();
+
+ }
+
+ int priority;
+#if 0
+ if (item->local())
+ priority = 0;
+ else {
+#endif
+ priority = getRepoPriority (item->repository());
+// }
+
+ if (priority < _min_priority) _min_priority = priority;
+ if (priority > _max_priority) _max_priority = priority;
+
+ _other_penalties += other_penalty;
+
+ }
+
+ return true;
+}
+
+
+// change state to TO_BE_INSTALLED (does upgrade)
+
+bool
+ResolverContext::upgrade (PoolItem_Ref item, PoolItem_Ref old_item, bool is_soft, int other_penalty)
+{
+ ResStatus status;
+
+ _XDEBUG( "ResolverContext[" << this << "]::upgrade(" << item << " upgrades " << old_item << ")" );
+
+ status = getStatus(item);
+
+ if (status.isToBeUninstalled()) {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INSTALL_TO_BE_UNINSTALLED,
+ item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ addError (misc_info);
+ return false;
+ }
+ if (status.isImpossible()) {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UNINSTALLABLE,
+ item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ addError (misc_info);
+ return false;
+ }
+
+ if (status.isToBeInstalled())
+ return true;
+
+ if (isParallelInstall( item )) {
+ ResolverInfoMisc_Ptr misc_info = new ResolverInfoMisc( RESOLVER_INFO_TYPE_INSTALL_PARALLEL, item, RESOLVER_INFO_PRIORITY_VERBOSE );
+ PoolItem_Ref otherItem = getParallelInstall ( item );
+ ResStatus statusOtherItem = getStatus (otherItem);
+ misc_info->setOtherPoolItem (otherItem);
+ if (NVRA(item.resolvable()) == NVRA(otherItem.resolvable())
+ && status.isBySolver() && statusOtherItem.isBySolver()) {
+ // If there has already been selected another item by the solver (e.g. from another repo)
+ // we will take that.
+ // Bug 224698
+ addInfo( misc_info );
+ return true;
+ }
+ else {
+ addError( misc_info );
+ return false;
+ }
+ }
+
+ ResStatus::TransactByValue by = ResStatus::SOLVER;
+ if (item.status().isToBeInstalled()
+ && item.status().getTransactByValue() > ResStatus::SOLVER) {
+ // if the item has already has been set for installation by
+ // user, or other applications with higher priority
+ // We will use this priority
+ by = item.status().getTransactByValue();
+ }
+
+ if (is_soft) {
+ ResStatus newStatus = ResStatus::toBeInstalledSoft; // This can only be done by the solver
+ setStatus (item, newStatus);
+ }
+ else {
+ ResStatus newStatus;
+ newStatus.setToBeInstalled (by);
+ setStatus (item, newStatus);
+ }
+
+ Resolvable::constPtr res = old_item.resolvable();
+ Package::constPtr pkg = asKind<Package>(res); // try to access it as a package
+ if (pkg) { // if its !=NULL, get size information
+
+ _install_size -= pkg->size();
+ }
+
+ if (status == ResStatus::uninstalled) {
+ res = item.resolvable();
+ pkg = asKind<Package>(res); // try to access it as a package
+ if (pkg) { // if its !=NULL, get size information
+
+ _download_size += pkg->downloadSize();
+ _install_size += pkg->size();
+
+ }
+
+ int priority;
+#if 0
+ if (item->local())
+ priority = 0;
+ else {
+#endif
+ priority = getRepoPriority (item->repository());
+// }
+
+ if (priority < _min_priority) _min_priority = priority;
+ if (priority > _max_priority) _max_priority = priority;
+
+ _other_penalties += other_penalty;
+ }
+ return true;
+}
+
+
+// change state to 'TO_BE_UNINSTALLED{, DUE_TO_OBSOLETE, DUE_TO_UNLINK}'
+
+bool
+ResolverContext::uninstall (PoolItem_Ref item, bool part_of_upgrade, bool due_to_obsolete, bool due_to_unlink, bool explicitly_requested)
+{
+ ResStatus status, new_status;
+ std::string msg;
+
+ status = getStatus(item);
+
+ _XDEBUG( "ResolverContext[" << this << "]::uninstall("
+ << item << " " << (part_of_upgrade ? "part_of_upgrade" : "") << " "
+ << (due_to_obsolete ? "due_to_obsolete": "") << " "
+ << (due_to_unlink ? "due_to_unlink" : "")
+ << ( explicitly_requested ? "explicitly_requested" : "")
+ << ")" << "context-status:" << status);
+
+ assert (! (due_to_obsolete && due_to_unlink));
+
+ if ( ( forceResolve() // This is the behaviour of ZMD
+ && (status.isToBeInstalledNotSoft() // \ The resolvable will be installed
+ || item.status().isToBeInstalledNotSoft())) // / explicit. (And not by WEAK dependencies like supplements)
+
+ || ( !forceResolve() // This is the bahaviour of YaST
+ && ((status.staysInstalled() || status.isToBeInstalledNotSoft()) // \ We will have the resolvable
+ && (item.status().staysInstalled() || item.status().isToBeInstalledNotSoft()) // / available.
+ || status.isToBeInstalledNotSoft()) // is to be installed e.g. due solver requirement
+ // (And not by WEAK dependencies like supplements)
+ && !part_of_upgrade
+ && !due_to_obsolete
+ && !due_to_unlink
+ && !explicitly_requested)) {
+ // We have a resolvable which should be kept on the system or is set to be installed explicit.
+ // So we are not allowed deleting it. The reason WHY this resolvable has to be deleted here
+ // is not show. We go back to the ResolverInfo to evaluate the reason. This reason (marked as an info)
+ // will be stored at the end of ResolverInfo and will be marked as an error which is shown
+ // to the UI (solution included)
+ // Canditates of searched ResolverInfo are RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL
+ // RESOLVER_INFO_TYPE_NO_PROVIDER
+ // RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER
+ // RESOLVER_INFO_TYPE_CANT_SATISFY
+ // RESOLVER_INFO_TYPE_CONFLICTS_WITH
+ //
+ // Testcases are:
+ // conflict2-test.xml conflict-test.xml remove-still-needed2-test.xml require-test.xml
+ // conflict3-test.xml remove-still-needed1-test.xml remove-still-needed3-test.xml unfulfilled-2-test.xml
+ //
+ bool found = false;
+
+ ResolverInfoList addList;
+ for (ResolverInfoList::const_iterator iter = _log.begin(); iter != _log.end(); iter++) {
+ ResolverInfo_Ptr info = *iter;
+
+ if (info->type() == RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL
+ || info->type() == RESOLVER_INFO_TYPE_CONFLICTS_WITH) {
+
+ // There is a conflict like "a conflicts with b"
+ // Searching if there is already an error like "b conflicts with a"
+ PoolItem_Ref other_item = PoolItem_Ref();
+ if (info->type() == RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL) {
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ other_item = misc_info->other();
+ } else {
+ ResolverInfoConflictsWith_constPtr conflicts_with = dynamic_pointer_cast<const ResolverInfoConflictsWith>(info);
+ if (conflicts_with->items().size() == 1) {
+ // It is only useful if there is ONE other item
+ other_item = *(conflicts_with->items().begin());
+ }
+ }
+
+ bool other_found = false;
+
+ if (other_item != PoolItem_Ref()) {
+ // searching for other solutions which have the same problem/solution
+ for (ResolverInfoList::const_iterator iter_other = addList.begin();
+ iter_other != addList.end(); iter_other++) {
+
+ if ((*iter_other)->type() == RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL) {
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(*iter_other);
+ if ( (other_item == misc_info->other()
+ && item == misc_info->affected())
+ || (other_item == misc_info->affected()
+ && item == misc_info->other()))
+ other_found = true;
+ }
+ else if ((*iter_other)->type() == RESOLVER_INFO_TYPE_CONFLICTS_WITH) {
+ ResolverInfoConflictsWith_constPtr conflicts_with = dynamic_pointer_cast<const ResolverInfoConflictsWith>(*iter_other);
+ if (conflicts_with->items().size() == 1) {
+ // It is only useful if there is ONE other item
+ if ( (other_item == *(conflicts_with->items().begin())
+ && item == conflicts_with->affected())
+ || (other_item == conflicts_with->affected()
+ && item == *(conflicts_with->items().begin())))
+ other_found = true;
+ }
+ }
+ }
+ }
+
+ if ( !other_found
+ && (info->affected() == item
+ || other_item == item)) {
+ if (!getStatus(info->affected()).isImpossible() // Check, if the both items are still "installable"
+ && !getStatus(other_item).isImpossible()) { // If not this is not an error anymore
+ // put the info on the end as an error
+ addList.push_back (info);
+ found = true;
+ }
+ }
+ } else if ( (info->type() == RESOLVER_INFO_TYPE_NO_PROVIDER
+ || info->type() == RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER
+ || info->type() == RESOLVER_INFO_TYPE_CANT_SATISFY)
+ && info->affected() == item)
+ {
+ // put the info on the end as error
+ found = true;
+ // dont duplicate known errors (#167309)
+ if (!info->error())
+ addList.push_back (info);
+ } else if (info->type() == RESOLVER_INFO_TYPE_CONFLICTS_WITH
+ && info->affected() == item) {
+ // put the info on the end as error
+ found = true;
+ // dont duplicate known errors (#167309)
+ if (!info->error())
+ addList.push_back (info);
+ }
+ }
+ if (!found) {
+ // generating a default problem
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_REJECT_INSTALL, item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ addError (misc_info, true); // true = asking the user
+ } else {
+ // Put the info at the end of the list, flagged as error
+ for (ResolverInfoList::const_iterator iter = addList.begin(); iter != addList.end(); iter++) {
+ ResolverInfo_Ptr info = *iter;
+ addError (info, true); // true = asking the user
+ }
+ }
+
+// return false;
+ }
+
+ if (status.isToBeUninstalled()
+ && !status.isToBeUninstalledDueToUnlink())
+ {
+ return true;
+ }
+
+ if (status.wasUninstalled()
+ || status.isImpossible()
+ || status.isToBeUninstalledDueToUnlink())
+ {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UNINSTALLABLE, item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ addInfo (misc_info);
+ }
+
+ if (due_to_obsolete) {
+ setStatus (item, ResStatus::toBeUninstalledDueToObsolete);
+ }
+ else if (due_to_unlink) {
+ setStatus (item, ResStatus::toBeUninstalledDueToUnlink);
+ }
+ else if (status.wasUninstalled() ||
+ (status.isToBeInstalled() && status.isBySolver())) {
+ setStatus (item, ResStatus::impossible);
+ }
+ else if (part_of_upgrade) {
+ setStatus (item, ResStatus::toBeUninstalledDueToUpgrade);
+ }
+ else {
+ setStatus (item, ResStatus::toBeUninstalled);
+ }
+
+ if (status.wasInstalled()) {
+ Resolvable::constPtr res = item.resolvable();
+ Package::constPtr pkg = asKind<Package>(res); // try to access it as a package
+ if (pkg) { // if its !=NULL, get size information
+ _install_size -= pkg->size();
+ }
+ }
+
+ return true;
+}
+
+
+// change state to UNNEEDED
+
+bool
+ResolverContext::unneeded (PoolItem_Ref item, int other_penalty)
+{
+ ResStatus status;
+
+ _XDEBUG( "ResolverContext[" << this << "]::unneeded(" << item << ")" );
+
+ status = getStatus(item);
+
+ if (status.wasInstalled()) {
+ if (item->kind() != ResTraits<Patch>::kind
+ && item->kind() != ResTraits<Atom>::kind
+ && item->kind() != ResTraits<Script>::kind
+ && item->kind() != ResTraits<Message>::kind) {
+ setStatus (item, ResStatus::satisfied);
+ } else {
+ // Patch concerning resolvables have to be set to
+ // "unneeded" although they are installed. In order
+ // to get the state "no longer applicable" (Bug 171590)
+ setStatus (item, ResStatus::unneeded);
+ }
+ }
+ else if (status.wasUninstalled()) {
+ setStatus (item, ResStatus::unneeded);
+ }
+ return true;
+}
+
+
+// change state to SATISFIED
+
+bool
+ResolverContext::satisfy (PoolItem_Ref item, int other_penalty)
+{
+ ResStatus status;
+
+ status = getStatus(item);
+
+ _XDEBUG( "ResolverContext[" << this << "]::satisfy(" << item << ":" << status << ")" );
+
+ if (status.wasInstalled()) {
+ setStatus (item, ResStatus::complete);
+ }
+ else if (status.wasUninstalled()) {
+ setStatus (item, ResStatus::satisfied);
+ }
+
+ return true;
+}
+
+
+// change state to INCOMPLETE
+
+bool
+ResolverContext::incomplete (PoolItem_Ref item, int other_penalty)
+{
+ ResStatus status = getStatus (item);
+
+ _XDEBUG( "ResolverContext[" << this << "]::incomplete(" << item << "):" << status );
+
+ if (_establishing) {
+ if (status.wasInstalled()) {
+ setStatus (item, ResStatus::incomplete);
+ }
+ else {
+ setStatus (item, ResStatus::needed);
+ }
+
+ return true;
+ }
+
+ // if something installed goes 'incomplete' outside of the establishing call, its always an error
+
+ if (status.staysInstalled()) {
+ ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INCOMPLETES, item, RESOLVER_INFO_PRIORITY_VERBOSE);
+ addError (misc_info);
+ return false;
+ }
+
+ return true;
+}
+
+//---------------------------------------------------------------------------
+
+// is it installed (after transaction), is unneeded or satisfied
+// if yes, install/requires requests are considered done
+
+bool
+ResolverContext::isPresent (PoolItem_Ref item, bool *unneeded, bool *installed)
+{
+ ResStatus status = getStatus(item);
+
+ bool res = ((status.staysInstalled() && !status.isIncomplete())
+ || (status.isToBeInstalled() && !status.isNeeded())
+ || status.isUnneeded()
+ || status.isSatisfied()
+ );
+
+ if (unneeded) *unneeded = status.isUnneeded();
+ if (installed) *installed = status.staysInstalled() || status.isToBeInstalled();
+
+_XDEBUG("ResolverContext::itemIsPresent(<" << status << ">" << item << ") " << (res?"Y":"N"));
+
+ return res;
+}
+
+
+// is it uninstalled (after transaction) ?
+// if yes, uninstall requests are considered done
+
+bool
+ResolverContext::isAbsent (PoolItem_Ref item)
+{
+ ResStatus status = getStatus(item);
+
+ // DONT add incomplete here, uninstall requests for incompletes must be handled
+
+ bool res = (status.staysUninstalled()
+ || status.isToBeUninstalled()
+ || status.isImpossible());
+
+_XDEBUG("ResolverContext::itemIsAbsent(<" << status << ">" << item << ") " << (res?"Y":"N"));
+
+ return res;
+}
+
+
+//---------------------------------------------------------------------------
+// marked
+
+void
+ResolverContext::foreachMarked (MarkedPoolItemFn fn, void *data) const
+{
+ ResolverContext_constPtr context = this;
+ while (context) {
+ for (Context::const_iterator iter = context->_context.begin(); iter != context->_context.end(); ++iter) {
+ fn (iter->first, iter->second, data);
+ }
+ context = context->_parent;
+ }
+}
+
+
+//---------------------------------------------------------------------------
+// collect
+
+typedef struct {
+ PoolItemList *rl;
+ int status; // <0: uninstalls, ==0: all, >0: installs
+} MarkedResolvableInfo;
+
+
+static void
+marked_item_collector (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ MarkedResolvableInfo *info = (MarkedResolvableInfo *)data;
+ if (info->status == 0
+ || (info->status > 0 && status.isToBeInstalled())
+ || (info->status < 0 && status.isToBeUninstalled()))
+ {
+ info->rl->push_back (item);
+ }
+}
+
+
+PoolItemList
+ResolverContext::getMarked (int which) // <0: uninstalls, ==0: all, >0: installs
+{
+ if ( _last_getMarked_which == which
+ && _last_getMarked.size() > 0 )
+ return _last_getMarked; // use the last run
+
+ MarkedResolvableInfo info = { &_last_getMarked, which };
+
+ foreachMarked (marked_item_collector, &info);
+
+ _last_getMarked.sort(compare_items());
+ _last_getMarked_which = which;
+
+ return _last_getMarked;
+}
+
+//---------------------------------------------------------------------------
+// install
+
+typedef struct {
+ ResPool pool;
+ MarkedPoolItemFn fn;
+ PoolItemList *rl;
+ int count;
+} InstallInfo;
+
+static void
+install_item_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ InstallInfo *info = (InstallInfo *)data;
+
+ if (status.isToBeInstalled()
+ && !item.status().isInstalled()
+ && !Helper::findInstalledItem( info->pool, item))
+ {
+ if (info->fn) info->fn (item, status, info->rl);
+ ++info->count;
+ }
+}
+
+
+int
+ResolverContext::foreachInstall (MarkedPoolItemFn fn, void *data) const
+{
+ PoolItemList *rl = (PoolItemList *)data;
+ InstallInfo info = { _pool, fn, rl, 0 };
+
+ foreachMarked (install_item_cb, (void *)&info);
+
+ return info.count;
+}
+
+
+static void
+context_item_collector (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ PoolItemList *rl = (PoolItemList *)data;
+ if (status.isToBeInstalled()
+ || status.isToBeUninstalled())
+ {
+ rl->push_front (item);
+ }
+}
+
+
+PoolItemList
+ResolverContext::getInstalls (void) const
+{
+ PoolItemList rl;
+
+ foreachInstall (context_item_collector, (void *)&rl);
+
+ return rl;
+}
+
+
+//---------------------------------------------------------------------------
+// satisfy
+
+typedef struct {
+ ResPool pool;
+ MarkedPoolItemFn fn;
+ PoolItemList *rl;
+ int count;
+} SatisfyInfo;
+
+static void
+satisfy_item_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ SatisfyInfo *info = (SatisfyInfo *)data;
+ if (status.isSatisfied()
+ && ! status.staysInstalled ()
+ && !Helper::findInstalledItem (info->pool, item))
+ {
+ if (info->fn) info->fn (item, status, info->rl);
+ ++info->count;
+ }
+}
+
+
+int
+ResolverContext::foreachSatisfy (MarkedPoolItemFn fn, void *data) const
+{
+ PoolItemList *rl = (PoolItemList *)data;
+ SatisfyInfo info = { _pool, fn, rl, 0 };
+
+ foreachMarked (satisfy_item_cb, (void *)&info);
+
+ return info.count;
+}
+
+
+static void
+context_item_collector_satisfy (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ PoolItemList *rl = (PoolItemList *)data;
+ if (status.isSatisfied ())
+ {
+ rl->push_front (item);
+ }
+}
+
+
+PoolItemList
+ResolverContext::getSatisfies (void) const
+{
+ PoolItemList rl;
+
+ foreachSatisfy (context_item_collector_satisfy, (void *)&rl);
+
+ return rl;
+}
+
+
+//---------------------------------------------------------------------------
+// incomplete
+
+typedef struct {
+ ResPool pool;
+ MarkedPoolItemFn fn;
+ PoolItemList *rl;
+ int count;
+} IncompleteInfo;
+
+static void
+incomplete_item_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ IncompleteInfo *info = (IncompleteInfo *)data;
+
+ if (status.isIncomplete ()) {
+ if (info->fn) info->fn (item, status, info->rl);
+ ++info->count;
+ }
+}
+
+
+int
+ResolverContext::foreachIncomplete (MarkedPoolItemFn fn, void *data) const
+{
+ PoolItemList *rl = (PoolItemList *)data;
+ IncompleteInfo info = { _pool, fn, rl, 0 };
+
+ foreachMarked (incomplete_item_cb, (void *)&info);
+
+ return info.count;
+}
+
+
+static void
+context_item_collector_incomplete (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ PoolItemList *rl = (PoolItemList *)data;
+ if (status.isIncomplete ())
+ {
+ rl->push_front (item);
+ }
+}
+
+
+PoolItemList
+ResolverContext::getIncompletes (void) const
+{
+ PoolItemList rl;
+
+ foreachIncomplete (context_item_collector_incomplete, (void *)&rl);
+
+ return rl;
+}
+
+
+//---------------------------------------------------------------------------
+// upgrade
+
+typedef struct {
+ ResPool pool;
+ MarkedPoolItemPairFn fn;
+ void *data;
+ ResolverContext_Ptr context;
+ int count;
+} UpgradeInfo;
+
+static void
+upgrade_item_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ UpgradeInfo *info = (UpgradeInfo *)data;
+
+ PoolItem_Ref installed_item;
+
+ if (status.isToBeInstalled()
+ && ! item.status().isInstalled ())
+ {
+ // check if there is already an installed item with same name and kind
+ installed_item = Helper::findInstalledItem( info->pool, item );
+ if (installed_item) {
+
+ // there is an installed item, check its status
+ ResStatus installed_status( info->context->getStatus( installed_item ) );
+
+ // if it does not transact, it does not get updated (we have an allowed parallel install)
+ if (!installed_status.transacts())
+ return;
+
+ if (info->fn) {
+ info->fn (item, status, installed_item, installed_status, info->data);
+ }
+ ++info->count;
+ }
+ }
+}
+
+
+int
+ResolverContext::foreachUpgrade (MarkedPoolItemPairFn fn, void *data)
+{
+ UpgradeInfo info = { _pool, fn, data, this, 0 };
+
+ foreachMarked (upgrade_item_cb, (void *)&info);
+
+ return info.count;
+}
+
+
+static void
+pair_item_collector (PoolItem_Ref item, const ResStatus & status, PoolItem_Ref old_item, const ResStatus & old_status, void *data)
+{
+ PoolItemList *rl = (PoolItemList *)data;
+ rl->push_back (item);
+}
+
+
+PoolItemList
+ResolverContext::getUpgrades (void)
+{
+ PoolItemList rl;
+
+ foreachUpgrade (pair_item_collector, (void *)&rl);
+
+ return rl;
+}
+
+
+//---------------------------------------------------------------------------
+// uninstall
+
+typedef std::mapstd::string,PoolItem_Ref UpgradeTable;
+
+typedef struct {
+ MarkedPoolItemFn fn;
+ PoolItemList *rl;
+ UpgradeTable upgrade_hash;
+ int count;
+} UninstallInfo;
+
+static void
+uninstall_item_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ UninstallInfo *info = (UninstallInfo *)data;
+
+ UpgradeTable::const_iterator pos = info->upgrade_hash.find(item->name());
+
+ if (status.isToBeUninstalled ()
+ && pos == info->upgrade_hash.end()) // dont count upgrades
+ {
+ if (info->fn)
+ info->fn (item, status, info->rl);
+ ++info->count;
+ }
+}
+
+
+static void
+build_upgrade_hash_cb (PoolItem_Ref item_add, const ResStatus & add_status, PoolItem_Ref item_del, const ResStatus & del_status, void *data)
+{
+ UpgradeTable *upgrade_hash = (UpgradeTable *)data;
+ (*upgrade_hash)[item_del->name()] = item_del;
+}
+
+
+int
+ResolverContext::foreachUninstall (MarkedPoolItemFn fn, void *data)
+{
+ UninstallInfo info; // inits upgrade_hash
+
+ info.fn = fn;
+ info.rl = (PoolItemList *)data;
+ info.count = 0;
+
+ foreachUpgrade (build_upgrade_hash_cb, (void *)&(info.upgrade_hash));
+ foreachMarked (uninstall_item_cb, (void *)&info);
+
+ return info.count;
+}
+
+
+PoolItemList
+ResolverContext::getUninstalls (void)
+{
+ PoolItemList rl;
+
+ foreachUninstall (context_item_collector, (void *)&rl);
+
+ return rl;
+}
+
+
+//---------------------------------------------------------------------------
+// impossible
+
+typedef struct {
+ ResPool pool;
+ MarkedPoolItemFn fn;
+ int count;
+ void *data;
+} ImpossibleInfo;
+
+static void
+impossible_item_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ ImpossibleInfo *info = (ImpossibleInfo *)data;
+
+ if (status.isImpossible ()) {
+ if (info->fn) info->fn (item, status, info->data);
+ ++info->count;
+ }
+}
+
+
+int
+ResolverContext::foreachImpossible (MarkedPoolItemFn fn, void *data)
+{
+ ImpossibleInfo info = { _pool, fn, 0, data };
+
+ foreachMarked (impossible_item_cb, (void *)&info);
+
+ return info.count;
+}
+
+
+//---------------------------------------------------------------------------
+
+static void
+install_count_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ int *count = (int *)data;
+ if (!item.status().isInstalled ()) {
+ ++*count;
+ }
+}
+
+int
+ResolverContext::installCount (void) const
+{
+ int count = 0;
+
+ foreachInstall (install_count_cb, (void *)&count);
+
+ return count;
+}
+
+
+static void
+uninstall_count_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ int *count = (int *)data;
+ if (item.status().isInstalled ()) {
+ ++*count;
+ }
+}
+
+
+int
+ResolverContext::uninstallCount (void)
+{
+ int count = 0;
+
+ foreachUninstall (uninstall_count_cb, (void *)&count);
+
+ return count;
+}
+
+
+int
+ResolverContext::upgradeCount (void)
+{
+ return foreachUpgrade ((MarkedPoolItemPairFn)NULL, (void *)NULL);
+}
+
+
+static void
+satisfy_count_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ int *count = (int *)data;
+ if (!item.status().isInstalled ()) {
+ ++*count;
+ }
+}
+
+int
+ResolverContext::satisfyCount (void) const
+{
+ int count = 0;
+
+ foreachSatisfy (satisfy_count_cb, (void *)&count);
+
+ return count;
+}
+
+
+int
+ResolverContext::incompleteCount (void) const
+{
+ return foreachIncomplete ((MarkedPoolItemFn)NULL, (void *)NULL);
+}
+
+
+
+//---------------------------------------------------------------------------
+// info
+
+void
+ResolverContext::addInfo (ResolverInfo_Ptr info, bool askUser)
+{
+ _XDEBUG( "ResolverContext[" << this << "]::addInfo(" << *info << ")" );
+ _log.push_back (info);
+
+ // _propagated_importance = false;
+
+ if (info->error ()
+ && !askUser) { // Go forward in order to evaluate more problems
+
+ if (! _invalid) {
+ ResolverInfo_Ptr info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INVALID_SOLUTION, PoolItem_Ref(), RESOLVER_INFO_PRIORITY_VERBOSE);
+ info->flagAsError ();
+ _log.push_back (info);
+ }
+
+ _invalid = true;
+ }
+ if (askUser)
+ _askUser = true;
+}
+
+
+void
+ResolverContext::addError (ResolverInfo_Ptr info, bool askUser)
+{
+ bool is_error = true;
+
+ if (info->type() == RESOLVER_INFO_TYPE_UNINSTALL_LOCKED) {
+ for (PoolItemList::const_iterator iter = _ignoreInstalledItem.begin(); iter != _ignoreInstalledItem.end(); iter++) {
+ if (info->affected() == *iter) {
+ XXX << "ignore keep installed: " << info->affected() << endl;
+ is_error = false;
+ break;
+ }
+ }
+ }
+
+ if (is_error)
+ info->flagAsError ();
+
+ WAR << "******** Error: " << *info << endl;
+ addInfo (info, askUser);
+}
+
+
+//---------------------------------------------------------------------------
+// foreach info
+
+// We call a item mentioned by an error info an "error-item".
+// We call a item mentioned by an important info an "important-item".
+//
+// The rules:
+// (1) An info item that mentions an error-item is important.
+// (2) An info item is about an important-item is important.
+
+static void
+mark_important_info (const ResolverInfoList & il)
+{
+ // set of all items mentioned in the ResolverInfoList
+ PoolItemSet error_set;
+
+ bool did_something;
+ int pass_num = 1;
+
+ /* First of all, store all error-items in a set. */
+
+ for (ResolverInfoList::const_iterator info_iter = il.begin(); info_iter != il.end(); ++info_iter) {
+ ResolverInfo_Ptr info = (*info_iter);
+ if (info != NULL // list items might be NULL
+ && info->error ()) // only look at error infos
+ {
+ PoolItem_Ref item = info->affected(); // get item from ResolverInfoList
+ if (item) {
+ error_set.insert (item);
+ }
+
+ // the info might be a container, check it by doing a dynamic cast
+
+ PoolItemList containerItems;
+ ResolverInfoContainer_constPtr c = dynamic_pointer_cast<const ResolverInfoContainer>(*info_iter);
+ if (c != NULL) containerItems = c->items();
+
+ // containerItems is non-empty if info is really a ResolverInfoContainer
+
+ for (PoolItemList::iterator res_iter = containerItems.begin(); res_iter != containerItems.end(); res_iter++) {
+ PoolItem_Ref item = (*res_iter);
+ if (item) {
+ error_set.insert (item);
+ }
+ }
+ }
+ }
+
+ // now collect all important ones
+
+ PoolItemSet important_set;
+
+ do {
+ ++pass_num;
+ assert (pass_num < 10000);
+
+ did_something = false;
+
+ for (ResolverInfoList::const_iterator info_iter = il.begin(); info_iter != il.end(); ++info_iter) {
+
+ ResolverInfo_Ptr info = (*info_iter);
+
+ if (info != NULL // list items might be set to NULL
+ && !info->important ()) // only look at ones we didn't consider yet
+ {
+ bool should_be_important = false;
+
+ for (PoolItemSet::const_iterator res_iter = error_set.begin(); res_iter != error_set.end() && ! should_be_important; ++res_iter) {
+ ResolverInfoContainer_constPtr c = dynamic_pointer_cast<const ResolverInfoContainer>(*info_iter);
+ if (c != NULL // check if it really is a container
+ && c->mentions (*res_iter))
+ {
+ should_be_important = true;
+ }
+ }
+
+ for (PoolItemSet::const_iterator res_iter = important_set.begin(); res_iter != important_set.end() && ! should_be_important; ++res_iter) {
+ if (info->isAbout (*res_iter)) {
+ should_be_important = true;
+ break;
+ }
+ }
+
+ if (should_be_important) {
+ did_something = true;
+ info->flagAsImportant ();
+ PoolItemList items;
+ ResolverInfoContainer_constPtr c = dynamic_pointer_cast<const ResolverInfoContainer>(*info_iter); // check if it really is a container
+ if (c != NULL) items = c->items();
+ for (PoolItemList::iterator res_iter = items.begin(); res_iter != items.end(); res_iter++) {
+ important_set.insert (*res_iter);
+ }
+ }
+ }
+ }
+
+ } while (did_something);
+
+}
+
+void
+ResolverContext::foreachInfo (PoolItem_Ref item, int priority, ResolverInfoFn fn, void *data,
+ const bool merge, const bool findImportant) const
+{
+ ResolverInfoList info_list;
+
+ ResolverContext_constPtr context = this;
+ // Assemble a list of copies of all of the info objects
+ while (context != NULL) {
+
+ for (ResolverInfoList::const_iterator iter = context->_log.begin(); iter != context->_log.end(); ++iter) {
+
+ ResolverInfo_Ptr info = *iter;
+
+ if ((item == PoolItem_Ref()
+ || info->affected() == item)
+ && info->priority() >= priority)
+ {
+ info_list.push_back( info );
+
+ if (!merge
+ && !findImportant) {
+ // invoke our callback in order to avoid an additional run over the complete list
+ fn( info, data );
+ }
+ }
+ }
+ context = context->_parent;
+ }
+ if (merge) {
+ // Merge info objects
+ for (ResolverInfoList::iterator iter = info_list.begin(); iter != info_list.end(); ++iter) {
+
+ ResolverInfo_Ptr info1 = (*iter);
+ ResolverInfoList::iterator subiter = iter;
+
+ if (info1 != NULL) {
+ for (subiter++; subiter != info_list.end();) {
+ ResolverInfo_Ptr info2 = *subiter;
+ ResolverInfoList::iterator next = subiter; ++next;
+ if (info2 && info1->merge (info2)) {
+ info_list.erase( subiter );
+ }
+ subiter = next;
+ }
+ }
+ }
+ }
+
+ if (findImportant) mark_important_info( info_list );
+
+ if (merge
+ || findImportant) {
+ // Walk across the list of info objects and invoke our callback
+
+ for (ResolverInfoList::iterator iter = info_list.begin(); iter != info_list.end(); ++iter) {
+ if (*iter != NULL) {
+ fn( *iter, data );
+ }
+ }
+ }
+}
+
+
+
+static void
+get_info_foreach_cb (ResolverInfo_Ptr info, void *data)
+{
+ ResolverInfoList *il = (ResolverInfoList *)data;
+
+ if (info->important ()) {
+ il->push_back (info);
+ }
+}
+
+
+
+ResolverInfoList
+ResolverContext::getInfo (void) const
+{
+ ResolverInfoList il;
+ foreachInfo (PoolItem_Ref(), -1, get_info_foreach_cb, (void *)&il);
+ return il;
+}
+
+
+//---------------------------------------------------------------------------
+// spew
+
+static void
+spew_item_cb (PoolItem_Ref item, const ResStatus & status, void *unused)
+{
+ MIL << " " << item << " (" << status << ")" << endl;
+}
+
+
+void
+spew_item_pair_cb (PoolItem_Ref item1, const ResStatus & status1, PoolItem_Ref item2, const ResStatus & status2, void *unused)
+{
+ MIL << " " << item2 << " (" << status2 << ") => (" << item1 << " (" << status2 << ")" << endl;
+}
+
+
+void
+ResolverContext::spew (void)
+{
+ MIL << "TO INSTALL:" << endl;
+ foreachInstall (spew_item_cb, NULL);
+ MIL << endl;
+
+ MIL << "TO REMOVE:" << endl;
+ foreachUninstall (spew_item_cb, NULL);
+ MIL << endl;
+
+ MIL << "TO UPGRADE:" << endl;
+ foreachUpgrade (spew_item_pair_cb, NULL);
+ MIL << endl;
+}
+
+
+static void
+spew_info_cb (ResolverInfo_Ptr info, void *unused)
+{
+ if (info == NULL) return;
+
+ if (info->error ()) MIL << "[ERROR] " << *info << endl;
+ else if (info->important()) MIL << "[>>>>>] " << *info << endl;
+ else MIL << *info << endl;
+}
+
+
+void
+ResolverContext::spewInfo (void) const
+{
+ _XDEBUG( "ResolverContext[" << this << "]::spewInfo" );
+ foreachInfo (PoolItem_Ref(), -1, spew_info_cb, NULL, false, false);
+}
+
+//---------------------------------------------------------------------------
+// requirements
+
+struct RequirementMet
+{
+ ResolverContext_Ptr context;
+ bool flag;
+ bool unneeded;
+ bool *installed;
+ const PoolItem_Ref whoNeeds;
+ const Dep cap;
+ const bool installInfoFlag;
+
+ RequirementMet (ResolverContext_Ptr ctx, bool *inst, const PoolItem_Ref who, const Dep & capKind, const bool instFlag)
+ : context (ctx)
+ , flag (false)
+ , unneeded( false )
+ , installed( inst )
+ , whoNeeds( who )
+ , cap( capKind )
+ , installInfoFlag( instFlag )
+ { }
+
+
+ bool operator()( const CapAndItem & cai )
+ {
+ Capability match( cai.cap );
+ PoolItem provider( cai.item );
+ // capability is set for item set children. If it is set, query the
+ // exact version only.
+ bool my_unneeded = false;
+ if (context->isPresent( provider, &my_unneeded, installed ))
+ {
+ unneeded = my_unneeded;
+ flag = true;
+ ResolverInfoNeededBy_Ptr info;
+
+ if (cap == Dep::PREREQUIRES
+ || cap == Dep::REQUIRES
+ || cap == Dep::RECOMMENDS
+ || cap == Dep::SUGGESTS) {
+ info = new ResolverInfoNeededBy (provider);
+ info->addRelatedPoolItem (whoNeeds);
+ } else {
+ // FRESHENS, ENHANCES, SUPPLEMENTS
+ // are reverse dependencies
+ info = new ResolverInfoNeededBy (whoNeeds);
+ info->addRelatedPoolItem (provider);
+ if (installInfoFlag)
+ info->setInitialInstallation (true);
+ }
+ info->setCapability (match, cap);
+ context->addInfo (info);
+ }
+
+// ERR << "RequirementMet(" << provider << ", " << match << ") [capability " <<
+// capability << "] -> " << (flag ? "true" : "false") << endl;
+
+ if ( installed // Checking as long as we have found an installed item
+ && !*installed )
+ return true;
+
+ return ! flag;
+ }
+};
+
+
+bool
+ResolverContext::requirementIsMet (const Capability & capability,
+ const PoolItem_Ref who,
+ const Dep & capKind,
+ bool *unneeded, bool *installed,
+ const bool installInfoFlag)
+{
+ RequirementMet info (this, installed, who, capKind, installInfoFlag);
+
+ // world()->foreachProviding (capability, requirement_met_cb, (void *)&info);
+
+ Dep dep( Dep::PROVIDES );
+
+ // world->foreachProvidingResItem (capability, require_process_cb, &info);
+
+ invokeOnEach( pool().byCapabilityIndexBegin( capability.index(), dep ),
+ pool().byCapabilityIndexEnd( capability.index(), dep ),
+ resfilter::ByCapMatch( capability ),
+ functor::functorRef(info) );
+_XDEBUG( "ResolverContext::requirementIsMet(" << capability << ") " << (info.flag?"Y":"N") );
+ if (unneeded) *unneeded = info.unneeded;
+
+ return info.flag;
+}
+
+//---------------------------------------------------------------------------
+/**
+ *\return \c true if the requirement is already fulfilled.
+ *either by an installed item or the requirement is unneeded.
+ *The behaviour depends on the item kind (package,patch,..)
+ *which requires this capability.
+ */
+bool
+ResolverContext::requirementIsInstalledOrUnneeded (const Capability & capability,
+ const PoolItem_Ref who,
+ const Dep & capKind)
+{
+ ResObject::Kind kind = who->kind();
+ bool fulfilled = false;
+
+ if (kind != ResTraits<Package>::kind
+ || kind != ResTraits<Script>::kind
+ || kind != ResTraits<Message>::kind)
+ {
+ bool unneeded, installed;
+ fulfilled = requirementIsMet (capability, who, capKind, &unneeded, &installed);
+ if (!fulfilled
+ || (!unneeded
+ && !installed)) {
+ fulfilled = false;
+ _XDEBUG("Requirement is not unneeded and not installed.");
+ // "low" level resolvables will be installed if they are not unneeded
+ // Bug 192535/204913
+ }
+ }else {
+ fulfilled = requirementIsMet (capability, who, capKind);
+ }
+
+ return fulfilled;
+}
+
+
+
+//---------------------------------------------------------------------------
+
+struct RequirementPossible
+{
+ ResolverContext_Ptr context;
+ bool flag;
+
+ RequirementPossible( ResolverContext_Ptr ctx )
+ : context (ctx)
+ , flag (false)
+ { }
+
+ bool operator()( const CapAndItem & cai )
+ {
+ PoolItem provider( cai.item );
+ ResStatus status = context->getStatus( provider );
+ if (! (status.isToBeUninstalled () || status.isImpossible())
+ || status.isToBeUninstalledDueToUnlink())
+ {
+ flag = true;
+ }
+
+ // Checking, if it has already been selected for removing by the user
+ // Bug 155368; Testcase data.deptestomatic/yast-tests/bug155368-test.xml
+ if (flag
+ && !context->forceResolve()) {
+ PoolItem installedItem = Helper::findInstalledByNameAndKind (context->pool(), provider->name(), provider->kind() );
+ if (installedItem) {
+ ResStatus statusInstalled = context->getStatus (installedItem);
+ if (installedItem.status().isToBeUninstalled()
+ && installedItem.status().isByUser()){
+ XXX << provider << " would satify the requirement but it has been selected for removing by the user." << endl;
+ flag = false;
+ }
+ }
+ }
+
+ return ! flag;
+ }
+};
+
+
+bool
+ResolverContext::requirementIsPossible (const Capability & capability)
+{
+ RequirementPossible info( this );
+
+ // world()->foreachProviding (dep, requirement_possible_cb, (void *)&info);
+
+ Dep dep( Dep::PROVIDES );
+
+ invokeOnEach( pool().byCapabilityIndexBegin( capability.index(), dep ),
+ pool().byCapabilityIndexEnd( capability.index(), dep ),
+ resfilter::ByCapMatch( capability ),
+ functor::functorRef(info) );
+ _XDEBUG("requirementIsPossible( " << capability << ") = " << (info.flag ? "Y" : "N"));
+ return info.flag;
+}
+
+
+bool
+ResolverContext::itemIsPossible( PoolItem_Ref item, Capability & failed )
+{
+ CapSet requires = item->dep (Dep::REQUIRES);
+ for (CapSet::iterator iter = requires.begin(); iter != requires.end(); iter++) {
+ if (! requirementIsPossible (*iter)) {
+ failed = *iter;
+ return false;
+ }
+ }
+
+ return true;
+}
+
+//---------------------------------------------------------------------------
+
+typedef struct {
+ PoolItem_Ref other;
+ bool flag;
+ PoolItem_Ref foundItem;
+} DupNameCheckInfo;
+
+static void
+dup_name_check_cb (PoolItem_Ref item, const ResStatus & status, void *data)
+{
+ DupNameCheckInfo *info = (DupNameCheckInfo *)data;
+ if (! info->flag
+ && status.isToBeInstalled ()
+ && info->other->kind() == item->kind()
+ && info->other->name() == item->name()
+#if 0
+ && item->edition().compare(info->other->edition()) == 0
+ && item->arch() == info->other->arch()
+#endif
+ && item != info->other) // if it's exactly the same package, ignore it silently.
+ {
+ Package::constPtr p1 = asKind<Package>(item.resolvable());
+ Package::constPtr p2 = asKind<Package>(info->other.resolvable());
+ if (p1 && p2 && p1->installOnly() && p2->installOnly()) // both are parallel installable
+ return;
+
+ info->flag = true;
+ info->foundItem = item;
+ }
+}
+
+
+bool
+ResolverContext::isParallelInstall (PoolItem_Ref item) const
+{
+ if (item->kind() == ResTraits<Atom>::kind) {
+ return false; // Atoms are paralell installable (#170098)
+ }
+
+ for (PoolItemList::const_iterator iter = _ignoreInstalledItem.begin();
+ iter != _ignoreInstalledItem.end(); iter++) {
+ if (item == *iter) {
+ XXX << "ignore parallel install: " << item << endl;
+ return false;
+ }
+ }
+
+ DupNameCheckInfo info;
+
+ info.other = item;
+ info.flag = false;
+ foreachMarked (dup_name_check_cb, (void *)&info);
+ if (info.flag) {
+ XXX << "isParallelInstall!!(" << item << ", " << info.foundItem << ")" << endl;
+ }
+ return info.flag;
+}
+
+
+PoolItem_Ref
+ResolverContext::getParallelInstall (PoolItem_Ref item) const
+{
+ DupNameCheckInfo info;
+
+ info.other = item;
+ info.flag = false;
+ foreachMarked( dup_name_check_cb, (void *)&info );
+ return info.foundItem;
+}
+
+
+int
+ResolverContext::getRepoPriority (Repository repo) const
+{
+#warning fix repo priority
+ return 0;
+// if (repo.subscribed())
+// return repo.priority();
+// return repository.priorityUnsubscribed();
+}
+
+//---------------------------------------------------------------------------
+
+static int
+num_cmp (double a, double b)
+{
+ return (b < a) - (a < b);
+}
+
+static int
+rev_num_cmp (double a, double b)
+{
+ return (a < b) - (b < a);
+}
+
+static double
+churn_factor (ResolverContext_Ptr a)
+{
+ return a->upgradeCount() + (2.0 * a->installCount ()) + (4.0 * a->uninstallCount ());
+}
+
+void
+ResolverContext::collectCompareInfo (int & cmpVersion, // Version compare of ACCUMULATED items
+ int & cmpRepo, // compare of Repositories
+ ResolverContext_Ptr compareContext)
+{
+ Repository userRepo; // Repo Id of items which have been selected by the user for installation
+ // It is empty, if there are different repos
+ bool differentUserRepos = false;
+ Repository userRepoCompare; // Repo Id of items which have been selected by the user for installation
+ // It is empty, if there are different repos
+ bool differentUserCompareRepos = false;
+ RepositoryCounter thisMap; // Map of to be installed repositorys with an item counter
+ RepositoryCounter compareMap; // Map of to be installed repositorys with an item counter
+
+ PoolItemList installList = getMarked(1);
+ PoolItemList compareList = compareContext->getMarked(1);; // List of comparing items which has to be installed
+ PoolItemList::const_iterator itCompare = compareList.begin();
+ _XDEBUG ("Starting comparing two solutions--------");
+ for ( PoolItemList::const_iterator thisIt = installList.begin();
+ thisIt != installList.end(); thisIt++ )
+ {
+ // evaluate, if the user selected packages (items) has the same repository
+ ResStatus status = getStatus (*thisIt);
+ if (status.isByUser()
+ || thisIt->status().isByUser())
+ {
+ if (userRepo == Repository::noRepository
+ && !differentUserRepos)
+ {
+ userRepo = thisIt->resolvable()->repository();
+ }
+ else if (userRepo != thisIt->resolvable()->repository())
+ {
+ differentUserRepos = true; // there are other items of other repositorys which have been set by the user
+ }
+ }
+
+ // collecting relationship between channels and installed items
+ if (thisMap.find (thisIt->resolvable()->repository()) == thisMap.end()) {
+ thisMap[thisIt->resolvable()->repository()] = 1;
+ }
+ else {
+ thisMap[thisIt->resolvable()->repository()] += 1;
+ }
+ _XDEBUG ("Count of left " << thisIt->resolvable()->repository() << ": " << thisMap[thisIt->resolvable()->repository()] << " : " << *(thisIt->resolvable()));
+
+ // Comparing versions
+ while (itCompare != compareList.end() )
+ {
+ int cmp = compareByN ( thisIt->resolvable(), itCompare->resolvable());
+ if ( cmp == 0) {
+ // comparing the version of both items and "adding" the result
+ // to accumulated compare result.
+ // Testcase: freshen-tests/exercise-7f-test
+ // Testcase: freshen-tests/exercise-7-test
+ cmpVersion += thisIt->resolvable()->edition().compare( itCompare->resolvable()->edition());
+ _XDEBUG ("Version: " << *(thisIt->resolvable()) << "[" << thisIt->resolvable()->repository() << "]" << endl
+ << " <--> " << endl
+ << "Version: " << *(itCompare->resolvable()) << "[" << itCompare->resolvable()->repository() << "]"
+ << " --> cmpVersion : " << cmpVersion);
+
+ // evaluate if the user selected packages (items) has the same repository
+ ResObject::constPtr repositoryItem = itCompare->resolvable();
+ ResStatus compStatus = compareContext->getStatus(*itCompare);
+ if (compStatus.isByUser()
+ || itCompare->status().isByUser())
+ {
+ if (userRepoCompare == Repository::noRepository
+ && !differentUserCompareRepos)
+ userRepoCompare = repositoryItem->repository();
+ else if (userRepoCompare != repositoryItem->repository())
+ differentUserCompareRepos = true; // there are other items of other repositorys which have been set by the user
+ }
+ // collecting relationship between channels and installed items
+ if (compareMap.find (repositoryItem->repository()) == compareMap.end())
+ compareMap[repositoryItem->repository()] = 1;
+ else
+ compareMap[repositoryItem->repository()] += 1;
+ _XDEBUG ("Count of right " << repositoryItem->repository() << ": " << compareMap[repositoryItem->repository()] << " : " << *(itCompare->resolvable()));
+ itCompare++;
+ } else if (cmp > 0 )
+ itCompare++;
+ else break;
+ }
+ }
+
+ // comparing the rest of the other install list
+ while (itCompare != compareList.end() )
+ {
+ // evaluate if the user selected packages (items) has the same repository
+ ResObject::constPtr repositoryItem = itCompare->resolvable();
+ ResStatus compStatus = compareContext->getStatus(*itCompare);
+ if (compStatus.isByUser()
+ || itCompare->status().isByUser())
+ {
+ if (userRepoCompare == Repository::noRepository
+ && !differentUserCompareRepos)
+ userRepoCompare = repositoryItem->repository();
+ else if (userRepoCompare != repositoryItem->repository())
+ differentUserCompareRepos = true; // there are other items of other repositorys which have been set by the user
+ }
+
+ // collecting relationship between channels and installed items
+ if (compareMap.find (repositoryItem->repository()) == compareMap.end())
+ compareMap[repositoryItem->repository()] = 1;
+ else
+ compareMap[repositoryItem->repository()] += 1;
+ _XDEBUG ("Count of right" << repositoryItem->repository() << ": " << compareMap[repositoryItem->repository()] << " : "
+ << *(itCompare->resolvable()));
+ itCompare++;
+ }
+
+ // evaluate cmpRepo
+ cmpRepo = 0;
+ int cmpCompare = 0;
+
+ if (!differentUserRepos)
+ {
+ // user selected items which has to be installed has only one channel;
+ // cmpRepo = number of items of that channel
+ cmpRepo = thisMap[userRepo];
+ }
+
+ if (!differentUserCompareRepos) {
+ // user selected items which has to be installed has only one channel;
+ // cmpCompare = number of items of that channel
+ cmpCompare = compareMap[userRepoCompare];
+ }
+ _XDEBUG ("cmpRepo = " << cmpRepo << " ; cmpCompare = " << cmpCompare << " ; sizeof compareMap:" << compareMap.size());
+ if (compareMap.size() == 1
+ && thisMap.size() == 1
+ && userRepo == userRepoCompare) {
+ // We have only one repository from which all items will be instaled.
+ // So we will regards the complete amount of installed/updated packages
+ // Testcase basic-exercises/exercise-14-test
+ cmpRepo = 0;
+ } else {
+ // The solutions has different channels with user selected items.
+ // Take the solution with the greater account of items in this channel
+ // Testcase basic-exercises/exercise-solution-order-test
+ cmpRepo = cmpRepo - cmpCompare;
+ }
+
+ if (cmpRepo == 0)
+ {
+ // less amount of channels are better
+ cmpRepo = compareMap.size() - thisMap.size();
+ }
+ _XDEBUG ("End comparing two solutions-------- Version compare: " << cmpVersion << " Repo compare: "<< cmpRepo);
+}
+
+int
+ResolverContext::partialCompare (ResolverContext_Ptr context)
+{
+ int cmp = 0;
+ if (this != context) {
+
+ // collecting all data for comparing both resultion results
+ int cmpVersion = 0; // Version compare of ACCUMULATED items
+ int cmpRepo = 0; // compare of Repos
+
+ collectCompareInfo (cmpVersion, cmpRepo, context);
+ if (_preferHighestVersion) {
+ // comparing versions
+ cmp = cmpVersion;
+ XXX << "Comparing versions returned :" << cmp << endl;
+ if (cmp == 0) {
+ // High numbers are good... we don't want solutions containing low-priority channels.
+ // Repo priority which has been set externally
+ cmp = num_cmp (_min_priority, context->_min_priority);
+ XXX << "Comparing priority returned :" << cmp << endl;
+ if (cmp == 0) {
+ // High numbers are bad. Less churn is better.
+ cmp = rev_num_cmp (churn_factor (this), churn_factor (context));
+ XXX << "Comparing churn_factor returned :" << cmp << endl;
+ if (cmp == 0) {
+ // Comparing repositorys regarding the items which has to be installed
+ cmp = cmpRepo;
+ XXX << "Comparing repositorys returned :" << cmp << endl;
+ if (cmp == 0) {
+ // High numbers are bad. Bigger #s means more penalties.
+ cmp = rev_num_cmp (_other_penalties, context->_other_penalties);
+ XXX << "Comparing other penalties returned :" << cmp << endl;
+ }
+ }
+ }
+ }
+ } else {
+ // less transaction will be prefered
+ // High numbers are bad. Less churn is better.
+ cmp = rev_num_cmp (churn_factor (this), churn_factor (context));
+ XXX << "Comparing churn_factor returned :" << cmp << endl;
+ if (cmp == 0) {
+ // High numbers are good... we don't want solutions containing low-priority channels.
+ // Repo priority which has been set externally
+ cmp = num_cmp (_min_priority, context->_min_priority);
+ XXX << "Comparing priority returned :" << cmp << endl;
+ if (cmp == 0) {
+ cmp = cmpVersion;
+ XXX << "Comparing versions returned :" << cmp << endl;
+ if (cmp == 0) {
+ // Comparing repositorys regarding the items which has to be installed
+ cmp = cmpRepo;
+ XXX << "Comparing repositorys returned :" << cmp << endl;
+ if (cmp == 0) {
+ // High numbers are bad. Bigger #s means more penalties.
+ cmp = rev_num_cmp (_other_penalties, context->_other_penalties);
+ XXX << "Comparing other penalties returned :" << cmp << endl;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return cmp;
+}
+
+int
+ResolverContext::compare (ResolverContext_Ptr context)
+{
+ int cmp;
+
+ if (this == context)
+ return 0;
+
+ cmp = partialCompare (context);
+ if (cmp)
+ return cmp;
+
+ /* High numbers are bad. Smaller downloads are best. */
+ cmp = rev_num_cmp (_download_size, context->_download_size);
+ if (cmp)
+ return cmp;
+
+ /* High numbers are bad. Less disk space consumed is good. */
+ cmp = rev_num_cmp (_install_size, context->_install_size);
+ if (cmp)
+ return cmp;
+
+ return 0;
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverContext.h.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverContext.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverContext.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverContext.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,340 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverContext.h
+ *
+ *Keep a set of 'active' PoolItems, these are part of the current
+ *transaction. It thereby provides a to-be status for these items
+ *
+ *
+ *Copyright (C) 2000-2002 Ximian, Inc.
+ *Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ *This program is free software; you can redistribute it and/or
+ *modify it under the terms of the GNU General Public License,
+ *version 2, as published by the Free Software Foundation.
+ *
+ *This program is distributed in the hope that it will be useful, but
+ *WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *General Public License for more details.
+ *
+ *You should have received a copy of the GNU General Public License
+ *along with this program; if not, write to the Free Software
+ *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_RESOLVERCONTEXT_H
+#define ZYPP_SOLVER_DETAIL_RESOLVERCONTEXT_H
+
+#include "zypp/ResPool.h"
+#include "zypp/PoolItem.h"
+#include "zypp/Capability.h"
+#include "zypp/Repository.h"
+
+#include "zypp/solver/detail/Types.h"
+#include "zypp/solver/detail/ResolverInfo.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+typedef void (*ResolverContextFn) (ResolverContext_Ptr ctx, void *data);
+typedef void (*MarkedPoolItemFn) (PoolItem_Ref item, const ResStatus & status, void *data);
+typedef void (*MarkedPoolItemPairFn) (PoolItem_Ref item1, const ResStatus & status1, PoolItem_Ref item2, const ResStatus & status2, void *data);
+typedef std::multimap IgnoreMap;
+typedef std::map RepositoryCounter;
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : ResolverContext
+class ResolverContext : public base::ReferenceCounted, private base::NonCopyable {
+
+
+ private:
+
+ ResolverContext_Ptr _parent; // branches share a common parent
+ ResolverContext_Ptr _establish_context; // Context of the last Resolver-Establish call
+
+ typedef std::map Context;
+ Context _context; // the set of items touched in this transaction
+
+ ResPool _pool;
+
+ ResolverInfoList _log; // report log
+
+ unsigned long long _download_size;
+ unsigned long long _install_size;
+ int _total_priority;
+ int _min_priority;
+ int _max_priority;
+ int _other_penalties;
+
+ bool _verifying; // running 'verifySystem'
+ bool _establishing; // running 'establishSystem'
+ bool _invalid; // lead to invalid solution
+ bool _askUser; // lead to invalid solution too cause we have to ask the user
+
+ PoolItem_Ref _last_checked_item; // cache for {get,set}Status
+ ResStatus _last_checked_status;
+
+ PoolItemList _last_getMarked; // status of the last getMarked call
+ // it is sorted
+ int _last_getMarked_which; // which kind of getMarked
+
+ Arch _architecture;
+
+ // These conflict should be ignored of the concering item
+ IgnoreMap _ignoreConflicts;
+ // These requires should be ignored of the concering item
+ IgnoreMap _ignoreRequires;
+ // These obsoletes should be ignored of the concering item
+ IgnoreMap _ignoreObsoletes;
+ // Ignore the status "installed" of the item
+ PoolItemList _ignoreInstalledItem;
+ // Ignore the architecture of the item
+ PoolItemList _ignoreArchitectureItem;
+ // Ignore the vendor of the item
+ PoolItemList _ignoreVendorItem;
+
+ // Items which has been selected NOT by the solver
+ // This will be stored while a solver run in order to save time
+ // if this information is needed.
+ PoolItemList _userDeleteItems;
+ PoolItemList _userInstallItems;
+ PoolItemList _userLockUninstalledItems;
+
+ bool _forceResolve; // remove items which are conflicts with others or
+ // have unfulfilled requirements.
+ // This behaviour is favourited by ZMD
+ bool _upgradeMode; // Resolver has been called with doUpgrade
+
+ bool _preferHighestVersion; // Prefer the result with the newest version
+ //if there are more solver results.
+
+ // In order reducing solver time we are reducing the branches
+ // by skipping resolvables which have worse architecture,edition
+ // than a resolvable which provides the same cababilities.
+ // BUT if there is no valid solution we will regard the "other"
+ // resolvables in a second solver run too.
+ bool _tryAllPossibilities; // Try ALL alternatives
+ bool _skippedPossibilities;// Flag that there are other possibilities
+ // which we are currently ignore
+
+ public:
+ ResolverContext (const ResPool & pool, const Arch & arch, ResolverContext_Ptr parent = NULL);
+ virtual ~ResolverContext();
+
+ // ---------------------------------- I/O
+
+ friend std::ostream& operator<<(std::ostream&, const ResolverContext & context);
+
+ // ---------------------------------- accessors
+
+ unsigned long long downloadSize(void) const { return _download_size; }
+ unsigned long long installSize(void) const { return _install_size; }
+ int totalPriority (void) const { return _total_priority; }
+ int minPriority (void) const { return _min_priority; }
+ int maxPriority (void) const { return _max_priority; }
+ int otherPenalties (void) const { return _other_penalties; }
+
+ bool isValid (void) const { return !_invalid; }
+ bool askUser (void) const { return _askUser; }
+ bool isInvalid (void) const { return _invalid; }
+
+ bool verifying (void) const { return _verifying; }
+ void setVerifying (bool verifying) { _verifying = verifying; }
+
+ bool tryAllPossibilities (void) const { return _tryAllPossibilities; }
+ void setTryAllPossibilities (bool tryAllPossibilities) { _tryAllPossibilities = tryAllPossibilities; }
+
+ bool skippedPossibilities (void) const { return _skippedPossibilities; }
+ void setSkippedPossibilities (bool skippedPossibilities) { _skippedPossibilities = skippedPossibilities; }
+
+ bool establishing (void) const { return _establishing; }
+ void setEstablishing (bool establishing) { _establishing = establishing; }
+
+ inline ResPool pool() const { return _pool; }
+
+ inline Arch architecture() const { return _architecture; }
+
+ // ---------------------------------- ignore capabilities
+ void setIgnoreCababilities(const IgnoreMap ignoreConflicts,
+ const IgnoreMap ignoreRequires,
+ const IgnoreMap ignoreObsoletes,
+ const PoolItemList ignoreInstalledItem,
+ const PoolItemList ignoreArchitectureItem,
+ const PoolItemList ignoreVendorItem)
+ {_ignoreConflicts = ignoreConflicts;
+ _ignoreRequires = ignoreRequires;
+ _ignoreObsoletes = ignoreObsoletes;
+ _ignoreInstalledItem = ignoreInstalledItem;
+ _ignoreArchitectureItem = ignoreArchitectureItem;
+ _ignoreVendorItem = ignoreVendorItem;
+ }
+
+ const IgnoreMap getIgnoreConflicts() const { return _ignoreConflicts; }
+ const IgnoreMap getIgnoreRequires() const { return _ignoreRequires; }
+ const IgnoreMap getIgnoreObsoletes() const { return _ignoreObsoletes; }
+ const PoolItemList getIgnoreInstalledItem() const { return _ignoreInstalledItem; }
+ const PoolItemList getIgnoreArchitectureItem() const { return _ignoreArchitectureItem; }
+ const PoolItemList getIgnoreVendorItem() const { return _ignoreVendorItem; }
+
+ void setForceResolve (const bool force) { _forceResolve = force; }
+ const bool forceResolve() { return _forceResolve; }
+
+ void setEstablishContext (const ResolverContext_Ptr establish_context) { _establish_context = establish_context; }
+
+ void setPreferHighestVersion (const bool highestVersion) { _preferHighestVersion = highestVersion; }
+ const bool preferHighestVersion() { return _preferHighestVersion; }
+
+ void setUpgradeMode (const bool upgrade) { _upgradeMode = upgrade; }
+ const bool upgradeMode() { return _upgradeMode; }
+
+ void setUserDeleteItems ( const PoolItemList & deleteItems) { _userDeleteItems = deleteItems; }
+ void setUserInstallItems ( const PoolItemList& installItems) { _userInstallItems = installItems; }
+ void setUserLockUninstalledItems ( const PoolItemList& lockItems) { _userLockUninstalledItems = lockItems; }
+ PoolItemList userDeleteItems () { return _userDeleteItems; }
+ PoolItemList userInstallItems () { return _userInstallItems; }
+ PoolItemList userLockUninstalledItems () { return _userLockUninstalledItems; }
+
+ // ---------------------------------- methods
+
+ /**
+ *get the state of \c item
+ *This is NOT the status in the pool but the status according
+ * to the context. */
+ ResStatus getStatus (PoolItem_Ref item);
+
+ /** state change functions
+ * they do some checking before actually changing the state of the PoolItem. */
+
+ /**
+ *set the state of \c item to \c status
+ *If \c status is not the current state of \c item, make \c item
+ *part of the current transaction (the context) */
+ void setStatus (PoolItem_Ref item, const ResStatus & status);
+
+ /**
+ *set \c item to \a to-be-installed */
+ bool install (PoolItem_Ref item, bool is_soft, int other_penalty);
+
+ /**
+ *set \c item to \a satisfied */
+ bool satisfy (PoolItem_Ref item, int other_penalty);
+
+ /**
+ *set \c item to \a unneeded */
+ bool unneeded (PoolItem_Ref item, int other_penalty);
+
+ /**
+ *set \c item to \a incomplete */
+ bool incomplete (PoolItem_Ref item, int other_penalty);
+
+ /**
+ *upgrade \c from to \c to
+ *marks \c from as \a to-be-uninstalled and \c to as \a to-be-installed */
+ bool upgrade (PoolItem_Ref to, PoolItem_Ref from, bool is_soft, int other_penalty);
+
+ /**
+ *set \c item to \a to-be-uninstalled */
+ bool uninstall (PoolItem_Ref item, bool part_of_upgrade, bool due_to_obsolete, bool due_to_unlink, bool explicitly_requested);
+
+ // rough installed/uninstalled test for 'after transaction'
+
+ /**
+ *\return \c true if \c item is \a installed or \a to-be-installed */
+ bool isPresent (PoolItem_Ref item, bool *unneeded = NULL,
+ bool *installed = NULL);
+
+ /**
+ *\return \c true if \c item is \a uninstalled or \a to-be-uninstalled */
+ bool isAbsent (PoolItem_Ref item);
+
+ bool requirementIsMet (const Capability & cap,
+ const PoolItem_Ref who,
+ const Dep & capKind,
+ bool *unneeded = NULL,
+ bool *installed = NULL);
+ /**
+ *\return \c true if the requirement is already fulfilled.
+ *either by an installed item or the requirement is unneeded.
+ *The behaviour depends on the item kind (package,patch,..)
+ *which requires this capability.
+ */
+ bool requirementIsInstalledOrUnneeded (const Capability & capability,
+ const PoolItem_Ref who,
+ const Dep & capKind);
+ bool requirementIsPossible (const Capability & cap);
+ bool itemIsPossible (const PoolItem_Ref item);
+ bool isParallelInstall (const PoolItem_Ref item) const;
+ PoolItem_Ref getParallelInstall (const PoolItem_Ref item) const;
+
+ /** iterate over various states */
+
+ void foreachMarked (MarkedPoolItemFn fn, void *data) const;
+ PoolItemList getMarked (int which); // <0:uninstalls, 0:all; >0:installs
+
+ int foreachInstall (MarkedPoolItemFn fn, void *data) const;
+ PoolItemList getInstalls (void) const;
+ int installCount (void) const;
+
+ int foreachUninstall (MarkedPoolItemFn fn, void *data);
+ PoolItemList getUninstalls (void);
+ int uninstallCount (void);
+
+ int foreachUpgrade (MarkedPoolItemPairFn fn, void *data);
+ PoolItemList getUpgrades (void);
+ int upgradeCount (void);
+
+ int foreachSatisfy (MarkedPoolItemFn fn, void *data) const;
+ PoolItemList getSatisfies (void) const;
+ int satisfyCount (void) const;
+
+ int foreachIncomplete (MarkedPoolItemFn fn, void *data) const;
+ PoolItemList getIncompletes (void) const;
+ int incompleteCount (void) const;
+
+ int foreachImpossible (MarkedPoolItemFn fn, void *data);
+// PoolItemList getImpossibles (void);
+// int impossibleCount (void);
+
+ // add to the report log
+ void addInfo (ResolverInfo_Ptr info, bool askUser = false); // normal progress info
+ void addError (ResolverInfo_Ptr info, bool askUser = false);// error progress info
+
+ // iterate over report log
+ void foreachInfo (PoolItem_Ref item, int priority, ResolverInfoFn fn, void *data, const bool merge=true, const bool findImportant = true) const;
+ ResolverInfoList getInfo (void) const;
+
+ // Context compare to identify equal branches
+ void collectCompareInfo (int & cmpVersion, // Version compare of ACCUMULATED items
+ int & cmpSource, // compare of Sources
+ ResolverContext_Ptr compareContext);
+
+ int partialCompare (ResolverContext_Ptr context);
+ int compare (ResolverContext_Ptr context);
+
+ // debug
+ void spew (void);
+ void spewInfo (void) const;
+
+ int getRepoPriority (Repository source) const;
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOLVER_DETAIL_RESOLVERCONTEXT_H
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverInfo.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverInfo.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverInfo.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverInfo.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,273 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverInfo.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <map>
+#include <sstream>
+
+#include "zypp/solver/detail/ResolverInfo.h"
+#include "zypp/Repository.h"
+#include "zypp/Capability.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/base/Logger.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(ResolverInfo);
+
+//---------------------------------------------------------------------------
+
+#define RIT(x) RESOLVER_INFO_TYPE_ ## x, #x
+static struct {
+ ResolverInfoType type;
+ const char *typestr;
+ const char *str;
+} type_str_table[] = {
+ { RIT(NEEDED_BY), "needed_by" },
+ { RIT(CONFLICTS_WITH), "conflicts_with" },
+ { RIT(OBSOLETES), "obsoletes" },
+ { RIT(DEPENDS_ON), "depended_on" },
+ { RIT(CHILD_OF), "child_of" },
+ { RIT(MISSING_REQ), "missing_req" },
+
+ { RIT(INVALID_SOLUTION), "Marking this resolution attempt as invalid" },
+ { RIT(UNINSTALLABLE), "Marking p as uninstallable" },
+ { RIT(REJECT_INSTALL), "p is scheduled to be installed, but this is not possible because of dependency problems." },
+ { RIT(INSTALL_TO_BE_UNINSTALLED), "Can't install p since it is already marked as needing to be uninstalled" },
+ { RIT(INSTALL_UNNEEDED), "Can't install p since it is does not apply to this system." },
+ { RIT(INSTALL_PARALLEL), "Can't install p, since a resolvable of the same name is already marked as needing to be installed." },
+ { RIT(INCOMPLETES), "This would invalidate p" },
+ // from QueueItemEstablish
+ { RIT(ESTABLISHING), "Establishing p" },
+ // from QueueItemInstall
+ { RIT(INSTALLING), "Installing p" },
+ { RIT(UPDATING), "Updating p" },
+ { RIT(SKIPPING), "Skipping p, already installed" },
+ // from QueueItemRequire
+ { RIT(NO_OTHER_PROVIDER), "There are no alternative installed providers of c [for p]" },
+ { RIT(NO_PROVIDER), "There are no installable providers of c [for p]" },
+ { RIT(NO_UPGRADE), "Upgrade to q to avoid removing p is not possible." },
+ { RIT(UNINSTALL_PROVIDER), "p provides c but is scheduled to be uninstalled" },
+ { RIT(KEEP_PROVIDER), "p provides c but is scheduled to be kept" },
+ { RIT(PARALLEL_PROVIDER), "p provides c but another version is already installed" },
+ { RIT(NOT_INSTALLABLE_PROVIDER), "p provides c but is uninstallable" },
+ { RIT(LOCKED_PROVIDER), "p provides c but is locked" },
+ { RIT(OTHER_ARCH_PROVIDER), "p provides c but has other architecture" },
+ { RIT(OTHER_VENDOR_PROVIDER), "p provides c but has other vendor" },
+ { RIT(CANT_SATISFY), "Can't satisfy requirement c" },
+ // from QueueItemUninstall
+ { RIT(UNINSTALL_TO_BE_INSTALLED), "p is to-be-installed, so it won't be unlinked." },
+ { RIT(UNINSTALL_INSTALLED), "p is required by installed, so it won't be unlinked." },
+ { RIT(UNINSTALL_LOCKED), "cant uninstall, its locked" },
+ // from QueueItemConflict
+ { RIT(CONFLICT_CANT_INSTALL), "to-be-installed p conflicts with q due to c" },
+ { RIT(CONFLICT_UNINSTALLABLE), "uninstalled p is marked uninstallable it conflicts [with q] due to c" },
+ { RIT(INVALID), "invalid" },
+ { RIT(INVALID), NULL }
+};
+#undef RIT
+
+static const char *
+info_type_to_string (ResolverInfoType type)
+{
+ int i;
+
+ for (i = 0; type_str_table[i].str != NULL; ++i) {
+ if (type == type_str_table[i].type)
+ return type_str_table[i].typestr;
+ }
+
+ return "?ResolverInfoType?";
+}
+
+
+static const char *
+info_type_to_message (ResolverInfoType type)
+{
+ int i;
+
+ for (i = 0; type_str_table[i].str != NULL; ++i) {
+ if (type == type_str_table[i].type)
+ return type_str_table[i].str;
+ }
+
+ return "?ResolverInfoType?";
+}
+
+
+ResolverInfoType
+resolver_info_type_from_string (const char *str)
+{
+ int i;
+
+ if (str == NULL) return RESOLVER_INFO_TYPE_INVALID;
+
+ for (i = 0; type_str_table[i].str != NULL; ++i) {
+ if (strcasecmp (str, type_str_table[i].str) == 0)
+ return type_str_table[i].type;
+ }
+
+ return RESOLVER_INFO_TYPE_INVALID;
+}
+
+string
+ResolverInfo::toString (PoolItem_Ref item, bool shortVersion)
+{
+ ostringstream os;
+ if (!item) return "";
+
+ if (item->kind() != ResTraitszypp::Package::kind)
+ os << item->kind() << ':';
+ os << item->name();
+ if (!shortVersion) {
+ os << '-' << item->edition();
+ if (item->arch() != "") {
+ os << '.' << item->arch();
+ }
+ Repository s = item->repository();
+ if (s) {
+ string alias = s.info().alias();
+ if (!alias.empty()
+ && alias != "@system")
+ {
+ os << '[' << s.info().alias() << ']';
+ }
+ }
+ }
+ return os.str();
+}
+
+
+string
+ResolverInfo::toString (const Capability & capability)
+{
+ ostringstream os;
+ os << capability.asString();
+ return os.str();
+}
+
+string
+ResolverInfo::message( ) const
+{
+ return string(info_type_to_message(_type)) + " " + toString(_affected);
+}
+//---------------------------------------------------------------------------
+
+std::ostream &
+ResolverInfo::dumpOn( std::ostream & os ) const
+{
+ os << "ResolverInfo<";
+ os << info_type_to_string (_type);
+ os << "> ";
+
+ if (_affected) {
+ os << toString (_affected);
+ }
+
+ if (_error) os << " " << _(" Error!");
+ if (_important) os << " " << _(" Important!");
+
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+ResolverInfo::ResolverInfo (ResolverInfoType type, PoolItem_Ref item, int priority)
+ : _type (type)
+ , _affected (item)
+ , _priority (priority)
+ , _error (false)
+ , _important (false)
+{
+ _XDEBUG(*this);
+}
+
+
+ResolverInfo::~ResolverInfo()
+{
+}
+
+//---------------------------------------------------------------------------
+
+bool
+ResolverInfo::merge (ResolverInfo_Ptr to_be_merged)
+{
+ if (to_be_merged == NULL) return false;
+
+ if (_type != to_be_merged->_type
+ || _affected != to_be_merged->_affected
+ || _error != to_be_merged->_error) {
+ return false;
+ }
+
+ return true;
+}
+
+void
+ResolverInfo::copy (ResolverInfo_constPtr from)
+{
+ _error = from->_error;
+ _important = from->_important;
+}
+
+
+ResolverInfo_Ptr
+ResolverInfo::copy (void) const
+{
+ ResolverInfo_Ptr cpy = new ResolverInfo(_type, _affected, _priority);
+
+ cpy->copy (this);
+
+ return cpy;
+}
+
+
+//---------------------------------------------------------------------------
+
+bool
+ResolverInfo::isAbout (PoolItem_Ref item) const
+{
+ if (!_affected)
+ return false;
+
+ return _affected->name() == item->name();
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverInfo.h.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverInfo.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverInfo.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverInfo.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,153 @@
+#/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverInfo.h
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_RESOLVER_INFO_H
+#define ZYPP_SOLVER_DETAIL_RESOLVER_INFO_H
+
+#include "zypp/solver/detail/Types.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+typedef enum {
+ RESOLVER_INFO_TYPE_INVALID = 0,
+ RESOLVER_INFO_TYPE_NEEDED_BY,
+ RESOLVER_INFO_TYPE_CONFLICTS_WITH,
+ RESOLVER_INFO_TYPE_OBSOLETES,
+ RESOLVER_INFO_TYPE_DEPENDS_ON,
+ RESOLVER_INFO_TYPE_CHILD_OF,
+ RESOLVER_INFO_TYPE_MISSING_REQ,
+ // from ResolverContext
+ RESOLVER_INFO_TYPE_INVALID_SOLUTION, // Marking this resolution attempt as invalid.
+ RESOLVER_INFO_TYPE_UNINSTALLABLE, // Marking p as uninstallable
+ RESOLVER_INFO_TYPE_REJECT_INSTALL, // p is scheduled to be installed, but this is not possible because of dependency problems.
+ RESOLVER_INFO_TYPE_INSTALL_TO_BE_UNINSTALLED, // Can't install p since it is already marked as needing to be uninstalled
+ RESOLVER_INFO_TYPE_INSTALL_UNNEEDED, // Can't install p since it is does not apply to this system.
+ RESOLVER_INFO_TYPE_INSTALL_PARALLEL, // Can't install p, since a resolvable of the same name is already marked as needing to be installed.
+ RESOLVER_INFO_TYPE_INCOMPLETES, // This would invalidate p
+ // from QueueItemEstablish
+ RESOLVER_INFO_TYPE_ESTABLISHING, // Establishing p
+ // from QueueItemInstall
+ RESOLVER_INFO_TYPE_INSTALLING, // Installing p
+ RESOLVER_INFO_TYPE_UPDATING, // Updating p
+ RESOLVER_INFO_TYPE_SKIPPING, // Skipping p, already installed
+ // from QueueItemRequire
+ RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER, // There are no alternative installed providers of c [for p]
+ RESOLVER_INFO_TYPE_NO_PROVIDER, // There are no installable providers of c [for p]
+ RESOLVER_INFO_TYPE_NO_UPGRADE, // Upgrade to q to avoid removing p is not possible.
+ RESOLVER_INFO_TYPE_UNINSTALL_PROVIDER, // p provides c but is scheduled to be uninstalled
+ RESOLVER_INFO_TYPE_KEEP_PROVIDER, // p provides c but is scheduled to be kept
+ RESOLVER_INFO_TYPE_PARALLEL_PROVIDER, // p provides c but another version is already installed
+ RESOLVER_INFO_TYPE_NOT_INSTALLABLE_PROVIDER, // p provides c but is uninstallable
+ RESOLVER_INFO_TYPE_LOCKED_PROVIDER, // p provides c but is locked
+ RESOLVER_INFO_TYPE_OTHER_ARCH_PROVIDER, // p provides c but has other architecture
+ RESOLVER_INFO_TYPE_CANT_SATISFY, // Can't satisfy requirement c
+ // from QueueItemUninstall
+ RESOLVER_INFO_TYPE_UNINSTALL_TO_BE_INSTALLED, // p is to-be-installed, so it won't be unlinked.
+ RESOLVER_INFO_TYPE_UNINSTALL_INSTALLED, // p is required by installed, so it won't be unlinked.
+ RESOLVER_INFO_TYPE_UNINSTALL_LOCKED, // cant uninstall, its locked
+ // from QueueItemConflict
+ RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL, // to-be-installed p conflicts with q due to c
+ RESOLVER_INFO_TYPE_CONFLICT_UNINSTALLABLE // uninstalled p is marked uninstallable it conflicts [with q] due to c
+} ResolverInfoType;
+
+#define RESOLVER_INFO_PRIORITY_USER 500
+#define RESOLVER_INFO_PRIORITY_VERBOSE 100
+#define RESOLVER_INFO_PRIORITY_DEBUGGING 0
+
+typedef void (*ResolverInfoFn) (ResolverInfo_Ptr info, void *data);
+
+typedef std::list ResolverInfoList;
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : ResolverInfo
+
+class ResolverInfo : public base::ReferenceCounted, private base::NonCopyable {
+
+ private:
+
+ ResolverInfoType _type;
+
+ PoolItem_Ref _affected;
+
+ int _priority;
+
+ bool _error;
+ bool _important;
+
+ protected:
+
+ ResolverInfo (ResolverInfoType type, PoolItem_Ref affected, int priority);
+
+ public:
+
+ virtual ~ResolverInfo();
+
+ void copy (ResolverInfo_constPtr from);
+
+ // ---------------------------------- I/O
+
+ static std::string toString (PoolItem_Ref item, bool shortVersion=false);
+ static std::string toString (const Capability & capability);
+
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ friend std::ostream& operator<<(std::ostream & str, const ResolverInfo & obj)
+ { return obj.dumpOn (str); }
+
+ // ---------------------------------- accessors
+
+ ResolverInfoType type (void) const { return _type; }
+ PoolItem_Ref affected (void) const { return _affected; }
+ int priority (void) const { return _priority; }
+
+ int error (void) const { return _error; }
+ void flagAsError (void) { _error = true; }
+ int important (void) const { return _important || _error; }
+ void flagAsImportant (void) { _important = true; }
+
+ // ---------------------------------- methods
+
+ virtual std::string message (void) const;
+ bool merge (ResolverInfo_Ptr to_be_merged);
+ virtual ResolverInfo_Ptr copy (void) const;
+
+ bool isAbout (PoolItem_Ref item) const;
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOLVER_DETAIL_RESOLVER_INFO_H
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverInfoContainer.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverInfoContainer.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverInfoContainer.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverInfoContainer.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,209 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverInfoContainer.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <map>
+#include <sstream>
+
+#include "zypp/solver/detail/ResolverInfoContainer.h"
+#include "zypp/solver/detail/Helper.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(ResolverInfoContainer);
+
+//---------------------------------------------------------------------------
+
+
+std::ostream &
+ResolverInfoContainer::dumpOn( std::ostream & os ) const
+{
+ ResolverInfo::dumpOn (os);
+
+ os << "";
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+ResolverInfoContainer::ResolverInfoContainer (ResolverInfoType type, PoolItem_Ref item, int priority, PoolItem_Ref child)
+ : ResolverInfo (type, item, priority)
+{
+ if (child)
+ _item_list.push_back (child);
+}
+
+
+ResolverInfoContainer::~ResolverInfoContainer ()
+{
+}
+
+//---------------------------------------------------------------------------
+
+bool
+ResolverInfoContainer::merge (ResolverInfoContainer_Ptr to_be_merged)
+{
+ bool res;
+
+ res = ((ResolverInfo_Ptr)this)->merge ((ResolverInfo_Ptr)to_be_merged);
+ if (!res) return res;
+
+ typedef std::map SeenTable;
+ SeenTable seen_packages;
+
+ for (PoolItemList::const_iterator iter = _item_list.begin(); iter != _item_list.end(); iter++) {
+ seen_packages[*iter] = true;
+ }
+
+ PoolItemList rl = to_be_merged->items();
+ for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
+ SeenTable::const_iterator pos = seen_packages.find(*iter);
+ if (pos == seen_packages.end()) {
+ _item_list.push_front (*iter);
+ seen_packages[*iter] = true;
+ }
+ }
+
+ return true;
+}
+
+
+void
+ResolverInfoContainer::copy (ResolverInfoContainer_constPtr from)
+{
+ ((ResolverInfo_Ptr)this)->copy(from);
+
+ for (PoolItemList::const_iterator iter = from->_item_list.begin(); iter != from->_item_list.end(); iter++) {
+ _item_list.push_back (*iter);
+ }
+}
+
+
+ResolverInfo_Ptr
+ResolverInfoContainer::copy (void) const
+{
+ ResolverInfoContainer_Ptr cpy = new ResolverInfoContainer(type(), affected(), priority());
+
+ cpy->copy (this);
+
+ return cpy;
+}
+
+//---------------------------------------------------------------------------
+
+string
+ResolverInfoContainer::itemsToString (const bool names_only) const
+{
+ ostringstream res;
+
+ if (_item_list.empty())
+ return "";
+
+ if (names_only)
+ {
+ if (_item_list.size() > 1) res << " [";
+ for (PoolItemList::const_iterator iter = _item_list.begin();
+ iter != _item_list.end(); ++iter)
+ {
+ if (iter != _item_list.begin())
+ res << ", ";
+ res << (*iter)->name();
+ }
+ if (_item_list.size() > 1) res << "]";
+ }
+ else
+ {
+ if (_item_list.size() == 1) {
+ res << ResolverInfo::toString (*_item_list.begin());
+ } else {
+ // one line for each entry
+ for (PoolItemList::const_iterator iter = _item_list.begin();
+ iter != _item_list.end(); iter++)
+ {
+ res << "\n- ";
+ res << ResolverInfo::toString (*iter);
+ }
+ }
+ }
+
+ return res.str();
+}
+
+
+bool
+ResolverInfoContainer::mentions (PoolItem_Ref item) const
+{
+ if (isAbout(item))
+ return true;
+
+ // Search item_list for any mention of the item.
+
+ for (PoolItemList::const_iterator iter = _item_list.begin(); iter != _item_list.end(); iter++) {
+ if ((*iter)->name() == item->name()) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+void
+ResolverInfoContainer::addRelatedPoolItem (PoolItem_Ref item)
+{
+ if (item && !mentions(item)) {
+ _item_list.push_front (item);
+ }
+}
+
+
+void
+ResolverInfoContainer::addRelatedPoolItemList (const PoolItemList & items)
+{
+ for (PoolItemList::const_iterator iter = items.begin(); iter != items.end(); iter++) {
+ _item_list.push_front (*iter);
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverInfoMisc.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverInfoMisc.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverInfoMisc.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverInfoMisc.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,676 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverInfoMisc.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <map>
+#include <sstream>
+
+#include "zypp/solver/detail/ResolverInfo.h"
+#include "zypp/solver/detail/ResolverInfoMisc.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/Gettext.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(ResolverInfoMisc);
+
+//---------------------------------------------------------------------------
+
+
+std::ostream &
+ResolverInfoMisc::dumpOn( std::ostream & os ) const
+{
+ ResolverInfo::dumpOn (os); // this already shows the affected item
+
+ os << ">>" << message() << "<<";
+ os << itemsToString(true);
+ if (!_action.empty()) {
+ os << _(", Action: ") << _action << endl;
+ }
+ os << _(", Trigger: ");
+ switch (_trigger) {
+ case ResolverInfoMisc::NONE: os << "none"; break;
+ case ResolverInfoMisc::OBSOLETE: os << "obsoletes"; break;
+ case ResolverInfoMisc::REQUIRE: os << "requires"; break;
+ case ResolverInfoMisc::CONFLICT: os << "conflicts"; break;
+ }
+ os << endl;
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+ResolverInfoMisc::ResolverInfoMisc (ResolverInfoType detailedtype, PoolItem_Ref affected, int priority, const Capability & capability)
+ : ResolverInfoContainer (detailedtype, affected, priority)
+ , _capability (capability)
+ , _trigger (NONE)
+{
+}
+
+
+ResolverInfoMisc::~ResolverInfoMisc ()
+{
+}
+
+//---------------------------------------------------------------------------
+
+static string
+translateResTraits (const Resolvable::Kind & kind)
+{
+ if (kind == ResTraits<Package>::kind) {
+ // Translator: Notation for (RPM) package
+ return _( "package" );
+ }
+ else if (kind == ResTraits<Selection>::kind) {
+ // Translator: Notation for SuSE package selection (set of packages)
+ return _( "selection" );
+ }
+ else if (kind == ResTraits<Pattern>::kind) {
+ // Translator: Notation for SuSE installation pattern (set of packages, describing use of system)
+ return _( "pattern" );
+ }
+ else if (kind == ResTraits<Product>::kind) {
+ // Translator: Notation for product
+ return _( "product" );
+ }
+ else if (kind == ResTraits<Patch>::kind) {
+ // Translator: Notation for patch
+ return _( "patch" );
+ }
+ else if (kind == ResTraits<Script>::kind) {
+ // Translator: Notation for script (part of a patch)
+ return _( "script" );
+ }
+ else if (kind == ResTraits<Message>::kind) {
+ // Translator: Notation for message (part of a patch)
+ return _( "message" );
+ }
+ else if (kind == ResTraits<Atom>::kind) {
+ // Translator: Notation for atom (part of a patch)
+ return _( "atom" );
+ }
+ else if (kind == ResTraits<SystemResObject>::kind) {
+ // Translator: Notation for computer system
+ return _( "system" );
+ }
+
+ // Translator: Generic term for an item with dependencies, please leave untranslated for now
+ return _("Resolvable");
+}
+
+
+std::string
+ResolverInfoMisc::message (void) const
+{
+ string msg;
+
+ string affected_str = ResolverInfo::toString(affected());
+
+ switch (type()) {
+
+ //===================
+ // from ResolverContext
+
+ case RESOLVER_INFO_TYPE_INVALID_SOLUTION: {
+ // TranslatorExplanation: Additional information to dependency solver result, no solution could be found
+ msg = _("Marking this resolution attempt as invalid.");
+ }
+ break;
+
+ case RESOLVER_INFO_TYPE_UNINSTALLABLE: {
+ // Translator: %s = name of packages,patch,...
+ // TranslatorExplanation: Additional information to dependency solver result.
+ msg = str::form (_("Marking resolvable %s as uninstallable"),
+ affected_str.c_str());
+ }
+ break;
+
+ case RESOLVER_INFO_TYPE_REJECT_INSTALL: {
+ // Translator: %s = name of packages,patch,...
+ // TranslatorExplanation: Additional information to dependency solver result.
+ msg = str::form (_("%s is scheduled to be installed, but this is impossible due to dependency problems."),
+ affected_str.c_str());
+ }
+ break;
+
+ case RESOLVER_INFO_TYPE_INSTALL_TO_BE_UNINSTALLED: {
+ // Translator: %s = name of package,patch,...
+ // TranslatorExplanation: Additional information to dependency solver result.
+ msg = str::form (_("Can't install %s since it is already marked as needed to be uninstalled"),
+ affected_str.c_str());
+ }
+ break;
+
+ case RESOLVER_INFO_TYPE_INSTALL_UNNEEDED: {
+ // Translator: %s = name of patch
+ // TranslatorExplanation: A patch which is not needed (does not apply) cant be installed
+ // TranslatorExplanation: Patches contain updates (bug fixes) to packages. Such fixes
+ // TranslatorExplanation: do only apply if the package to-be-fixed is actually installed.
+ // TranslatorExplanation: Here a patch was selected for installation but the to-be-fixed
+ // TranslatorExplanation: package is not installed.
+ msg = str::form (_("Can't install %s, because it does not apply to this system."),
+ affected_str.c_str());
+ }
+ break;
+
+ case RESOLVER_INFO_TYPE_INSTALL_PARALLEL: {
+ // affected() = item 1 which has to be installed
+ // _capability =
+ // other() = item 2 which has to be installed
+ // other_capability() =
+ // Translator: %s = name of package,patch,...
+ msg = str::form (_("Can't install %s, because %s is already marked as needed to for installation"),
+ affected_str.c_str(),
+ toString (other()).c_str());
+ }
+ break;
+
+ case RESOLVER_INFO_TYPE_INCOMPLETES: {
+ // Translator: %s = name of patch,product
+ msg = str::form (_("This would invalidate %s."),
+ affected_str.c_str());
+ }
+ break;
+
+ //===================
+ // from QueueItemEstablish
+
+ //-------------------
+ // Establishing p
+ case RESOLVER_INFO_TYPE_ESTABLISHING: {
+ // Translator: %s = name of patch, pattern, ...
+ // TranslatorExplanation: Establishing is the process of computing which patches are needed
+ // TranslatorExplanation: This is just a progress indicator
+ // TranslatorExplanation: It is also used for other types of resolvables in order to verify
+ // TranslatorExplanation: the completeness of their dependencies
+ msg = str::form (_("Establishing %s"), affected_str.c_str());
+ }
+ break;
+
+
+ //===================
+ // from QueueItemInstall
+
+ //-------------------
+ // Installing p
+
+ case RESOLVER_INFO_TYPE_INSTALLING: {
+ // affected() = resolvable to be installed
+ // _capability =
+ // other() =
+ // other_capability() =
+
+ // Translator: %s = name of package,patch,...
+ // TranslatorExample: Installing foo
+ // TranslatorExplanation: Just a progress indicator that something is scheduled for installation
+ // Translator: %s = packagename
+ msg = str::form (_("Installing %s"),
+ affected_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // Updating q to p
+
+ case RESOLVER_INFO_TYPE_UPDATING: {
+ // affected() = updated resolvable
+ // _capability =
+ // other() = currently installed, being updated resolvable
+ // other_capability() =
+
+ // Translator: 1.%s and 2.%s = name of package
+ // TranslatorExample: Updating foo-1.1 to foo-1.2
+ // TranslatorExplanation: Just a progress indicator that something is scheduled for upgrade
+ msg = str::form (_("Updating %s to %s"),
+ ResolverInfo::toString (other()).c_str(),
+ affected_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // skipping p, already installed
+
+ case RESOLVER_INFO_TYPE_SKIPPING: {
+ // affected() =
+ // _capability =
+ // other() =
+ // other_capability() =
+
+ // Translator: %s = name of package,patch,...
+ // TranslatorExample: Skipping foo: already installed
+ // TranslatorExplanation: An installation request for foo is skipped since foo is already installed
+ msg = str::form (_("Skipping %s: already installed"), affected_str.c_str());
+ }
+ break;
+
+ //===================
+ // from QueueItemRequire
+
+ //-------------------
+ // There are no alternative installed providers of c [for p]
+
+ case RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER: {
+ // affected() = is set
+ // _capability = is set
+ // other() =
+ // other_capability() =
+
+ // Translator: 1.%s = dependency
+ // TranslatorExample: There are no alternative installed providers of foo
+ // TranslatorExplanation: A resolvable is to be uninstalled. It provides 'foo' which is needed by others
+ // TranslatorExplanation: We just found out that 'foo' is not provided by anything else (an alternative)
+ // TranslatorExplanation: removal of this resolvable would therefore break dependency
+ // TranslatorExplanation: This is an error message explaining that the resolvable cannot be uninstalled
+ msg = str::form (_("There are no alternative providers of %s installed"), ResolverInfo::toString (_capability).c_str());
+ if (affected()) {
+ msg += " ";
+ // Translator: 1.%s = name of package,patch....
+ // TranslatorExample: for bar
+ // TranslatorExplanation: extension to previous message if we know what the resolvable is
+ msg += str::form (_("for %s"), affected_str.c_str());
+ }
+ }
+ break;
+
+ //-------------------
+ // There are no installable providers of c [for p]
+
+ case RESOLVER_INFO_TYPE_NO_PROVIDER: {
+ // affected() =
+ // _capability =
+ // other() =
+ // other_capability() =
+
+ // Translator: 1.%s = dependency
+ // TranslatorExample: There are no installable providers of foo
+ // TranslatorExplanation: A resolvable is to be installed which requires foo
+ // TranslatorExplanation: But there is nothing available to fulfill this requirement
+ // TranslatorExplanation: This is an error message explaining that the resolvable cannot be installed
+ msg = str::form (_("There are no installable providers of %s"), ResolverInfo::toString (_capability).c_str());
+ if (affected()) {
+ msg += " ";
+ // Translator: 1.%s = name of package,patch....
+ // TranslatorExample: for bar
+ // TranslatorExplanation: extension to previous message if we know what the resolvable is
+ msg += str::form (_("for %s"), affected_str.c_str());
+ }
+ }
+ break;
+
+ //-------------------
+ // Upgrade to q to avoid removing p is not possible
+
+ case RESOLVER_INFO_TYPE_NO_UPGRADE: {
+ // affected() = resolvable to be removed
+ // _capability =
+ // other() = failed upgrade to affected()
+ // other_capability() =
+
+ string other_str = ResolverInfo::toString(other());
+ // Translator: 1.%s = name of package,patch,..., 2.%s = name of package,patch,...
+ // TranslatorExample: Upgrade to foo to avoid removing bar is not possible
+ // TranslatorExplanation: bar requires something from foo
+ msg = str::form (_("Upgrading to %s to avoid removing %s is not possible."),
+ other_str.c_str(),
+ affected_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // p provides c but is scheduled to be uninstalled
+
+ case RESOLVER_INFO_TYPE_UNINSTALL_PROVIDER: {
+ // affected() = requirer of capability
+ // _capability = provided by other()
+ // other() = provider of capability
+ // other_capability() = - empty -
+
+ string other_str = ResolverInfo::toString(other());
+ string cap_str = ResolverInfo::toString (_capability);
+ // Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+ msg = str::form (_("%s provides %s, but is scheduled to be uninstalled."),
+ other_str.c_str(),
+ cap_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // p provides c but another version is already installed
+
+ case RESOLVER_INFO_TYPE_PARALLEL_PROVIDER: {
+ // affected() = requirer of capability
+ // _capability = provided by other()
+ // other() = provider of capability
+ // other_capability() = - empty -
+
+ string other_str = ResolverInfo::toString(other());
+ string cap_str = ResolverInfo::toString (_capability);
+ // Translator: 1.%s = name of package,patch,...; 2.%s = dependency; 3.%s type (package, patch, ...)
+ msg = str::form (_("%s provides %s, but another version of that %s is already installed."),
+ other_str.c_str(),
+ cap_str.c_str(),
+ translateResTraits(other()->kind()).c_str());
+ }
+ break;
+
+ //-------------------
+ // p provides c but is uninstallable
+
+ case RESOLVER_INFO_TYPE_NOT_INSTALLABLE_PROVIDER: {
+ // affected() = requirer of capability
+ // _capability = provided by other()
+ // other() = provider of capability
+ // other_capability() = - empty -
+
+ string other_str = ResolverInfo::toString(other());
+ string cap_str = ResolverInfo::toString (_capability);
+ // Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+ msg = str::form (_("%s provides %s, but it is uninstallable. Try installing it on its own for more details."),
+ other_str.c_str(),
+ cap_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // p provides c but is locked
+
+ case RESOLVER_INFO_TYPE_LOCKED_PROVIDER: {
+ // affected() = requirer of capability
+ // _capability = provided by other()
+ // other() = provider of capability
+ // other_capability() = - empty -
+
+ string other_str = ResolverInfo::toString(other());
+ string cap_str = ResolverInfo::toString (_capability);
+ // Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+ msg = str::form (_("%s provides %s, but it is locked."),
+ other_str.c_str(),
+ cap_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // p provides c but is set to kept
+
+ case RESOLVER_INFO_TYPE_KEEP_PROVIDER: {
+ // affected() = requirer of capability
+ // _capability = provided by other()
+ // other() = provider of capability
+ // other_capability() = - empty -
+
+ string other_str = ResolverInfo::toString(other());
+ string cap_str = ResolverInfo::toString (_capability);
+ // Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+ msg = str::form (_("%s provides %s, but is scheduled to be kept."),
+ other_str.c_str(),
+ cap_str.c_str());
+ }
+ break;
+
+
+ //-------------------
+ // p provides c but has other architecture
+
+ case RESOLVER_INFO_TYPE_OTHER_ARCH_PROVIDER: {
+ // affected() = requirer of capability
+ // _capability = provided by other()
+ // other() = provider of capability
+ // other_capability() = - empty -
+
+ string other_str = ResolverInfo::toString(other());
+ string cap_str = ResolverInfo::toString (_capability);
+ // Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
+ msg = str::form (_("%s provides %s, but has another architecture."),
+ other_str.c_str(),
+ cap_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // p provides c but has other vendor
+
+ case RESOLVER_INFO_TYPE_OTHER_VENDOR_PROVIDER: {
+ // affected() = requirer of capability
+ // _capability = provided by other()
+ // other() = provider of capability
+ // other_capability() = - empty -
+
+ string other_str = ResolverInfo::toString(other());
+ string cap_str = ResolverInfo::toString (_capability);
+ // Translator: 1.%s = name of package,patch,...; 2.%s = dependency; 3.%s = vendor ID
+ msg = str::form (_("%s provides %s, but has another vendor (%s)."),
+ other_str.c_str(),
+ cap_str.c_str(),
+ (other->vendor()).c_str());
+ }
+ break;
+
+ //-------------------
+ // Can't satisfy requirement
+
+ case RESOLVER_INFO_TYPE_CANT_SATISFY: {
+ // affected() = requirer of capability
+ // _capability = required capability
+ // other() = - empty -
+ // other_capability() = - empty -
+
+ string cap_str = ResolverInfo::toString (_capability);
+ // Translator: 1.%s = dependency. 2.%s name of package, patch, ...
+ msg = str::form (_("Can't satisfy requirement %s for %s"),
+ cap_str.c_str(),
+ affected_str.c_str());
+ }
+ break;
+
+ //===================
+ // from QueueItemUninstall
+
+ //-------------------
+ // p is to-be-installed, so it won't be unlinked.
+
+ case RESOLVER_INFO_TYPE_UNINSTALL_TO_BE_INSTALLED: {
+ // affected() = to-be-installed resolvable which was scheduled to be uninstalled
+ // _capability =
+ // other() =
+ // other_capability() =
+
+ // Translator: %s = name of package,patch,...
+ // TranslatorExample: foo is required by other to-be-installed resolvable, so it won't be unlinked.
+ // TranslatorExplanation: Cant uninstall foo since it is required by an to-be-installed resolvable
+ msg = str::form (_("%s is required by another resolvable selected for installation, so it won't be unlinked."),
+ affected_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // p is required by another installed resolvable q, so it won't be unlinked.
+
+ case RESOLVER_INFO_TYPE_UNINSTALL_INSTALLED: {
+ // affected() = provider of cap
+ // _capability =
+ // other() =
+ // other_capability() =
+
+ // Translator: %s = name of package,patch,...
+ // TranslatorExample: foo is required by other installed resolvable, so it won't be unlinked.
+ // TranslatorExplanation: Cant uninstall foo since it is required by an installed resolvable
+ msg = str::form (_("%s is required by another installed resolvable, so it won't be unlinked."),
+ affected_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // cant uninstall, its locked
+
+ case RESOLVER_INFO_TYPE_UNINSTALL_LOCKED: {
+ // affected() = to-be-uninstalled resolvable which is locked
+ // _capability =
+ // other() =
+ // other_capability() =
+
+ // Translator: %s = name of package,patch,...
+ // TranslatorExample: foo is locked and cannot be uninstalled.
+ // TranslatorExplanation: foo is to-be-uninstalled but it is locked
+ msg = str::form (_("%s is locked and cannot be uninstalled."),
+ affected_str.c_str());
+ }
+ break;
+
+ //===================
+ // from QueueItemConflict
+
+ //-------------------
+ // to-be-installed p conflicts with q due to c
+
+ case RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL: {
+ // affected() = provider of capability
+ // _capability = provided by provider
+ // other() = conflict issuer
+ // other_capability() = conflict capability
+
+ // Translator: 1.%s and 2.%s = Dependency; 4.%s = name of package,patch,...
+ // TranslatorExample: A conflict over foo (bar) requires the removal of to-be-installed xyz
+ msg = str::form(_("A conflict over %s (%s) requires the removal of %s which is scheduled for installation"),
+ ResolverInfo::toString (_capability).c_str(),
+ ResolverInfo::toString (_other_capability).c_str(),
+ affected_str.c_str());
+ }
+ break;
+
+ //-------------------
+ // uninstalled p is marked uninstallable it conflicts [with q] due to c
+
+ case RESOLVER_INFO_TYPE_CONFLICT_UNINSTALLABLE: {
+ // affected() = provider of capability
+ // _capability = provided by provider
+ // other() = conflict issuer
+ // other_capability() = conflict capability from issuer
+
+ // Translator: 1.%s = name of package,patch,...; 3.%s and 4.%s = Dependency;
+ // TranslatorExample: Marking xyz as uninstallable due to conflicts over foo (bar)
+ msg = str::form (_("Marking %s as uninstallable due to conflicts over %s"),
+ affected_str.c_str(),
+ ResolverInfo::toString (_capability).c_str());
+ PoolItem_Ref issuer = other();
+ if (issuer) {
+ msg += " ";
+ // Translator: %s = name of package,patch
+ // TranslatorExample: from abc
+ msg += str::form (_("from %s"),
+ ResolverInfo::toString (issuer).c_str());
+ }
+ }
+ break;
+
+ //===================
+ //-------------------
+
+ default:
+ WAR << "Not an InfoMisc type: " << type() << endl;
+// msg = "Unknown";
+ break;
+ }
+ return msg;
+}
+
+//---------------------------------------------------------------------------
+
+bool
+ResolverInfoMisc::merge (ResolverInfoContainer_Ptr info)
+{
+ bool res;
+ ResolverInfoMisc_Ptr to_be_merged = dynamic_pointer_cast<ResolverInfoMisc>(info);
+
+ res = ResolverInfo::merge(to_be_merged);
+ if (!res) return res;
+
+ if (type() == to_be_merged->type()
+ && affected() == to_be_merged->affected()
+ && _capability == to_be_merged->_capability) {
+
+ return true;
+ }
+
+ return false;
+}
+
+
+ResolverInfo_Ptr
+ResolverInfoMisc::copy (void) const
+{
+ ResolverInfoMisc_Ptr cpy = new ResolverInfoMisc(type(), affected(), priority(), _capability);
+
+ ((ResolverInfoContainer_Ptr)cpy)->copy (this);
+ cpy->_other_item = _other_item;
+ cpy->_other_capability = _other_capability;
+ cpy->_action = _action;
+ cpy->_trigger = _trigger;
+
+ return cpy;
+}
+
+//---------------------------------------------------------------------------
+
+void
+ResolverInfoMisc::addAction (const std::string & action_msg)
+{
+ _action = action_msg;
+}
+
+
+void
+ResolverInfoMisc::addTrigger (const TriggerReason & trigger)
+{
+ _trigger = trigger;
+}
+
+void
+ResolverInfoMisc::setOtherPoolItem (PoolItem_Ref other)
+{
+ _other_item = other;
+}
+
+void
+ResolverInfoMisc::setOtherCapability (const Capability & capability)
+{
+ _other_capability = capability;
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverInfoNeededBy.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverInfoNeededBy.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverInfoNeededBy.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverInfoNeededBy.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverInfoNeededBy.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <map>
+#include <sstream>
+
+#include "zypp/solver/detail/ResolverInfo.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/Dep.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(ResolverInfoNeededBy);
+
+//---------------------------------------------------------------------------
+
+
+std::ostream &
+ResolverInfoNeededBy::dumpOn( std::ostream & os ) const
+{
+ ResolverInfo::dumpOn (os);
+
+ ostringstream affected_str;
+ affected_str << ResolverInfo::toString (affected());
+
+ switch ( _capKind.inSwitch() )
+ {
+ case Dep::RECOMMENDS_e:
+ // Translator: all.%s = name of package,patch,...
+ os << str::form (_("%s is recommended by %s"),
+ affected_str.str().c_str(),
+ itemsToString(true).c_str());
+ break;
+ case Dep::SUGGESTS_e:
+ // Translator: all.%s = name of package,patch,...
+ os << str::form (_("%s is suggested by %s"),
+ affected_str.str().c_str(),
+ itemsToString(true).c_str());
+ break;
+ case Dep::FRESHENS_e:
+ // Translator: all.%s = name of package,patch,...
+ os << str::form (_("%s is freshened by %s"),
+ affected_str.str().c_str(),
+ itemsToString(true).c_str());
+ break;
+ case Dep::ENHANCES_e:
+ // Translator: all.%s = name of package,patch,...
+ os << str::form (_("%s is enhanced by %s"),
+ affected_str.str().c_str(),
+ itemsToString(true).c_str());
+ break;
+ case Dep::SUPPLEMENTS_e:
+ // Translator: all.%s = name of package,patch,...
+ os << str::form (_("%s is supplemented by %s"),
+ affected_str.str().c_str(),
+ itemsToString(true).c_str());
+ break;
+ default:
+ // Translator: all.%s = name of package,patch,...
+ os << str::form (_("%s is needed by %s"),
+ affected_str.str().c_str(),
+ itemsToString(true).c_str());
+ }
+ if (_cap != Capability::noCap)
+ os << " (" << _cap << ")";
+
+ return os;
+}
+
+string
+ResolverInfoNeededBy::message( ) const
+{
+ string affected_str = ResolverInfo::toString(affected());
+ string ret;
+
+ switch ( _capKind.inSwitch() )
+ {
+ case Dep::RECOMMENDS_e:
+ // Translator: all.%s = name of package,patch,...
+ ret = str::form (_("%s is recommended by %s"),
+ affected_str.c_str(),
+ itemsToString(false).c_str());
+ break;
+ case Dep::SUGGESTS_e:
+ // Translator: all.%s = name of package,patch,...
+ ret = str::form (_("%s is suggested by %s"),
+ affected_str.c_str(),
+ itemsToString(false).c_str());
+ break;
+ case Dep::FRESHENS_e:
+ // Translator: all.%s = name of package,patch,...
+ ret = str::form (_("%s is freshened by %s"),
+ affected_str.c_str(),
+ itemsToString(false).c_str());
+ break;
+ case Dep::ENHANCES_e:
+ // Translator: all.%s = name of package,patch,...
+ ret = str::form (_("%s is enhanced by %s"),
+ affected_str.c_str(),
+ itemsToString(false).c_str());
+ break;
+ case Dep::SUPPLEMENTS_e:
+ // Translator: all.%s = name of package,patch,...
+ ret = str::form (_("%s is supplemented by %s"),
+ affected_str.c_str(),
+ itemsToString(false).c_str());
+ break;
+ default:
+ // Translator: all.%s = name of package,patch,...
+ ret = str::form (_("%s is needed by %s"),
+ affected_str.c_str(),
+ itemsToString(false).c_str());
+ }
+ if (_cap != Capability::noCap)
+ ret += " (" + _cap.asString() + ")";
+
+ return ret;
+}
+
+//---------------------------------------------------------------------------
+
+ResolverInfoNeededBy::ResolverInfoNeededBy (PoolItem_Ref item)
+ : ResolverInfoContainer (RESOLVER_INFO_TYPE_NEEDED_BY, item, RESOLVER_INFO_PRIORITY_USER)
+ , _cap(Capability::noCap)
+ , _capKind(Dep::REQUIRES)
+ , _initialInstallation(false)
+{
+}
+
+
+ResolverInfoNeededBy::~ResolverInfoNeededBy ()
+{
+}
+
+//---------------------------------------------------------------------------
+
+ResolverInfo_Ptr
+ResolverInfoNeededBy::copy (void) const
+{
+ ResolverInfoNeededBy_Ptr cpy = new ResolverInfoNeededBy(affected());
+
+ ((ResolverInfoContainer_Ptr)cpy)->copy (this);
+
+ return cpy;
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverQueue.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverQueue.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverQueue.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverQueue.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,443 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* ResolverQueue.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <map>
+
+#include "zypp/base/String.h"
+#include "zypp/solver/detail/ResolverQueue.h"
+#include "zypp/solver/detail/QueueItemBranch.h"
+#include "zypp/solver/detail/QueueItemConflict.h"
+#include "zypp/solver/detail/QueueItemEstablish.h"
+#include "zypp/solver/detail/QueueItemGroup.h"
+#include "zypp/solver/detail/QueueItemInstall.h"
+#include "zypp/solver/detail/QueueItemRequire.h"
+#include "zypp/solver/detail/QueueItemUninstall.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/CapSet.h"
+#include "zypp/base/Logger.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(ResolverQueue);
+
+//---------------------------------------------------------------------------
+
+
+//---------------------------------------------------------------------------
+
+ostream&
+operator<<( ostream& os, const ResolverQueue & resolverqueue)
+{
+ os << str::form ("Context [%p]", (const void *)resolverqueue._context.get());
+ os << ", " << resolverqueue._qitems.size() << " Items:" << endl << "\t";
+ os << resolverqueue._qitems;
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+ResolverQueue::ResolverQueue (const ResPool & pool, const Arch & arch, ResolverContext_Ptr context)
+ : _context (context)
+{
+ _XDEBUG("ResolverQueue::ResolverQueue(pool,... )");
+ if (context == NULL)
+ _context = new ResolverContext(pool, arch);
+}
+
+
+ResolverQueue::~ResolverQueue()
+{
+}
+
+//---------------------------------------------------------------------------
+
+void
+ResolverQueue::addPoolItemToInstall (PoolItem_Ref poolItem)
+{
+ QueueItemInstall_Ptr qitem;
+
+ if (_context->isPresent (poolItem)
+ && poolItem.status().staysInstalled()) {
+ WAR << poolItem << " is already installed" << endl;
+ return;
+ }
+
+ qitem = new QueueItemInstall (_context->pool(), poolItem, poolItem.status().isSoftInstall());
+ poolItem.status().setSoftInstall(false);
+ qitem->setExplicitlyRequested ();
+
+ addItem (qitem);
+}
+
+
+void
+ResolverQueue::addPoolItemToEstablish (PoolItem_Ref poolItem)
+{
+ QueueItemEstablish_Ptr qitem;
+
+ qitem = new QueueItemEstablish (_context->pool(), poolItem);
+ qitem->setExplicitlyRequested ();
+
+ addItem (qitem);
+}
+
+
+void
+ResolverQueue::addPoolItemToRemove (PoolItem_Ref poolItem, bool remove_only_mode)
+{
+ QueueItemUninstall_Ptr qitem;
+
+ if (_context->isAbsent (poolItem))
+ return;
+
+ qitem = new QueueItemUninstall (_context->pool(), poolItem, QueueItemUninstall::EXPLICIT, poolItem.status().isSoftUninstall());
+ poolItem.status().setSoftUninstall(false);
+ if (remove_only_mode)
+ qitem->setRemoveOnly ();
+
+ qitem->setExplicitlyRequested ();
+
+ addItem (qitem);
+}
+
+
+void
+ResolverQueue::addPoolItemToVerify (PoolItem_Ref poolItem)
+{
+ if (poolItem.status().staysInstalled()
+ || poolItem.status().isToBeInstalled()) {
+ // regarding only items which will on the system after commit
+ CapSet requires = poolItem->dep (Dep::REQUIRES);
+ for (CapSet::const_iterator iter = requires.begin(); iter != requires.end(); ++iter) {
+ QueueItemRequire_Ptr qitem = new QueueItemRequire (_context->pool(), *iter);
+ qitem->addPoolItem (poolItem);
+ addItem (qitem);
+ }
+
+ CapSet conflicts = poolItem->dep (Dep::CONFLICTS);
+ for (CapSet::const_iterator iter = conflicts.begin(); iter != conflicts.end(); ++iter) {
+ QueueItemConflict_Ptr qitem = new QueueItemConflict (_context->pool(), *iter, poolItem);
+ addItem (qitem);
+ }
+ }
+}
+
+
+void
+ResolverQueue::addExtraCapability (const Capability & dep)
+{
+ QueueItemRequire_Ptr qitem = new QueueItemRequire (_context->pool(), dep);
+ addItem (qitem);
+}
+
+
+void
+ResolverQueue::addExtraConflict (const Capability & dep)
+{
+ QueueItemConflict_Ptr qitem = new QueueItemConflict (_context->pool(), dep, PoolItem_Ref());
+ addItem (qitem);
+}
+
+
+void
+ResolverQueue::addItem (QueueItem_Ptr qitem)
+{
+ _qitems.push_back(qitem);
+}
+
+
+bool
+ResolverQueue::isInvalid ()
+{
+ return _context->isInvalid() || _context->askUser();
+}
+
+
+bool
+ResolverQueue::containsOnlyBranches ()
+{
+ for (QueueItemList::const_iterator iter = _qitems.begin(); iter != _qitems.end(); ++iter) {
+ if (!(*iter)->isBranch())
+ return false;
+ }
+
+ return true;
+}
+
+//---------------------------------------------------------------------------
+
+static int
+qitemlist_max_priority (const QueueItemList & qil)
+{
+ int max_priority = -1;
+ for (QueueItemList::const_iterator iter = qil.begin(); iter != qil.end(); ++iter) {
+ if ((*iter)->priority() > max_priority) {
+ max_priority = (*iter)->priority();
+ }
+ }
+
+ return max_priority;
+}
+
+
+
+bool
+ResolverQueue::processOnce ()
+{
+ QueueItemList new_qitems;
+ int max_priority;
+ bool did_something = false;
+
+ _XDEBUG("ResolverQueue::processOnce()" << (int) _qitems.size() << " items");
+ while ( (max_priority = qitemlist_max_priority (_qitems)) >= 0
+ && _context->isValid () ) {
+
+ bool did_something_recently = false;
+
+ for (QueueItemList::iterator iter = _qitems.begin(); iter != _qitems.end() && _context->isValid();) {
+ QueueItem_Ptr qitem = *iter;
+ _XDEBUG( "=====> 1st pass: [" << *qitem << "]");
+ QueueItemList::iterator next = iter; ++next;
+ if (qitem && qitem->priority() == max_priority) {
+ if (qitem->process (_context, new_qitems)) {
+ did_something_recently = true;
+ }
+ _qitems.erase (iter);
+ }
+ iter = next;
+ }
+
+ if (did_something_recently) {
+ did_something = true;
+ }
+ }
+
+ _qitems = new_qitems;
+ _XDEBUG(_qitems.size() << " qitems after first pass");
+
+ /*
+ Now make a second pass over the queue, removing any super-branches.
+ (If one branch contains all of the possible items of another branch,
+ the larger branch can be dropped.
+ */
+
+ for (QueueItemList::iterator iter = _qitems.begin(); iter != _qitems.end();) {
+ QueueItemList::iterator next = iter; ++next;
+ QueueItem_Ptr qitem = *iter;
+
+ _XDEBUG( "=====> 2nd pass: [" << *qitem << "]");
+ if (qitem->isBranch()) {
+ _XDEBUG("ResolverQueue::processOnce() is branch");
+ QueueItemBranch_Ptr branch = dynamic_pointer_cast<QueueItemBranch>(qitem);
+ for (QueueItemList::const_iterator iter2 = _qitems.begin(); iter2 != _qitems.end(); ++iter2) {
+ _XDEBUG("Compare branch with [" << *(*iter2) << "]");
+ if (iter != iter2
+ && branch->contains (*iter2)) {
+ _XDEBUG("Contained within, removing");
+ _qitems.erase (iter);
+ break;
+ }
+ }
+ }
+ iter = next;
+ }
+ if (did_something) {
+ _XDEBUG( "did something: " << _qitems.size() << " qitems");
+ }
+ else {
+ _XDEBUG( "did nothing: " << _qitems.size() << " qitems");
+ }
+
+ return did_something;
+}
+
+
+void
+ResolverQueue::process ()
+{
+ _XDEBUG("----- Processing -----");
+ spew ();
+
+ while (_context->isValid ()
+ && ! isEmpty ()
+ && processOnce ()) {
+ /* all of the work is in the conditional! */
+ spew ();
+ }
+}
+
+
+//---------------------------------------------------------------------------
+
+ResolverQueue_Ptr
+ResolverQueue::copy_queue_except_for_branch (QueueItem_Ptr branch_qitem, QueueItem_Ptr subqitem) const
+{
+ ResolverContext_Ptr new_context;
+ ResolverQueue_Ptr new_queue;
+ _XDEBUG("copy_queue_except_for_branch");
+ new_context = new ResolverContext (_context->pool(), _context->architecture(), _context);
+
+ new_queue = new ResolverQueue (new_context->pool(), new_context->architecture(), new_context);
+
+ QueueItemList qil = _qitems;
+ for (QueueItemList::const_iterator iter = qil.begin(); iter != qil.end(); ++iter) {
+ QueueItem_Ptr qitem = *iter;
+ QueueItem_Ptr new_qitem;
+
+ if (qitem == branch_qitem) {
+ new_qitem = subqitem->copy ();
+
+ if (new_qitem->isInstall()) {
+ QueueItemInstall_Ptr install_qitem = dynamic_pointer_cast<QueueItemInstall>(new_qitem);
+
+ /* Penalties are negative priorities */
+#warning FIX priorities
+ int penalty = 0;
+ Repository repo = install_qitem->item()->repository();
+ //penalty = - src.priority();
+ install_qitem->setOtherPenalty (penalty);
+ }
+
+ } else {
+
+ new_qitem = qitem->copy ();
+
+ }
+
+ new_queue->addItem (new_qitem);
+ }
+
+ return new_queue;
+}
+
+
+void
+ResolverQueue::splitFirstBranch (ResolverQueueList & new_queues, ResolverQueueList & deferred_queues)
+{
+ QueueItemBranch_Ptr first_branch = NULL;
+ typedef std::map DeferTable;
+ DeferTable to_defer;
+
+ for (QueueItemList::const_iterator iter = _qitems.begin(); iter != _qitems.end() && first_branch == NULL; ++iter) {
+ QueueItem_Ptr qitem = *iter;
+ if (qitem->isBranch()) {
+ first_branch = dynamic_pointer_cast<QueueItemBranch>(qitem);
+ }
+ }
+
+ if (first_branch == NULL)
+ return;
+
+ QueueItemList possible_qitems = first_branch->possibleQItems();
+
+ /*
+ Check for deferrable qitems: if we have two install qitems where the to-be-installed
+ poolItems have the same name, then we will defer the lower-priority install if
+ one of the following is true:
+ (1) Both poolItems have the same version
+ (2) The lower-priority channel is a previous version.
+ */
+
+ for (QueueItemList::const_iterator iter = possible_qitems.begin(); iter != possible_qitems.end(); ++iter) {
+ QueueItemList::const_iterator iter2 = iter;
+ for (iter2++; iter2 != possible_qitems.end(); iter2++) {
+ QueueItem_Ptr qitem = *iter;
+ QueueItem_Ptr qitem2 = *iter2;
+
+ if (qitem->isInstall() && qitem2->isInstall()) {
+ PoolItem_Ref r = (dynamic_pointer_cast<QueueItemInstall>(qitem))->item();
+ PoolItem_Ref r2 = (dynamic_pointer_cast<QueueItemInstall>(qitem2))->item();
+ Repository repo1 = r->repository();
+ Repository repo2 = r2->repository();
+ int priority, priority2;
+
+ priority = _context->getRepoPriority( repo1 );
+ priority2 = _context->getRepoPriority( repo2 );
+
+ if (priority != priority2 && r->name() == r2->name()) {
+ if (r->edition().compare(r2->edition()) == 0
+ || (priority < priority2 && r->edition().compare(r2->edition()) < 0)
+ || (priority > priority2 && r->edition().compare(r2->edition()) > 0))
+ {
+ if (priority < priority2)
+ to_defer[qitem] = qitem;
+ else /* if (priority > priority2) */
+ to_defer[qitem2] = qitem2;
+ }
+ }
+ }
+ }
+ }
+
+ for (QueueItemList::const_iterator iter = possible_qitems.begin(); iter != possible_qitems.end(); ++iter) {
+ ResolverQueue_Ptr new_queue;
+ QueueItem_Ptr new_qitem = *iter;
+
+ new_queue = copy_queue_except_for_branch ((QueueItem_Ptr) first_branch, new_qitem);
+
+ DeferTable::const_iterator pos = to_defer.find (new_qitem);
+ if (pos != to_defer.end()) {
+ deferred_queues.push_back(new_queue);
+ } else {
+ new_queues.push_back(new_queue);
+ }
+ }
+
+}
+
+
+void
+ResolverQueue::spew ()
+{
+ _XDEBUG( "Resolver Queue: " << (_context->isInvalid() ? "INVALID" : "") );
+
+ if (_qitems.empty()) {
+
+ _XDEBUG( " (empty)" );
+
+ } else {
+ for (QueueItemList::const_iterator iter = _qitems.begin(); iter != _qitems.end(); ++iter) {
+ _XDEBUG( " " << *(*iter) );
+ }
+
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverUpgrade.cc new/libzypp-3.22.1/zypp/solver/detail/ResolverUpgrade.cc
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverUpgrade.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverUpgrade.cc 2007-09-07 14:53:31.000000000 +0200
@@ -42,7 +42,7 @@
#include "zypp/base/String.h"
#include "zypp/base/Gettext.h"
#include "zypp/base/Exception.h"
-
+#include "zypp/VendorAttr.h"
#include "zypp/base/Algorithm.h"
#include "zypp/ResPool.h"
#include "zypp/ResStatus.h"
@@ -213,7 +213,7 @@
bool operator()( const CapAndItem & cai )
{
PoolItem provider( cai.item );
- if ( provider->vendor() != forItem->vendor() )
+ if ( !VendorAttr::instance().equivalent(provider->vendor(), forItem->vendor()) )
{
MIL << "Discarding '" << provider << "' from vendor '"
<< provider->vendor() << "' different to uninstalled '"
@@ -226,13 +226,27 @@
FindMap::iterator it = providers.find( provider->name() );
if (it != providers.end()) { // provider with same name found
- int cmp = it->second->arch().compare( provider->arch() );
- if (cmp < 0) { // new provider has better arch
- it->second = provider;
- }
- else if (cmp == 0) { // new provider has equal arch
- if (it->second->edition().compare( provider->edition() ) < 0) {
- it->second = provider; // new provider has better edition
+ if (provider.status().isToBeInstalled()
+ || it->second.status().isToBeInstalled()) {
+
+ if (provider.status().isToBeInstalled()
+ && it->second.status().isToBeInstalled()) {
+ ERR << "only one should be set for installation: " << it->second << "; " << provider << endl;
+ } else {
+ if (provider.status().isToBeInstalled()) {
+ it->second = provider; // take thatone which is already set for installation
+ }
+ }
+ } else {
+ // not the same --> find better provider
+ int cmp = it->second->arch().compare( provider->arch() );
+ if (cmp < 0) { // new provider has better arch
+ it->second = provider;
+ }
+ else if (cmp == 0) { // new provider has equal arch
+ if (it->second->edition().compare( provider->edition() ) < 0) {
+ it->second = provider; // new provider has better edition
+ }
}
}
}
@@ -361,7 +375,7 @@
continue;
}
- if ( installed->vendor() != candidate->vendor() )
+ if ( !VendorAttr::instance().equivalent(installed->vendor(), candidate->vendor()) )
{
MIL << "Discarding '" << candidate << "' from vendor '"
<< candidate->vendor() << "' different to uninstalled '"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/ResolverUpgrade.cc.bak new/libzypp-3.22.1/zypp/solver/detail/ResolverUpgrade.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/ResolverUpgrade.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/ResolverUpgrade.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,751 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/* ResolverUpgrade.cc
+ *
+ * Implements the distribution upgrade algorithm.
+ *
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+/*
+ stolen from PMPackageManager_update.cc
+ original author Michael Andres
+ zypp port by Klaus Kaempf
+
+/-*/
+
+#include "zypp/CapSet.h"
+#include "zypp/capability/SplitCap.h"
+
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/base/Exception.h"
+#include "zypp/VendorAttr.h"
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResStatus.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+#include "zypp/Capability.h"
+#include "zypp/CapFactory.h"
+#include "zypp/VendorAttr.h"
+#include "zypp/Package.h"
+
+#include "zypp/capability/CapabilityImpl.h"
+#include "zypp/ZYppFactory.h"
+
+#include "zypp/solver/detail/Types.h"
+#include "zypp/solver/detail/Helper.h"
+#include "zypp/solver/detail/Resolver.h"
+
+#include "zypp/Target.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+using namespace zypp;
+using zypp::capability::SplitCap;
+
+
+/** Order on AvialableItemSet.
+ * \li best Arch
+ * \li best Edition
+ * \li ResObject::constPtr as fallback.
+*/
+struct AVOrder : public std::binary_function
+{
+ // NOTE: operator() provides LESS semantics to order the set.
+ // So LESS means 'prior in set'. We want 'better' archs and
+ // 'better' editions at the beginning of the set. So we return
+ // TRUE if (lhs > rhs)!
+ //
+ bool operator()( const PoolItem_Ref lhs, const PoolItem_Ref rhs ) const
+ {
+ int res = lhs->arch().compare( rhs->arch() );
+ if ( res )
+ return res > 0;
+ res = lhs->edition().compare( rhs->edition() );
+ if ( res )
+ return res > 0;
+
+ // no more criteria, still equal:
+ // use the ResObject::constPtr (the poiner value)
+ // (here it's arbitrary whether < or > )
+ return lhs.resolvable() < rhs.resolvable();
+ }
+};
+
+typedef std::set PoolItemOrderSet;
+
+
+
+// check if downgrade is allowed
+// (Invariant on entry: installed.edition >= candidate.edition)
+//
+// candidate must have allowed vendor (e.g. 'SuSE', 'Novell', ...) and candidates buildtime must be
+// newer.
+
+static bool
+downgrade_allowed( PoolItem_Ref installed, PoolItem_Ref candidate, bool silent_downgrades )
+{
+ if (installed.status().isLocked()) {
+ MIL << "Installed " << installed << " is locked, not upgrading" << endl;
+ return false;
+ }
+
+ Resolvable::constPtr ires = installed.resolvable();
+ Package::constPtr ipkg = asKind<Package>(ires);
+ Resolvable::constPtr cres = candidate.resolvable();
+ Package::constPtr cpkg = asKind<Package>(cres);
+
+ if (ipkg)
+ DBG << "Installed vendor '" << ipkg->vendor() << "'" << endl;
+ if (cpkg)
+ DBG << "Candidate vendor '" << cpkg->vendor() << "'" << endl;
+
+ if (cpkg
+ && VendorAttr::instance().isKnown( cpkg->vendor() ) )
+ {
+ if ( silent_downgrades )
+ return true;
+ if ( ipkg->buildtime() < cpkg->buildtime() ) { // installed has older buildtime
+ MIL << "allowed downgrade " << installed << " to " << candidate << endl;
+ return true; // see bug #152760
+ }
+ }
+ return false;
+}
+
+
+
+struct FindObsoletes
+{
+ bool obsoletes;
+
+ FindObsoletes ()
+ : obsoletes (false)
+ { }
+
+ bool operator()( const CapAndItem & cai )
+ {
+ obsoletes = true; // we have a match
+ return false; // stop looping here
+ }
+};
+
+
+// does the candidate obsolete the capability ?
+
+bool
+Resolver::doesObsoleteCapability (PoolItem_Ref candidate, const Capability & cap)
+{
+ _DEBUG("doesObsoleteCapability " << candidate << ", " << cap);
+
+ Dep dep (Dep::OBSOLETES);
+ FindObsoletes info;
+ invokeOnEach( _pool.byCapabilityIndexBegin( cap.index(), dep ),
+ _pool.byCapabilityIndexEnd( cap.index(), dep ),
+ resfilter::ByCapMatch( cap ),
+ functor::functorRef(info) );
+
+ _DEBUG((info.obsoletes ? "YES" : "NO"));
+ return info.obsoletes;
+}
+
+
+bool
+Resolver::doesObsoleteItem (PoolItem_Ref candidate, PoolItem_Ref installed)
+{
+ CapFactory factory;
+ Capability installedCap = factory.parse ( installed->kind(), installed->name(), Rel::EQ, installed->edition());
+
+ return doesObsoleteCapability (candidate, installedCap);
+}
+
+
+//-----------------------------------------------------------------------------
+
+
+// find best available providers for installed name
+
+typedef map FindMap;
+
+struct FindProviders
+{
+ FindMap providers; // the best providers which matched
+ PoolItem forItem;
+ bool otherVendorFound;
+ FindProviders (PoolItem item)
+ :forItem(item),
+ otherVendorFound(false)
+ { }
+
+ bool operator()( const CapAndItem & cai )
+ {
+ PoolItem provider( cai.item );
+ if ( !VendorAttr::instance().equivalent(provider->vendor(), forItem->vendor()) )
+ {
+ MIL << "Discarding '" << provider << "' from vendor '"
+ << provider->vendor() << "' different to uninstalled '"
+ << forItem->vendor() << "' vendor." << endl;
+ otherVendorFound = true;
+ } else if ( provider.status().isToBeUninstalled() ) {
+ MIL << " IGNORE relation match (package is tagged to delete): " << cai.cap << " ==> " << provider << endl;
+ }
+ else {
+ FindMap::iterator it = providers.find( provider->name() );
+
+ if (it != providers.end()) { // provider with same name found
+ int cmp = it->second->arch().compare( provider->arch() );
+ if (cmp < 0) { // new provider has better arch
+ it->second = provider;
+ }
+ else if (cmp == 0) { // new provider has equal arch
+ if (it->second->edition().compare( provider->edition() ) < 0) {
+ it->second = provider; // new provider has better edition
+ }
+ }
+ }
+ else {
+ providers[provider->name()] = provider;
+ }
+ }
+ return true;
+ }
+};
+
+
+//-----------------------------------------------------------------------------
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : Resolver::doUpgrade
+// METHOD TYPE : int
+//
+// DESCRIPTION : go through all installed (but not yet touched by user)
+// packages and look for update candidates
+// handle splitprovides and replaced and dropped
+//
+void
+Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
+{
+ typedef map CandidateMap;
+ typedef intrusive_ptr<const SplitCap> SplitCapPtr;
+ typedef map SplitMap;
+ typedef map TodoMap;
+
+ CandidateMap candidatemap;
+
+ SplitMap splitmap;
+ TodoMap applyingSplits;
+ TodoMap addSplitted;
+ TodoMap addProvided;
+ TodoMap addMultiProvided;
+
+ Target_Ptr target;
+ try {
+ target = getZYpp()->target();
+ }
+ catch( const Exception & excpt_r) {
+ ERR << "Huh, no target ?";
+ ZYPP_CAUGHT(excpt_r);
+ if (!_testing) return; // can't continue without target
+ MIL << "Running in test mode, continuing without target" << endl;
+ }
+ MIL << "target at " << target << endl;
+
+ MIL << "doUpgrade start... "
+ << "(delete_unmaintained:" << (opt_stats_r.delete_unmaintained?"yes":"no") << ")"
+ << "(silent_downgrades:" << (opt_stats_r.silent_downgrades?"yes":"no") << ")"
+ << "(keep_installed_patches:" << (opt_stats_r.keep_installed_patches?"yes":"no") << ")"
+ << endl;
+
+ _update_items.clear();
+ {
+ UpgradeOptions opts( opt_stats_r );
+ opt_stats_r = UpgradeStatistics();
+ (UpgradeOptions&)opt_stats_r = opts;
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ // Reset all auto states and build PoolItemOrderSet of available candidates
+ // (those that do not belong to PoolItems set to delete).
+ //
+ // On the fly remember splitprovides and afterwards check, which
+ // of them do apply.
+ ///////////////////////////////////////////////////////////////////
+ PoolItemOrderSet available; // candidates available for install (no matter if selected for install or not)
+
+ for ( ResPool::const_iterator it = _pool.begin(); it != _pool.end(); ++it ) {
+ PoolItem_Ref item = *it;
+ PoolItem_Ref candidate;
+ PoolItem_Ref installed;
+
+ if ( item.status().isToBeUninstalled() ) {
+ MIL << "doUpgrade available: SKIP to delete " << item << endl;
+ ++opt_stats_r.pre_todel;
+ continue;
+ }
+ if ( item.status().isLocked() ) {
+ MIL << "doUpgrade available: SKIP locked " << item << endl;
+ if ( item.status().staysInstalled() ) {
+ ++opt_stats_r.pre_nocand;
+ }
+ continue;
+ }
+
+ if ( item.status().staysInstalled() ) { // installed item
+ installed = item;
+ CandidateMap::const_iterator cand_it = candidatemap.find( installed );
+ if (cand_it != candidatemap.end()) {
+ candidate = cand_it->second; // found candidate already
+ }
+ else {
+ candidate = Helper::findUpdateItem( _pool, installed ); // find 'best' upgrade candidate
+ }
+ if (!candidate) {
+ MIL << "doUpgrade available: SKIP no candidate for " << installed << endl;
+ ++opt_stats_r.pre_nocand;
+ continue;
+ }
+ MIL << "item " << item << " is installed, candidate is " << candidate << endl;
+ if (candidate.status().isSeen()) { // seen already
+ candidate.status().setSeen(true);
+ continue;
+ }
+ candidate.status().setSeen(true); // mark as seen
+ candidatemap[installed] = candidate;
+ }
+ else { // assume Uninstalled
+ if (item.status().isSeen()) { // seen already
+ item.status().setSeen(true);
+ continue;
+ }
+ candidate = item;
+ candidate.status().setSeen(true); // mark as seen
+ installed = Helper::findInstalledItem( _pool, candidate );
+ if (installed) { // check if we already have an installed
+ if ( installed.status().isLocked() ) {
+ MIL << "doUpgrade available: SKIP candidate " << candidate << ", locked " << installed << endl;
+ continue;
+ }
+
+ if ( !VendorAttr::instance().equivalent(installed->vendor(), candidate->vendor()) )
+ {
+ MIL << "Discarding '" << candidate << "' from vendor '"
+ << candidate->vendor() << "' different to uninstalled '"
+ << installed->vendor() << "' vendor." << endl;
+ continue;
+ }
+
+ MIL << "found installed " << installed << " for item " << candidate << endl;
+ CandidateMap::const_iterator cand_it = candidatemap.find( installed );
+ if (cand_it == candidatemap.end() // not in map yet
+ || (cand_it->second->arch().compare( candidate->arch() ) < 0) // or the new has better architecture
+ || ((cand_it->second->arch().compare( candidate->arch() ) == 0) // or the new has the same architecture
+ && (cand_it->second->edition().compare( candidate->edition() ) < 0)) // and a better edition (-> 157501)
+ )
+ {
+ candidatemap[installed] = candidate; // put it in !
+ }
+ }
+ }
+
+ ++opt_stats_r.pre_avcand;
+ available.insert( candidate );
+
+ MIL << "installed " << installed << ", candidate " << candidate << endl;
+
+ // remember any splitprovides to packages actually installed.
+ CapSet caps = candidate->dep (Dep::PROVIDES);
+ for (CapSet::iterator cit = caps.begin(); cit != caps.end(); ++cit ) {
+ if (isKindcapability::SplitCap( *cit ) ) {
+
+ capability::CapabilityImpl::SplitInfo splitinfo = capability::CapabilityImpl::getSplitInfo( *cit );
+
+ PoolItem splititem = Helper::findInstalledByNameAndKind (_pool, splitinfo.name, ResTraitszypp::Package::kind);
+ MIL << "has split cap " << splitinfo.name << ":" << splitinfo.path << ", splititem:" << splititem << endl;
+ if (splititem) {
+ if (target) {
+ ResObject::constPtr robj = target->whoOwnsFile( splitinfo.path );
+ if (robj)
+ MIL << "whoOwnsFile(): " << *robj << endl;
+ if (robj
+ && robj->name() == splitinfo.name)
+ {
+ MIL << "split matched !" << endl;
+ splitmap[splititem].insert( candidate );
+ }
+ }
+ }
+ }
+ }
+
+ } // iterate over the complete pool
+
+ // reset all seen (for next run)
+ for ( ResPool::const_iterator it = _pool.begin(); it != _pool.end(); ++it ) {
+ it->status().setSeen( false );
+ }
+
+ MIL << "doUpgrade: " << opt_stats_r.pre_todel << " packages tagged to delete" << endl;
+ MIL << "doUpgrade: " << opt_stats_r.pre_nocand << " packages without candidate (foreign, replaced or dropped)" << endl;
+ MIL << "doUpgrade: " << opt_stats_r.pre_avcand << " packages available for update" << endl;
+
+ MIL << "doUpgrade: going to check " << splitmap.size() << " probably splitted packages" << endl;
+ {
+ ///////////////////////////////////////////////////////////////////
+ // splitmap entries are gouped by PoolItems (we know this). So get the
+ // filelist as a new PoolItem occures, and use it for consecutive entries.
+ //
+ // On the fly build SplitPkgMap from splits that do apply (i.e. file is
+ // in PoolItems's filelist). The way splitmap was created, candidates added
+ // are not initially tagged to delete!
+ ///////////////////////////////////////////////////////////////////
+
+ PoolItem_Ref citem;
+
+ for ( SplitMap::iterator it = splitmap.begin(); it != splitmap.end(); ++it ) {
+ applyingSplits[it->first].insert( it->second.begin(), it->second.end() );
+ _DEBUG(" split count for " << it->first->name() << " now " << applyingSplits[it->first].size());
+ }
+ splitmap.clear();
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ // Now iterate installed packages, not selected to delete, and
+ // figure out what might be an appropriate replacement. Current
+ // packages state is changed immediately. Additional packages are
+ // reported but set to install later.
+ ///////////////////////////////////////////////////////////////////
+ MIL << "doUpgrade pass 1..." << endl;
+
+ for ( ResPool::const_iterator it = _pool.begin(); it != _pool.end(); ++it ) {
+
+ PoolItem_Ref installed(*it);
+ ResStatus status (installed.status());
+
+ if ( ! status.staysInstalled() ) {
+ continue;
+ }
+ ++opt_stats_r.chk_installed_total;
+
+ if ( status.transacts() ) { // we know its installed, if it transacts also
+ MIL << "SKIP to delete: " << installed.resolvable() << endl; // it'll be deleted
+ ++opt_stats_r.chk_already_todel;
+ continue;
+ }
+
+ if ( installed.status().isLocked() ) { // skip locked
+ MIL << "SKIP taboo: " << installed << endl;
+ ++opt_stats_r.chk_is_taboo;
+ _update_items.push_back( installed ); // remember in problem list
+ continue;
+ }
+
+ if ( isKind<Patch>(installed.resolvable())
+ || isKind<Atom>(installed.resolvable())
+ || isKind<Script>(installed.resolvable())
+ || isKind<Message>(installed.resolvable()) )
+ {
+ if ( ! opt_stats_r.keep_installed_patches )
+ {
+ if ( isKind<Patch>(installed.resolvable()) )
+ MIL << "OUTDATED Patch: " << installed << endl;
+ installed.status().setToBeUninstalled( ResStatus::APPL_HIGH );
+ }
+ else
+ {
+ if ( isKind<Patch>(installed.resolvable()) )
+ MIL << "SKIP Patch: " << installed << endl;
+ }
+ continue;
+ }
+
+ CandidateMap::iterator cand_it = candidatemap.find( installed );
+
+ bool probably_dropped = false;
+
+ MIL << "REPLACEMENT FOR " << installed << endl;
+ ///////////////////////////////////////////////////////////////////
+ // figure out replacement
+ ///////////////////////////////////////////////////////////////////
+ if ( cand_it != candidatemap.end() ) {
+
+ PoolItem_Ref candidate (cand_it->second);
+
+ if ( ! candidate.status().isToBeInstalled() ) {
+ int cmp = installed->edition().compare( candidate->edition() );
+ if ( cmp < 0 ) { // new edition
+ candidate.status().setToBeInstalled( ResStatus::APPL_HIGH );
+ MIL << " ==> INSTALL (new version): " << candidate << endl;
+ ++opt_stats_r.chk_to_update;
+ } else { // older or equal edition
+ // check whether to downgrade:
+
+ if (cmp == 0 // equal
+ || !downgrade_allowed( installed, candidate,
+ opt_stats_r.silent_downgrades) ) // or downgrade not allowed
+ {
+ MIL << " ==> (keep installed)" << candidate << endl; // keep installed
+ ++opt_stats_r.chk_to_keep_installed;
+ } else { // older and downgrade allowed
+ candidate.status().setToBeInstalled( ResStatus::APPL_HIGH );
+ MIL << " ==> INSTALL (SuSE version downgrade): " << candidate << endl;
+ ++opt_stats_r.chk_to_downgrade;
+ }
+ }
+ } else {
+ MIL << " ==> INSTALL (preselected): " << candidate << endl;
+ ++opt_stats_r.chk_already_toins;
+ }
+
+ }
+ else { // no candidate
+
+ // replaced or dropped (anyway there's no candidate for this!)
+ // If unique provides exists check if obsoleted (replaced).
+ // Remember new package for 2nd pass.
+
+ Dep dep (Dep::PROVIDES);
+ CapFactory factory;
+ Capability installedCap = factory.parse( installed->kind(), installed->name(), Rel::GE, installed->edition() );
+
+ FindProviders info(installed);
+
+ invokeOnEach( _pool.byCapabilityIndexBegin( installed->name(), dep ),
+ _pool.byCapabilityIndexEnd( installed->name(), dep ),
+ functor::chain( resfilter::ByCaIUninstalled(),
+ resfilter::ByCapMatch( installedCap ) ) ,
+ functor::functorRef(info) );
+
+ int num_providers = info.providers.size();
+
+ _DEBUG("lookup " << num_providers << " provides for installed " << installedCap);
+
+ // copy from map to set
+ PoolItemOrderSet providers;
+ for (FindMap::const_iterator mapit = info.providers.begin(); mapit != info.providers.end(); ++mapit) {
+ providers.insert( mapit->second );
+ }
+
+ switch ( info.providers.size() ) {
+ case 0:
+ if (info.otherVendorFound) {
+ MIL << " only resolvable with other vendor found ==> do nothing" << endl;
+ } else {
+ MIL << " ==> (dropped)" << endl;
+ // wait untill splits are processed. Might be a split obsoletes
+ // this one (i.e. package replaced but not provided by new one).
+ // otherwise it's finaly dropped.
+ probably_dropped = true;
+ }
+ break;
+ case 1:
+ addProvided[installed] = providers;
+ MIL << " ==> REPLACED by: " << (*providers.begin()) << endl;
+ // count stats later
+ // check obsoletes later
+ break;
+ default:
+ addMultiProvided[installed] = providers;
+ MIL << " ==> pass 2 (" << providers.size() << " times provided)" << endl;
+ // count stats later
+ // check obsoletes later
+ break;
+ }
+
+ } // no candidate
+
+ ///////////////////////////////////////////////////////////////////
+ // anyway check for packages split off
+ ///////////////////////////////////////////////////////////////////
+
+ TodoMap::iterator sit = applyingSplits.find( installed );
+ if ( sit != applyingSplits.end() ) {
+ PoolItemOrderSet & toadd( sit->second );
+ if ( !toadd.size() ) {
+ INT << "Empty SplitPkgMap entry for " << installed << endl;
+ } else {
+ for ( PoolItemOrderSet::iterator ait = toadd.begin(); ait != toadd.end(); ++ait ) {
+ PoolItem_Ref split_candidate = *ait;
+ MIL << " ==> ADD (splitted): " << split_candidate << endl;
+ if ( probably_dropped
+ && split_candidate.status().staysUninstalled()
+ && doesObsoleteItem (split_candidate, installed))
+ {
+ probably_dropped = false;
+ }
+ }
+ addSplitted[installed] = toadd;
+ }
+ // count stats later
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ // now handle dropped package
+ ///////////////////////////////////////////////////////////////////
+
+ if ( probably_dropped ) {
+ if ( opt_stats_r.delete_unmaintained ) {
+ installed.status().setToBeUninstalled( ResStatus::APPL_HIGH );
+ }
+ ++opt_stats_r.chk_dropped;
+ _update_items.push_back( installed );
+ }
+
+ } // pass 1 end
+
+ ///////////////////////////////////////////////////////////////////
+ // Now check the remembered packages and check non unique provided.
+ // Maybe one of them was somehow selected. Otherwise we have to guess
+ // one.
+ ///////////////////////////////////////////////////////////////////
+ MIL << "doUpgrade pass 2..." << endl;
+
+ // look at the ones with a single provide first
+
+ for ( TodoMap::iterator it = addProvided.begin(); it != addProvided.end(); ++it ) {
+
+ PoolItemOrderSet & tset( it->second ); // these are the providers (well, just one)
+
+ for ( PoolItemOrderSet::iterator sit = tset.begin(); sit != tset.end(); ++sit ) {
+ PoolItem_Ref provider (*sit);
+
+ if (provider.status().setToBeInstalled( ResStatus::APPL_HIGH )) {
+ ++opt_stats_r.chk_replaced;
+ }
+
+ // needs installed
+
+ if ( doesObsoleteItem (provider, it->first ) ) {
+ it->first.status().setToBeUninstalled( ResStatus::APPL_HIGH );
+ }
+ }
+
+ }
+
+ // look at the split providers
+
+ for ( TodoMap::iterator it = addSplitted.begin(); it != addSplitted.end(); ++it ) {
+
+ PoolItemOrderSet & tset( it->second );
+ PoolItem_Ref lastItem = PoolItem_Ref();
+
+ for ( PoolItemOrderSet::iterator sit = tset.begin(); sit != tset.end(); ++sit ) {
+ if (!lastItem
+ || compareByN ( lastItem.resolvable(), sit->resolvable()) != 0) // do not install packages with the same NVR and other architecture
+ {
+ PoolItem_Ref item( *sit );
+
+ // only install split if its actually a different edition
+
+ PoolItem_Ref already_installed = Helper::findInstalledItem( _pool, item );
+ if (!already_installed
+ || already_installed->edition().compare( item->edition() ) != 0 )
+ {
+ if (item.status().setToBeInstalled( ResStatus::APPL_HIGH )) {
+ ++opt_stats_r.chk_add_split;
+ }
+ }
+ }
+ lastItem = *sit;
+ }
+
+ }
+
+ // look at the ones with multiple providers
+
+ for ( TodoMap::iterator it = addMultiProvided.begin(); it != addMultiProvided.end(); ++it ) {
+ MIL << "GET ONE OUT OF " << it->second.size() << " for " << it->first << endl;
+
+ PoolItem_Ref guess;
+ PoolItemOrderSet & gset( it->second );
+
+ for ( PoolItemOrderSet::iterator git = gset.begin(); git != gset.end(); ++git ) {
+ PoolItem_Ref item (*git);
+
+ if (git == gset.begin()) // default to first of set; the set is ordered, first is the best
+ guess = item;
+
+ if ( item.status().isToBeInstalled()) {
+ MIL << " ==> (pass 2: meanwhile set to install): " << item << endl;
+ if ( ! doesObsoleteItem (item, it->first ) ) {
+ it->first.status().setToBeUninstalled( ResStatus::APPL_HIGH );
+ }
+ guess = PoolItem_Ref();
+ break;
+ } else {
+ // Be prepared to guess.
+ // Most common situation for guessing is something like:
+ // qt-devel
+ // qt-devel-experimental
+ // qt-devel-japanese
+ // That's why currently the shortest package name wins.
+ if ( !guess || guess->name().size() > item->name().size() ) {
+ guess = item;
+ }
+ }
+ }
+
+ if ( guess ) {
+ guess.status().setToBeInstalled( ResStatus::APPL_HIGH );
+ MIL << " ==> REPLACED by: (pass 2: guessed): " << guess << endl;
+ if ( ! doesObsoleteItem (guess, it->first ) ) {
+ it->first.status().setToBeUninstalled( ResStatus::APPL_HIGH );
+ }
+ ++opt_stats_r.chk_replaced_guessed;
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ // done
+ ///////////////////////////////////////////////////////////////////
+ MIL << opt_stats_r << endl;
+
+ // Setting Resolver to upgrade mode
+ _upgradeMode = true;
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Resolver_problems.cc new/libzypp-3.22.1/zypp/solver/detail/Resolver_problems.cc
--- old/libzypp-3.22.1/zypp/solver/detail/Resolver_problems.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/solver/detail/Resolver_problems.cc 2007-09-07 14:53:31.000000000 +0200
@@ -136,6 +136,16 @@
collector->problems.insert (make_pair( item, info));
} else {
collector->additionalInfo.insert (make_pair( item, info));
+
+ if (info->type()==RESOLVER_INFO_TYPE_NEEDED_BY) { // logging reverse needed by
+ ResolverInfoNeededBy_constPtr needed_by = dynamic_pointer_cast<const ResolverInfoNeededBy>(info);
+ PoolItemList itemList = needed_by->items();
+ for (PoolItemList::const_iterator iter = itemList.begin();
+ iter != itemList.end(); ++iter)
+ {
+ collector->additionalInfo.insert (make_pair( *iter, info));
+ }
+ }
}
// Collicting items which are providing requirements but they
@@ -699,8 +709,13 @@
break;
case RESOLVER_INFO_TYPE_NO_PROVIDER: { // There are no installable providers of c [for p]
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
- // TranslatorExplanation %s = name of package, patch, selection ...
- what = str::form (_("%s cannot be installed due to missing dependencies"), whoShort.c_str());
+ if (item.status().isInstalled()) {
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s has missing dependencies"), whoShort.c_str());
+ } else {
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s cannot be installed due to missing dependencies"), whoShort.c_str());
+ }
details = misc_info->message() + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -947,6 +962,8 @@
details += more_details;
}
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ // ignore requirement
+ problem->addSolution (new ProblemSolutionIgnoreRequires (problem, PoolItem_Ref(), misc_info->capability()));
problems.push_back (problem);
problem_created = true;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Resolver_problems.cc.bak new/libzypp-3.22.1/zypp/solver/detail/Resolver_problems.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/Resolver_problems.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/Resolver_problems.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,1005 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* Resolver_problems.cc
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <map>
+#include <sstream>
+
+#include "zypp/solver/detail/Resolver.h"
+#include "zypp/Resolver.h"
+#include "zypp/solver/detail/ResolverContext.h"
+#include "zypp/ResolverProblem.h"
+#include "zypp/solver/detail/ProblemSolutionIgnore.h"
+#include "zypp/solver/detail/ProblemSolutionInstall.h"
+#include "zypp/solver/detail/ProblemSolutionUninstall.h"
+#include "zypp/solver/detail/ProblemSolutionUnlock.h"
+#include "zypp/solver/detail/ProblemSolutionKeep.h"
+#include "zypp/solver/detail/ProblemSolutionAllBranches.h"
+#include "zypp/solver/detail/ProblemSolutionDoubleTimeout.h"
+
+#include "zypp/solver/detail/ResolverInfoChildOf.h"
+#include "zypp/solver/detail/ResolverInfoConflictsWith.h"
+#include "zypp/solver/detail/ResolverInfoContainer.h"
+#include "zypp/solver/detail/ResolverInfoDependsOn.h"
+#include "zypp/solver/detail/ResolverInfoMisc.h"
+#include "zypp/solver/detail/ResolverInfoMissingReq.h"
+#include "zypp/solver/detail/ResolverInfoNeededBy.h"
+#include "zypp/solver/detail/ResolverInfoObsoletes.h"
+
+#include "zypp/base/String.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/Gettext.h"
+
+#include "zypp/base/Algorithm.h"
+#include "zypp/ResPool.h"
+#include "zypp/ResFilters.h"
+#include "zypp/CapFilters.h"
+
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+
+typedef multimap ProblemMap;
+typedef multimap ItemCapabilityMap;
+typedef multimap ConflictMap;
+
+#define MAXPROBLEMS 20
+#define TAB " "
+
+// match template over ItemCapabilityMap
+template
+class cap_equals {
+ private:
+ V value;
+public:
+ cap_equals (const V& v)
+ : value(v) {
+ }
+ // comparison
+ bool operator() (pair elem) {
+ return value.matches (elem.second) == CapMatch::yes;
+ }
+};
+
+// match template over ConflictMap
+template
+class conflict_equals {
+ private:
+ V value;
+public:
+ conflict_equals (const V& v)
+ : value(v) {
+ }
+ // comparison
+ bool operator() (pair elem) {
+ return value = elem.second;
+ }
+};
+
+// set resolvables with errors
+
+typedef struct {
+ // Map of errors
+ ProblemMap problems;
+ // Map of additional information applied to an item
+ ProblemMap additionalInfo;
+ // A map of PoolItems which provides a capability but are set
+ // for uninstallation
+ ItemCapabilityMap provideAndDeleteMap;
+ // A map of PoolItems which provides a capability but are set
+ // to be kept
+ ItemCapabilityMap provideAndKeptMap;
+ // A map of PoolItems which provides a capability but are locked
+ ItemCapabilityMap provideAndLockMap;
+ // A map of PoolItems which provides a capability but have another architecture
+ ItemCapabilityMap provideAndOtherArchMap;
+ // A map of PoolItems which provides a capability but have another vendor
+ ItemCapabilityMap provideAndOtherVendorMap;
+ // A map of conflicting Items
+ ConflictMap conflictMap;
+} ResItemCollector;
+
+
+static void
+collector_cb (ResolverInfo_Ptr info, void *data)
+{
+ ResItemCollector *collector = (ResItemCollector *)data;
+ PoolItem_Ref item = info->affected();
+ if (info->error()) {
+ collector->problems.insert (make_pair( item, info));
+ } else {
+ collector->additionalInfo.insert (make_pair( item, info));
+ if (info->type()==RESOLVER_INFO_TYPE_NEEDED_BY) { // logging reverse needed by
+ ResolverInfoNeededBy_constPtr needed_by = dynamic_pointer_cast<const ResolverInfoNeededBy>(info);
+ for (PoolItemList::const_iterator iter = needed_by->items().begin();
+ iter != needed_by->items().end(); ++iter)
+ {
+ collector->additionalInfo.insert (make_pair( *iter, info));
+ }
+ }
+ }
+
+ // Collicting items which are providing requirements but they
+ // are set for uninstall
+ if (info->type() == RESOLVER_INFO_TYPE_UNINSTALL_PROVIDER) {
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // does entry already exists ?
+ ItemCapabilityMap::iterator pos = find_if (collector->provideAndDeleteMap.begin(),
+ collector->provideAndDeleteMap.end(),
+ cap_equals(misc_info->capability()));
+
+ if (pos == collector->provideAndDeleteMap.end()) {
+ _XDEBUG ("Inserting " << misc_info->capability() << "/" << misc_info->other()
+ << " into provideAndDelete map");
+ collector->provideAndDeleteMap.insert (make_pair( misc_info->other(), misc_info->capability()));
+ }
+ }
+ // Collicting items which are providing requirements but they
+ // are set to be kept
+ if (info->type() == RESOLVER_INFO_TYPE_KEEP_PROVIDER) {
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // does entry already exists ?
+ ItemCapabilityMap::iterator pos = find_if (collector->provideAndKeptMap.begin(),
+ collector->provideAndKeptMap.end(),
+ cap_equals(misc_info->capability()));
+
+ if (pos == collector->provideAndKeptMap.end()) {
+ _XDEBUG ("Inserting " << misc_info->capability() << "/" << misc_info->other()
+ << " into provideAndKeptMap map");
+ collector->provideAndKeptMap.insert (make_pair( misc_info->other(), misc_info->capability()));
+ }
+ }
+ // Collecting items which are providing requirements but they
+ // are locked
+ if (info->type() == RESOLVER_INFO_TYPE_LOCKED_PROVIDER) {
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // does entry already exists ?
+ ItemCapabilityMap::iterator pos = find_if (collector->provideAndLockMap.begin(),
+ collector->provideAndLockMap.end(),
+ cap_equals(misc_info->capability()));
+
+ if (pos == collector->provideAndLockMap.end()) {
+ _XDEBUG ("Inserting " << misc_info->capability() << "/" << misc_info->other()
+ << " into provideAndLockMap map");
+ collector->provideAndLockMap.insert (make_pair( misc_info->other(), misc_info->capability()));
+ }
+ }
+ // Collecting items which are providing requirements but they
+ // have another architecture
+ if (info->type() == RESOLVER_INFO_TYPE_OTHER_ARCH_PROVIDER) {
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // does entry already exists ?
+ ItemCapabilityMap::iterator pos = find_if (collector->provideAndOtherArchMap.begin(),
+ collector->provideAndOtherArchMap.end(),
+ cap_equals(misc_info->capability()));
+
+ if (pos == collector->provideAndOtherArchMap.end()) {
+ _XDEBUG ("Inserting " << misc_info->capability() << "/" << misc_info->other()
+ << " into provideAndOtherArchMap map");
+ collector->provideAndOtherArchMap.insert (make_pair( misc_info->other(), misc_info->capability()));
+ }
+ }
+ // Collecting items which are providing requirements but they
+ // have another vendor
+ if (info->type() == RESOLVER_INFO_TYPE_OTHER_VENDOR_PROVIDER) {
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // does entry already exists ?
+ ItemCapabilityMap::iterator pos = find_if (collector->provideAndOtherVendorMap.begin(),
+ collector->provideAndOtherVendorMap.end(),
+ cap_equals(misc_info->capability()));
+
+ if (pos == collector->provideAndOtherVendorMap.end()) {
+ _XDEBUG ("Inserting " << misc_info->capability() << "/" << misc_info->other()
+ << " into provideAndOtherVendorMap map");
+ collector->provideAndOtherVendorMap.insert (make_pair( misc_info->other(), misc_info->capability()));
+ }
+ }
+ // Collecting all conflicting Items
+ if (info->type() == RESOLVER_INFO_TYPE_CONFLICT_UNINSTALLABLE
+ || info->type() == RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL) {
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+
+ // does entry already exists ?
+ ConflictMap::iterator pos = find_if (collector->conflictMap.lower_bound(misc_info->other()),
+ collector->conflictMap.upper_bound(misc_info->other()),
+ conflict_equals(misc_info->affected()));
+ if (pos == collector->conflictMap.end()) {
+ _XDEBUG ("Inserting " << misc_info->affected() << "/" << misc_info->other()
+ << " into conflictMap map");
+ collector->conflictMap.insert (make_pair(misc_info->affected(), misc_info->other()));
+ collector->conflictMap.insert (make_pair(misc_info->other(), misc_info->affected())); // reverse
+ }
+ }
+
+}
+
+struct AllRequires
+{
+ PoolItemList requirers;
+
+ bool operator()( const CapAndItem & cai )
+ {
+ _XDEBUG (cai.item << " requires " << cai.cap);
+ requirers.push_back( cai.item );
+
+ return true;
+ }
+};
+
+std::string logAdditionalInfo ( const ProblemMap &additionalInfo, const PoolItem_Ref item)
+{
+ string infoStr = "";
+ for (ProblemMap::const_iterator iter = additionalInfo.find(item); iter != additionalInfo.end();) {
+ ResolverInfo_Ptr info = iter->second;
+ PoolItem_Ref iterItem = iter->first;
+
+ if (iter == additionalInfo.find(item)) {
+ string who = ResolverInfo::toString( item );
+ infoStr = "=== " + who + " ===\n";
+
+ ResStatus status = iterItem.status();
+ if (status.isToBeUninstalled()) {
+ if (status.isByUser())
+ // Translator: all.%s = name of package,patch,...
+ infoStr += TAB + str::form (_("%s will be deleted by the user.\n"),
+ who.c_str());
+ if (status.isByApplHigh()
+ || status.isByApplLow())
+ // Translator: all.%s = name of package,patch,...
+ infoStr += TAB + str::form (_("%s will be deleted by another application. (ApplLow/ApplHigh)\n"),
+ who.c_str());
+ }
+ if (status.isToBeInstalled()) {
+ if (status.isByUser())
+ // Translator: all.%s = name of package,patch,...
+ infoStr += TAB + str::form (_("%s will be installed by the user.\n"),
+ who.c_str());
+ if (status.isByApplHigh()
+ || status.isByApplLow())
+ // Translator: all.%s = name of package,patch,...
+ infoStr += TAB + str::form (_("%s will be installed by another application. (ApplLow/ApplHigh)\n"),
+ who.c_str());
+ }
+ }
+ if (iterItem == item) {
+ // filter out useless information
+ if (info->type() != RESOLVER_INFO_TYPE_INSTALLING
+ && info->type() != RESOLVER_INFO_TYPE_ESTABLISHING
+ && info->type() != RESOLVER_INFO_TYPE_UPDATING
+ && info->type() != RESOLVER_INFO_TYPE_SKIPPING
+ && info->type() != RESOLVER_INFO_TYPE_UNINSTALLABLE
+ && info->type() != RESOLVER_INFO_TYPE_CONFLICT_UNINSTALLABLE) {
+ infoStr += TAB +info->message();
+ infoStr += "\n";
+ }
+ iter++;
+ } else {
+ // exit
+ iter = additionalInfo.end();
+ }
+ }
+ return infoStr;
+}
+
+
+static void
+moreDetailsCb( ResolverInfo_Ptr info, void *data )
+{
+ if (info->important()
+ && info->priority() >= RESOLVER_INFO_PRIORITY_USER) {
+ std::liststd::string *details = (std::liststd::string *)data;
+ details->push_back( info->message() );
+ }
+
+}
+
+static string
+moreDetails( ResolverContext_Ptr context, PoolItem_Ref item )
+{
+ MIL << "moreDetails for " << item << endl;
+ std::liststd::string details;
+ context->foreachInfo( item, RESOLVER_INFO_PRIORITY_USER, moreDetailsCb, &details, true, true ); //, const bool merge=true, const bool findImportant = true) const;
+ string result;
+ std::liststd::string::iterator it;
+ for (it = details.begin(); it != details.end(); ++it)
+ {
+ result += " ";
+ result += *it;
+ result += "\n";
+ }
+
+ return result;
+}
+
+
+
+ResolverProblemList
+Resolver::problems (const bool ignoreValidSolution) const
+{
+ ResolverProblemList problems;
+
+ MIL << "Resolver::problems(" << (ignoreValidSolution ? "ignoreValidSolution": "") << ")" << endl;
+
+ if (_best_context && !ignoreValidSolution) {
+ MIL << "Valid solution found, no problems" << endl;
+ return problems;
+ }
+
+ // collect all resolvables with error
+ ResolverQueueList invalid = invalidQueues();
+ MIL << invalid.size() << " invalid queues" << endl;
+
+ if (invalid.empty()) {
+ WAR << "No solver problems, but there is also no valid solution." << endl;
+ if (!_best_context
+ && timeout() > 0) {
+ // This can be generated by a timout only
+ string what = str::form (_("No valid solution found within %d seconds"), timeout());
+ string details = _("The solver has reached a defined timout");
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ problem->addSolution (new ProblemSolutionDoubleTimeout (problem));
+ if (tryAllPossibilities())
+ problem->addSolution (new ProblemSolutionAllBranches (problem,false));
+ problems.push_back (problem);
+ }
+
+ return problems;
+ }
+
+ bool skippedPossibilities = false;
+
+ for (ResolverQueueList::iterator iter = invalid.begin();
+ iter != invalid.end(); iter++) {
+ // evaluate if there are other possibilities which have not been regarded
+ ResolverQueue_Ptr invalidQ = *iter;
+ if (invalidQ->context()->skippedPossibilities()) {
+ skippedPossibilities = true;
+ break;
+ }
+ }
+
+ if (!_tryAllPossibilities // a second run with ALL possibilities has not been tried
+ && skippedPossibilities) { // possible other solutions skipped
+ // give the user an additional solution for trying all branches
+ string what = _("No valid solution found with just resolvables of best architecture.");
+ string details = _("With this run only resolvables with the best architecture have been regarded.\n");
+ details = details + _("Regarding all possible resolvables takes time, but can come to a valid result.");
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ problem->addSolution (new ProblemSolutionAllBranches (problem));
+ problems.push_back (problem);
+ }
+
+ ResolverContext_Ptr context = invalid.front()->context();
+ ResItemCollector collector;
+ context->foreachInfo (PoolItem(), RESOLVER_INFO_PRIORITY_VERBOSE, collector_cb, &collector);
+
+ for (ProblemMap::const_iterator iter = collector.problems.begin(); iter != collector.problems.end(); ++iter) {
+ PoolItem_Ref item = iter->first;
+ ResolverInfo_Ptr info = iter->second;
+
+ bool problem_created = false;
+
+ MIL << "Problem: " << *info;
+ XXX << "; Evaluate solutions..." << endl;
+ string what;
+ string details;
+
+ if (item) {
+ string who = ResolverInfo::toString( item );
+ string whoShort = ResolverInfo::toString( item, true ); // short version
+ switch (info->type()) {
+ case RESOLVER_INFO_TYPE_INVALID: {
+ what = _("Invalid information");
+ }
+ break;
+ case RESOLVER_INFO_TYPE_NEEDED_BY: { // no solution; it is only a info
+ ResolverInfoNeededBy_constPtr needed_by = dynamic_pointer_cast<const ResolverInfoNeededBy>(info);
+ if (needed_by->items().size() >= 1)
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s is needed by other resolvables"), whoShort.c_str());
+ else
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s is needed by %s"), whoShort.c_str(), needed_by->itemsToString(true).c_str());
+ details = str::form (_("%s is needed by:\n%s"), who.c_str(), needed_by->itemsToString(false).c_str());
+ }
+ break;
+ case RESOLVER_INFO_TYPE_CONFLICTS_WITH: {
+ ResolverInfoConflictsWith_constPtr conflicts_with = dynamic_pointer_cast<const ResolverInfoConflictsWith>(info);
+ if (conflicts_with->items().size() >= 1)
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s conflicts with other resolvables"), whoShort.c_str() );
+ else
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s conflicts with %s"), whoShort.c_str(), conflicts_with->itemsToString(true).c_str());
+
+ details = str::form (_("%s conflicts with:\n%s"), who.c_str(), conflicts_with->itemsToString(false).c_str()) + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ PoolItemList item_list = conflicts_with->items();
+ for (PoolItemList::const_iterator it = item_list.begin(); it != item_list.end(); ++it) {
+ details += logAdditionalInfo(collector.additionalInfo, *it);
+ }
+
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ // Uninstall p
+ problem->addSolution (new ProblemSolutionUninstall (problem, item));
+ if (conflicts_with->items().size() == 1) {
+ // Uninstall q
+ problem->addSolution (new ProblemSolutionUninstall (problem, *(conflicts_with->items().begin())));
+ } else {
+ // Uninstall all other
+ PoolItemList conflict_items = conflicts_with->items();
+ problem->addSolution (new ProblemSolutionUninstall (problem, conflict_items));
+ }
+ // Remove conflict in the resolvable which has to be installed
+ problem->addSolution (new ProblemSolutionIgnoreConflicts (problem, item, conflicts_with->capability(),
+ conflicts_with->items()));
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ case RESOLVER_INFO_TYPE_OBSOLETES: { // no solution; it is only a info
+ ResolverInfoObsoletes_constPtr obsoletes = dynamic_pointer_cast<const ResolverInfoObsoletes>(info);
+ if (obsoletes->items().size() >= 1)
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s obsoletes other resolvables"), whoShort.c_str());
+ else
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s obsoletes %s"), whoShort.c_str(), obsoletes->itemsToString(true).c_str());
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ details = str::form (_("%s obsoletes:%s"), who.c_str(), obsoletes->itemsToString(false).c_str());
+ details += _("\nThese resolvables will be deleted from the system.");
+ details += "\n" + logAdditionalInfo(collector.additionalInfo, item);
+ }
+ break;
+ case RESOLVER_INFO_TYPE_DEPENDS_ON: { // no solution; it is only a info
+ ResolverInfoDependsOn_constPtr depends_on = dynamic_pointer_cast<const ResolverInfoDependsOn>(info);
+ if (depends_on->items().size() >= 1)
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s depends on other resolvables"), whoShort.c_str(),
+ depends_on->itemsToString(true).c_str());
+ else
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s depends on %s"), whoShort.c_str(),
+ depends_on->itemsToString(true).c_str());
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ details = str::form (_("%s depends on:%s"), who.c_str(), depends_on->itemsToString(false).c_str());
+ }
+ break;
+ case RESOLVER_INFO_TYPE_CHILD_OF: { // unused
+ ResolverInfoChildOf_constPtr child_of = dynamic_pointer_cast<const ResolverInfoChildOf>(info);
+ // TranslatorExplanation: currently it is unused.
+ what = _("Child of");
+ }
+ break;
+ case RESOLVER_INFO_TYPE_MISSING_REQ: { // no solution; it is only a info
+ ResolverInfoMissingReq_constPtr missing_req = dynamic_pointer_cast<const ResolverInfoMissingReq>(info);
+ // TranslatorExplanation %s = dependency
+ what = str::form (_("Cannot install %s"), whoShort.c_str());
+ // TranslatorExplanation %s = capability
+ details = str::form (_("None provides %s"), missing_req->capability().asString().c_str());
+ details += _("\nThere is no resource available which supports this requirement.");
+ }
+ break;
+
+ // from ResolverContext
+ case RESOLVER_INFO_TYPE_INVALID_SOLUTION: { // Marking this resolution attempt as invalid.
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+ details = _("Due to the problems described above/below, this resolution will not solve all dependencies");
+ // no solution available
+ }
+ break;
+ case RESOLVER_INFO_TYPE_UNINSTALLABLE: { // Marking p as uninstallable
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // Trying to find a concerning conflict
+
+ for (ConflictMap::const_iterator it = collector.conflictMap.begin();
+ it != collector.conflictMap.end(); ++it) {
+ if (it->first == item) {
+ what = str::form (_("Cannot install %s, because it is conflicting with %s"),
+ whoShort.c_str(),
+ it->second->name().c_str()) + "\n";
+ details = logAdditionalInfo(collector.additionalInfo, item);
+ details += logAdditionalInfo(collector.additionalInfo, it->second);
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ // Uninstall p
+ problem->addSolution (new ProblemSolutionUninstall (problem, item));
+ // Uninstall q
+ problem->addSolution (new ProblemSolutionUninstall (problem, it->second));
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ }
+ if (!problem_created) {
+ // default
+ what = misc_info->message();
+ // TranslatorExplanation %s = name of package,patch,...
+ details = str::form (_("%s is not installed and has been marked as uninstallable"), who.c_str()) + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ problem->addSolution (new ProblemSolutionInstall (problem, item)); // Install resolvable again
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ }
+ break;
+ case RESOLVER_INFO_TYPE_REJECT_INSTALL: { // p is scheduled to be installed, but this is not possible because of dependency problems.
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package,patch,...
+ what = str::form (_("Cannot install %s due to dependency problems"), whoShort.c_str());
+ details = misc_info->message() + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ // Uninstall it;
+ problem->addSolution (new ProblemSolutionUninstall (problem, item));
+ // currently no solution concerning "ignore" is available
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ case RESOLVER_INFO_TYPE_INSTALL_TO_BE_UNINSTALLED: { // Can't install p since it is already marked as needing to be uninstalled
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package,patch,...
+ what = misc_info->message() + "\n";
+ details = logAdditionalInfo(collector.additionalInfo, item);
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ problem->addSolution (new ProblemSolutionInstall (problem, item)); // Install resolvable again
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ case RESOLVER_INFO_TYPE_INSTALL_UNNEEDED: { // Can't install p since it is does not apply to this system.
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package,patch,...
+ what = misc_info->message();
+ // no solution; it is only a info
+ }
+ break;
+ case RESOLVER_INFO_TYPE_INSTALL_PARALLEL: { // Can't install p, since a resolvable of the same name is already marked as needing to be installed.
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package,patch,...
+ what = str::form (_("Cannot install %s"), whoShort.c_str());
+ details = misc_info->message() + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ details += logAdditionalInfo(collector.additionalInfo, misc_info->other());
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ // Uninstall the item
+ ResStatus status = item.status();
+ string description = "";
+ if (status.isInstalled())
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ description = str::form (_("delete %s"), ResolverInfo::toString (item).c_str());
+ else
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ description = str::form (_("do not install %s"), ResolverInfo::toString (item).c_str());
+ problem->addSolution (new ProblemSolutionUninstall (problem, item, description, ""));
+
+ // Uninstall the other
+ status = misc_info->other().status();
+ if (status.isInstalled())
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ description = str::form (_("delete %s"), ResolverInfo::toString (misc_info->other()).c_str());
+ else
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ description = str::form (_("do not install %s"), ResolverInfo::toString (misc_info->other()).c_str());
+ problem->addSolution (new ProblemSolutionUninstall (problem, misc_info->other(), description, ""));
+
+ // Ignore it
+ problem->addSolution (new ProblemSolutionIgnoreInstalled (problem, item, misc_info->other()));
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ case RESOLVER_INFO_TYPE_INCOMPLETES: { // This would invalidate p
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ details = str::form (_("%s has unfulfilled requirements"), who.c_str())+ "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ // Uninstall
+ problem->addSolution (new ProblemSolutionUninstall (problem, item));
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ // from QueueItemEstablish
+ case RESOLVER_INFO_TYPE_ESTABLISHING: { // Establishing p
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+ // no solution is needed cause it is only a progress indicator
+ }
+ break;
+ // from QueueItemInstall
+ case RESOLVER_INFO_TYPE_INSTALLING: { // Installing p
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+ // no solution is needed cause it is only a progress indicator
+ }
+ break;
+ case RESOLVER_INFO_TYPE_UPDATING: { // Updating p
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+ // no solution is needed cause it is only a progress indicator
+ }
+ break;
+ case RESOLVER_INFO_TYPE_SKIPPING: { // Skipping p, already installed
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+ // It is only an info and happens while upgrading
+ }
+ break;
+ // from QueueItemRequire
+ case RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER: { // There are no alternative installed providers of c [for p]
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s has missing dependencies"), whoShort.c_str());
+ details = misc_info->message() + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+
+ // Searching for another item which provides this requires BUT has been set to uninstall
+ for (ItemCapabilityMap::const_iterator it = collector.provideAndDeleteMap.begin();
+ it != collector.provideAndDeleteMap.end(); ++it) {
+ if (it->second.matches (misc_info->capability()) == CapMatch::yes) {
+ // Do not delete
+ problem->addSolution (new ProblemSolutionKeep (problem, it->first));
+ }
+ }
+
+ // Searching for another item which provides this requires BUT has been set to be kept
+ for (ItemCapabilityMap::const_iterator it = collector.provideAndKeptMap.begin();
+ it != collector.provideAndKeptMap.end(); ++it) {
+ if (it->second.matches (misc_info->capability()) == CapMatch::yes) {
+ // Do install
+ problem->addSolution (new ProblemSolutionInstall (problem, it->first));
+ }
+ }
+
+ // uninstall
+ problem->addSolution (new ProblemSolutionUninstall (problem, item));
+
+ // Unflag require ONLY for this item
+ problem->addSolution (new ProblemSolutionIgnoreRequires (problem, item, misc_info->capability()));
+
+ // Unflag ALL require
+ // Evaluating all require Items
+ AllRequires info;
+ Dep dep( Dep::REQUIRES );
+
+ invokeOnEach( _pool.byCapabilityIndexBegin( misc_info->capability().index(), dep ), // begin()
+ _pool.byCapabilityIndexEnd( misc_info->capability().index(), dep ), // end()
+ resfilter::ByCapMatch( misc_info->capability() ),
+ functor::functorRef(info) );
+ if (info.requirers.size() > 1)
+ problem->addSolution (new ProblemSolutionIgnoreRequires (problem, info.requirers, misc_info->capability()));
+
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ case RESOLVER_INFO_TYPE_NO_PROVIDER: { // There are no installable providers of c [for p]
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s cannot be installed due to missing dependencies"), whoShort.c_str());
+ details = misc_info->message() + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+
+ // Searching for another item which provides this requires BUT has been locked
+ for (ItemCapabilityMap::const_iterator it = collector.provideAndLockMap.begin();
+ it != collector.provideAndLockMap.end(); ++it) {
+ if (it->second.matches (misc_info->capability()) == CapMatch::yes) {
+ // unlock this item
+ problem->addSolution (new ProblemSolutionUnlock (problem, it->first));
+ // unlock ALL existing resolvables
+ problem->addSolution (new ProblemSolutionUnlock (problem, pool()));
+ }
+ }
+ // Searching for another item which provides this requires BUT has another architec
+ for (ItemCapabilityMap::const_iterator it = collector.provideAndOtherArchMap.begin();
+ it != collector.provideAndOtherArchMap.end(); ++it) {
+ if (it->second.matches (misc_info->capability()) == CapMatch::yes) {
+ // ignoring architecture
+ problem->addSolution (new ProblemSolutionIgnoreArchitecture (problem, it->first));
+ }
+ }
+ // Searching for another item which provides this requires BUT has another vendor
+ for (ItemCapabilityMap::const_iterator it = collector.provideAndOtherVendorMap.begin();
+ it != collector.provideAndOtherVendorMap.end(); ++it) {
+ if (it->second.matches (misc_info->capability()) == CapMatch::yes) {
+ // ignoring vendor
+ problem->addSolution (new ProblemSolutionIgnoreVendor (problem, it->first));
+ }
+ }
+ // Searching for another item which provides this requires BUT has been set to be kept
+ for (ItemCapabilityMap::const_iterator it = collector.provideAndKeptMap.begin();
+ it != collector.provideAndKeptMap.end(); ++it) {
+ if (it->second.matches (misc_info->capability()) == CapMatch::yes) {
+ // Do install
+ problem->addSolution (new ProblemSolutionInstall (problem, it->first));
+ }
+ }
+
+ // uninstall
+ problem->addSolution (new ProblemSolutionUninstall (problem, item));
+ // ignore requirement
+ problem->addSolution (new ProblemSolutionIgnoreRequires (problem, item, misc_info->capability()));
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ case RESOLVER_INFO_TYPE_NO_UPGRADE: { // Upgrade to q to avoid removing p is not possible.
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ break;
+ case RESOLVER_INFO_TYPE_UNINSTALL_PROVIDER: { // p provides c but is scheduled to be uninstalled
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what =str::form (_("%s fulfills dependencies of %s but will be uninstalled"),
+ misc_info->other()->name().c_str(),
+ whoShort.c_str());
+ details = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ break;
+ case RESOLVER_INFO_TYPE_KEEP_PROVIDER: { // p provides c but is scheduled to be kept
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what =str::form (_("%s fulfills dependencies of %s but will be kept on your system"),
+ misc_info->other()->name().c_str(),
+ whoShort.c_str());
+ details = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ break;
+ case RESOLVER_INFO_TYPE_PARALLEL_PROVIDER: { // p provides c but another version is already installed
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("No need to install %s"), misc_info->other()->name().c_str());
+ details = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ break;
+ case RESOLVER_INFO_TYPE_NOT_INSTALLABLE_PROVIDER: { // p provides c but is uninstallable
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("Cannot install %s to fulfill the dependencies of %s"),
+ misc_info->other()->name().c_str(),
+ whoShort.c_str());
+ details = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ case RESOLVER_INFO_TYPE_OTHER_ARCH_PROVIDER: { // p provides c but has other architecture
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ break;
+ case RESOLVER_INFO_TYPE_LOCKED_PROVIDER: { // p provides c but is locked
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("Cannot install %s to fulfil the dependencies of %s"),
+ misc_info->other()->name().c_str(),
+ whoShort.c_str());
+ what = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ break;
+ case RESOLVER_INFO_TYPE_CANT_SATISFY: { // Can't satisfy requirement c
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message() + "\n";
+ details = logAdditionalInfo(collector.additionalInfo, item);
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ // uninstall
+ problem->addSolution (new ProblemSolutionUninstall (problem, item));
+
+ // Unflag requirement for this item
+ problem->addSolution (new ProblemSolutionIgnoreRequires (problem, item, misc_info->capability()));
+
+ // Unflag ALL require
+ // Evaluating all require Items
+ AllRequires info;
+ Dep dep( Dep::REQUIRES );
+
+ invokeOnEach( _pool.byCapabilityIndexBegin( misc_info->capability().index(), dep ), // begin()
+ _pool.byCapabilityIndexEnd( misc_info->capability().index(), dep ), // end()
+ resfilter::ByCapMatch( misc_info->capability() ),
+ functor::functorRef(info) );
+ if (info.requirers.size() > 1)
+ problem->addSolution (new ProblemSolutionIgnoreRequires (problem, info.requirers, misc_info->capability()));
+
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ // from QueueItemUninstall
+ case RESOLVER_INFO_TYPE_UNINSTALL_TO_BE_INSTALLED: { // p is to-be-installed, so it won't be unlinked.
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s will not be uninstalled, because it is still required"), whoShort.c_str());
+ details = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ break;
+ case RESOLVER_INFO_TYPE_UNINSTALL_INSTALLED: { // p is required by installed, so it won't be unlinked.
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s will not be uninstalled, because it is still required"), whoShort.c_str());
+ details = misc_info->message() + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ if (item.status().isInstalled()) {
+ // keep installed
+ problem->addSolution (new ProblemSolutionKeep (problem, item));
+ } else {
+ // Do install
+ problem->addSolution (new ProblemSolutionInstall (problem, item));
+ }
+ problems.push_back (problem);
+ problem_created = true;
+
+ }
+ break;
+ case RESOLVER_INFO_TYPE_UNINSTALL_LOCKED: { // cant uninstall, its locked
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ what = misc_info->message();
+
+ if (misc_info->trigger() == ResolverInfoMisc::OBSOLETE) {
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ details = str::form (_("%s obsoletes %s. But %s cannot be deleted, because it is locked."),
+ misc_info->other()->name().c_str(),
+ who.c_str(), who.c_str()) + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ }
+
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ problem->addSolution (new ProblemSolutionUnlock (problem, item)); // Unlocking resItem
+ // unlock ALL existing resolvables
+ problem->addSolution (new ProblemSolutionUnlock (problem, pool()));
+ if (misc_info->trigger() == ResolverInfoMisc::OBSOLETE) {
+ // Ignore obsoletes
+ problem->addSolution (new ProblemSolutionIgnoreObsoletes (problem, item, misc_info->capability(),
+ misc_info->other()));
+ } else {
+ // This is an "default" soltution
+ // keep installed
+ problem->addSolution (new ProblemSolutionKeep (problem, item));
+ }
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ // from QueueItemConflict
+ case RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL: { // to-be-installed p conflicts with q due to c
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ if (misc_info->other())
+ what = str::form (_("Cannot install %s, because it is conflicting with %s"),
+ whoShort.c_str(),
+ misc_info->other()->name().c_str());
+ else
+ what = str::form (_("Cannot install %s, because it is conflicting"),
+ whoShort.c_str());
+ details = misc_info->message() + "\n";
+ details += logAdditionalInfo(collector.additionalInfo, item);
+ if (misc_info->other())
+ details += logAdditionalInfo(collector.additionalInfo, misc_info->other());
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ // Uninstall p
+ problem->addSolution (new ProblemSolutionUninstall (problem, item));
+ if (misc_info->other())
+ // Uninstall q
+ problem->addSolution (new ProblemSolutionUninstall (problem, misc_info->other()));
+ // Remove conflict in the resolvable which has to be installed
+ problem->addSolution (new ProblemSolutionIgnoreConflicts (problem, item, misc_info->other_capability(),
+ misc_info->other()));
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ case RESOLVER_INFO_TYPE_CONFLICT_UNINSTALLABLE: { // uninstalled p is marked uninstallable it conflicts [with q] due to c
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ what = str::form (_("%s is uninstallable due to conflicts with %s"),
+ whoShort.c_str(),
+ misc_info->other()->name().c_str());
+ details = misc_info->message();
+ // It is only an info --> no solution is needed
+ }
+ break;
+ }
+ } else {
+ // No item available
+ switch (info->type()) {
+ case RESOLVER_INFO_TYPE_NO_PROVIDER: { // There are no installable providers of c [for p]
+ ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
+ // TranslatorExplanation %s = name requirement ...
+ what = str::form (_("Requirememt %s cannot be fulfilled."), misc_info->capability().asString().c_str());
+ details = misc_info->message() + "\n";
+ PoolItem_Ref item = misc_info->affected();
+ if (!item)
+ {
+ // user request, get more details
+ string more_details = moreDetails( context, item );
+ details += more_details;
+ }
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ problems.push_back (problem);
+ problem_created = true;
+ }
+ break;
+ default:
+ ERR << "No item available for error:" << info << endl;
+ // but do not generate a default problem
+ problem_created = true;
+ }
+ }
+ if (!problem_created) {
+ ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+ problems.push_back (problem);
+ }
+
+ if (problems.size() >= MAXPROBLEMS) {
+ MIL << "Max problems reached: " << MAXPROBLEMS << ". Do not regarding the rest." << endl;
+ break;
+ }
+
+ }
+ if (problems.empty()) {
+ context->spewInfo();
+ }
+ return problems;
+}
+
+void
+Resolver::applySolutions (const ProblemSolutionList & solutions)
+{
+ for (ProblemSolutionList::const_iterator iter = solutions.begin();
+ iter != solutions.end(); ++iter) {
+ ProblemSolution_Ptr solution = *iter;
+ if (!solution->apply (*this))
+ break;
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/SolutionAction.cc new/libzypp-3.22.1/zypp/solver/detail/SolutionAction.cc
--- old/libzypp-3.22.1/zypp/solver/detail/SolutionAction.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/solver/detail/SolutionAction.cc 2007-09-07 14:53:31.000000000 +0200
@@ -181,8 +181,12 @@
bool
InjectSolutionAction::execute(Resolver & resolver) const
{
- Dependencies dependencies = _item.resolvable()->deps();
- CapSet depList = dependencies[Dep::CONFLICTS];
+ Dependencies dependencies;
+ CapSet depList;
+ if (_item != PoolItem_Ref()) {
+ dependencies = _item.resolvable()->deps();
+ depList = dependencies[Dep::CONFLICTS];
+ }
switch (_kind) {
case CONFLICTS:
// removing conflict in both resolvables
@@ -221,7 +225,13 @@
break;
case REQUIRES:
// removing the requires dependency from the item
- resolver.addIgnoreRequires (_item, _capability);
+ if (_item == PoolItem_Ref()) {
+ // this was a requirement via Resolver::addExtraCapability
+ // so we have to delete it.
+ resolver.removeExtraCapability (_capability);
+ } else {
+ resolver.addIgnoreRequires (_item, _capability);
+ }
break;
case ARCHITECTURE:
// This item is for ALL architectures available
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/SolutionAction.cc.bak new/libzypp-3.22.1/zypp/solver/detail/SolutionAction.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/SolutionAction.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/SolutionAction.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,265 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* SolutionAction.cc
+ *
+ * Easy-to use interface to the ZYPP dependency resolver
+ *
+ * Copyright (C) 2000-2002 Ximian, Inc.
+ * Copyright (C) 2005 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/solver/detail/Resolver.h"
+#include "zypp/solver/detail/SolutionAction.h"
+#include "zypp/CapSet.h"
+#include "zypp/base/Logger.h"
+#include "zypp/Dependencies.h"
+
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(SolutionAction);
+IMPL_PTR_TYPE(TransactionSolutionAction);
+IMPL_PTR_TYPE(InjectSolutionAction);
+
+//---------------------------------------------------------------------------
+
+SolutionAction::SolutionAction()
+{
+}
+
+
+SolutionAction::~SolutionAction()
+{
+}
+
+
+//---------------------------------------------------------------------------
+
+ostream &
+TransactionSolutionAction::dumpOn( ostream& os) const
+{
+ os << "TransactionSolutionAction: ";
+ switch (_action) {
+ case KEEP: os << "Keep"; break;
+ case INSTALL: os << "Install"; break;
+ case REMOVE: os << "Remove"; break;
+ case UNLOCK: os << "Unlock"; break;
+ case ALLBRANCHES_ON: os << "All branches on"; break;
+ case ALLBRANCHES_OFF: os << "All branches off"; break;
+ case DOUBLETIMEOUT: os << "Double timeout"; break;
+ }
+ os << " ";
+ os << _item;
+ os << endl;
+ return os;
+}
+
+
+ostream&
+operator<<( ostream& os, const SolutionActionList & actionlist)
+{
+ for (SolutionActionList::const_iterator iter = actionlist.begin(); iter != actionlist.end(); ++iter) {
+ os << *(*iter);
+ os << endl;
+ }
+ return os;
+}
+
+
+ostream&
+operator<<( ostream& os, const CSolutionActionList & actionlist)
+{
+ for (CSolutionActionList::const_iterator iter = actionlist.begin(); iter != actionlist.end(); ++iter) {
+ os << *(*iter);
+ os << endl;
+ }
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+ostream &
+InjectSolutionAction::dumpOn( ostream& os ) const
+{
+ os << "InjectSolutionAction: ";
+ os << _capability;
+ os << ", ";
+ switch (_kind) {
+ case REQUIRES: os << "Requires"; break;
+ case CONFLICTS: os << "Conflicts"; break;
+ case OBSOLETES: os << "Obsoletes"; break;
+ case INSTALLED: os << "Installed"; break;
+ case ARCHITECTURE: os << "Architecture"; break;
+ case VENDOR: os << "Vendor"; break;
+ default: os << "Wrong kind"; break;
+ }
+ os << " ";
+ os << _item;
+ os << endl;
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+
+ostream &
+SolutionAction::dumpOn( std::ostream & os ) const
+{
+ os << "SolutionAction<";
+ os << "not specified";
+ os << "> ";
+ return os;
+}
+
+
+bool
+TransactionSolutionAction::execute(Resolver & resolver) const
+{
+ bool ret = true;
+ switch (action()) {
+ case KEEP:
+ resolver.addIgnoreInstalledItem( _item );
+ /*FALLTHRU*/
+ case INSTALL:
+ if (_item.status().isToBeUninstalled())
+ ret = _item.status().setTransact (false, ResStatus::USER);
+ else
+ _item.status().setToBeInstalled (ResStatus::USER);
+ break;
+ case REMOVE:
+ if (_item.status().isToBeInstalled()) {
+ _item.status().setTransact (false,ResStatus::USER);
+ _item.status().setLock (true,ResStatus::USER); // no other dependency can set it again
+ } else if (_item.status().isInstalled())
+ _item.status().setToBeUninstalled (ResStatus::USER);
+ else
+ _item.status().setLock (true,ResStatus::USER); // no other dependency can set it again
+ break;
+ case UNLOCK:
+ ret = _item.status().setLock (false, ResStatus::USER);
+ if (!ret) ERR << "Cannot unlock " << _item << endl;
+ break;
+ case ALLBRANCHES_ON:
+ resolver.setTryAllPossibilities (true);
+ break;
+ case ALLBRANCHES_OFF:
+ resolver.setTryAllPossibilities (false);
+ break;
+ case DOUBLETIMEOUT:
+ resolver.setTimeout (resolver.timeout()*2);
+ break;
+ default:
+ ERR << "Wrong TransactionKind" << endl;
+ ret = false;
+ }
+ return ret;
+}
+
+bool
+InjectSolutionAction::execute(Resolver & resolver) const
+{
+ Dependencies dependencies = _item.resolvable()->deps();
+ CapSet depList = dependencies[Dep::CONFLICTS];
+ switch (_kind) {
+ case CONFLICTS:
+ // removing conflict in both resolvables
+ for (CapSet::const_iterator iter = depList.begin(); iter != depList.end(); iter++) {
+ if (iter->matches (_capability) == CapMatch::yes )
+ {
+ resolver.addIgnoreConflict (_item, _capability);
+ }
+ }
+ // Obsoletes are conflicts too
+ depList = dependencies[Dep::OBSOLETES];
+ for (CapSet::const_iterator iter = depList.begin(); iter != depList.end(); iter++) {
+ if (iter->matches (_capability) == CapMatch::yes )
+ {
+ resolver.addIgnoreConflict (_otherItem, _capability);
+ }
+ }
+
+ dependencies = _otherItem.resolvable()->deps();
+ depList = dependencies[Dep::CONFLICTS];
+ for (CapSet::const_iterator iter = depList.begin(); iter != depList.end(); iter++) {
+ if (iter->matches (_capability) == CapMatch::yes )
+ {
+ resolver.addIgnoreConflict (_otherItem, _capability);
+ }
+ }
+ // Obsoletes are conflicts too
+ depList = dependencies[Dep::OBSOLETES];
+ for (CapSet::const_iterator iter = depList.begin(); iter != depList.end(); iter++) {
+ if (iter->matches (_capability) == CapMatch::yes )
+ {
+ resolver.addIgnoreConflict (_otherItem, _capability);
+ }
+ }
+
+ break;
+ case REQUIRES:
+ // removing the requires dependency from the item
+ if (_item == PoolItem_Ref()) {
+ // this was a requirement via Resolver::addExtraCapability
+ // so we have to delete it.
+ resolver.removeExtraCapability (_capability);
+ } else {
+ resolver.addIgnoreRequires (_item, _capability);
+ }
+ break;
+ case ARCHITECTURE:
+ // This item is for ALL architectures available
+ resolver.addIgnoreArchitectureItem (_item);
+ break;
+ case VENDOR:
+ // This item is for ALL vendor available
+ resolver.addIgnoreVendorItem (_item);
+ break;
+ case OBSOLETES:
+ // removing the obsoletes dependency from the item
+ resolver.addIgnoreObsoletes (_otherItem, _capability);
+ break;
+ case INSTALLED:
+ // ignoring already installed items
+ resolver.addIgnoreInstalledItem (_item);
+ resolver.addIgnoreInstalledItem (_otherItem);
+ break;
+ default:
+ ERR << "No valid InjectSolutionAction kind found" << endl;
+ return false;
+ }
+
+ return true;
+}
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/SolutionAction.h.bak new/libzypp-3.22.1/zypp/solver/detail/SolutionAction.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/SolutionAction.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/SolutionAction.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,186 @@
+/*
+ *
+ * Easy-to use interface to the ZYPP dependency resolver
+ *
+ * Author: Stefan Hundhammer
+ *
+ **/
+
+#ifndef ZYPP_SOLVER_DETAIL_SOLUTIONACTION_H
+#define ZYPP_SOLVER_DETAIL_SOLUTIONACTION_H
+
+#include <list>
+#include <string>
+
+#include "zypp/base/ReferenceCounted.h"
+#include "zypp/base/PtrTypes.h"
+
+#include "zypp/Dep.h"
+#include "zypp/Capability.h"
+
+#include "zypp/solver/detail/Types.h"
+#include "zypp/solver/detail/Resolver.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+ /**
+ * Abstract base class for one action of a problem solution.
+ **/
+ class SolutionAction : public base::ReferenceCounted
+ {
+ protected:
+ SolutionAction ();
+ public:
+ virtual ~SolutionAction();
+
+ // ---------------------------------- I/O
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ friend std::ostream& operator<<(std::ostream & str, const SolutionAction & action)
+ { return action.dumpOn (str); }
+ friend std::ostream& operator<<(std::ostream & str, const SolutionActionList & actionlist);
+ friend std::ostream& operator<<(std::ostream & str, const CSolutionActionList & actionlist);
+
+ // ---------------------------------- methods
+ /**
+ * Execute this action.
+ * Returns 'true' on success, 'false' on error.
+ **/
+ virtual bool execute (Resolver & resolver) const = 0;
+ };
+
+
+ /**
+ * A problem solution action that performs a transaction
+ * (installs, removes, keep ...) one resolvable
+ * (package, patch, pattern, product).
+ **/
+ typedef enum
+ {
+ KEEP,
+ INSTALL,
+ REMOVE,
+ UNLOCK,
+ ALLBRANCHES,
+ DOUBLETIMEOUT
+ } TransactionKind;
+
+
+ class TransactionSolutionAction: public SolutionAction
+ {
+ public:
+ TransactionSolutionAction( PoolItem_Ref item,
+ TransactionKind action )
+ : SolutionAction(),
+ _item( item ), _action( action ) {}
+
+ TransactionSolutionAction( TransactionKind action )
+ : SolutionAction(),
+ _item(), _action( action ) {}
+
+ // ---------------------------------- I/O
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ friend std::ostream& operator<<(std::ostream& str, const TransactionSolutionAction & action)
+ { return action.dumpOn (str); }
+
+ // ---------------------------------- accessors
+
+ const PoolItem_Ref item() const { return _item; }
+ const TransactionKind action() const { return _action; }
+
+ // ---------------------------------- methods
+ virtual bool execute(Resolver & resolver) const;
+
+ protected:
+
+ PoolItem_Ref _item;
+ const TransactionKind _action;
+ };
+
+
+ /**
+ * Type of ignoring dependencies, architectures and vendor
+ **/
+
+ typedef enum
+ {
+ REQUIRES,
+ CONFLICTS,
+ OBSOLETES,
+ INSTALLED,
+ ARCHITECTURE,
+ VENDOR
+ } InjectSolutionKind;
+
+
+ /**
+ * A problem solution action that injects an artificial "provides" to
+ * the pool to satisfy open requirements or remove the conflict of
+ * concerning resolvable
+ *
+ * This is typically used by "ignore" (user override) solutions.
+ **/
+ class InjectSolutionAction: public SolutionAction
+ {
+ public:
+
+ InjectSolutionAction( PoolItem_Ref item,
+ const Capability & capability,
+ const InjectSolutionKind & kind)
+ : SolutionAction(),
+ _item( item ), _capability( capability ),
+ _kind( kind ), _otherItem() {}
+
+ InjectSolutionAction( PoolItem_Ref item,
+ const InjectSolutionKind & kind)
+ : SolutionAction(),
+ _item( item ), _capability(),
+ _kind( kind ), _otherItem() {}
+
+ InjectSolutionAction( PoolItem_Ref item,
+ const Capability & capability,
+ const InjectSolutionKind & kind,
+ PoolItem_Ref otherItem)
+ : SolutionAction(),
+ _item( item ), _capability( capability ),
+ _kind( kind ), _otherItem( otherItem ) {}
+
+ // ---------------------------------- I/O
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ friend std::ostream& operator<<(std::ostream& str, const InjectSolutionAction & action)
+ { return action.dumpOn (str); }
+
+ // ---------------------------------- accessors
+ const Capability & capability() const { return _capability; };
+ const PoolItem_Ref item() const { return _item; }
+
+ // ---------------------------------- methods
+ virtual bool execute(Resolver & resolver) const;
+
+ protected:
+ PoolItem_Ref _item;
+ const Capability _capability;
+ const InjectSolutionKind _kind;
+ PoolItem_Ref _otherItem;
+ };
+
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_SOLUTIONACTION_H
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Testcase.cc.bak new/libzypp-3.22.1/zypp/solver/detail/Testcase.cc.bak
--- old/libzypp-3.22.1/zypp/solver/detail/Testcase.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/Testcase.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,424 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/solver/detail/Testcase.cc
+ *
+*/
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <streambuf>
+
+#include "zypp/solver/detail/Testcase.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/LogControl.h"
+#include "zypp/PathInfo.h"
+#include "zypp/Product.h"
+#include "zypp/Package.h"
+#include "zypp/Edition.h"
+#include "zypp/target/store/xml_escape_parser.hpp"
+#include "zypp/capability/VersionedCap.h"
+#include "zypp/base/String.h"
+#include "zypp/base/PtrTypes.h"
+
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+#define TAB "\t"
+#define TAB2 "\t\t"
+
+using namespace std;
+using namespace zypp::capability;
+using namespace zypp::str;
+
+IMPL_PTR_TYPE(HelixResolvable);
+
+static std::string xml_escape( const std::string &text )
+{
+ iobind::parser::xml_escape_parser parser;
+ return parser.escape(text);
+}
+
+static std::string xml_tag_enclose( const std::string &text, const std::string &tag, bool escape = false )
+{
+ string result;
+ result += "<" + tag + ">";
+
+ if ( escape)
+ result += xml_escape(text);
+ else
+ result += text;
+
+ result += "" + tag + ">";
+ return result;
+}
+
+
+template<class T>
+std::string helixXML( const T &obj ); //undefined
+
+template<>
+std::string helixXML( const Edition &edition )
+{
+ stringstream str;
+ str << xml_tag_enclose(edition.version(), "version");
+ if (!edition.release().empty())
+ str << xml_tag_enclose(edition.release(), "release");
+ if (edition.epoch() != Edition::noepoch)
+ str << xml_tag_enclose(numstring(edition.epoch()), "epoch");
+ return str.str();
+}
+
+template<>
+std::string helixXML( const Arch &arch )
+{
+ stringstream str;
+ str << xml_tag_enclose(arch.asString(), "arch");
+ return str.str();
+}
+
+template<>
+std::string helixXML( const Capability &cap )
+{
+ stringstream str;
+ VersionedCap::constPtr vercap = asKind<VersionedCap>(cap);
+ if (vercap
+ && vercap->op() != Rel::NONE
+ && vercap->op() != Rel::ANY
+ && !vercap->edition().version().empty() )
+ {
+ // version capability
+ str << "edition().release().empty())
+ str << " release='" << vercap->edition().release() << "'";
+ if (vercap->edition().epoch() != Edition::noepoch)
+ str << " epoch='" << numstring(vercap->edition().epoch()) << "'";
+ }
+ else
+ {
+ str << "" << endl;
+
+ return str.str();
+}
+
+template<>
+std::string helixXML( const CapSet &caps )
+{
+ stringstream str;
+ CapSet::iterator it = caps.begin();
+ str << endl;
+ for ( ; it != caps.end(); ++it)
+ {
+ str << TAB2 << helixXML((*it));
+ }
+ str << TAB;
+ return str.str();
+}
+
+template<>
+std::string helixXML( const Dependencies &dep )
+{
+ stringstream str;
+ if ( dep[Dep::PROVIDES].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::PROVIDES]), "provides") << endl;
+ if ( dep[Dep::CONFLICTS].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::CONFLICTS]), "conflicts") << endl;
+ if ( dep[Dep::OBSOLETES].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::OBSOLETES]), "obsoletes") << endl;
+ if ( dep[Dep::FRESHENS].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::FRESHENS]), "freshens") << endl;
+ if ( dep[Dep::REQUIRES].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::REQUIRES]), "requires") << endl;
+ if ( dep[Dep::RECOMMENDS].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::RECOMMENDS]), "recommends") << endl;
+ if ( dep[Dep::ENHANCES].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::ENHANCES]), "enhances") << endl;
+ if ( dep[Dep::SUPPLEMENTS].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::SUPPLEMENTS]), "supplements") << endl;
+ if ( dep[Dep::SUGGESTS].size() > 0 )
+ str << TAB << xml_tag_enclose(helixXML(dep[Dep::SUGGESTS]), "suggests") << endl;
+ return str.str();
+}
+
+std::string helixXML( const Resolvable::constPtr &resolvable )
+{
+ stringstream str;
+ if ( isKind<SystemResObject>(resolvable)
+ || isKind<Language>(resolvable) ) {
+ // system resolvable will be generated by the resolver
+ // language dependencies will be written i another part
+ return str.str();
+ }
+
+ str << "<" << toLower (resolvable->kind().asString()) << ">" << endl;
+ str << TAB << xml_tag_enclose (resolvable->name(), "name", true) << endl;
+ if ( isKind<Package>(resolvable) ) {
+ str << TAB << "<history>" << endl << TAB << "<update>" << endl;
+ str << TAB2 << helixXML (resolvable->arch()) << endl;
+ str << TAB2 << helixXML (resolvable->edition()) << endl;
+ str << TAB << "</update>" << endl << TAB << "</history>" << endl;
+ } else {
+ str << TAB << helixXML (resolvable->arch()) << endl;
+ str << TAB << helixXML (resolvable->edition()) << endl;
+ }
+ str << helixXML (resolvable->deps());
+
+ str << "" << toLower (resolvable->kind().asString()) << ">" << endl;
+ return str.str();
+}
+
+//---------------------------------------------------------------------------
+
+Testcase::Testcase()
+ :dumpPath("/var/log/YaST2/solverTestcase")
+{
+}
+
+Testcase::Testcase(const std::string & path)
+ :dumpPath(path)
+{
+}
+
+
+Testcase::~Testcase()
+{
+}
+
+bool Testcase::createTestcase(Resolver & resolver)
+{
+ PathInfo path (dumpPath);
+
+ if ( !path.isExist() ) {
+ if (zypp::filesystem::mkdir (dumpPath)!=0) {
+ ERR << "Cannot create directory " << dumpPath << endl;
+ return false;
+ }
+ } else {
+ if (!path.isDir()) {
+ ERR << dumpPath << " is not a directory." << endl;
+ return false;
+ }
+ // remove old stuff
+ zypp::filesystem::clean_dir (dumpPath);
+ }
+
+ zypp::base::LogControl::instance().logfile( dumpPath +"/y2log" );
+ zypp::base::LogControl::TmpExcessive excessive;
+
+ resolver.reset(true); // true = resetting all valid solverresults
+ resolver.resolvePool();
+
+ zypp::base::LogControl::instance().logfile( "/var/log/YaST2/y2log" );
+
+ ResPool pool = resolver.pool();
+ RepositoryTable repoTable;
+ PoolItemList items_to_install;
+ PoolItemList items_to_remove;
+ PoolItemList items_locked;
+ PoolItemList language;
+ HelixResolvable system (dumpPath + "/solver-system.xml");
+
+ for ( ResPool::const_iterator it = pool.begin(); it != pool.end(); ++it )
+ {
+ Resolvable::constPtr res = it->resolvable();
+
+ if (isKind<Language>(res)) {
+ if ( it->status().isInstalled()
+ || it->status().isToBeInstalled()) {
+ language.push_back (*it);
+ }
+ } else {
+ if ( it->status().isInstalled() ) {
+ // system channel
+ system.addResolvable (res);
+ } else {
+ // repo channels
+ ResObject::constPtr repoItem = it->resolvable();
+ Repository repo = repoItem->repository();
+ if (repoTable.find (repo) == repoTable.end()) {
+ repoTable[repo] = new HelixResolvable(dumpPath + "/"
+ + numstring(repo.numericId())
+ + "-package.xml");
+ }
+ repoTable[repo]->addResolvable (res);
+ }
+
+ if ( it->status().isToBeInstalled()
+ && !(it->status().isBySolver())) {
+ items_to_install.push_back (*it);
+ }
+ if ( it->status().isToBeUninstalled()
+ && !(it->status().isBySolver())) {
+ items_to_remove.push_back (*it);
+ }
+ if ( it->status().isLocked()
+ && !(it->status().isBySolver())) {
+ items_locked.push_back (*it);
+ }
+
+ }
+ }
+
+ // writing control file "*-test.xml"
+
+ HelixControl control (dumpPath + "/solver-test.xml",
+ repoTable,
+ resolver.architecture(),
+ language);
+
+ for (PoolItemList::const_iterator iter = items_to_install.begin(); iter != items_to_install.end(); iter++) {
+ control.installResolvable (iter->resolvable());
+ }
+
+ for (PoolItemList::const_iterator iter = items_locked.begin(); iter != items_locked.end(); iter++) {
+ control.lockResolvable (iter->resolvable());
+ }
+
+
+ for (PoolItemList::const_iterator iter = items_to_remove.begin(); iter != items_to_remove.end(); iter++) {
+ control.deleteResolvable (iter->resolvable());
+ }
+
+ control.addDependencies (resolver.extraCapability(), resolver.extraConflicts());
+
+ return true;
+}
+
+//---------------------------------------------------------------------------
+
+HelixResolvable::HelixResolvable(const std::string & path)
+ :dumpFile (path)
+{
+ file = new ofstream(path.c_str());
+ if (!file) {
+ ZYPP_THROW (Exception( "Can't open " + path ) );
+ }
+
+ *file << "<channel><subchannel>" << endl;
+}
+
+HelixResolvable::~HelixResolvable()
+{
+ *file << "</subchannel></channel>" << endl;
+}
+
+
+void HelixResolvable::addResolvable(const Resolvable::constPtr &resolvable)
+{
+ *file << helixXML (resolvable);
+}
+
+//---------------------------------------------------------------------------
+
+HelixControl::HelixControl(const std::string & controlPath,
+ const RepositoryTable & repoTable,
+ const Arch & systemArchitecture,
+ const PoolItemList &languages,
+ const std::string & systemPath)
+ :dumpFile (controlPath)
+{
+ file = new ofstream(controlPath.c_str());
+ if (!file) {
+ ZYPP_THROW (Exception( "Can't open " + controlPath ) );
+ }
+
+ *file << "<?xml version=\"1.0\"?>" << endl
+ << "<!-- testcase generated by YaST -->" << endl
+ << "<test>" << endl
+ << "" << endl
+ << TAB << "" << endl;
+ for ( RepositoryTable::const_iterator it = repoTable.begin();
+ it != repoTable.end(); ++it ) {
+ Repository repo = it->first;
+ *file << TAB << "" << endl;
+ }
+ for (PoolItemList::const_iterator iter = languages.begin(); iter != languages.end(); iter++) {
+ *file << TAB << "resolvable()->name()
+ << "\" />" << endl;
+ }
+ *file << "</setup>" << endl
+ << "<trial>" << endl
+ << "" << endl
+ << "<establish/>" << endl
+ << "!> ESTABLISHED:\"/>" << endl;
+}
+
+HelixControl::HelixControl()
+ :dumpFile ("/var/log/YaST2/solverTestcase/solver-test.xml")
+{
+ HelixControl (dumpFile);
+}
+
+HelixControl::~HelixControl()
+{
+ *file << "</trial>" << endl
+ << "</test>" << endl;
+}
+
+void HelixControl::installResolvable(const ResObject::constPtr &resObject)
+{
+ Repository repo = resObject->repository();
+ *file << "kind().asString()) << "\""
+ << " name=\"" << resObject->name() << "\"" << " arch=\"" << resObject->arch().asString() << "\""
+ << " version=\"" << resObject->edition().version() << "\"" << " release=\"" << resObject->edition().release() << "\""
+ << "/>" << endl;
+}
+
+void HelixControl::lockResolvable(const ResObject::constPtr &resObject)
+{
+ Repository repo = resObject->repository();
+ *file << "kind().asString()) << "\""
+ << " name=\"" << resObject->name() << "\"" << " arch=\"" << resObject->arch().asString() << "\""
+ << " version=\"" << resObject->edition().version() << "\"" << " release=\"" << resObject->edition().release() << "\""
+ << "/>" << endl;
+}
+
+void HelixControl::deleteResolvable(const ResObject::constPtr &resObject)
+{
+ Repository repo = resObject->repository();
+ *file << "kind().asString()) << "\""
+ << " name=\"" << resObject->name() << "\"" << "/>" << endl;
+}
+
+void HelixControl::addDependencies (const CapSet & capRequire, const CapSet & capConflict)
+{
+ for (CapSet::const_iterator iter = capRequire.begin(); iter != capRequire.end(); iter++) {
+ *file << "kind().asString()) << "\""
+ << " name=\"" << iter->asString() << "\"" << "/>" << endl;
+ }
+ for (CapSet::const_iterator iter = capConflict.begin(); iter != capConflict.end(); iter++) {
+ *file << "kind().asString()) << "\""
+ << " name=\"" << iter->asString() << "\"" << "/>" << endl;
+ }
+}
+
+
+ ///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/solver/detail/Testcase.h.bak new/libzypp-3.22.1/zypp/solver/detail/Testcase.h.bak
--- old/libzypp-3.22.1/zypp/solver/detail/Testcase.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/solver/detail/Testcase.h.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,143 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/solver/detail/Testcase.h
+ *
+*/
+
+#ifndef ZYPP_SOLVER_DETAIL_TESTCASE_H
+#define ZYPP_SOLVER_DETAIL_TESTCASE_H
+
+#include <iosfwd>
+#include <string>
+#include "zypp/base/ReferenceCounted.h"
+#include "zypp/base/NonCopyable.h"
+#include "zypp/base/PtrTypes.h"
+#include "zypp/solver/detail/Resolver.h"
+#include "zypp/CapSet.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+
+template<class T>
+std::string helixXML( const T &obj ); //undefined
+
+template<>
+std::string helixXML( const Edition &edition );
+
+template<>
+std::string helixXML( const Arch &arch );
+
+template<>
+std::string helixXML( const Capability &cap );
+
+template<>
+std::string helixXML( const CapSet &caps );
+
+template<>
+std::string helixXML( const Dependencies &dep );
+
+template<>
+std::string helixXML( const Resolvable::constPtr &resolvable );
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : HelixResolvable
+/**
+ * Creates a file in helix format which includes all available
+ * or installed packages,patches,selections.....
+ **/
+class HelixResolvable : public base::ReferenceCounted, private base::NonCopyable{
+
+ private:
+ std::string dumpFile; // Path of the generated testcase
+ std::ofstream *file;
+
+ public:
+ HelixResolvable (const std::string & path);
+ ~HelixResolvable ();
+
+ void addResolvable (const Resolvable::constPtr &resolvable);
+ std::string filename () { return dumpFile; }
+};
+
+DEFINE_PTR_TYPE(HelixResolvable);
+typedef std::map RepositoryTable;
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : HelixControl
+/**
+ * Creates a file in helix format which contains all controll
+ * action of a testcase ( file is known as *-test.xml)
+ **/
+class HelixControl {
+
+ private:
+ std::string dumpFile; // Path of the generated testcase
+ std::ofstream *file;
+
+ public:
+ HelixControl (const std::string & controlPath,
+ const RepositoryTable & sourceTable,
+ const Arch & systemArchitecture,
+ const PoolItemList &languages,
+ const std::string & systemPath = "solver-system.xml");
+ HelixControl ();
+ ~HelixControl ();
+
+ void installResolvable (const ResObject::constPtr &resObject);
+ void deleteResolvable (const ResObject::constPtr &resObject);
+ void addDependencies (const CapSet &capRequire, const CapSet &capConflict);
+ std::string filename () { return dumpFile; }
+};
+
+
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : Testcase
+/**
+ * Generating a testcase of the current pool and solver state
+ **/
+class Testcase {
+
+ private:
+ std::string dumpPath; // Path of the generated testcase
+
+ public:
+ Testcase (const std::string & path);
+ Testcase ();
+ ~Testcase ();
+
+ bool createTestcase (Resolver & resolver);
+
+};
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_TESTCASE_H
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/target/TargetImpl.cc.bak new/libzypp-3.22.1/zypp/target/TargetImpl.cc.bak
--- old/libzypp-3.22.1/zypp/target/TargetImpl.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.22.1/zypp/target/TargetImpl.cc.bak 2007-09-07 14:53:31.000000000 +0200
@@ -0,0 +1,813 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/target/TargetImpl.cc
+ *
+*/
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <list>
+#include <set>
+
+#include "zypp/base/Logger.h"
+#include "zypp/base/Exception.h"
+#include "zypp/base/Iterator.h"
+#include "zypp/base/Gettext.h"
+#include "zypp/base/UserRequestException.h"
+
+#include "zypp/PoolItem.h"
+#include "zypp/Resolvable.h"
+#include "zypp/ResObject.h"
+#include "zypp/Package.h"
+#include "zypp/SrcPackage.h"
+#include "zypp/Pattern.h"
+#include "zypp/Selection.h"
+#include "zypp/Script.h"
+#include "zypp/Message.h"
+#include "zypp/Url.h"
+
+#include "zypp/CapMatchHelper.h"
+#include "zypp/ResFilters.h"
+#include "zypp/target/CommitLog.h"
+#include "zypp/target/TargetImpl.h"
+#include "zypp/target/TargetCallbackReceiver.h"
+#include "zypp/target/rpm/librpmDb.h"
+#include "zypp/target/CommitPackageCache.h"
+
+#include "zypp/pool/GetResolvablesToInsDel.h"
+#include "zypp/solver/detail/Helper.h"
+
+#include "zypp/repo/DeltaCandidates.h"
+#include "zypp/repo/PackageProvider.h"
+#include "zypp/repo/ScriptProvider.h"
+#include "zypp/repo/SrcPackageProvider.h"
+
+using namespace std;
+using namespace zypp;
+using namespace zypp::resfilter;
+using zypp::solver::detail::Helper;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace target
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ namespace
+ { /////////////////////////////////////////////////////////////////
+ void ExecuteScriptHelper( repo::RepoMediaAccess & access_r,
+ Script::constPtr script_r,
+ bool do_r )
+ {
+ MIL << "Execute script " << script_r << endl;
+ if ( ! script_r )
+ {
+ INT << "NULL Script passed." << endl;
+ return;
+ }
+
+ repo::ScriptProvider prov( access_r );
+ ManagedFile localfile = prov.provideScript( script_r, do_r );
+
+ if ( localfile->empty() )
+ {
+ DBG << "No " << (do_r?"do":"undo") << " script for " << script_r << endl;
+ return; // success
+ }
+
+ // Go...
+ callback::SendReport<ScriptResolvableReport> report;
+ report->start( script_r, localfile,
+ (do_r ? ScriptResolvableReport::DO
+ : ScriptResolvableReport::UNDO ) );
+
+ PathInfo pi( localfile );
+ if ( ! pi.isFile() )
+ {
+ std::ostringstream err;
+ err << "Script is not a file: " << pi.fileType() << " " << localfile;
+ report->problem( err.str() );
+ ZYPP_THROW(Exception(err.str()));
+ }
+
+ filesystem::chmod( localfile, S_IRUSR|S_IXUSR ); // "r-x------"
+ ExternalProgram prog( localfile->asString(), ExternalProgram::Stderr_To_Stdout, false, -1, true );
+ for ( std::string output = prog.receiveLine(); output.length(); output = prog.receiveLine() )
+ {
+ if ( ! report->progress( ScriptResolvableReport::OUTPUT, output ) )
+ {
+ WAR << "User request to abort script." << endl;
+ prog.kill(); // the rest is handled by exit code evaluation.
+ }
+ }
+
+ int exitCode = prog.close();
+ if ( exitCode != 0 )
+ {
+ std::ostringstream err;
+ err << "Script failed with exit code " << exitCode;
+ report->problem( err.str() );
+ ZYPP_THROW(Exception(err.str()));
+ }
+
+ report->finish();
+ return;
+ }
+
+ inline void ExecuteDoScript( repo::RepoMediaAccess & access_r, const Script::constPtr & script_r )
+ {
+ ExecuteScriptHelper( access_r, script_r, true );
+ }
+
+ inline void ExecuteUndoScript( repo::RepoMediaAccess & access_r, const Script::constPtr & script_r )
+ {
+ ExecuteScriptHelper( access_r, script_r, false );
+ }
+ /////////////////////////////////////////////////////////////////
+ } // namespace
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ namespace
+ { /////////////////////////////////////////////////////////////////
+
+ /** Helper removing obsoleted non-Package from store. */
+ struct StorageRemoveObsoleted
+ {
+ StorageRemoveObsoleted( storage::PersistentStorage & storage_r,
+ const PoolItem & byPoolitem_r )
+ : _storage( storage_r )
+ , _byPoolitem( byPoolitem_r )
+ {}
+
+ bool operator()( const PoolItem & poolitem_r ) const
+ {
+ if ( ! poolitem_r.status().isInstalled() )
+ return true;
+
+ if ( isKind<Package>(poolitem_r.resolvable()) )
+ {
+ ERR << "Ignore unsupported Package/non-Package obsolete: "
+ << _byPoolitem << " obsoletes " << poolitem_r << endl;
+ return true;
+ }
+
+ try
+ {
+ _storage.deleteObject( poolitem_r.resolvable() );
+ MIL<< "Obsoleted: " << poolitem_r << " (by " << _byPoolitem << ")" << endl;
+ }
+ catch ( Exception & excpt_r )
+ {
+ ZYPP_CAUGHT( excpt_r );
+ WAR << "Failed obsolete: " << poolitem_r << " (by " << _byPoolitem << ")" << endl;
+ }
+
+ return true;
+ }
+
+ private:
+ storage::PersistentStorage & _storage;
+ const PoolItem _byPoolitem;
+ };
+
+ /** Helper processing non-Package obsoletes.
+ *
+ * Scan \a pool_r for items obsoleted \a byPoolitem_r and remove them from
+ * \a storage_r.
+ */
+ void obsoleteMatchesFromStorage( storage::PersistentStorage & storage_r,
+ const ResPool & pool_r,
+ const PoolItem & byPoolitem_r )
+ {
+ forEachPoolItemMatchedBy( pool_r, byPoolitem_r, Dep::OBSOLETES,
+ OncePerPoolItem( StorageRemoveObsoleted( storage_r,
+ byPoolitem_r ) ) );
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace
+ ///////////////////////////////////////////////////////////////////
+
+ /** Helper for PackageProvider queries during commit. */
+ struct QueryInstalledEditionHelper
+ {
+ bool operator()( const std::string & name_r,
+ const Edition & ed_r,
+ const Arch & arch_r ) const
+ {
+ rpm::librpmDb::db_const_iterator it;
+ for ( it.findByName( name_r ); *it; ++it )
+ {
+ if ( arch_r == it->tag_arch()
+ && ( ed_r == Edition::noedition || ed_r == it->tag_edition() ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ };
+
+ /**
+ * \short Let the Source provide the package.
+ * \p pool_r \ref ResPool used to get candidates
+ * \p pi item to be commited
+ */
+ struct RepoProvidePackage
+ {
+ ResPool _pool;
+ repo::RepoMediaAccess &_access;
+
+ RepoProvidePackage( repo::RepoMediaAccess &access, ResPool pool_r )
+ : _pool(pool_r), _access(access)
+ {
+
+ }
+
+ ManagedFile operator()( const PoolItem & pi )
+ {
+ // Redirect PackageProvider queries for installed editions
+ // (in case of patch/delta rpm processing) to rpmDb.
+ repo::PackageProviderPolicy packageProviderPolicy;
+ packageProviderPolicy.queryInstalledCB( QueryInstalledEditionHelper() );
+
+ Package::constPtr p = asKind<Package>(pi.resolvable());
+
+
+ // Build a repository list for repos
+ // contributing to the pool
+ std::list<Repository> repos( _pool.knownRepositoriesBegin(), _pool.knownRepositoriesEnd() );
+ repo::DeltaCandidates deltas(repos);
+ repo::PackageProvider pkgProvider( _access, p, deltas, packageProviderPolicy );
+ return pkgProvider.providePackage();
+ }
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ IMPL_PTR_TYPE(TargetImpl);
+
+ TargetImpl_Ptr TargetImpl::_nullimpl;
+
+ /** Null implementation */
+ TargetImpl_Ptr TargetImpl::nullimpl()
+ {
+ if (_nullimpl == 0)
+ _nullimpl = new TargetImpl;
+ return _nullimpl;
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : TargetImpl::TargetImpl
+ // METHOD TYPE : Ctor
+ //
+ TargetImpl::TargetImpl(const Pathname & root_r)
+ : _root(root_r), _storage_enabled(false)
+ {
+ _rpm.initDatabase(root_r);
+ MIL << "Initialized target on " << _root << endl;
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : TargetImpl::~TargetImpl
+ // METHOD TYPE : Dtor
+ //
+ TargetImpl::~TargetImpl()
+ {
+ _rpm.closeDatabase();
+ MIL << "Targets closed" << endl;
+ }
+
+ bool TargetImpl::isStorageEnabled() const
+ {
+ return _storage_enabled;
+ }
+
+
+ void TargetImpl::enableStorage(const Pathname &root_r)
+ {
+ _storage.init(root_r);
+ _storage_enabled = true;
+ }
+
+ Pathname TargetImpl::root() const
+ {
+ return _root;
+ }
+
+ void TargetImpl::loadKindResolvables( const Resolvable::Kind kind )
+ {
+ // if this kind is already loaded, return
+ if ( _resstore_loaded[kind] )
+ return;
+
+ if ( kind == ResTraitszypp::Package::kind )
+ {
+ std::listPackage::Ptr packages = _rpm.getPackages();
+ for (std::listPackage::Ptr::const_iterator it = packages.begin();
+ it != packages.end();
+ it++)
+ {
+ _store.insert(*it);
+ }
+ _resstore_loaded[kind] = true;
+ }
+ else
+ {
+ if ( isStorageEnabled() )
+ {
+ // resolvables stored in the zypp storage database
+ std::listResObject::Ptr resolvables = _storage.storedObjects(kind);
+ for (std::listResObject::Ptr::iterator it = resolvables.begin();
+ it != resolvables.end();
+ it++)
+ {
+ _store.insert(*it);
+ }
+ }
+ else
+ {
+ WAR << "storage target not enabled" << std::endl;
+ }
+ _resstore_loaded[kind] = true;
+ } // end switch
+ }
+
+ ResStore::resfilter_const_iterator TargetImpl::byKindBegin( const ResObject::Kind & kind_r ) const
+ {
+ TargetImpl *ptr = const_cast(this);
+ ptr->loadKindResolvables(kind_r);
+ resfilter::ResFilter filter = ByKind(kind_r);
+ return make_filter_iterator( filter, _store.begin(), _store.end() );
+ }
+
+ ResStore::resfilter_const_iterator TargetImpl::byKindEnd( const ResObject::Kind & kind_r ) const
+ {
+ TargetImpl *ptr = const_cast(this);
+ ptr->loadKindResolvables(kind_r);
+ resfilter::ResFilter filter = ByKind(kind_r);
+ return make_filter_iterator( filter, _store.end(), _store.end() );
+ }
+
+ const ResStore & TargetImpl::resolvables()
+ {
+ loadKindResolvables( ResTraitszypp::Patch::kind );
+ loadKindResolvables( ResTraitszypp::Selection::kind );
+ loadKindResolvables( ResTraitszypp::Pattern::kind );
+ loadKindResolvables( ResTraitszypp::Product::kind );
+ loadKindResolvables( ResTraitszypp::Language::kind );
+ loadKindResolvables( ResTraitszypp::Package::kind );
+ return _store;
+ }
+
+ void TargetImpl::reset()
+ {
+ // make this smarter later
+ _store.clear();
+ _resstore_loaded[ResTraitszypp::Patch::kind] = false;
+ _resstore_loaded[ResTraitszypp::Selection::kind] = false;
+ _resstore_loaded[ResTraitszypp::Pattern::kind] = false;
+ _resstore_loaded[ResTraitszypp::Product::kind] = false;
+ _resstore_loaded[ResTraitszypp::Language::kind] = false;
+ _resstore_loaded[ResTraitszypp::Package::kind] = false;
+ }
+
+ ZYppCommitResult TargetImpl::commit( ResPool pool_r, const ZYppCommitPolicy & policy_rX )
+ {
+ // ----------------------------------------------------------------- //
+ // Fake outstanding YCP fix: Honour restriction to media 1
+ // at installation, but install all remaining packages if post-boot.
+ ZYppCommitPolicy policy_r( policy_rX );
+ if ( policy_r.restrictToMedia() > 1 )
+ policy_r.allMedia();
+ // ----------------------------------------------------------------- //
+
+ MIL << "TargetImpl::commit(<pool>, " << policy_r << ")" << endl;
+ ZYppCommitResult result;
+
+ TargetImpl::PoolItemList to_uninstall;
+ TargetImpl::PoolItemList to_install;
+ TargetImpl::PoolItemList to_srcinstall;
+ {
+
+ pool::GetResolvablesToInsDel
+ collect( pool_r, policy_r.restrictToMedia() ? pool::GetResolvablesToInsDel::ORDER_BY_MEDIANR
+ : pool::GetResolvablesToInsDel::ORDER_BY_SOURCE );
+ MIL << "GetResolvablesToInsDel: " << endl << collect << endl;
+ to_uninstall.swap( collect._toDelete );
+ to_install.swap( collect._toInstall );
+ to_srcinstall.swap( collect._toSrcinstall );
+ }
+
+ if ( policy_r.restrictToMedia() )
+ {
+ MIL << "Restrict to media number " << policy_r.restrictToMedia() << endl;
+ }
+
+ commit (to_uninstall, policy_r, pool_r );
+
+ if (policy_r.restrictToMedia() == 0)
+ { // commit all
+ result._remaining = commit( to_install, policy_r, pool_r );
+ result._srcremaining = commit( to_srcinstall, policy_r, pool_r );
+ }
+ else
+ {
+ TargetImpl::PoolItemList current_install;
+ TargetImpl::PoolItemList current_srcinstall;
+
+ // Collect until the 1st package from an unwanted media occurs.
+ // Further collection could violate install order.
+ bool hitUnwantedMedia = false;
+ for (TargetImpl::PoolItemList::iterator it = to_install.begin(); it != to_install.end(); ++it)
+ {
+ ResObject::constPtr res( it->resolvable() );
+
+ if ( hitUnwantedMedia
+ || ( res->mediaNr() && res->mediaNr() != policy_r.restrictToMedia() ) )
+ {
+ hitUnwantedMedia = true;
+ result._remaining.push_back( *it );
+ }
+ else
+ {
+ current_install.push_back( *it );
+ }
+ }
+
+ TargetImpl::PoolItemList bad = commit( current_install, policy_r, pool_r );
+ result._remaining.insert(result._remaining.end(), bad.begin(), bad.end());
+
+ for (TargetImpl::PoolItemList::iterator it = to_srcinstall.begin(); it != to_srcinstall.end(); ++it)
+ {
+ Resolvable::constPtr res( it->resolvable() );
+ Package::constPtr pkg( asKind<Package>(res) );
+ if (pkg && policy_r.restrictToMedia() != pkg->mediaNr()) // check medianr for packages only
+ {
+ XXX << "Package " << *pkg << ", wrong media " << pkg->mediaNr() << endl;
+ result._srcremaining.push_back( *it );
+ }
+ else
+ {
+ current_srcinstall.push_back( *it );
+ }
+ }
+ bad = commit( current_srcinstall, policy_r, pool_r );
+ result._srcremaining.insert(result._srcremaining.end(), bad.begin(), bad.end());
+ }
+
+
+ result._result = (to_install.size() - result._remaining.size());
+ return result;
+ }
+
+
+ TargetImpl::PoolItemList
+ TargetImpl::commit( const TargetImpl::PoolItemList & items_r,
+ const ZYppCommitPolicy & policy_r,
+ const ResPool & pool_r )
+ {
+ TargetImpl::PoolItemList remaining;
+ repo::RepoMediaAccess access;
+ MIL << "TargetImpl::commit(<list>" << policy_r << ")" << endl;
+
+ bool abort = false;
+
+ // remember the last used source (if any)
+ Repository lastUsedRepo;
+
+ RepoProvidePackage repoProvidePackage( access, pool_r);
+ // prepare the package cache.
+ CommitPackageCache packageCache( items_r.begin(), items_r.end(),
+ root() / "tmp", repoProvidePackage );
+
+ for (TargetImpl::PoolItemList::const_iterator it = items_r.begin(); it != items_r.end(); it++)
+ {
+ if (isKind<Package>(it->resolvable()))
+ {
+ Package::constPtr p = asKind<Package>(it->resolvable());
+ if (it->status().isToBeInstalled())
+ {
+ ManagedFile localfile;
+ try
+ {
+ localfile = packageCache.get( it );
+ }
+ catch ( const SkipRequestException &e )
+ {
+ ZYPP_CAUGHT( e );
+ WAR << "Skipping package " << p << " in commit" << endl;
+ continue;
+ }
+
+ lastUsedRepo = p->repository(); // remember the package source
+
+#warning Exception handling
+ // create a installation progress report proxy
+ RpmInstallPackageReceiver progress( it->resolvable() );
+ progress.connect();
+ bool success = true;
+ unsigned flags = 0;
+ if (p->installOnly()) flags |= rpm::RpmDb::RPMINST_NOUPGRADE;
+ if (policy_r.dryRun()) flags |= rpm::RpmDb::RPMINST_TEST;
+ if (policy_r.rpmNoSignature()) flags |= rpm::RpmDb::RPMINST_NOSIGNATURE;
+
+ try
+ {
+ progress.tryLevel( target::rpm::InstallResolvableReport::RPM );
+ rpm().installPackage( localfile, flags );
+
+ if ( progress.aborted() )
+ {
+ WAR << "commit aborted by the user" << endl;
+ progress.disconnect();
+ abort = true;
+ break;
+ }
+
+ }
+ catch (Exception & excpt_r)
+ {
+ ZYPP_CAUGHT(excpt_r);
+ WAR << "Install failed, retrying with --nodeps" << endl;
+ if (policy_r.dryRun())
+ {
+ WAR << "dry run failed" << endl;
+ progress.disconnect();
+ break;
+ }
+
+ try
+ {
+ progress.tryLevel( target::rpm::InstallResolvableReport::RPM_NODEPS );
+ flags |= rpm::RpmDb::RPMINST_NODEPS;
+ rpm().installPackage( localfile, flags );
+
+ if ( progress.aborted() )
+ {
+ WAR << "commit aborted by the user" << endl;
+ abort = true;
+ progress.disconnect();
+ break;
+ }
+ }
+ catch (Exception & excpt_r)
+ {
+ ZYPP_CAUGHT(excpt_r);
+ WAR << "Install failed again, retrying with --force --nodeps" << endl;
+
+ try
+ {
+ progress.tryLevel( target::rpm::InstallResolvableReport::RPM_NODEPS_FORCE );
+ flags |= rpm::RpmDb::RPMINST_FORCE;
+ rpm().installPackage( localfile, flags );
+ }
+ catch (Exception & excpt_r)
+ {
+ remaining.push_back( *it );
+ success = false;
+ ZYPP_CAUGHT(excpt_r);
+ }
+
+ if ( progress.aborted() )
+ {
+ WAR << "commit aborted by the user" << endl;
+ abort = true;
+ progress.disconnect();
+ break;
+ }
+ }
+ }
+ if (success
+ && !policy_r.dryRun())
+ {
+ it->status().resetTransact( ResStatus::USER );
+ }
+ progress.disconnect();
+ }
+ else
+ {
+ bool success = true;
+
+ RpmRemovePackageReceiver progress( it->resolvable() );
+ progress.connect();
+ unsigned flags = rpm::RpmDb::RPMINST_NODEPS;
+ if (policy_r.dryRun()) flags |= rpm::RpmDb::RPMINST_TEST;
+ try
+ {
+ rpm().removePackage( p, flags );
+ }
+ catch (Exception & excpt_r)
+ {
+ WAR << "removal of " << p << " failed";
+ success = false;
+ ZYPP_CAUGHT( excpt_r );
+ }
+ if (success
+ && !policy_r.dryRun())
+ {
+ it->status().resetTransact( ResStatus::USER );
+ }
+ progress.disconnect();
+ }
+ }
+ else if (!policy_r.dryRun()) // other resolvables (non-Package)
+ {
+ if ( isStorageEnabled() )
+ {
+ if (it->status().isToBeInstalled())
+ {
+ // Process OBSOLETES and remove them from store.
+ obsoleteMatchesFromStorage( _storage, pool_r, *it );
+
+ bool success = false;
+ try
+ {
+ if (isKind<Message>(it->resolvable()))
+ {
+ Message::constPtr m = dynamic_pointer_cast<const Message>(it->resolvable());
+ std::string text = m->text().asString();
+
+ callback::SendReporttarget::MessageResolvableReport report;
+
+ report->show( m );
+
+ MIL << "Displaying the text '" << text << "'" << endl;
+ }
+ else if (isKind<Script>(it->resolvable()))
+ {
+ ExecuteDoScript( access, asKind<Script>(it->resolvable()) );
+ }
+ else if (!isKind<Atom>(it->resolvable())) // atoms are re-created from the patch data, no need to save them
+ {
+ // #160792 do not just add, also remove older versions
+ if (true) // !installOnly - only on Package?!
+ {
+ // this would delete the same item over and over
+ //for (PoolItem_Ref old = Helper::findInstalledItem (pool_r, *it); old; )
+#warning REMOVE ALL OLD VERSIONS AND NOT JUST ONE
+ PoolItem_Ref old = Helper::findInstalledItem (pool_r, *it);
+ if (old)
+ {
+ _storage.deleteObject(old.resolvable());
+ }
+ }
+ _storage.storeObject(it->resolvable());
+ }
+ success = true;
+ }
+ catch (Exception & excpt_r)
+ {
+ ZYPP_CAUGHT(excpt_r);
+ WAR << "Install of Resolvable from storage failed" << endl;
+ }
+ if (success)
+ it->status().resetTransact( ResStatus::USER );
+ }
+ else
+ { // isToBeUninstalled
+ bool success = false;
+ try
+ {
+ if (isKind<Atom>(it->resolvable()))
+ {
+ DBG << "Uninstalling atom - no-op" << endl;
+ }
+ else if (isKind<Message>(it->resolvable()))
+ {
+ DBG << "Uninstalling message - no-op" << endl;
+ }
+ else if (isKind<Script>(it->resolvable()))
+ {
+ ExecuteUndoScript( access, asKind<Script>(it->resolvable()) );
+ }
+ else
+ {
+ _storage.deleteObject(it->resolvable());
+ }
+ success = true;
+ }
+ catch (Exception & excpt_r)
+ {
+ ZYPP_CAUGHT(excpt_r);
+ WAR << "Uninstall of Resolvable from storage failed" << endl;
+ }
+ if (success)
+ it->status().resetTransact( ResStatus::USER );
+ }
+ }
+ else
+ {
+ WAR << "storage target disabled" << std::endl;
+ }
+
+ } // other resolvables
+
+ } // for
+
+ // we're done with the commit, release the source media
+ // In the case of a single media, end of commit means we don't need _this_
+ // media any more.
+ // In the case of 'commit any media', end of commit means we're completely
+ // done and don't need the source's media anyways.
+
+ if (lastUsedRepo)
+ { // if a source was used
+ //lastUsedRepo.release(); // release their medias
+ }
+
+ if ( abort )
+ ZYPP_THROW( TargetAbortedException( N_("Installation has been aborted as directed.") ) );
+
+ return remaining;
+ }
+
+ rpm::RpmDb & TargetImpl::rpm()
+ {
+ return _rpm;
+ }
+
+ bool TargetImpl::providesFile (const std::string & path_str, const std::string & name_str) const
+ {
+ return _rpm.hasFile(path_str, name_str);
+ }
+
+ /** Return the resolvable which provides path_str (rpm -qf)
+ return NULL if no resolvable provides this file */
+ ResObject::constPtr TargetImpl::whoOwnsFile (const std::string & path_str) const
+ {
+ string name = _rpm.whoOwnsFile (path_str);
+ if (name.empty())
+ return NULL;
+
+ for (ResStore::const_iterator it = _store.begin(); it != _store.end(); ++it)
+ {
+ if ((*it)->name() == name)
+ {
+ return *it;
+ }
+ }
+ return NULL;
+ }
+
+ /** Set the log file for target */
+ bool TargetImpl::setInstallationLogfile(const Pathname & path_r)
+ {
+ CommitLog::setFname(path_r);
+ return true;
+ }
+
+ Date TargetImpl::timestamp() const
+ {
+ Date ts_rpm;
+ Date ts_store;
+
+ ts_rpm = _rpm.timestamp();
+
+ if ( isStorageEnabled() )
+ ts_store = _storage.timestamp();
+
+ if ( ts_rpm > ts_store )
+ {
+ return ts_rpm;
+ }
+ else if (ts_rpm < ts_store)
+ {
+ return ts_store;
+ }
+ else
+ {
+ // they are the same
+ if ( ts_rpm != 0 )
+ return ts_rpm;
+ else
+ return Date::now();
+ }
+ }
+
+ void TargetImpl::installSrcPackage( const SrcPackage_constPtr & srcPackage_r )
+ {
+ // provide on local disk
+ repo::RepoMediaAccess access_r;
+ repo::SrcPackageProvider prov( access_r );
+ ManagedFile localfile = prov.provideSrcPackage( srcPackage_r );
+ // install it
+ rpm().installPackage ( localfile );
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace target
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.22.1/zypp/target/store/XMLFilesBackend.cc new/libzypp-3.22.1/zypp/target/store/XMLFilesBackend.cc
--- old/libzypp-3.22.1/zypp/target/store/XMLFilesBackend.cc 2007-09-03 17:18:12.000000000 +0200
+++ new/libzypp-3.22.1/zypp/target/store/XMLFilesBackend.cc 2007-09-07 14:53:31.000000000 +0200
@@ -791,6 +791,7 @@
impl->_install_notify = parsed.install_notify;
impl->_delete_notify = parsed.delete_notify;
impl->_license_to_confirm = parsed.license_to_confirm;
+ impl->_vendor = parsed.vendor;
impl->_size = parsed.size;
impl->_downloadSize = parsed.downloadSize;
impl->_install_only = parsed.install_only;
@@ -883,6 +884,7 @@
impl->_install_notify = parsed.install_notify;
impl->_delete_notify = parsed.delete_notify;
impl->_license_to_confirm = parsed.license_to_confirm;
+ impl->_vendor = parsed.vendor;
impl->_size = parsed.size;
impl->_downloadSize = parsed.downloadSize;
impl->_install_only = parsed.install_only;
@@ -920,6 +922,7 @@
impl->_install_notify = parsed.install_notify;
impl->_delete_notify = parsed.delete_notify;
impl->_license_to_confirm = parsed.license_to_confirm;
+ impl->_vendor = parsed.vendor;
impl->_size = parsed.size;
impl->_downloadSize = parsed.downloadSize;
impl->_install_only = parsed.install_only;
@@ -961,6 +964,7 @@
impl->_install_notify = parsed.install_notify;
impl->_delete_notify = parsed.delete_notify;
impl->_license_to_confirm = parsed.license_to_confirm;
+ impl->_vendor = parsed.vendor;
impl->_size = parsed.size;
impl->_downloadSize = parsed.downloadSize;
impl->_install_only = parsed.install_only;
@@ -1020,6 +1024,7 @@
impl->_install_notify = parsed.install_notify;
impl->_delete_notify = parsed.delete_notify;
impl->_license_to_confirm = parsed.license_to_confirm;
+ impl->_vendor = parsed.vendor;
impl->_size = parsed.size;
impl->_downloadSize = parsed.downloadSize;
impl->_install_only = parsed.install_only;
@@ -1173,6 +1178,7 @@
impl->_install_notify = parsed.install_notify;
impl->_delete_notify = parsed.delete_notify;
impl->_license_to_confirm = parsed.license_to_confirm;
+ impl->_vendor = parsed.vendor;
impl->_size = parsed.size;
impl->_downloadSize = parsed.downloadSize;
impl->_install_only = parsed.install_only;
@@ -1189,6 +1195,13 @@
if (!parsed.arch.empty())
arch = Arch(parsed.arch);
+ // Workaround for bug #307743:
+ // Hijack installed patterns with empty vendor.
+ if ( impl->_vendor.empty() )
+ {
+ impl->_vendor = "SUSE (assumed)";
+ }
+
// Collect basic Resolvable data
NVRAD dataCollect( parsed.name, Edition( parsed.ver, parsed.rel, parsed.epoch ), arch, createDependencies( parsed, ResTraits<Pattern>::kind));
Pattern::Ptr pattern = detail::makeResolvableFromImpl( dataCollect, impl );
@@ -1217,6 +1230,7 @@
impl->_install_notify = parsed.install_notify;
impl->_delete_notify = parsed.delete_notify;
impl->_license_to_confirm = parsed.license_to_confirm;
+ impl->_vendor = parsed.vendor;
impl->_size = parsed.size;
impl->_downloadSize = parsed.downloadSize;
impl->_install_only = parsed.install_only;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org