Hello community, here is the log from the commit of package libzypp for openSUSE:Factory checked in at 2014-09-28 19:53:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzypp (Old) and /work/SRC/openSUSE:Factory/.libzypp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzypp" Changes: -------- --- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes 2014-09-17 17:42:14.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libzypp.new/libzypp.changes 2014-09-28 19:53:27.000000000 +0200 @@ -1,0 +2,53 @@ +Thu Sep 25 17:59:06 CEST 2014 - m...@suse.de + +- Trigger appdata plugin when system repos have changed (bnc#866257) +- Protect against race when destructing globals +- BuildRequire libsolv-tools as libsolv-devel no longer does +- version 14.29.4 (29) + +------------------------------------------------------------------- +Thu Sep 25 01:15:42 CEST 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Tue Sep 23 17:07:45 CEST 2014 - m...@suse.de + +- Fix computation of userinstalled items (bnc#897404) +- version 14.29.3 (29) + +------------------------------------------------------------------- +Tue Sep 23 10:55:08 CEST 2014 - m...@suse.de + +- Adapt to API changes in rpm.4.12 +- SLE-12 (suse_version 1315) uses it's own translations set + (bnc#897176) +- version 14.29.2 (29) + +------------------------------------------------------------------- +Sun Sep 21 01:13:25 CEST 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Thu Sep 18 15:47:50 CEST 2014 - m...@suse.de + +- Update sle-zypp-po.tar.bz2 + +------------------------------------------------------------------- +Thu Sep 18 15:47:34 CEST 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Thu Sep 18 15:46:11 CEST 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Wed Sep 17 13:18:23 CEST 2014 - m...@suse.de + +- adjust BuildRequires +- version 14.29.1 (29) + +------------------------------------------------------------------- @@ -3,0 +57,3 @@ +- DiskUsageCounter: Set growonly on detetcted snapshotting btrfs + partitions (bnc#896176) +- DiskUsageCounter: Allow MountPoint to store fstype Old: ---- libzypp-14.29.0.tar.bz2 New: ---- libzypp-14.29.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp.spec ++++++ --- /var/tmp/diff_new_pack.ADVC7v/_old 2014-09-28 19:53:28.000000000 +0200 +++ /var/tmp/diff_new_pack.ADVC7v/_new 2014-09-28 19:53:28.000000000 +0200 @@ -23,7 +23,7 @@ Summary: Package, Patch, Pattern, and Product Management License: GPL-2.0+ Group: System/Packages -Version: 14.29.0 +Version: 14.29.4 Release: 0 Source: %{name}-%{version}.tar.bz2 Source1: %{name}-rpmlintrc @@ -32,6 +32,7 @@ # Features we provide (update doc/autoinclude/FeatureTest.doc): Provides: libzypp(plugin) = 0 +Provides: libzypp(plugin:appdata) = 0 Provides: libzypp(plugin:commit) = 1 Provides: libzypp(plugin:services) = 0 Provides: libzypp(plugin:system) = 0 @@ -75,6 +76,7 @@ BuildRequires: libsolv-devel >= 0.6.5 %if 0%{?suse_version} >= 1100 +BuildRequires: libsolv-tools %requires_eq libsolv-tools %else Requires: libsolv-tools @@ -209,13 +211,20 @@ export CXXFLAGS="$RPM_OPT_FLAGS" unset TRANSLATION_SET unset EXTRA_CMAKE_OPTIONS -# SLE11-* might want its own translation set: -%if 0%{?suse_version} == 1110 +# Same codebase, but SLES may use it's own translation set. +# suse_version +# 1110 SLES11 +# 1315 SLES12 +%if 0%{?suse_version} == 1110 || 0%{?suse_version} == 1315 if [ -f ../po/sle-zypp-po.tar.bz ]; then export TRANSLATION_SET=sle-zypp - export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON" fi %endif +# No libproxy on SLE11 +%if 0%{?suse_version} == 1110 +export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON" +%endif + cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DDOC_INSTALL_DIR=%{_docdir} \ -DLIB=%{_lib} \ @@ -252,6 +261,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins +mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system ++++++ libzypp-14.29.0.tar.bz2 -> libzypp-14.29.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/VERSION.cmake new/libzypp-14.29.4/VERSION.cmake --- old/libzypp-14.29.0/VERSION.cmake 2014-09-16 10:49:10.000000000 +0200 +++ new/libzypp-14.29.4/VERSION.cmake 2014-09-25 18:01:10.000000000 +0200 @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "14") SET(LIBZYPP_COMPATMINOR "29") SET(LIBZYPP_MINOR "29") -SET(LIBZYPP_PATCH "0") +SET(LIBZYPP_PATCH "4") # -# LAST RELEASED: 14.29.0 (29) +# LAST RELEASED: 14.29.4 (29) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/doc/autoinclude/Plugins.doc new/libzypp-14.29.4/doc/autoinclude/Plugins.doc --- old/libzypp-14.29.0/doc/autoinclude/Plugins.doc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.29.4/doc/autoinclude/Plugins.doc 2014-09-25 18:01:10.000000000 +0200 @@ -83,6 +83,19 @@ \endverbatim <HR><!-- ====================================================================== --> +\section plugins-impl Developers: Implementation + +Plugins are implemented in the following classes: + +- \ref zypp::PluginScript (Plugin as an external program) +- \ref zypp::PluginScriptException +- \ref zypp::PluginFrame (Message for the stateful protocol) +- \ref zypp::PluginFrameException +- \ref zypp::repo::PluginServices (Finds Service plugins) + +The plugins default location is obtained from \ref zypp::ZConfig::pluginsPath() + +<HR><!-- ====================================================================== --> \section plugin-toc Supported plugins \subpage plugin-commit Escort installation of packages @@ -91,6 +104,7 @@ \ref plugin-url-resolver +\ref plugin-appdata <HR><!-- ====================================================================== --> \section plugin-services Service plugins @@ -141,7 +155,7 @@ plugin:foo?param1=val1¶m2=val2 \endverbatim -ZYpp tries to executa a plugin named foo (in /usr/lib/zypp/plugins/urlresolver) and calla it with the following protocol: +ZYpp tries to executa a plugin named foo (in /usr/lib/zypp/plugins/urlresolver) and call it with the following protocol: \verbatim RESOLVEURL @@ -187,16 +201,17 @@ In this example, the service plugin could have inmediately resolved the urls and returned http://realurl, but the url resolver allows also to add HTTP headers to the request. <HR><!-- ====================================================================== --> -\section plugins-impl Developers: Implementation +\section plugin-appdata Appdata refresh plugins (repo change) -Plugins are implemented in the following classes: +Stateless plugins found in /usr/lib/zypp/plugins/appdata are called whenever any of the system repos has changed (added/removed/renamed/modified) or has been refreshed. Detailed information \b what exactly has changed is not available. (scripts are executed IFF euid is '0' and --root is not used). For every enabled system repo we pass alias type and metadata path on the commandline like this: -- \ref zypp::PluginScript (Plugin as an external program) -- \ref zypp::PluginScriptException -- \ref zypp::PluginFrame (Message for the stateful protocol) -- \ref zypp::PluginFrameException -- \ref zypp::repo::PluginServices (Finds Service plugins) +\verbatim + -R REPO_ALIAS -t REPO_TYPE -p REPO_METADATA_PATH -R NEXT_REPO.... +\endverbatim -The plugins default location is obtained from \ref zypp::ZConfig::pluginsPath() +\note REPO_TYPE can be e.g. "rpm-md", "yast2", "plaindir" or "NONE" indicating the repo was not yet probed. + +\note REPO_METADATA_PATH can be empty or a not existing directory, indicating valid metadata for the repo are not yet available. +Scripts are executed 'fire and forget' whenever a RepoManager instance that performed changes goes out of scope. So it's up to the script to protect against concurrency. */ \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/libzypp.spec.cmake new/libzypp-14.29.4/libzypp.spec.cmake --- old/libzypp-14.29.0/libzypp.spec.cmake 2014-09-16 15:20:17.000000000 +0200 +++ new/libzypp-14.29.4/libzypp.spec.cmake 2014-09-25 18:01:10.000000000 +0200 @@ -32,6 +32,7 @@ # Features we provide (update doc/autoinclude/FeatureTest.doc): Provides: libzypp(plugin) = 0 +Provides: libzypp(plugin:appdata) = 0 Provides: libzypp(plugin:commit) = 1 Provides: libzypp(plugin:services) = 0 Provides: libzypp(plugin:system) = 0 @@ -75,6 +76,7 @@ BuildRequires: libsolv-devel >= 0.6.5 %if 0%{?suse_version} >= 1100 +BuildRequires: libsolv-tools %requires_eq libsolv-tools %else Requires: libsolv-tools @@ -209,13 +211,20 @@ export CXXFLAGS="$RPM_OPT_FLAGS" unset TRANSLATION_SET unset EXTRA_CMAKE_OPTIONS -# SLE11-* might want its own translation set: -%if 0%{?suse_version} == 1110 +# Same codebase, but SLES may use it's own translation set. +# suse_version +# 1110 SLES11 +# 1315 SLES12 +%if 0%{?suse_version} == 1110 || 0%{?suse_version} == 1315 if [ -f ../po/sle-zypp-po.tar.bz ]; then export TRANSLATION_SET=sle-zypp - export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON" fi %endif +# No libproxy on SLE11 +%if 0%{?suse_version} == 1110 +export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON" +%endif + cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DDOC_INSTALL_DIR=%{_docdir} \ -DLIB=%{_lib} \ @@ -252,6 +261,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins +mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/package/libzypp.changes new/libzypp-14.29.4/package/libzypp.changes --- old/libzypp-14.29.0/package/libzypp.changes 2014-09-16 10:49:10.000000000 +0200 +++ new/libzypp-14.29.4/package/libzypp.changes 2014-09-25 18:01:10.000000000 +0200 @@ -1,6 +1,62 @@ ------------------------------------------------------------------- +Thu Sep 25 17:59:06 CEST 2014 - m...@suse.de + +- Trigger appdata plugin when system repos have changed (bnc#866257) +- Protect against race when destructing globals +- BuildRequire libsolv-tools as libsolv-devel no longer does +- version 14.29.4 (29) + +------------------------------------------------------------------- +Thu Sep 25 01:15:42 CEST 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Tue Sep 23 17:07:45 CEST 2014 - m...@suse.de + +- Fix computation of userinstalled items (bnc#897404) +- version 14.29.3 (29) + +------------------------------------------------------------------- +Tue Sep 23 10:55:08 CEST 2014 - m...@suse.de + +- Adapt to API changes in rpm.4.12 +- SLE-12 (suse_version 1315) uses it's own translations set + (bnc#897176) +- version 14.29.2 (29) + +------------------------------------------------------------------- +Sun Sep 21 01:13:25 CEST 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Thu Sep 18 15:47:50 CEST 2014 - m...@suse.de + +- Update sle-zypp-po.tar.bz2 + +------------------------------------------------------------------- +Thu Sep 18 15:47:34 CEST 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Thu Sep 18 15:46:11 CEST 2014 - m...@suse.de + +- Update zypp-po.tar.bz2 + +------------------------------------------------------------------- +Wed Sep 17 13:18:23 CEST 2014 - m...@suse.de + +- adjust BuildRequires +- version 14.29.1 (29) + +------------------------------------------------------------------- Tue Sep 16 10:45:39 CEST 2014 - m...@suse.de +- DiskUsageCounter: Set growonly on detetcted snapshotting btrfs + partitions (bnc#896176) +- DiskUsageCounter: Allow MountPoint to store fstype - DiskUsageCounter: Support setting 'growonly' partition hint (bnc#896176) - version 14.29.0 (29) Files old/libzypp-14.29.0/po/sle-zypp-po.tar.bz2 and new/libzypp-14.29.4/po/sle-zypp-po.tar.bz2 differ Files old/libzypp-14.29.0/po/zypp-po.tar.bz2 and new/libzypp-14.29.4/po/zypp-po.tar.bz2 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/tests/sat/CMakeLists.txt new/libzypp-14.29.4/tests/sat/CMakeLists.txt --- old/libzypp-14.29.0/tests/sat/CMakeLists.txt 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.29.4/tests/sat/CMakeLists.txt 2014-09-23 17:08:59.000000000 +0200 @@ -6,6 +6,7 @@ IdString LookupAttr Pool + Queue Map Solvable SolvParsing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/tests/sat/Queue_test.cc new/libzypp-14.29.4/tests/sat/Queue_test.cc --- old/libzypp-14.29.0/tests/sat/Queue_test.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-14.29.4/tests/sat/Queue_test.cc 2014-09-23 17:08:59.000000000 +0200 @@ -0,0 +1,51 @@ +#include <stdio.h> +#include <iostream> +#include <boost/test/auto_unit_test.hpp> + +#include "zypp/base/LogTools.h" +#include "zypp/base/Easy.h" +#include "zypp/sat/Queue.h" + + +#define BOOST_TEST_MODULE Queue + +using std::endl; +using std::cout; +using namespace zypp; +using namespace boost::unit_test; + + +BOOST_AUTO_TEST_CASE(basic) +{ + sat::Queue m; + BOOST_CHECK_EQUAL( m.empty(), true ); + BOOST_CHECK_EQUAL( m.size(), 0 ); + BOOST_CHECK_EQUAL( m.begin(), m.end() ); + BOOST_CHECK( m == sat::Queue() ); + BOOST_CHECK_EQUAL( m.first(), 0 ); + BOOST_CHECK_EQUAL( m.last(), 0 ); + + m.push( 13 ); + BOOST_CHECK_EQUAL( m.empty(), false ); + BOOST_CHECK_EQUAL( m.size(), 1 ); + BOOST_CHECK( m.begin() != m.end() ); + BOOST_CHECK_EQUAL( m.begin()+1, m.end() ); + + BOOST_CHECK_EQUAL( m.first(), 13 ); + BOOST_CHECK_EQUAL( m.last(), 13 ); + BOOST_CHECK_EQUAL( m.at(0), 13 ); + BOOST_CHECK_THROW( m.at(1), std::out_of_range ); + + BOOST_CHECK( m.contains(13) ); + BOOST_CHECK( !m.contains(14) ); + + BOOST_CHECK_EQUAL( m.find(13), m.begin() ); + BOOST_CHECK_EQUAL( m.find(14), m.end() ); + + m.pushUnique( 13 ); + BOOST_CHECK_EQUAL( m.size(), 1 ); + m.push( 13 ); + BOOST_CHECK_EQUAL( m.size(), 2 ); + m.remove( 13 ); + BOOST_CHECK_EQUAL( m.size(), 0 ); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/zypp/ExternalProgram.cc new/libzypp-14.29.4/zypp/ExternalProgram.cc --- old/libzypp-14.29.0/zypp/ExternalProgram.cc 2014-07-18 08:58:44.000000000 +0200 +++ new/libzypp-14.29.4/zypp/ExternalProgram.cc 2014-09-25 18:01:10.000000000 +0200 @@ -182,6 +182,7 @@ // retrieve options at beginning of arglist const char * redirectStdin = nullptr; // <[file] + const char * redirectStdout = nullptr; // >[file] const char * chdirTo = nullptr; // #/[path] if ( root ) @@ -211,6 +212,13 @@ redirectStdin = "/dev/null"; break; + case '>': + strip = true; + redirectStdout = argv[0]+1; + if ( *redirectStdout == '\0' ) + redirectStdout = "/dev/null"; + break; + case '#': strip = true; if ( argv[0][1] == '/' ) // #/[path] @@ -234,6 +242,8 @@ } if ( redirectStdin ) cmdstr << " < '" << redirectStdin << "'"; + if ( redirectStdout ) + cmdstr << " > '" << redirectStdout << "'"; _command = cmdstr.str(); } DBG << "Executing " << _command << endl; @@ -301,6 +311,13 @@ dup2( inp_fd, 0 ); } + if ( redirectStdout ) + { + ::close( 1 ); + int inp_fd = open( redirectStdout, O_WRONLY|O_CREAT|O_APPEND, 0600 ); + dup2( inp_fd, 1 ); + } + // Handle stderr if (stderr_disp == Discard_Stderr) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/zypp/ExternalProgram.h new/libzypp-14.29.4/zypp/ExternalProgram.h --- old/libzypp-14.29.0/zypp/ExternalProgram.h 2014-07-18 08:58:44.000000000 +0200 +++ new/libzypp-14.29.4/zypp/ExternalProgram.h 2014-09-25 18:01:10.000000000 +0200 @@ -108,6 +108,10 @@ * const char* argv[] = { "</tmp/x", "cat", NULL }; * ExternalProgram prog( argv ); * \endcode + * + * Stdout redirection: If the \b 1st argument starts with a \b '>', the remaining + * part is treated as file opened for writing on standard output (or \c /dev/null + * if empty). */ ExternalProgram(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/zypp/RepoManager.cc new/libzypp-14.29.4/zypp/RepoManager.cc --- old/libzypp-14.29.0/zypp/RepoManager.cc 2014-09-05 12:49:26.000000000 +0200 +++ new/libzypp-14.29.4/zypp/RepoManager.cc 2014-09-25 18:01:10.000000000 +0200 @@ -21,6 +21,7 @@ #include "zypp/base/InputStream.h" #include "zypp/base/LogTools.h" #include "zypp/base/Gettext.h" +#include "zypp/base/DefaultIntegral.h" #include "zypp/base/Function.h" #include "zypp/base/Regex.h" #include "zypp/PathInfo.h" @@ -223,7 +224,7 @@ bool nonroot( geteuid() != 0 ); if ( nonroot && ! PathInfo(dir).userMayRX() ) { - JobReport::warning( formatNAC(_("Cannot read repo directory ‘%1%’: Permission denied")) % dir ); + JobReport::warning( formatNAC(_("Cannot read repo directory '%1%': Permission denied")) % dir ); } else { @@ -241,7 +242,7 @@ { if ( nonroot && ! PathInfo(*it).userMayR() ) { - JobReport::warning( formatNAC(_("Cannot read repo file ‘%1%’: Permission denied")) % *it ); + JobReport::warning( formatNAC(_("Cannot read repo file '%1%': Permission denied")) % *it ); } else { @@ -441,19 +442,62 @@ init_knownRepositories(); } + ~Impl() + { + // trigger appdata refresh if some repos change + if ( _reposDirty && geteuid() == 0 && ( _options.rootDir.empty() || _options.rootDir == "/" ) ) + { + try { + std::list<Pathname> entries; + filesystem::readdir( entries, _options.pluginsPath/"appdata", false ); + if ( ! entries.empty() ) + { + ExternalProgram::Arguments cmd; + cmd.push_back( "<" ); // discard stdin + cmd.push_back( ">" ); // discard stdout + cmd.push_back( "PROGRAM" ); // [2] - fix index below if changing! + for ( const auto & rinfo : repos() ) + { + if ( ! rinfo.enabled() ) + continue; + cmd.push_back( "-R" ); + cmd.push_back( rinfo.alias() ); + cmd.push_back( "-t" ); + cmd.push_back( rinfo.type().asString() ); + cmd.push_back( "-p" ); + cmd.push_back( rinfo.metadataPath().asString() ); + } + + for_( it, entries.begin(), entries.end() ) + { + PathInfo pi( *it ); + //DBG << "/tmp/xx ->" << pi << endl; + if ( pi.isFile() && pi.userMayRX() ) + { + // trigger plugin + cmd[2] = pi.asString(); // [2] - PROGRAM + ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout ); + } + } + } + } + catch (...) {} // no throw in dtor + } + } + public: - bool repoEmpty() const { return _repos.empty(); } - RepoSizeType repoSize() const { return _repos.size(); } - RepoConstIterator repoBegin() const { return _repos.begin(); } - RepoConstIterator repoEnd() const { return _repos.end(); } + bool repoEmpty() const { return repos().empty(); } + RepoSizeType repoSize() const { return repos().size(); } + RepoConstIterator repoBegin() const { return repos().begin(); } + RepoConstIterator repoEnd() const { return repos().end(); } bool hasRepo( const std::string & alias ) const - { return foundAliasIn( alias, _repos ); } + { return foundAliasIn( alias, repos() ); } RepoInfo getRepo( const std::string & alias ) const { - RepoConstIterator it( findAlias( alias, _repos ) ); - return it == _repos.end() ? RepoInfo::noRepo : *it; + RepoConstIterator it( findAlias( alias, repos() ) ); + return it == repos().end() ? RepoInfo::noRepo : *it; } public: @@ -558,8 +602,8 @@ void getRepositoriesInService( const std::string & alias, OutputIterator out ) const { MatchServiceAlias filter( alias ); - std::copy( boost::make_filter_iterator( filter, _repos.begin(), _repos.end() ), - boost::make_filter_iterator( filter, _repos.end(), _repos.end() ), + std::copy( boost::make_filter_iterator( filter, repos().begin(), repos().end() ), + boost::make_filter_iterator( filter, repos().end(), repos().end() ), out); } @@ -567,11 +611,16 @@ void init_knownServices(); void init_knownRepositories(); + const RepoSet & repos() const { return _reposX; } + RepoSet & reposManip() { if ( ! _reposDirty ) _reposDirty = true; return _reposX; } + private: RepoManagerOptions _options; - RepoSet _repos; + RepoSet _reposX; ServiceSet _services; + DefaultIntegral<bool,false> _reposDirty; + private: friend Impl * rwcowClone<Impl>( const Impl * rhs ); /** clone for RWCOW_pointer */ @@ -703,7 +752,7 @@ // set the downloaded packages path for the repo repoInfo.setPackagesPath( packagescache_path_for_repoinfo(_options, repoInfo) ); // remember it - _repos.insert( repoInfo ); + _reposX.insert( repoInfo ); // direct access via _reposX in ctor! no reposManip. // detect orphaned repos belonging to a deleted service const std::string & serviceAlias( repoInfo.service() ); @@ -1063,6 +1112,7 @@ // ok we have the metadata, now exchange // the contents filesystem::exchange( tmpdir.path(), mediarootpath ); + reposManip(); // remember to trigger appdata refresh // we are done. return; @@ -1454,7 +1504,7 @@ MIL << "Try adding repo " << info << endl; RepoInfo tosave = info; - if ( _repos.find(tosave) != _repos.end() ) + if ( repos().find(tosave) != repos().end() ) ZYPP_THROW(RepoAlreadyExistsException(info)); // check the first url for now @@ -1501,7 +1551,7 @@ oinfo.setMetadataPath( metadataPath( tosave ) ); oinfo.setPackagesPath( packagesPath( tosave ) ); } - _repos.insert(tosave); + reposManip().insert(tosave); progress.set(90); @@ -1579,7 +1629,7 @@ MIL << "Saving " << (*it).alias() << endl; it->setFilepath(repofile.asString()); it->dumpAsIniOn(file); - _repos.insert(*it); + reposManip().insert(*it); HistoryLog(_options.rootDir).addRepository(*it); } @@ -1663,7 +1713,7 @@ // now delete metadata (#301037) cleanMetadata( todelete, mSubprogrcv ); cleanPackages( todelete, pSubprogrcv ); - _repos.erase(todelete); + reposManip().erase(todelete); MIL << todelete.alias() << " sucessfully deleted." << endl; HistoryLog(_options.rootDir).removeRepository(todelete); return; @@ -1723,8 +1773,8 @@ } newinfo.setFilepath(toedit.filepath()); - _repos.erase(toedit); - _repos.insert(newinfo); + reposManip().erase(toedit); + reposManip().insert(newinfo); HistoryLog(_options.rootDir).modifyRepository(toedit, newinfo); MIL << "repo " << alias << " modified" << endl; } @@ -1734,8 +1784,8 @@ RepoInfo RepoManager::Impl::getRepositoryInfo( const std::string & alias, const ProgressData::ReceiverFnc & progressrcv ) { - RepoConstIterator it( findAlias( alias, _repos ) ); - if ( it != _repos.end() ) + RepoConstIterator it( findAlias( alias, repos() ) ); + if ( it != repos().end() ) return *it; RepoInfo info; info.setAlias( alias ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/zypp/repo/RepoType.cc new/libzypp-14.29.4/zypp/repo/RepoType.cc --- old/libzypp-14.29.0/zypp/repo/RepoType.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.29.4/zypp/repo/RepoType.cc 2014-09-25 18:01:10.000000000 +0200 @@ -21,7 +21,7 @@ { static NamedValue<RepoType::Type> & table() { - static NamedValue<RepoType::Type> _t; + static NamedValue<RepoType::Type> & _t( *new NamedValue<RepoType::Type> ); if ( _t.empty() ) { _t( RepoType::RPMMD_e ) | "rpm-md" | "rpmmd"|"repomd"|"yum"|"up2date"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/zypp/sat/Queue.cc new/libzypp-14.29.4/zypp/sat/Queue.cc --- old/libzypp-14.29.0/zypp/sat/Queue.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.29.4/zypp/sat/Queue.cc 2014-09-23 17:08:59.000000000 +0200 @@ -58,7 +58,7 @@ Queue::const_iterator Queue::find( value_type val_r ) const { for_( it, begin(), end() ) - if ( *it != val_r ) + if ( *it == val_r ) return it; return end(); } @@ -96,11 +96,8 @@ void Queue::remove( value_type val_r ) { - const_iterator it( find( val_r ) ); - if ( it != end() ) - { + for ( const_iterator it( find( val_r ) ); it != end(); it = find( val_r ) ) ::queue_delete( _pimpl.get(), it - begin() ); - } } void Queue::push( value_type val_r ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/zypp/solver/detail/SATResolver.cc new/libzypp-14.29.4/zypp/solver/detail/SATResolver.cc --- old/libzypp-14.29.0/zypp/solver/detail/SATResolver.cc 2014-07-11 13:45:16.000000000 +0200 +++ new/libzypp-14.29.4/zypp/solver/detail/SATResolver.cc 2014-09-17 13:33:09.000000000 +0200 @@ -57,6 +57,25 @@ ///////////////////////////////////////////////////////////////////////// namespace zypp { /////////////////////////////////////////////////////////////////////// + + ///////////////////////////////////////////////////////////////////////// + namespace env + { + inline bool HACKENV( const char * var_r, bool default_r ) + { + bool ret = default_r; + const char * val = ::getenv( var_r ); + if ( val ) + { + ret = str::strToBool( val, default_r ); + if ( ret != default_r ) + INT << "HACKENV " << var_r << " = " << ret << endl; + } + return ret; + } + } // namespace env + ///////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////// namespace solver { ///////////////////////////////////////////////////////////////////// @@ -112,20 +131,33 @@ { os << "<resolver>" << endl; if (_solv) { - // os << " fixsystem = " << _solv->fixsystem << endl; - // os << " updatesystem = " << _solv->updatesystem << endl; - os << " allowdowngrade = " << solver_get_flag(_solv, SOLVER_FLAG_ALLOW_DOWNGRADE) << endl; - os << " allowarchchange = " << solver_get_flag(_solv, SOLVER_FLAG_ALLOW_ARCHCHANGE) << endl; - os << " allowvendorchange = " << solver_get_flag(_solv, SOLVER_FLAG_ALLOW_VENDORCHANGE) << endl; - os << " allowuninstall = " << solver_get_flag(_solv, SOLVER_FLAG_ALLOW_UNINSTALL) << endl; - os << " noupdateprovide = " << solver_get_flag(_solv, SOLVER_FLAG_NO_UPDATEPROVIDE) << endl; - os << " dosplitprovides = " << solver_get_flag(_solv, SOLVER_FLAG_SPLITPROVIDES) << endl; - os << " onlyRequires = " << solver_get_flag(_solv, SOLVER_FLAG_IGNORE_RECOMMENDED) << endl; - os << " ignorealreadyrecommended = " << !solver_get_flag(_solv, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED) << endl; - os << " distupgrade = " << _distupgrade << endl; - os << " distupgrade_removeunsupported = " << _distupgrade_removeunsupported << endl; - os << " solveSrcPackages = " << _solveSrcPackages << endl; - os << " cleandepsOnRemove = " << _cleandepsOnRemove << endl; +#define OUTS(X) os << " " << #X << "\t= " << solver_get_flag(_solv, SOLVER_FLAG_##X) << endl + OUTS( ALLOW_DOWNGRADE ); + OUTS( ALLOW_ARCHCHANGE ); + OUTS( ALLOW_VENDORCHANGE ); + OUTS( ALLOW_UNINSTALL ); + OUTS( NO_UPDATEPROVIDE ); + OUTS( SPLITPROVIDES ); + OUTS( IGNORE_RECOMMENDED ); + OUTS( ADD_ALREADY_RECOMMENDED ); + OUTS( NO_INFARCHCHECK ); + OUTS( ALLOW_NAMECHANGE ); + OUTS( KEEP_EXPLICIT_OBSOLETES ); + OUTS( BEST_OBEY_POLICY ); + OUTS( NO_AUTOTARGET ); + OUTS( DUP_ALLOW_DOWNGRADE ); + OUTS( DUP_ALLOW_ARCHCHANGE ); + OUTS( DUP_ALLOW_VENDORCHANGE ); + OUTS( DUP_ALLOW_NAMECHANGE ); + OUTS( KEEP_ORPHANS ); + OUTS( BREAK_ORPHANS ); + OUTS( FOCUS_INSTALLED ); + OUTS( YUM_OBSOLETES ); +#undef OUTS + os << " distupgrade = " << _distupgrade << endl; + os << " distupgrade_removeunsupported = " << _distupgrade_removeunsupported << endl; + os << " solveSrcPackages = " << _solveSrcPackages << endl; + os << " cleandepsOnRemove = " << _cleandepsOnRemove << endl; } else { os << "<NULL>"; } @@ -448,6 +480,13 @@ solver_set_flag(_solv, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide); solver_set_flag(_solv, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires); +#define HACKENV(X,D) solver_set_flag(_solv, X, env::HACKENV( #X, D ) ); + HACKENV( SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, true ); + HACKENV( SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, true ); + HACKENV( SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,true ); + HACKENV( SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, true ); +#undef HACKENV + sat::Pool::instance().prepareForSolving(); // Solve ! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/zypp/target/rpm/librpm.h new/libzypp-14.29.4/zypp/target/rpm/librpm.h --- old/libzypp-14.29.0/zypp/target/rpm/librpm.h 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.29.4/zypp/target/rpm/librpm.h 2014-09-22 14:25:09.000000000 +0200 @@ -28,6 +28,7 @@ #include <rpm/rpmmacro.h> #include <rpm/rpmdb.h> #include <rpm/rpmts.h> +#include <rpm/rpmfi.h> #include <fcntl.h> } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-14.29.0/zypp/target/rpm/librpmDb.cc new/libzypp-14.29.4/zypp/target/rpm/librpmDb.cc --- old/libzypp-14.29.0/zypp/target/rpm/librpmDb.cc 2014-07-01 11:30:28.000000000 +0200 +++ new/libzypp-14.29.4/zypp/target/rpm/librpmDb.cc 2014-09-22 14:25:09.000000000 +0200 @@ -679,7 +679,11 @@ if ( ! create( RPMDBI_PACKAGES ) ) return false; #warning TESTCASE: rpmdbAppendIterator and (non)sequential access? +#ifdef RPMFILEITERMAX // since rpm.4.12 + ::rpmdbAppendIterator( _mi, (const unsigned *)&off_r, 1 ); +#else ::rpmdbAppendIterator( _mi, &off_r, 1 ); +#endif return advance(); } -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org