[zypp-commit] r11235 - in /trunk/libzypp: package/libzypp.changes zypp.conf zypp/ZConfig.cc zypp/ZConfig.h zypp/repo/PackageProvider.cc
Author: mlandres Date: Thu Oct 2 19:50:07 2008 New Revision: 11235 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11235&view=rev Log: - Add zypp.conf option 'download.use_deltarpm_always' to enable using delta rpms even if the package is available on a local source. (Axel C. Frinke) Modified: trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp.conf trunk/libzypp/zypp/ZConfig.cc trunk/libzypp/zypp/ZConfig.h trunk/libzypp/zypp/repo/PackageProvider.cc Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=11235&r1=11234&r2=11235&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Thu Oct 2 19:50:07 2008 @@ -1,9 +1,17 @@ ------------------------------------------------------------------- +Thu Oct 2 19:46:13 CEST 2008 - ma@suse.de + +- Add zypp.conf option 'download.use_deltarpm_always' to enable using + delta rpms even if the package is available on a local source. + (Axel C. Frinke) +- revision 11235 +- version 5.14.0 (13) + +------------------------------------------------------------------- Thu Oct 2 18:50:11 CEST 2008 - ma@suse.de - Add product attribute: PRODUCTLINE. - revision 11234 -- version 5.14.0 (13) ------------------------------------------------------------------- Thu Oct 2 17:18:19 CEST 2008 - ma@suse.de Modified: trunk/libzypp/zypp.conf URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp.conf?rev=11235&r1=11234&r2=11235&view=diff ============================================================================== --- trunk/libzypp/zypp.conf (original) +++ trunk/libzypp/zypp.conf Thu Oct 2 19:50:07 2008 @@ -135,6 +135,15 @@ ## # download.use_deltarpm = true +## +## Whether to consider using a deltarpm even when rpm is local +## +## Valid values: boolean +## Default value: false +## +## This option has no effect unless download.use_deltarpm is set true. +## +# download.use_deltarpm_always = false ## ## Defining directory which contains vendor description files. Modified: trunk/libzypp/zypp/ZConfig.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZConfig.cc?rev=11235&r1=11234&r2=11235&view=diff ============================================================================== --- trunk/libzypp/zypp/ZConfig.cc (original) +++ trunk/libzypp/zypp/ZConfig.cc Thu Oct 2 19:50:07 2008 @@ -147,6 +147,7 @@ , repo_add_probe ( false ) , repo_refresh_delay ( 10 ) , download_use_deltarpm ( true ) + , download_use_deltarpm_always ( false ) , solver_onlyRequires ( false ) , apply_locks_file ( true ) @@ -233,6 +234,10 @@ { download_use_deltarpm = str::strToBool( value, download_use_deltarpm ); } + else if ( entry == "download.use_deltarpm_always" ) + { + download_use_deltarpm_always = str::strToBool( value, download_use_deltarpm_always ); + } else if ( entry == "vendordir" ) { cfg_vendor_path = Pathname(value); @@ -288,11 +293,11 @@ } else if ( entry == "credentials.global.dir" ) { - credentials_global_dir_path = Pathname(value); + credentials_global_dir_path = Pathname(value); } else if ( entry == "credentials.global.file" ) { - credentials_global_file_path = Pathname(value); + credentials_global_file_path = Pathname(value); } } } @@ -346,6 +351,7 @@ unsigned repo_refresh_delay; bool download_use_deltarpm; + bool download_use_deltarpm_always; bool solver_onlyRequires; Pathname solver_checkSystemFile; @@ -355,7 +361,7 @@ bool apply_locks_file; target::rpm::RpmInstFlags rpmInstallFlags; - + Pathname history_log_path; Pathname credentials_global_dir_path; Pathname credentials_global_file_path; @@ -525,6 +531,8 @@ bool ZConfig::download_use_deltarpm() const { return _pimpl->download_use_deltarpm; } + bool ZConfig::download_use_deltarpm_always() const + { return download_use_deltarpm() && _pimpl->download_use_deltarpm_always; } bool ZConfig::solver_onlyRequires() const { return _pimpl->solver_onlyRequires; } Modified: trunk/libzypp/zypp/ZConfig.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ZConfig.h?rev=11235&r1=11234&r2=11235&view=diff ============================================================================== --- trunk/libzypp/zypp/ZConfig.h (original) +++ trunk/libzypp/zypp/ZConfig.h Thu Oct 2 19:50:07 2008 @@ -155,6 +155,12 @@ */ bool download_use_deltarpm() const; + /** Whether to consider using a deltarpm even when rpm is local. + * This requires \ref download_use_deltarpm being \c true. + * Config option <tt>download.use_deltarpm_always (false)</tt> + */ + bool download_use_deltarpm_always() const; + /** * Directory for equivalent vendor definitions (configPath()/vendors.d) * \ingroup g_ZC_CONFIGFILES @@ -228,16 +234,16 @@ /** * Path where ZYpp install history is logged. Defaults to * /var/log/zypp/history. - * + * * \see http://en.opensuse.org/Libzypp/Package_History */ Pathname historyLogFile() const; - + /** * Defaults to /etc/zypp/credentials.d */ Pathname credentialsGlobalDir() const; - + /** * Defaults to /etc/zypp/credentials.cat */ Modified: trunk/libzypp/zypp/repo/PackageProvider.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/PackageProvider.cc?rev=11235&r1=11234&r2=11235&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/PackageProvider.cc (original) +++ trunk/libzypp/zypp/repo/PackageProvider.cc Thu Oct 2 19:50:07 2008 @@ -20,6 +20,7 @@ #include "zypp/repo/Applydeltarpm.h" #include "zypp/repo/PackageDelta.h" +#include "zypp/TmpPath.h" #include "zypp/ZConfig.h" #include "zypp/RepoInfo.h" #include "zypp/media/MediaManager.h" @@ -128,7 +129,7 @@ url = * info.baseUrlsBegin(); // check whether to process patch/delta rpms - if ( MediaManager::downloads(url) ) + if ( MediaManager::downloads(url) || ZConfig::instance().download_use_deltarpm_always() ) { std::list<DeltaRpm> deltaRpms; if ( ZConfig::instance().download_use_deltarpm() ) @@ -196,11 +197,14 @@ } Pathname destination( Pathname::dirname( delta ) / defRpmFileName( _package ) ); - /* just to ease testing with non remote sources */ - // FIXME removed API - //if ( ! _package->source().remote() ) - // destination = Pathname("/tmp") / defRpmFileName( _package ); - /**/ + + if ( ! delta.getDispose() ) + { + // There is no cleanup method associated with the deta. Thus the + // delta is not a temporary file, and we don't want to write in + // the package into this directory. + destination = filesystem::TmpPath::defaultLocation() / defRpmFileName( _package ); + } if ( ! applydeltarpm::provide( delta, destination, bind( &PackageProvider::progressDeltaApply, this, _1 ) ) ) -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlandres@svn.opensuse.org