SET(LIBZYPP_MAJOR "14")
SET(LIBZYPP_COMPATMINOR "27")
SET(LIBZYPP_MINOR "27")
-SET(LIBZYPP_PATCH "1")
+SET(LIBZYPP_PATCH "2")
#
-# LAST RELEASED: 14.27.1 (27)
+# LAST RELEASED: 14.27.2 (27)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
USR << __PRETTY_FUNCTION__ << endl;
}
- // Dowmload patch rpm:
- // - path below url reported on start()
- // - expected download size (0 if unknown)
- // - download is interruptable
- virtual void startPatchDownload( const Pathname & /*filename*/, const ByteCount & /*downloadsize*/ )
- {
- USR << __PRETTY_FUNCTION__ << endl;
- }
-
- virtual bool progressPatchDownload( int /*value*/ )
- {
- USR << __PRETTY_FUNCTION__ << endl;
- return true;
- }
-
- virtual void problemPatchDownload( const std::string &/*description*/ )
- {
- USR << __PRETTY_FUNCTION__ << endl;
- }
-
- virtual void finishPatchDownload()
- {
- USR << __PRETTY_FUNCTION__ << endl;
- }
-
-
// return false if the download should be aborted right now
virtual bool progress(int value, Resolvable::constPtr resolvable_ptr)
{
-------------------------------------------------------------------
+Fri Aug 29 14:46:25 CEST 2014 - ma@suse.de
+
+- PackageProvider: consider toplevel cache if --root or --pkg-cachedir
+ is used.
+- Cleanup orpahned cache dirs only at zypp.conf default locations
+ (bnc#891515)
+- Remove orphaned package caches on refresh (bnc#888919)
+- version 14.27.2 (27)
+
+-------------------------------------------------------------------
+Sun Aug 24 01:16:00 CEST 2014 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Mon Aug 18 14:01:06 CEST 2014 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
Thu Jul 31 19:22:56 CEST 2014 - ma@suse.de
- Fix gpg key creation/modification date computation to properly
return ret;
}
+ std:: ostream & operator<<( std::ostream & str, const RepoManagerOptions & obj )
+ {
+#define OUTS(X) str << " " #X "\t" << obj.X << endl
+ str << "RepoManagerOptions (" << obj.rootDir << ") {" << endl;
+ OUTS( repoRawCachePath );
+ OUTS( repoSolvCachePath );
+ OUTS( repoPackagesCachePath );
+ OUTS( knownReposPath );
+ OUTS( knownServicesPath );
+ OUTS( pluginsPath );
+ str << "}" << endl;
+#undef OUTS
+ return str;
+ }
+
///////////////////////////////////////////////////////////////////
/// \class RepoManager::Impl
/// \brief RepoManager implementation.
repo::PluginServices(_options.pluginsPath/"services", ServiceCollector(_services));
}
+ ///////////////////////////////////////////////////////////////////
+ namespace {
+ /** Delete \a cachePath_r subdirs not matching known aliases in \a repoEscAliases_r (must be sorted!)
+ * \note bnc#891515: Auto-cleanup only zypp.conf default locations. Otherwise
+ * we'd need some magic file to identify zypp cache directories. Without this
+ * we may easily remove user data (zypper --pkg-cache-dir . download ...)
+ */
+ inline void cleanupNonRepoMetadtaFolders( const Pathname & cachePath_r,
+ const Pathname & defaultCachePath_r,
+ const std::list<std::string> & repoEscAliases_r )
+ {
+ if ( cachePath_r != defaultCachePath_r )
+ return;
+
+ std::list<std::string> entries;
+ if ( filesystem::readdir( entries, cachePath_r, false ) == 0 )
+ {
+ entries.sort();
+ std::set<std::string> oldfiles;
+ set_difference( entries.begin(), entries.end(), repoEscAliases_r.begin(), repoEscAliases_r.end(),
+ std::inserter( oldfiles, oldfiles.end() ) );
+ for ( const std::string & old : oldfiles )
+ {
+ if ( old == Repository::systemRepoAlias() ) // don't remove the @System solv file
+ continue;
+ filesystem::recursive_rmdir( cachePath_r / old );
+ }
+ }
+ }
+ } // namespace
+ ///////////////////////////////////////////////////////////////////
void RepoManager::Impl::init_knownRepositories()
{
MIL << "start construct known repos" << endl;
}
// delete metadata folders without corresponding repo (e.g. old tmp directories)
+ //
+ // bnc#891515: Auto-cleanup only zypp.conf default locations. Otherwise
+ // we'd need somemagic file to identify zypp cache directories. Without this
+ // we may easily remove user data (zypper --pkg-cache-dir . download ...)
repoEscAliases.sort();
- for ( const Pathname & cachePath : { _options.repoRawCachePath
- , _options.repoSolvCachePath } )
- {
- std::list<std::string> entries;
- if ( filesystem::readdir( entries, cachePath, false ) == 0 )
- {
- entries.sort();
- std::set<std::string> oldfiles;
- set_difference( entries.begin(), entries.end(), repoEscAliases.begin(), repoEscAliases.end(),
- std::inserter( oldfiles, oldfiles.end() ) );
- for ( const std::string & old : oldfiles )
- {
- if ( old == Repository::systemRepoAlias() ) // don't remove the @System solv file
- continue;
- filesystem::recursive_rmdir( cachePath / old );
- }
- }
- }
+ RepoManagerOptions defaultCache( _options.rootDir );
+ cleanupNonRepoMetadtaFolders( _options.repoRawCachePath, defaultCache.repoRawCachePath, repoEscAliases );
+ cleanupNonRepoMetadtaFolders( _options.repoSolvCachePath, defaultCache.repoSolvCachePath, repoEscAliases );
+ cleanupNonRepoMetadtaFolders( _options.repoPackagesCachePath, defaultCache.repoPackagesCachePath, repoEscAliases );
}
MIL << "end construct known repos" << endl;
}
}
}
- // To test the new matadta create temp dir as sibling of mediarootpath
- filesystem::TmpDir tmpdir( filesystem::TmpDir::makeSibling( mediarootpath ) );
-
repo::RepoType repokind = info.type();
// if unknown: probe it
if ( repokind == RepoType::NONE )
virtual void finishDeltaApply()
{}
- // Dowmload patch rpm:
- // - path below url reported on start()
- // - expected download size (0 if unknown)
- // - download is interruptable
- virtual void startPatchDownload( const Pathname & /*filename*/, const ByteCount & /*downloadsize*/ )
+ /** \deprecated Unused since 2008 */
+ virtual ZYPP_DEPRECATED void startPatchDownload( const Pathname & /*filename*/, const ByteCount & /*downloadsize*/ )
{}
- virtual bool progressPatchDownload( int /*value*/ )
+ /** \deprecated Unused since 2008 */
+ virtual ZYPP_DEPRECATED bool progressPatchDownload( int /*value*/ )
{ return true; }
- virtual void problemPatchDownload( const std::string &/*description*/ )
+ /** \deprecated Unused since 2008 */
+ virtual ZYPP_DEPRECATED void problemPatchDownload( const std::string &/*description*/ )
{}
- virtual void finishPatchDownload()
+ /** \deprecated Unused since 2008 */
+ virtual ZYPP_DEPRECATED void finishPatchDownload()
{}
*
*/
#include <iostream>
+#include <fstream>
#include <sstream>
#include "zypp/repo/PackageDelta.h"
#include "zypp/base/Logger.h"
#include "zypp/TmpPath.h"
#include "zypp/ZConfig.h"
#include "zypp/RepoInfo.h"
+#include "zypp/RepoManager.h"
using std::endl;
return ret; // <-- cache hit
}
- // HERE: cache misss, do download:
+ // HERE: cache misss, check toplevel cache or do download:
RepoInfo info = _package->repoInfo();
+
+ // Check toplevel cache
+ {
+ RepoManagerOptions topCache;
+ if ( info.packagesPath().dirname() != topCache.repoPackagesCachePath ) // not using toplevel cache
+ {
+ const OnMediaLocation & loc( _package->location() );
+ if ( ! loc.checksum().empty() ) // no cache hit without checksum
+ {
+ PathInfo pi( topCache.repoPackagesCachePath / info.packagesPath().basename() / loc.filename() );
+ if ( pi.isExist() && loc.checksum() == CheckSum( loc.checksum().type(), std::ifstream( pi.c_str() ) ) )
+ {
+ report()->start( _package, pi.path().asFileUrl() );
+ const Pathname & dest( info.packagesPath() / loc.filename() );
+ if ( filesystem::assert_dir( dest.dirname() ) == 0 && filesystem::hardlinkCopy( pi.path(), dest ) == 0 )
+ {
+ ret = ManagedFile( dest );
+ if ( ! info.keepPackages() )
+ ret.setDispose( filesystem::unlink );
+
+ MIL << "provided Package from toplevel cache " << _package << " at " << ret << endl;
+ report()->finish( _package, repo::DownloadResolvableReport::NO_ERROR, std::string() );
+ return ret; // <-- toplevel cache hit
+ }
+ }
+ }
+ }
+ }
+
// FIXME we only support the first url for now.
if ( info.baseUrlsEmpty() )
ZYPP_THROW(Exception("No url in repository."));