Hello community, here is the log from the commit of package libzypp for openSUSE:Factory checked in at 2017-04-11 12:39:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzypp (Old) and /work/SRC/openSUSE:Factory/.libzypp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzypp" Tue Apr 11 12:39:54 2017 rev:377 rq:483824 version:16.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes 2017-03-21 22:47:30.492094508 +0100 +++ /work/SRC/openSUSE:Factory/.libzypp.new/libzypp.changes 2017-04-11 12:39:57.242755658 +0200 @@ -1,0 +2,20 @@ +Thu Mar 30 15:00:30 CEST 2017 - [email protected] + +- Recognize license tarball in rpmmd repos (FATE#316159) +- Fix media verification to properly propagate media access errors + (bsc#1031093) +- version 16.6.1 (0) + +------------------------------------------------------------------- +Mon Mar 27 17:10:52 CEST 2017 - [email protected] + +- Fix invalidation of PoolItems if Pool IDs are reused (bsc#1028661) +- version 16.6.0 (0) + +------------------------------------------------------------------- +Mon Mar 27 09:33:26 CEST 2017 - [email protected] + +- Fix X-libcurl-Empty-Header-Workaround (bsc#1030919) +- version 16.5.2 (0) + +------------------------------------------------------------------- Old: ---- libzypp-16.5.1.tar.bz2 New: ---- libzypp-16.6.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp.spec ++++++ --- /var/tmp/diff_new_pack.ptTfPN/_old 2017-04-11 12:39:58.098634727 +0200 +++ /var/tmp/diff_new_pack.ptTfPN/_new 2017-04-11 12:39:58.098634727 +0200 @@ -19,7 +19,7 @@ %define force_gcc_46 0 Name: libzypp -Version: 16.5.1 +Version: 16.6.1 Release: 0 Url: git://gitorious.org/opensuse/libzypp.git Summary: Package, Patch, Pattern, and Product Management ++++++ libzypp-16.5.1.tar.bz2 -> libzypp-16.6.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/VERSION.cmake new/libzypp-16.6.1/VERSION.cmake --- old/libzypp-16.5.1/VERSION.cmake 2017-03-21 13:41:10.000000000 +0100 +++ new/libzypp-16.6.1/VERSION.cmake 2017-03-30 15:01:09.000000000 +0200 @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "16") SET(LIBZYPP_COMPATMINOR "0") -SET(LIBZYPP_MINOR "5") +SET(LIBZYPP_MINOR "6") SET(LIBZYPP_PATCH "1") # -# LAST RELEASED: 16.5.1 (0) +# LAST RELEASED: 16.6.1 (0) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/package/libzypp.changes new/libzypp-16.6.1/package/libzypp.changes --- old/libzypp-16.5.1/package/libzypp.changes 2017-03-21 13:41:10.000000000 +0100 +++ new/libzypp-16.6.1/package/libzypp.changes 2017-03-30 15:01:09.000000000 +0200 @@ -1,4 +1,24 @@ ------------------------------------------------------------------- +Thu Mar 30 15:00:30 CEST 2017 - [email protected] + +- Recognize license tarball in rpmmd repos (FATE#316159) +- Fix media verification to properly propagate media access errors + (bsc#1031093) +- version 16.6.1 (0) + +------------------------------------------------------------------- +Mon Mar 27 17:10:52 CEST 2017 - [email protected] + +- Fix invalidation of PoolItems if Pool IDs are reused (bsc#1028661) +- version 16.6.0 (0) + +------------------------------------------------------------------- +Mon Mar 27 09:33:26 CEST 2017 - [email protected] + +- Fix X-libcurl-Empty-Header-Workaround (bsc#1030919) +- version 16.5.2 (0) + +------------------------------------------------------------------- Tue Mar 21 13:38:08 CET 2017 - [email protected] - MediaCurl: Treat http response 410(Gone) like 404(Not Found) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/tests/data/PoolReuseIds/SeqA/repo.xml new/libzypp-16.6.1/tests/data/PoolReuseIds/SeqA/repo.xml --- old/libzypp-16.5.1/tests/data/PoolReuseIds/SeqA/repo.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-16.6.1/tests/data/PoolReuseIds/SeqA/repo.xml 2017-03-27 17:16:07.000000000 +0200 @@ -0,0 +1,56 @@ +<channel><subchannel> +<package> + <name>package</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</package> +<patch> + <name>patch</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</patch> +<pattern> + <name>pattern</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</pattern> +<product> + <name>product</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</product> +<srcpackage> + <name>srcpackage</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</srcpackage> +<application> + <name>application</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</application> +</subchannel></channel> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/tests/data/PoolReuseIds/SeqA/solver-test.xml new/libzypp-16.6.1/tests/data/PoolReuseIds/SeqA/solver-test.xml --- old/libzypp-16.5.1/tests/data/PoolReuseIds/SeqA/solver-test.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-16.6.1/tests/data/PoolReuseIds/SeqA/solver-test.xml 2017-03-27 17:16:07.000000000 +0200 @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<test> +<setup arch="x86_64"> + <channel file="repo.xml" name="SEQA" priority="99" /> +</setup> +</test> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/tests/data/PoolReuseIds/SeqB/oper.xml new/libzypp-16.6.1/tests/data/PoolReuseIds/SeqB/oper.xml --- old/libzypp-16.5.1/tests/data/PoolReuseIds/SeqB/oper.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-16.6.1/tests/data/PoolReuseIds/SeqB/oper.xml 2017-03-27 17:16:07.000000000 +0200 @@ -0,0 +1,56 @@ +<channel><subchannel> +<application> + <name>application</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</application> +<package> + <name>package</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</package> +<patch> + <name>patch</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</patch> +<pattern> + <name>pattern</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</pattern> +<product> + <name>product</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</product> +<srcpackage> + <name>srcpackage</name> + <vendor>unkown</vendor> + <history><update> + <arch>x86_64</arch> + <version>4</version> + <release>1</release> + </update></history> +</srcpackage> +</subchannel></channel> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/tests/data/PoolReuseIds/SeqB/solver-test.xml new/libzypp-16.6.1/tests/data/PoolReuseIds/SeqB/solver-test.xml --- old/libzypp-16.5.1/tests/data/PoolReuseIds/SeqB/solver-test.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-16.6.1/tests/data/PoolReuseIds/SeqB/solver-test.xml 2017-03-27 17:16:07.000000000 +0200 @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<test> +<setup arch="x86_64"> + <channel file="oper.xml" name="SeqB" priority="99" /> +</setup> +</test> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/tests/zypp/CMakeLists.txt new/libzypp-16.6.1/tests/zypp/CMakeLists.txt --- old/libzypp-16.5.1/tests/zypp/CMakeLists.txt 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/tests/zypp/CMakeLists.txt 2017-03-27 17:16:07.000000000 +0200 @@ -16,6 +16,7 @@ Digest Deltarpm Edition + ExtendedPool Fetcher FileChecker Flags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/tests/zypp/ExtendedPool_test.cc new/libzypp-16.6.1/tests/zypp/ExtendedPool_test.cc --- old/libzypp-16.5.1/tests/zypp/ExtendedPool_test.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-16.6.1/tests/zypp/ExtendedPool_test.cc 2017-03-27 17:16:07.000000000 +0200 @@ -0,0 +1,85 @@ +#include <boost/test/auto_unit_test.hpp> + +#include <iostream> + +#include "TestSetup.h" +#include <zypp/base/LogTools.h> + +#include <zypp/ResObjects.h> +#include <zypp/ResPool.h> + +using boost::unit_test::test_case; +using std::cin; +using std::cout; +using std::cerr; +using std::endl; +using namespace zypp; + +static TestSetup test; + +void testcase_init() +{ +// cout << "+++[repoinit]=======================" << endl; + test.loadTestcaseRepos( TESTS_SRC_DIR"/data/PoolReuseIds/SeqA" ); +// for ( auto && pi : ResPool::instance() ) +// cout << pi << " " << pi.resolvable() << endl; +// cout << "---[repoinit]=======================" << endl; +} + +void testcase_init2() +{ +// cout << "+++[repoinit2]=======================" << endl; + sat::Pool::instance().reposEraseAll(); + test.loadTestcaseRepos( TESTS_SRC_DIR"/data/PoolReuseIds/SeqB" ); +// for ( auto && pi : ResPool::instance() ) +// cout << pi << " " << pi.resolvable() << endl; +// cout << "---[repoinit2]=======================" << endl; +} + +void checkpi( const PoolItem & pi ) +{ + BOOST_CHECK( pi.resolvable() ); + BOOST_CHECK_EQUAL( pi.id(), pi.resolvable()->id() ); + BOOST_CHECK_EQUAL( bool(asKind<Package>( pi.resolvable() )), isKind<Package>(pi) ); + BOOST_CHECK_EQUAL( bool(asKind<Patch>( pi.resolvable() )), isKind<Patch>(pi) ); + BOOST_CHECK_EQUAL( bool(asKind<Pattern>( pi.resolvable() )), isKind<Pattern>(pi) ); + BOOST_CHECK_EQUAL( bool(asKind<Product>( pi.resolvable() )), isKind<Product>(pi) ); + BOOST_CHECK_EQUAL( bool(asKind<SrcPackage>( pi.resolvable() )), isKind<SrcPackage>(pi) ); + BOOST_CHECK_EQUAL( bool(asKind<Application>( pi.resolvable() )), isKind<Application>(pi) ); +} + +void repocheck() +{ +// cout << "+++[repocheck]======================" << endl; + for ( auto && pi : ResPool::instance() ) + { +// cout << "??? " << pi << endl; + checkpi( pi ); + } +// cout << "---[repocheck]======================" << endl; +} + +/////////////////////////////////////////////////////////////////// +// Check that after ERASING ALL REPOS and loading a new one, ResPool +// actually creates new PoolItems rather than reusing already existing +// ones. +// +// Adding/removing repos will not reuse poolIDs unless actually all +// repos are removed from the pool. In this case ResPool must invalidate +// ALL existing PoolItems (especially the Resolvable Pointers inside). +// +// SeqA SeqB +// (1)package - (1)application +// (2)pattern - (2)package +// ... ... +// +// The two test repos have Resolvables of different kind in different +// order. If ResPool fails to recreate the PoolItem, we'll experience +// cast errors. PoolItem(1) will claim to be an application, but the +// Resolvable is still the original one created for a package... +/////////////////////////////////////////////////////////////////// + +BOOST_AUTO_TEST_CASE(t_1) { testcase_init(); } +BOOST_AUTO_TEST_CASE(t_2) { repocheck(); } +BOOST_AUTO_TEST_CASE(t_4) { testcase_init2(); } +BOOST_AUTO_TEST_CASE(t_5) { repocheck(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/tools/zypp-NameReqPrv.cc new/libzypp-16.6.1/tools/zypp-NameReqPrv.cc --- old/libzypp-16.5.1/tools/zypp-NameReqPrv.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/tools/zypp-NameReqPrv.cc 2017-03-23 16:01:07.000000000 +0100 @@ -28,7 +28,7 @@ } cerr << "Usage: " << appname << " [--root ROOTDIR] [OPTIONS] NAME... [[OPTIONS] NAME...]..." << endl; cerr << " Load all enabled repositories (no refresh) and search for" << endl; - cerr << " occurrences of NAME (regex) in package names or dependencies" << endl; + cerr << " occurrences of NAME (regex or -x) in package names or dependencies" << endl; cerr << " --root Load repos from the system located below ROOTDIR. If ROOTDIR" << endl; cerr << " denotes a sover testcase, the testcase is loaded." << endl; cerr << " --installed Process installed packages only." << endl; @@ -43,6 +43,7 @@ cerr << " -e/-E turn on/off looking for enhan./sugg.(default off)" << endl; cerr << " -a short for -n -p -r" << endl; cerr << " -A short for -n -P -R" << endl; + cerr << " -x do exact matching (glob) rather than regex (substring)" << endl; cerr << " -D <pkg> dump dependencies of <pkg>" << endl; cerr << "" << endl; return exit_r; @@ -195,6 +196,7 @@ /////////////////////////////////////////////////////////////////// bool ignorecase ( true ); + bool matechexact ( false ); bool names ( true ); bool provides ( false ); bool requires ( false ); @@ -204,6 +206,7 @@ bool supplements ( false ); bool enhacements ( false ); + for ( ; argc; --argc,++argv ) { if ( (*argv)[0] == '-' ) @@ -223,6 +226,7 @@ break; case 'i': ignorecase = true; break; case 'I': ignorecase = false; break; + case 'x': matechexact = true; break; case 'n': names = true; break; case 'N': names = false; break; case 'r': requires = true; break; @@ -271,7 +275,10 @@ else q.addString( qstr ); - q.setMatchRegex(); + if ( matechexact ) + q.setMatchGlob(); + else + q.setMatchRegex(); q.setCaseSensitive( ! ignorecase ); if ( names ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/tools/zypp-install.cc new/libzypp-16.6.1/tools/zypp-install.cc --- old/libzypp-16.5.1/tools/zypp-install.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-16.6.1/tools/zypp-install.cc 2017-03-23 16:01:07.000000000 +0100 @@ -0,0 +1,270 @@ +// +// g++ -Wall -std=c++11 zypp-install.cc -l zypp -o zypp-install +// +// A small (and simple) demo which walks through zypp, initializing +// and refreshing the repos, selecting packages ('zypper dup'), +// resolving dependencies and finally comitting/installing the +// result (in dry-run mode). +// +// No callbacks, questions or fancy output during commit, but it will +// do a 'zypper dup' if you'd remove the DryRun and DownloadOnly flag. +// +// So be careful if running it as root. +// +#include <iostream> + +#define TEST_DEBUGLOG 0 + +#if ( TEST_DEBUGLOG ) +#include <zypp/base/LogControl.h> +#endif +#include <zypp/ZYppFactory.h> +#include <zypp/RepoManager.h> +#include <zypp/ResPool.h> + +using std::cin; +using std::cout; +using std::cerr; +using std::endl; +using namespace zypp; + +//////////////////////////////////////////////////////////////////////////////// +int main( int argc, char * argv[] ) +try { + --argc; + ++argv; +#if ( TEST_DEBUGLOG ) +#warning debug log is on + base::LogControl::instance().logfile( "/tmp/zypp-install.log" ); +#endif + + Pathname sysRoot( "/" ); + ZYpp::Ptr zypp = getZYpp(); // acquire initial zypp lock + + //////////////////////////////////////////////////////////////////////////////// + // init Target: + { + cout << "Initialize target at " << sysRoot << endl; + zypp->initializeTarget( sysRoot ); // initialize target + cout << "Loading target resolvables" << endl; + zypp->getTarget()->load(); // load installed packages to pool + } + + //////////////////////////////////////////////////////////////////////////////// + // init Repos: + { + RepoManager repoManager( sysRoot ); + + // sync the current repo set + for ( RepoInfo & nrepo : repoManager.knownRepositories() ) + { + if ( ! nrepo.enabled() ) + continue; + + // Often volatile media are sipped in automated environments + // to avoid media chagne requests: + if ( nrepo.url().schemeIsVolatile() ) + continue; + + bool refreshNeeded = false; + if ( nrepo.autorefresh() ) // test whether to autorefresh repo metadata + { + for ( const Url & url : nrepo.baseUrls() ) + { + try + { + if ( repoManager.checkIfToRefreshMetadata( nrepo, url ) == RepoManager::REFRESH_NEEDED ) + { + cout << "Need to autorefresh repo " << nrepo.alias() << endl; + refreshNeeded = true; + } + break; // exit after first successful checkIfToRefreshMetadata + } + catch ( const Exception & exp ) + {} // Url failed, try next one... + } + // If all urls failed we can leave it to the code below to + // fail if access is actually needed and still failing. + // (missing metadata, package download, ...) + } + + // initial metadata download or cache refresh + if ( ! repoManager.isCached( nrepo ) || refreshNeeded ) + { + cout << "Refreshing repo " << nrepo << endl; + if ( repoManager.isCached( nrepo ) ) + { + repoManager.cleanCache( nrepo ); + } + repoManager.refreshMetadata( nrepo ); + repoManager.buildCache( nrepo ); + } + + // load cache + try + { + cout << "Loading resolvables from " << nrepo.alias() << endl; + repoManager.loadFromCache( nrepo );// load available packages to pool + } + catch ( const Exception & exp ) + { + // cachefile has old fomat (or is corrupted): try yo rebuild it + repoManager.cleanCache( nrepo ); + repoManager.buildCache( nrepo ); + repoManager.loadFromCache( nrepo ); + } + } + } + + cout << zypp->pool() << endl; + cout << "=====[pool ready]==============================" << endl; + + //////////////////////////////////////////////////////////////////////////////// + // GO... + //////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////// + // Select package to install... + // For demo purpose do 'zypper dup' + // otherwise select manually whatever you need... + zypp->resolver()->doUpgrade(); + + + //////////////////////////////////////////////////////////////////////////////// + // solve selection... + { + cout << "Solving dependencies..." << endl; + + unsigned attempt = 0; + while ( ! zypp->resolver()->resolvePool() ) + { + ++attempt; + cout << "Solving dependencies: " << attempt << ". attempt failed" << endl; + const ResolverProblemList & problems( zypp->resolver()->problems() ); + cout << problems.size() << " problems found..." << endl; + // Problem: + // ============================== + // kdepim3-3.5.10-29.1.4.x86_64 requires libsasl2.so.2()(64bit), but this requirement + // cannot be provided deleted providers: cyrus-sasl-2.1.25-28.1.2.x86_64 + // ------------------------------ + // Solution: + // keep obsolete cyrus-sasl-2.1.25-28.1.2.x86_64 + // Solution: + // remove lock to allow removal of kdepim3-3.5.10-29.1.4.x86_64 + // Solution: + // remove lock to allow removal of kdepim3-3.5.10-29.1.4.x86_64 + // Solution: + // break kdepim3-3.5.10-29.1.4.x86_64 by ignoring some of its dependencies + + ProblemSolutionList totry; // only needed if you (interactively) resolve problems... + + unsigned probNo = 0; + for ( const auto & probPtr : problems ) + { + cout << "Problem " << ++probNo << ": " << probPtr->description() << endl; + + const ProblemSolutionList & solutions = probPtr->solutions(); + unsigned solNo = 0; + for ( const auto & solPtr : solutions ) + { + cout << " Solution " << ++solNo << ": " << solPtr->description() << endl; + } + + // if you (interactively) resolve problems pick 1 solution per problem + // and store it int the totry list. After having applied the selected + // start a new attempt. + // + // It's not necessary to process all problems. You can pick a solution + // for the first problem and retry immediately. Often one solution actually + // resolves more than one reported problem. + // + // totry.push_back( solPtr ); + } + + + if ( ! totry.empty() ) + { + cout << "Apply selected solutions..." << endl; + zypp->resolver()->applySolutions( totry ); + cout << "Solving dependencies..." << endl; + continue; + } + // otherwise give up + throw "Solving dependencies failed: Giving up!"; + } + cout << "Dependencies solved" << endl; + } + + //////////////////////////////////////////////////////////////////////////////// + // printing some stats... + if ( false ) + { + cout << "PoolItem summary (individual packages):" << endl; + for ( const PoolItem & pi : zypp->pool() ) + { + if ( pi.status().transacts() ) + cout << " " << pi << endl; + } + } + else + { + cout << "Selectable summary (grouped by name):" << endl; + for ( const ui::Selectable_Ptr & sel : zypp->pool().proxy() ) + { + if ( sel->toModify() ) + cout << " " << sel << endl; + } + } + + //////////////////////////////////////////////////////////////////////////////// + // finally commit.. + { + cout << "Going to commit..." << endl; + // dryRun and DownloadOnly will cause commit to skip + // transaction steps, so you want to check for 'noError' + // rather than 'allDone'. + bool dryRunEtc = false; + + ZYppCommitPolicy policy; + if ( true ) + { + policy.dryRun( true ); + dryRunEtc = true; + } + if ( true ) + { + policy.downloadMode( DownloadOnly ); + dryRunEtc = true; + } + + try + { + ZYppCommitResult result = zypp->commit( policy ); // go.... + if ( ! ( result.allDone() || ( dryRunEtc && result.noError() ) ) ) + { + throw "Incomplete commit!"; + // ZYppCommitResult offers access to the TransactionStepList + // where you can see which packages have been processed and + // which not. + } + cout << "Commit succeeded" << endl; + } + catch ( const Exception & exp ) + { + cout << "Commit aborted with exception:" << endl; + throw; + } + } + cout << "[bye]: " << endl; + return 0; +} +catch ( const Exception & exp ) +{ cerr << exp << endl << exp.historyAsString(); exit( 91 ); } +catch ( const std::exception & exp ) +{ cerr << exp.what() << endl; exit( 92 ); } +catch ( const char * exp ) +{ cerr << (exp?exp:"Oops!") << endl; exit( 93 ); } +catch (...) +{ cerr << "Oops!" << endl; exit( 94 ); } + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/RepoInfo.cc new/libzypp-16.6.1/zypp/RepoInfo.cc --- old/libzypp-16.5.1/zypp/RepoInfo.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/zypp/RepoInfo.cc 2017-03-30 15:01:09.000000000 +0200 @@ -17,6 +17,7 @@ #include "zypp/parser/xml/XmlEscape.h" #include "zypp/RepoInfo.h" +#include "zypp/Glob.h" #include "zypp/TriBool.h" #include "zypp/Pathname.h" #include "zypp/ZConfig.h" @@ -71,8 +72,22 @@ } public: + /** Path to a license tarball in case it exists in the repo. */ Pathname licenseTgz() const - { return metadatapath.empty() ? Pathname() : metadatapath / path / "license.tar.gz"; } + { + Pathname ret; + if ( !metadatapath.empty() ) + { + filesystem::Glob g; + g.add( metadatapath / path / "repodata/*license.tar.gz" ); + if ( g.empty() ) + g.add( metadatapath / path / "license.tar.gz" ); + + if ( !g.empty() ) + ret = *g.begin(); + } + return ret; + } const RepoVariablesReplacedUrlList & baseUrls() const { @@ -474,8 +489,7 @@ bool RepoInfo::hasLicense() const { - Pathname licenseTgz( _pimpl->licenseTgz() ); - return ! licenseTgz.empty() && PathInfo(licenseTgz).isFile(); + return !_pimpl->licenseTgz().empty(); } bool RepoInfo::needToAcceptLicense() const @@ -483,8 +497,8 @@ static const std::string noAcceptanceFile = "no-acceptance-needed\n"; bool accept = true; - Pathname licenseTgz( _pimpl->licenseTgz() ); - if ( licenseTgz.empty() || ! PathInfo( licenseTgz ).isFile() ) + const Pathname & licenseTgz( _pimpl->licenseTgz() ); + if ( licenseTgz.empty() ) return false; // no licenses at all ExternalProgram::Arguments cmd; @@ -551,8 +565,8 @@ LocaleSet RepoInfo::getLicenseLocales() const { - Pathname licenseTgz( _pimpl->licenseTgz() ); - if ( licenseTgz.empty() || ! PathInfo( licenseTgz ).isFile() ) + const Pathname & licenseTgz( _pimpl->licenseTgz() ); + if ( licenseTgz.empty() ) return LocaleSet(); ExternalProgram::Arguments cmd; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/base/LogTools.h new/libzypp-16.6.1/zypp/base/LogTools.h --- old/libzypp-16.5.1/zypp/base/LogTools.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/zypp/base/LogTools.h 2017-03-29 16:16:10.000000000 +0200 @@ -114,8 +114,53 @@ std::ostream & dumpRangeLine( std::ostream & str, TIterator begin, TIterator end ) { return dumpRange( str, begin, end, "(", "", ", ", "", ")" ); } + /** \overload for container */ + template<class TContainer> + std::ostream & dumpRangeLine( std::ostream & str, const TContainer & cont ) + { return dumpRangeLine( str, cont.begin(), cont.end() ); } + /////////////////////////////////////////////////////////////////// + namespace iomanip + { + /////////////////////////////////////////////////////////////////// + /// \class RangeLine<TIterator> + /// \brief Iomanip helper printing dumpRangeLine style + /////////////////////////////////////////////////////////////////// + template<class TIterator> + struct RangeLine + { + RangeLine( TIterator begin, TIterator end ) + : _begin( begin ) + , _end( end ) + {} + TIterator _begin; + TIterator _end; + }; + + /** \relates RangeLine<TIterator> */ + template<class TIterator> + std::ostream & operator<<( std::ostream & str, const RangeLine<TIterator> & obj ) + { return dumpRangeLine( str, obj._begin, obj._end ); } + + } // namespce iomanip + /////////////////////////////////////////////////////////////////// + + /** Iomanip printing dumpRangeLine style + * \code + * std::vector<int> c( { 1, 1, 2, 3, 5, 8 } ); + * std::cout << rangeLine(c) << std::endl; + * -> (1, 1, 2, 3, 5, 8) + * \endcode + */ + template<class TIterator> + iomanip::RangeLine<TIterator> rangeLine( TIterator begin, TIterator end ) + { return iomanip::RangeLine<TIterator>( begin, end ); } + /** \overload for container */ + template<class TContainer> + auto rangeLine( const TContainer & cont ) -> decltype( rangeLine( cont.begin(), cont.end() ) ) + { return rangeLine( cont.begin(), cont.end() ); } + template<class Tp> std::ostream & operator<<( std::ostream & str, const std::vector<Tp> & obj ) { return dumpRange( str, obj.begin(), obj.end() ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/media/MediaManager.cc new/libzypp-16.6.1/zypp/media/MediaManager.cc --- old/libzypp-16.5.1/zypp/media/MediaManager.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/zypp/media/MediaManager.cc 2017-03-29 11:31:09.000000000 +0200 @@ -82,32 +82,21 @@ } } - inline void - checkDesired(MediaAccessId id) + inline void checkDesired( MediaAccessId id ) { - checkAttached(id); + checkAttached( id ); - if( !desired) + if ( !desired ) { - try { - desired = verifier->isDesiredMedia(handler); - } - catch(const zypp::Exception &e) { - ZYPP_CAUGHT(e); - desired = false; - } + desired = verifier->isDesiredMedia(handler); - if( !desired) + if( !desired ) { - DBG << "checkDesired(" << id << "): not desired (report by " - << verifier->info() << ")" << std::endl; - ZYPP_THROW(MediaNotDesiredException( - handler->url() - )); + DBG << "checkDesired(" << id << "): not desired (report by " << verifier->info() << ")" << std::endl; + ZYPP_THROW( MediaNotDesiredException( handler->url() ) ); } - DBG << "checkDesired(" << id << "): desired (report by " - << verifier->info() << ")" << std::endl; + DBG << "checkDesired(" << id << "): desired (report by " << verifier->info() << ")" << std::endl; } else { DBG << "checkDesired(" << id << "): desired (cached)" << std::endl; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/media/UrlResolverPlugin.cc new/libzypp-16.6.1/zypp/media/UrlResolverPlugin.cc --- old/libzypp-16.5.1/zypp/media/UrlResolverPlugin.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/zypp/media/UrlResolverPlugin.cc 2017-03-27 09:52:47.000000000 +0200 @@ -68,7 +68,7 @@ std::pair<std::string, std::string> values(*it); // curl resets headers that are empty, so we use a workaround if (values.second.empty()) { - values.second = "\nX-libcurl-Empty-Header-Workaround: *"; + values.second = "\r\nX-libcurl-Empty-Header-Workaround: *"; } headers.insert(values); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/pool/PoolImpl.h new/libzypp-16.6.1/zypp/pool/PoolImpl.h --- old/libzypp-16.5.1/zypp/pool/PoolImpl.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/zypp/pool/PoolImpl.h 2017-03-27 17:16:07.000000000 +0200 @@ -306,6 +306,7 @@ { sat::Pool pool( satpool() ); bool addedItems = false; + bool reusedIDs = _watcherIDs.remember( pool.serialIDs() ); std::list<PoolItem> addedProducts; _store.resize( pool.capacity() ); @@ -321,7 +322,7 @@ // the PoolItem got invalidated (e.g unloaded repo) pi = PoolItem(); } - else if ( s && ! pi ) + else if ( reusedIDs || (s && ! pi) ) { // new PoolItem to add pi = PoolItem::makePoolItem( s ); // the only way to create a new one! @@ -398,6 +399,8 @@ private: /** Watch sat pools serial number. */ SerialNumberWatcher _watcher; + /** Watch sat pools Serial number of IDs - changes whenever resusePoolIDs==true - ResPool must also invalidate it's PoolItems! */ + SerialNumberWatcher _watcherIDs; mutable ContainerT _store; mutable DefaultIntegral<bool,true> _storeDirty; mutable Id2ItemT _id2item; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/sat/Pool.cc new/libzypp-16.6.1/zypp/sat/Pool.cc --- old/libzypp-16.5.1/zypp/sat/Pool.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/zypp/sat/Pool.cc 2017-03-27 17:16:07.000000000 +0200 @@ -55,6 +55,9 @@ const SerialNumber & Pool::serial() const { return myPool().serial(); } + const SerialNumber & Pool::serialIDs() const + { return myPool().serialIDs(); } + void Pool::prepare() const { return myPool().prepare(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/sat/Pool.h new/libzypp-16.6.1/zypp/sat/Pool.h --- old/libzypp-16.5.1/zypp/sat/Pool.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/zypp/sat/Pool.h 2017-03-27 17:16:07.000000000 +0200 @@ -64,6 +64,9 @@ /** Housekeeping data serial number. */ const SerialNumber & serial() const; + /** Serial number changing whenever resusePoolIDs==true was used. ResPool must also invalidate it's PoolItems! */ + const SerialNumber & serialIDs() const; + /** Update housekeeping data if necessary (e.g. whatprovides). */ void prepare() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/sat/detail/PoolImpl.cc new/libzypp-16.6.1/zypp/sat/detail/PoolImpl.cc --- old/libzypp-16.5.1/zypp/sat/detail/PoolImpl.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.6.1/zypp/sat/detail/PoolImpl.cc 2017-03-27 17:16:07.000000000 +0200 @@ -313,7 +313,10 @@ // If the last repo is removed clear the pool to actually reuse all IDs. // NOTE: the explicit ::repo_free above asserts all solvables are memset(0)! if ( !_pool->urepos ) + { + _serialIDs.setDirty(); // Indicate resusePoolIDs - ResPool must also invalidate it's PoolItems ::pool_freeallrepos( _pool, /*resusePoolIDs*/true ); + } } int PoolImpl::_addSolv( CRepo * repo_r, FILE * file_r ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.5.1/zypp/sat/detail/PoolImpl.h new/libzypp-16.6.1/zypp/sat/detail/PoolImpl.h --- old/libzypp-16.5.1/zypp/sat/detail/PoolImpl.h 2017-01-26 13:07:00.000000000 +0100 +++ new/libzypp-16.6.1/zypp/sat/detail/PoolImpl.h 2017-03-27 17:16:07.000000000 +0200 @@ -66,6 +66,10 @@ const SerialNumber & serial() const { return _serial; } + /** Serial number changing whenever resusePoolIDs==true was used. ResPool must also invalidate it's PoolItems! */ + const SerialNumber & serialIDs() const + { return _serialIDs; } + /** Update housekeeping data (e.g. whatprovides). * \todo actually requires a watcher. */ @@ -311,8 +315,10 @@ private: /** sat-pool. */ CPool * _pool; - /** Serial number. */ + /** Serial number - changes with each Pool content change. */ SerialNumber _serial; + /** Serial number of IDs - changes whenever resusePoolIDs==true - ResPool must also invalidate it's PoolItems! */ + SerialNumber _serialIDs; /** Watch serial number. */ SerialNumberWatcher _watcher; /** Additional \ref RepoInfo. */
