Hello community, here is the log from the commit of package libzypp for openSUSE:Factory checked in at 2017-05-20 10:08:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzypp (Old) and /work/SRC/openSUSE:Factory/.libzypp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libzypp" Sat May 20 10:08:29 2017 rev:380 rq:494827 version:16.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes 2017-05-04 08:51:37.492488080 +0200 +++ /work/SRC/openSUSE:Factory/.libzypp.new/libzypp.changes 2017-05-20 10:08:43.461753686 +0200 @@ -1,0 +2,16 @@ +Fri May 12 11:36:52 CEST 2017 - ma@suse.de + +- add identIsAutoInstalled convenience methods +- make gcc6 happy +- version 16.11.0 (0) + +------------------------------------------------------------------- +Thu May 11 15:23:28 CEST 2017 - ma@suse.de + +- Use a common workflow for downloading packages and srcpackages. + This includes a common way of handling and reposrting gpg signature + and checks. (bsc#1037210) +- PackageProvider: as well support downloading SrcPackage (for bsc#1037210) +- version 16.10.0 (0) + +------------------------------------------------------------------- Old: ---- libzypp-16.9.0.tar.bz2 New: ---- libzypp-16.11.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp.spec ++++++ --- /var/tmp/diff_new_pack.LHSO84/_old 2017-05-20 10:08:44.233644620 +0200 +++ /var/tmp/diff_new_pack.LHSO84/_new 2017-05-20 10:08:44.237644054 +0200 @@ -19,7 +19,7 @@ %define force_gcc_46 0 Name: libzypp -Version: 16.9.0 +Version: 16.11.0 Release: 0 Url: git://gitorious.org/opensuse/libzypp.git Summary: Package, Patch, Pattern, and Product Management ++++++ libzypp-16.9.0.tar.bz2 -> libzypp-16.11.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/VERSION.cmake new/libzypp-16.11.0/VERSION.cmake --- old/libzypp-16.9.0/VERSION.cmake 2017-04-27 16:06:07.000000000 +0200 +++ new/libzypp-16.11.0/VERSION.cmake 2017-05-12 11:41:09.000000000 +0200 @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "16") SET(LIBZYPP_COMPATMINOR "0") -SET(LIBZYPP_MINOR "9") +SET(LIBZYPP_MINOR "11") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 16.9.0 (0) +# LAST RELEASED: 16.11.0 (0) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/package/libzypp.changes new/libzypp-16.11.0/package/libzypp.changes --- old/libzypp-16.9.0/package/libzypp.changes 2017-04-27 16:06:07.000000000 +0200 +++ new/libzypp-16.11.0/package/libzypp.changes 2017-05-12 11:41:09.000000000 +0200 @@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Fri May 12 11:36:52 CEST 2017 - ma@suse.de + +- add identIsAutoInstalled convenience methods +- make gcc6 happy +- version 16.11.0 (0) + +------------------------------------------------------------------- +Thu May 11 15:23:28 CEST 2017 - ma@suse.de + +- Use a common workflow for downloading packages and srcpackages. + This includes a common way of handling and reposrting gpg signature + and checks. (bsc#1037210) +- PackageProvider: as well support downloading SrcPackage (for bsc#1037210) +- version 16.10.0 (0) + +------------------------------------------------------------------- Thu Apr 27 16:03:32 CEST 2017 - ma@suse.de - PoolQuery: Treat explicit queries for 'kind:name' correctly diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/Package.cc new/libzypp-16.11.0/zypp/Package.cc --- old/libzypp-16.9.0/zypp/Package.cc 2017-02-03 13:41:11.000000000 +0100 +++ new/libzypp-16.11.0/zypp/Package.cc 2017-05-11 17:57:02.000000000 +0200 @@ -23,6 +23,47 @@ using namespace std; /////////////////////////////////////////////////////////////////// +namespace zyppintern +{ + using namespace zypp; + + inline bool schemeIsLocalDir( const Url & url_r ) + { + const std::string & s( url_r.getScheme() ); + return s == "dir" || s == "file"; + } + + // here and from SrcPackage.cc + Pathname cachedLocation( const OnMediaLocation & loc_r, const RepoInfo & repo_r ) + { + PathInfo pi( repo_r.packagesPath() / loc_r.filename() ); + + if ( ! pi.isExist() ) + return Pathname(); // no file in cache + + if ( loc_r.checksum().empty() ) + { + Url url( repo_r.url() ); + if ( ! schemeIsLocalDir( url ) ) + return Pathname(); // same name but no checksum to verify + + // for local repos compare with the checksum in repo + if ( CheckSum( CheckSum::md5Type(), std::ifstream( (url.getPathName() / loc_r.filename()).c_str() ) ) + != CheckSum( CheckSum::md5Type(), std::ifstream( pi.c_str() ) ) ) + return Pathname(); // same name but wrong checksum + } + else + { + if ( loc_r.checksum() != CheckSum( loc_r.checksum().type(), std::ifstream( pi.c_str() ) ) ) + return Pathname(); // same name but wrong checksum + } + + return pi.path(); // the right one + } +} // namespace zyppintern +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// @@ -160,42 +201,8 @@ OnMediaLocation Package::location() const { return lookupLocation(); } - namespace - { - bool schemeIsLocalDir( const Url & url_r ) - { - std::string s( url_r.getScheme() ); - return s == "dir" || s == "file"; - } - } - Pathname Package::cachedLocation() const - { - OnMediaLocation loc( location() ); - PathInfo pi( repoInfo().packagesPath() / loc.filename() ); - - if ( ! pi.isExist() ) - return Pathname(); // no file in cache - - if ( loc.checksum().empty() ) - { - Url url( repoInfo().url() ); - if ( ! schemeIsLocalDir( url ) ) - return Pathname(); // same name but no checksum to verify - - // for local repos compare with the checksum in repo - if ( CheckSum( CheckSum::md5Type(), std::ifstream( (url.getPathName() / loc.filename()).c_str() ) ) - != CheckSum( CheckSum::md5Type(), std::ifstream( pi.c_str() ) ) ) - return Pathname(); // same name but wrong checksum - } - else - { - if ( loc.checksum() != CheckSum( loc.checksum().type(), std::ifstream( pi.c_str() ) ) ) - return Pathname(); // same name but wrong checksum - } - - return pi.path(); // the right one - } + { return zyppintern::cachedLocation( location(), repoInfo() ); } std::string Package::sourcePkgName() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/PoolQuery.h new/libzypp-16.11.0/zypp/PoolQuery.h --- old/libzypp-16.9.0/zypp/PoolQuery.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.11.0/zypp/PoolQuery.h 2017-05-02 17:56:15.000000000 +0200 @@ -141,6 +141,13 @@ * By default, all kinds will be returned. If addKind() is used, * only the specified kinds will be returned (multiple kinds will be ORed). * + * \note This kind filter does not apply if you explicitly specify a ResKind + * when searching for \c sat::SolvAttr::name. The following will always match + * and include the kernel \c packages, no matter which kind filter is set. + * \code + * addDependency( sat::SolvAttr::name, "package:kernel" ); + * \endcode + * * Pass ResKind constants to this method, (e.g. ResKind::package). */ void addKind(const ResKind & kind); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/SrcPackage.cc new/libzypp-16.11.0/zypp/SrcPackage.cc --- old/libzypp-16.9.0/zypp/SrcPackage.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.11.0/zypp/SrcPackage.cc 2017-05-11 17:57:02.000000000 +0200 @@ -10,6 +10,14 @@ * */ #include "zypp/SrcPackage.h" +/////////////////////////////////////////////////////////////////// +namespace zyppintern +{ + using namespace zypp; + // in Package.cc + Pathname cachedLocation( const OnMediaLocation & loc_r, const RepoInfo & repo_r ); +} // namespace zyppintern +/////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// namespace zypp @@ -46,6 +54,9 @@ OnMediaLocation SrcPackage::location() const { return lookupLocation(); } + Pathname SrcPackage::cachedLocation() const + { return zyppintern::cachedLocation( location(), repoInfo() ); } + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/SrcPackage.h new/libzypp-16.11.0/zypp/SrcPackage.h --- old/libzypp-16.9.0/zypp/SrcPackage.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.11.0/zypp/SrcPackage.h 2017-05-11 17:57:02.000000000 +0200 @@ -42,6 +42,13 @@ /** location of resolvable in repo */ OnMediaLocation location() const; + /** Location of the downloaded package in cache or an empty path. */ + Pathname cachedLocation() const; + + /** Whether the package is cached. */ + bool isCached() const + { return ! cachedLocation().empty(); } + protected: friend Ptr make<Self>( const sat::Solvable & solvable_r ); /** Ctor */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/ZYppCallbacks.h new/libzypp-16.11.0/zypp/ZYppCallbacks.h --- old/libzypp-16.9.0/zypp/ZYppCallbacks.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.11.0/zypp/ZYppCallbacks.h 2017-05-11 17:57:02.000000000 +0200 @@ -171,7 +171,7 @@ /** Detail information about the result of a performed pkgGpgCheck. * * Userdata sent: - * \param "Package" Package::constPtr of the package + * \param "ResObject" ResObject::constPtr of the downloaded package (Package or SrcPackage) * \param "Localpath" Pathname to downloaded package on disk * \param "CheckPackageResult" RpmDb::CheckPackageResult of signature check * \param "CheckPackageDetail" RpmDb::CheckPackageDetail logmessages of rpm signature check @@ -179,6 +179,9 @@ * Userdata accepted: * \param "Action" DownloadResolvableReport::Action user advice how to behave on error (ABORT). * If you set just an empty value here, a default probelm report will be triggered. + * + * Legacy data: + * \param "Package" Replaced by \c "ResObject" in 16.10.0. Package::constPtr of the package (\c nullptr in case of a SrcPackage) */ virtual void pkgGpgCheck( const UserData & userData_r = UserData() ) {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/repo/PackageProvider.cc new/libzypp-16.11.0/zypp/repo/PackageProvider.cc --- old/libzypp-16.9.0/zypp/repo/PackageProvider.cc 2016-12-14 12:26:08.000000000 +0100 +++ new/libzypp-16.11.0/zypp/repo/PackageProvider.cc 2017-05-12 08:29:10.000000000 +0200 @@ -25,6 +25,7 @@ #include "zypp/ZConfig.h" #include "zypp/RepoInfo.h" #include "zypp/RepoManager.h" +#include "zypp/SrcPackage.h" #include "zypp/ZYppFactory.h" #include "zypp/Target.h" @@ -36,6 +37,15 @@ /////////////////////////////////////////////////////////////////// namespace zypp { + namespace env + { + bool YAST_IS_RUNNING() + { + static const char * envp = getenv( "YAST_IS_RUNNING" ); + return envp && *envp; + } + } + /////////////////////////////////////////////////////////////////// namespace repo { @@ -52,47 +62,58 @@ return false; } - /////////////////////////////////////////////////////////////////// /// \class PackageProvider::Impl - /// \brief PackageProvider implementation. + /// \brief PackageProvider implementation interface. /////////////////////////////////////////////////////////////////// - class PackageProvider::Impl : private base::NonCopyable + struct PackageProvider::Impl : private base::NonCopyable { + Impl() {} + virtual ~Impl() {} + + /** Provide the package. + * The basic workflow. + * \throws Exception. + */ + virtual ManagedFile providePackage() const = 0; + + /** Provide the package if it is cached. */ + virtual ManagedFile providePackageFromCache() const = 0; + + /** Whether the package is cached. */ + virtual bool isCached() const = 0; + }; + + /////////////////////////////////////////////////////////////////// + /// \class PackageProviderImpl<TPackage> + /// \brief PackageProvider implementation for \c Package and \c SrcPackage + /////////////////////////////////////////////////////////////////// + template <class TPackage> + class PackageProviderImpl : public PackageProvider::Impl + { + typedef typename TPackage::constPtr TPackagePtr; // Package or SrcPackage typedef callback::UserData UserData; public: /** Ctor taking the Package to provide. */ - Impl( RepoMediaAccess & access_r, - const Package::constPtr & package_r, - const DeltaCandidates & deltas_r, - const PackageProviderPolicy & policy_r ) + PackageProviderImpl( RepoMediaAccess & access_r, const TPackagePtr & package_r, + const PackageProviderPolicy & policy_r ) : _policy( policy_r ) , _package( package_r ) - , _deltas( deltas_r ) , _access( access_r ) , _retry(false) {} - virtual ~Impl() {} - - /** Factory method providing the appropriate implementation. - * Called by PackageProvider ctor. Returned pointer should be - * immediately wrapped into a smartpointer. - */ - static Impl * factoryMake( RepoMediaAccess & access_r, - const Package::constPtr & package_r, - const DeltaCandidates & deltas_r, - const PackageProviderPolicy & policy_r ); + virtual ~PackageProviderImpl() {} public: /** Provide the package. * The basic workflow. * \throws Exception. */ - ManagedFile providePackage() const; + virtual ManagedFile providePackage() const; /** Provide the package if it is cached. */ - ManagedFile providePackageFromCache() const + virtual ManagedFile providePackageFromCache() const { ManagedFile ret( doProvidePackageFromCache() ); if ( ! ( ret->empty() || _package->repoInfo().keepPackages() ) ) @@ -101,24 +122,22 @@ } /** Whether the package is cached. */ - bool isCached() const + virtual bool isCached() const { return ! doProvidePackageFromCache()->empty(); } protected: - typedef PackageProvider::Impl Base; + typedef PackageProviderImpl<TPackage> Base; typedef callback::SendReportrepo::DownloadResolvableReport Report; /** Lookup the final rpm in cache. * - * A non empty ManagedFile will be returned to the caller. + * A cache hit will return a non empty ManagedFile and an empty one on cache miss. * * \note File disposal depending on the repos keepPackages setting * are not set here, but in \ref providePackage or \ref providePackageFromCache. - * - * \note The provoided default implementation returns an empty ManagedFile - * (cache miss). */ - virtual ManagedFile doProvidePackageFromCache() const = 0; + ManagedFile doProvidePackageFromCache() const + { return ManagedFile( _package->cachedLocation() ); } /** Actually provide the final rpm. * Report start/problem/finish and retry loop are hadled by \ref providePackage. @@ -134,7 +153,15 @@ * \note The provided default implementation retrieves the packages default * location. */ - virtual ManagedFile doProvidePackage() const = 0; + virtual ManagedFile doProvidePackage() const + { + ManagedFile ret; + OnMediaLocation loc = _package->location(); + + ProvideFilePolicy policy; + policy.progressCB( bind( &Base::progressPackageDownload, this, _1 ) ); + return _access.provideFile( _package->repoInfo(), loc, policy ); + } protected: /** Access to the DownloadResolvableReport */ @@ -196,8 +223,7 @@ protected: PackageProviderPolicy _policy; - Package::constPtr _package; - DeltaCandidates _deltas; + TPackagePtr _package; RepoMediaAccess & _access; private: @@ -220,24 +246,8 @@ }; /////////////////////////////////////////////////////////////////// - /** Default implementation (cache miss). */ - ManagedFile PackageProvider::Impl::doProvidePackageFromCache() const - { return ManagedFile(); } - - /** Default implementation (provide full package) */ - ManagedFile PackageProvider::Impl::doProvidePackage() const - { - ManagedFile ret; - OnMediaLocation loc = _package->location(); - - ProvideFilePolicy policy; - policy.progressCB( bind( &Base::progressPackageDownload, this, _1 ) ); - return _access.provideFile( _package->repoInfo(), loc, policy ); - } - - /////////////////////////////////////////////////////////////////// - - ManagedFile PackageProvider::Impl::providePackage() const + template <class TPackage> + ManagedFile PackageProviderImpl<TPackage>::providePackage() const { ScopedGuard guardReport( newReport() ); @@ -299,15 +309,20 @@ { ret = doProvidePackage(); - if ( info.pkgGpgCheck() ) + if ( info.pkgGpgCheck() +#warning bsc1037210 disabled SrcPackage signature check if YAST_IS_RUNNING - waiting for yast to be fixed + && !( env::YAST_IS_RUNNING() && isKind<SrcPackage>( _package ) ) ) { UserData userData( "pkgGpgCheck" ); - userData.set( "Package", _package ); + ResObject::constPtr roptr( _package ); // gcc6 needs it more explcit. Has problem deducing + userData.set( "ResObject", roptr ); // a type for '_package->asKind<ResObject>()'... + /*legacy:*/userData.set( "Package", roptr->asKind<Package>() ); userData.set( "Localpath", ret.value() ); RpmDb::CheckPackageResult res = packageSigCheck( ret, userData ); // publish the checkresult, even if it is OK. Apps may want to report something... report()->pkgGpgCheck( userData ); -USR << "CHK: " << res << endl; + DBG << "CHK: " << res << endl; + if ( res != RpmDb::CHK_OK ) { if ( userData.hasvalue( "Action" ) ) // pkgGpgCheck report provided an user error action @@ -407,21 +422,20 @@ /////////////////////////////////////////////////////////////////// /// \class RpmPackageProvider - /// \brief RPM PackageProvider implementation. + /// \brief RPM PackageProvider implementation (with deltarpm processing). /////////////////////////////////////////////////////////////////// - class RpmPackageProvider : public PackageProvider::Impl + class RpmPackageProvider : public PackageProviderImpl<Package> { public: RpmPackageProvider( RepoMediaAccess & access_r, const Package::constPtr & package_r, const DeltaCandidates & deltas_r, const PackageProviderPolicy & policy_r ) - : PackageProvider::Impl( access_r, package_r, deltas_r, policy_r ) + : PackageProviderImpl<Package>( access_r, package_r, policy_r ) + , _deltas( deltas_r ) {} protected: - virtual ManagedFile doProvidePackageFromCache() const; - virtual ManagedFile doProvidePackage() const; private: @@ -437,14 +451,12 @@ bool queryInstalled( const Edition & ed_r = Edition() ) const { return _policy.queryInstalled( _package->name(), ed_r, _package->arch() ); } + + private: + DeltaCandidates _deltas; }; /////////////////////////////////////////////////////////////////// - ManagedFile RpmPackageProvider::doProvidePackageFromCache() const - { - return ManagedFile( _package->cachedLocation() ); - } - ManagedFile RpmPackageProvider::doProvidePackage() const { Url url; @@ -524,56 +536,59 @@ return ManagedFile( destination, filesystem::unlink ); } -#if 0 /////////////////////////////////////////////////////////////////// - /// \class PluginPackageProvider - /// \brief Plugin PackageProvider implementation. - /// - /// Basically downloads the default package and calls a - /// 'stem'2rpm plugin to cteate the final .rpm package. + // class PackageProvider /////////////////////////////////////////////////////////////////// - class PluginPackageProvider : public PackageProvider::Impl + namespace factory { - public: - PluginPackageProvider( const std::string & stem_r, - RepoMediaAccess & access_r, - const Package::constPtr & package_r, - const DeltaCandidates & deltas_r, - const PackageProviderPolicy & policy_r ) - : Base( access_r, package_r, deltas_r, policy_r ) - {} - - protected: - virtual ManagedFile doProvidePackageFromCache() const + inline PackageProvider::Impl * make( RepoMediaAccess & access_r, const PoolItem & pi_r, + const DeltaCandidates & deltas_r, + const PackageProviderPolicy & policy_r ) { - return Base::doProvidePackageFromCache(); + if ( pi_r.isKind<Package>() ) + return new RpmPackageProvider( access_r, pi_r->asKind<Package>(), deltas_r, policy_r ); + else if ( pi_r.isKind<SrcPackage>() ) + return new PackageProviderImpl<SrcPackage>( access_r, pi_r->asKind<SrcPackage>(), policy_r ); + else + ZYPP_THROW( Exception( str::Str() << "Don't know how to cache non-package " << pi_r.asUserString() ) ); } - virtual ManagedFile doProvidePackage() const + inline PackageProvider::Impl * make( RepoMediaAccess & access_r, const PoolItem & pi_r, + const PackageProviderPolicy & policy_r ) { - return Base::doProvidePackage(); + if ( pi_r.isKind<Package>() ) + return new PackageProviderImpl<Package>( access_r, pi_r->asKind<Package>(), policy_r ); + else if ( pi_r.isKind<SrcPackage>() ) + return new PackageProviderImpl<SrcPackage>( access_r, pi_r->asKind<SrcPackage>(), policy_r ); + else + ZYPP_THROW( Exception( str::Str() << "Don't know how to cache non-package " << pi_r.asUserString() ) ); } - }; - /////////////////////////////////////////////////////////////////// -#endif - /////////////////////////////////////////////////////////////////// - // class PackageProvider + inline PackageProvider::Impl * make( RepoMediaAccess & access_r, const Package::constPtr & package_r, + const DeltaCandidates & deltas_r, + const PackageProviderPolicy & policy_r ) + { return new RpmPackageProvider( access_r, package_r, deltas_r, policy_r ); } + + } // namespace factory /////////////////////////////////////////////////////////////////// - PackageProvider::Impl * PackageProvider::Impl::factoryMake( RepoMediaAccess & access_r, - const Package::constPtr & package_r, - const DeltaCandidates & deltas_r, - const PackageProviderPolicy & policy_r ) - { - return new RpmPackageProvider( access_r, package_r, deltas_r, policy_r ); - } + PackageProvider::PackageProvider( RepoMediaAccess & access_r, const PoolItem & pi_r, + const DeltaCandidates & deltas_r, const PackageProviderPolicy & policy_r ) + + : _pimpl( factory::make( access_r, pi_r, deltas_r, policy_r ) ) + {} + + PackageProvider::PackageProvider( RepoMediaAccess & access_r, const PoolItem & pi_r, + const PackageProviderPolicy & policy_r ) + : _pimpl( factory::make( access_r, pi_r, policy_r ) ) + {} + /* legacy */ PackageProvider::PackageProvider( RepoMediaAccess & access_r, const Package::constPtr & package_r, const DeltaCandidates & deltas_r, const PackageProviderPolicy & policy_r ) - : _pimpl( Impl::factoryMake( access_r, package_r, deltas_r, policy_r ) ) + : _pimpl( factory::make( access_r, package_r, deltas_r, policy_r ) ) {} PackageProvider::~PackageProvider() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/repo/PackageProvider.h new/libzypp-16.11.0/zypp/repo/PackageProvider.h --- old/libzypp-16.9.0/zypp/repo/PackageProvider.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.11.0/zypp/repo/PackageProvider.h 2017-05-11 17:57:02.000000000 +0200 @@ -60,11 +60,25 @@ class PackageProvider { public: - /** Ctor taking the Package to provide. */ + /** Ctor taking the package to provide. + * \throws Exception If pi_r refers to neither a \c Package nor a \c SrcPackage. + */ + PackageProvider( RepoMediaAccess & access, const PoolItem & pi_r, + const PackageProviderPolicy & policy_r = PackageProviderPolicy() ); + + /** \overload Ctor taking additional hint to deltarpms (not used for SrcPackages) + * \throws Exception If pi_r refers to neither a \c Package nor a \c SrcPackage. + */ + PackageProvider( RepoMediaAccess & access, const PoolItem & pi_r, + const DeltaCandidates & deltas, + const PackageProviderPolicy & policy_r = PackageProviderPolicy() ); + + /** Legacy Ctor taking a \c Package::constPtr to provide. */ PackageProvider( RepoMediaAccess & access, const Package::constPtr & package, const DeltaCandidates & deltas, const PackageProviderPolicy & policy_r = PackageProviderPolicy() ); + ~PackageProvider(); public: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/sat/Solvable.cc new/libzypp-16.11.0/zypp/sat/Solvable.cc --- old/libzypp-16.9.0/zypp/sat/Solvable.cc 2017-02-16 14:21:10.000000000 +0100 +++ new/libzypp-16.11.0/zypp/sat/Solvable.cc 2017-05-12 11:41:09.000000000 +0200 @@ -382,9 +382,9 @@ return isSystem() && myPool().isOnSystemByAuto( ident() ); } - bool Solvable::identIsAutoInstalled() const + bool Solvable::identIsAutoInstalled( const IdString & ident_r ) { - return myPool().isOnSystemByAuto( ident() ); + return myPool().isOnSystemByAuto( ident_r ); } bool Solvable::multiversionInstall() const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/sat/Solvable.h new/libzypp-16.11.0/zypp/sat/Solvable.h --- old/libzypp-16.9.0/zypp/sat/Solvable.h 2017-01-26 13:07:00.000000000 +0100 +++ new/libzypp-16.11.0/zypp/sat/Solvable.h 2017-05-12 11:41:09.000000000 +0200 @@ -130,8 +130,11 @@ */ bool onSystemByAuto() const; - /** Whether an installed solvable with the same ident is flagged as AutoInstalled. */ - bool identIsAutoInstalled() const; + /** Whether an installed solvable with the same \ref ident is flagged as AutoInstalled. */ + bool identIsAutoInstalled() const + { return identIsAutoInstalled( ident() ); } + /** \overload static version */ + static bool identIsAutoInstalled( const IdString & ident_r ); /** Whether different versions of this package can be installed at the same time. * Per default \c false. \see also \ref ZConfig::multiversion. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/target/CommitPackageCache.cc new/libzypp-16.11.0/zypp/target/CommitPackageCache.cc --- old/libzypp-16.9.0/zypp/target/CommitPackageCache.cc 2017-04-07 10:56:11.000000000 +0200 +++ new/libzypp-16.11.0/zypp/target/CommitPackageCache.cc 2017-05-11 17:57:02.000000000 +0200 @@ -80,20 +80,26 @@ RepoProvidePackage::~RepoProvidePackage() {} - ManagedFile RepoProvidePackage::operator()( const PoolItem & pi, bool fromCache_r ) + ManagedFile RepoProvidePackage::operator()( const PoolItem & pi_r, bool fromCache_r ) { - Package::constPtr p = asKind<Package>(pi.resolvable()); + ManagedFile ret; if ( fromCache_r ) { - repo::PackageProvider pkgProvider( _impl->_access, p, repo::DeltaCandidates(), _impl->_packageProviderPolicy ); - return pkgProvider.providePackageFromCache(); + repo::PackageProvider pkgProvider( _impl->_access, pi_r, _impl->_packageProviderPolicy ); + ret = pkgProvider.providePackageFromCache(); } - else + else if ( pi_r.isKind<Package>() ) // may make use of deltas { - repo::DeltaCandidates deltas( _impl->_repos, p->name() ); - repo::PackageProvider pkgProvider( _impl->_access, p, deltas, _impl->_packageProviderPolicy ); + repo::DeltaCandidates deltas( _impl->_repos, pi_r.name() ); + repo::PackageProvider pkgProvider( _impl->_access, pi_r, deltas, _impl->_packageProviderPolicy ); return pkgProvider.providePackage(); } + else // SrcPackage or throws + { + repo::PackageProvider pkgProvider( _impl->_access, pi_r, _impl->_packageProviderPolicy ); + return pkgProvider.providePackage(); + } + return ret; } /////////////////////////////////////////////////////////////////// diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/target/TargetImpl.cc new/libzypp-16.11.0/zypp/target/TargetImpl.cc --- old/libzypp-16.9.0/zypp/target/TargetImpl.cc 2017-04-07 10:56:11.000000000 +0200 +++ new/libzypp-16.11.0/zypp/target/TargetImpl.cc 2017-05-11 17:57:02.000000000 +0200 @@ -1264,22 +1264,7 @@ ManagedFile localfile; try { - // TODO: unify packageCache.get for Package and SrcPackage - if ( pi->isKind<Package>() ) - { - localfile = packageCache.get( pi ); - } - else if ( pi->isKind<SrcPackage>() ) - { - repo::RepoMediaAccess access; - repo::SrcPackageProvider prov( access ); - localfile = prov.provideSrcPackage( pi->asKind<SrcPackage>() ); - } - else - { - INT << "Don't know howto cache: Neither Package nor SrcPackage: " << pi << endl; - continue; - } + localfile = packageCache.get( pi ); localfile.resetDispose(); // keep the package file in the cache } catch ( const AbortRequestException & exp ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/ui/Selectable.cc new/libzypp-16.11.0/zypp/ui/Selectable.cc --- old/libzypp-16.9.0/zypp/ui/Selectable.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.11.0/zypp/ui/Selectable.cc 2017-05-12 11:41:09.000000000 +0200 @@ -82,6 +82,9 @@ PoolItem Selectable::highestAvailableVersionObj() const { return _pimpl->highestAvailableVersionObj(); } + bool Selectable::identIsAutoInstalled() const + { return _pimpl->identIsAutoInstalled(); } + bool Selectable::identicalAvailable( const PoolItem & rhs ) const { return _pimpl->identicalAvailable( rhs ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/ui/Selectable.h new/libzypp-16.11.0/zypp/ui/Selectable.h --- old/libzypp-16.9.0/zypp/ui/Selectable.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.11.0/zypp/ui/Selectable.h 2017-05-12 11:41:09.000000000 +0200 @@ -150,7 +150,10 @@ */ PoolItem highestAvailableVersionObj() const; - /** \c True if \a rhs is installed and one with the same content is available. + /** Whether this \ref ident is flagged as AutoInstalled. */ + bool identIsAutoInstalled() const; + + /** \c True if \a rhs is installed and one with the same content is available. * Basically the same name, edition, arch, vendor and buildtime. * \see \ref sat::Solvable::identical */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.9.0/zypp/ui/SelectableImpl.h new/libzypp-16.11.0/zypp/ui/SelectableImpl.h --- old/libzypp-16.9.0/zypp/ui/SelectableImpl.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.11.0/zypp/ui/SelectableImpl.h 2017-05-12 11:41:09.000000000 +0200 @@ -183,6 +183,10 @@ return ret; } + /** \copydoc Selectable::identIsAutoInstalled()const */ + bool identIsAutoInstalled() const + { return sat::Solvable::identIsAutoInstalled( ident() ); } + /** \copydoc Selectable::identicalAvailable( const PoolItem & )const */ bool identicalAvailable( const PoolItem & rhs ) const { return bool(identicalAvailableObj( rhs )); }