[zypp-commit] r6176 - in /trunk/libzypp/zypp: ./ repo/ target/
Author: dmacvicar
Date: Tue Jul 24 14:44:08 2007
New Revision: 6176
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6176&view=rev
Log:
Merge branch 'media-verif'
Conflicts:
zypp/repo/RepoProvideFile.cc
Modified:
trunk/libzypp/zypp/RepoInfo.cc
trunk/libzypp/zypp/RepoInfo.h
trunk/libzypp/zypp/RepoManager.cc
trunk/libzypp/zypp/repo/PackageProvider.cc
trunk/libzypp/zypp/repo/PackageProvider.h
trunk/libzypp/zypp/repo/RepoProvideFile.cc
trunk/libzypp/zypp/repo/RepoProvideFile.h
trunk/libzypp/zypp/repo/SUSEMediaVerifier.cc
trunk/libzypp/zypp/repo/SUSEMediaVerifier.h
trunk/libzypp/zypp/target/TargetImpl.cc
Modified: trunk/libzypp/zypp/RepoInfo.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoInfo.cc?rev=6176&r1=6175&r2=6176&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoInfo.cc (original)
+++ trunk/libzypp/zypp/RepoInfo.cc Tue Jul 24 14:44:08 2007
@@ -54,6 +54,7 @@
std::string alias;
std::string name;
Pathname filepath;
+ Pathname metadatapath;
public:
private:
@@ -167,6 +168,12 @@
_pimpl->filepath = filepath;
return *this;
}
+
+ RepoInfo & RepoInfo::setMetadataPath( const Pathname &path )
+ {
+ _pimpl->metadatapath = path;
+ return *this;
+ }
tribool RepoInfo::enabled() const
{ return _pimpl->enabled; }
@@ -186,6 +193,9 @@
Pathname RepoInfo::filepath() const
{ return _pimpl->filepath; }
+ Pathname RepoInfo::metadataPath() const
+ { return _pimpl->metadatapath; }
+
repo::RepoType RepoInfo::type() const
{ return _pimpl->type; }
Modified: trunk/libzypp/zypp/RepoInfo.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoInfo.h?rev=6176&r1=6175&r2=6176&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoInfo.h (original)
+++ trunk/libzypp/zypp/RepoInfo.h Tue Jul 24 14:44:08 2007
@@ -174,6 +174,14 @@
* infos created in memory.
*/
Pathname filepath() const;
+
+ /**
+ * \short Path where this repo metadata was read from
+ *
+ * \note could be an empty pathname for repo
+ * infos created in memory.
+ */
+ Pathname metadataPath() const;
/**
* \short Whether to check or not this repository with gpg
@@ -260,6 +268,16 @@
* \param path File path
*/
RepoInfo & setFilepath( const Pathname &filename );
+
+ /**
+ * \short set the path where the local metadata is stored
+ *
+ * The path to the metadata of this repository
+ * was defined, or empty if nowhere.
+ *
+ * \param path directory path
+ */
+ RepoInfo & setMetadataPath( const Pathname &path );
/**
* \short Whether to check or not this repository with gpg
Modified: trunk/libzypp/zypp/RepoManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=6176&r1=6175&r2=6176&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoManager.cc (original)
+++ trunk/libzypp/zypp/RepoManager.cc Tue Jul 24 14:44:08 2007
@@ -253,7 +253,18 @@
MIL << endl;
if ( PathInfo(_pimpl->options.knownReposPath).isExist() )
- return repositories_in_dir(_pimpl->options.knownReposPath);
+ {
+ RepoInfoList repos = repositories_in_dir(_pimpl->options.knownReposPath);
+ for ( RepoInfoList::iterator it = repos.begin();
+ it != repos.end();
+ ++it )
+ {
+ // set the metadata path for the repo
+ Pathname metadata_path = rawcache_path_for_repoinfo(_pimpl->options, (*it));
+ (*it).setMetadataPath(metadata_path);
+ }
+ return repos;
+ }
else
return std::list<RepoInfo>();
@@ -833,8 +844,7 @@
{
ZYPP_THROW(RepoException("Can't delete " + todelete.filepath().asString()));
}
- MIL << todelete.alias() << " sucessfully deleted." << endl;
- return;
+ MIL << todelete.alias() << " sucessfully deleted." << endl;
}
else
{
@@ -858,17 +868,19 @@
if ( (*fit).alias() != todelete.alias() )
(*fit).dumpRepoOn(file);
}
+ }
- cache::CacheStore store(_pimpl->options.repoCachePath);
-
- if ( store.isCached( todelete.alias() ) ) {
- MIL << "repository was cached. cleaning cache" << endl;
- store.cleanRepository(todelete.alias());
- }
+ // now delete it from cache
+ cache::CacheStore store(_pimpl->options.repoCachePath);
- MIL << todelete.alias() << " sucessfully deleted." << endl;
- return;
+ if ( store.isCached( todelete.alias() ) ) {
+ MIL << "repository was cached. cleaning cache" << endl;
+ store.cleanRepository(todelete.alias());
+ store.commit();
}
+
+ MIL << todelete.alias() << " sucessfully deleted." << endl;
+ return;
} // else filepath is empty
}
Modified: trunk/libzypp/zypp/repo/PackageProvider.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/PackageProvider.cc?rev=6176&r1=6175&r2=6176&view=diff
==============================================================================
--- trunk/libzypp/zypp/repo/PackageProvider.cc (original)
+++ trunk/libzypp/zypp/repo/PackageProvider.cc Tue Jul 24 14:44:08 2007
@@ -71,13 +71,15 @@
/////////////////////////////////////////////////////////////////
} // namespace source
///////////////////////////////////////////////////////////////////
- PackageProvider::PackageProvider( const Package::constPtr & package,
+ PackageProvider::PackageProvider( RepoMediaAccess &access,
+ const Package::constPtr & package,
const DeltaCandidates & deltas,
const PackageProviderPolicy & policy_r )
: _policy( policy_r )
, _package( package )
, _implPtr( detail::ImplConnect::resimpl( _package ) )
, _deltas(deltas)
+ , _access(access)
{}
PackageProvider::~PackageProvider()
@@ -186,8 +188,7 @@
ProvideFilePolicy policy;
policy.progressCB( bind( &PackageProvider::progressPackageDownload, this, _1 ) );
policy.failOnChecksumErrorCB( bind( &PackageProvider::failOnChecksumError, this ) );
-
- return repo::provideFile( _package->repository(), loc, policy );
+ return _access.provideFile( _package->repository(), loc, policy );
}
ManagedFile PackageProvider::tryDelta( const DeltaRpm & delta_r ) const
@@ -206,7 +207,7 @@
{
ProvideFilePolicy policy;
policy.progressCB( bind( &PackageProvider::progressDeltaDownload, this, _1 ) );
- delta = repo::provideFile( _package->repository(), delta_r.location(), policy );
+ delta = _access.provideFile( _package->repository(), delta_r.location(), policy );
}
catch ( const Exception & excpt )
{
@@ -257,7 +258,7 @@
{
ProvideFilePolicy policy;
policy.progressCB( bind( &PackageProvider::progressPatchDownload, this, _1 ) );
- patch = repo::provideFile( _package->repository(), patch_r.location(), policy );
+ patch = _access.provideFile( _package->repository(), patch_r.location(), policy );
}
catch ( const Exception & excpt )
{
Modified: trunk/libzypp/zypp/repo/PackageProvider.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/PackageProvider.h?rev=6176&r1=6175&r2=6176&view=diff
==============================================================================
--- trunk/libzypp/zypp/repo/PackageProvider.h (original)
+++ trunk/libzypp/zypp/repo/PackageProvider.h Tue Jul 24 14:44:08 2007
@@ -20,7 +20,7 @@
#include "zypp/Repository.h"
#include "zypp/Package.h"
#include "zypp/ManagedFile.h"
-
+#include "zypp/repo/RepoProvideFile.h"
#include "zypp/repo/DeltaCandidates.h"
///////////////////////////////////////////////////////////////////
@@ -74,7 +74,8 @@
public:
/** Ctor taking the Package to provide. */
- PackageProvider( const Package::constPtr & package,
+ PackageProvider( RepoMediaAccess &access,
+ const Package::constPtr & package,
const DeltaCandidates & deltas,
const PackageProviderPolicy & policy_r = PackageProviderPolicy() );
~PackageProvider();
@@ -107,6 +108,7 @@
mutable bool _retry;
mutable shared_ptr<Report> _report;
DeltaCandidates _deltas;
+ RepoMediaAccess &_access;
};
///////////////////////////////////////////////////////////////////
Modified: trunk/libzypp/zypp/repo/RepoProvideFile.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/RepoProvideFile.cc?rev=6176&r1=6175&r2=6176&view=diff
==============================================================================
--- trunk/libzypp/zypp/repo/RepoProvideFile.cc (original)
+++ trunk/libzypp/zypp/repo/RepoProvideFile.cc Tue Jul 24 14:44:08 2007
@@ -16,11 +16,15 @@
#include "zypp/base/Gettext.h"
#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
#include "zypp/repo/RepoProvideFile.h"
#include "zypp/ZYppCallbacks.h"
#include "zypp/MediaSetAccess.h"
#include "zypp/ZConfig.h"
+#include "zypp/repo/SUSEMediaVerifier.h"
+#include "zypp/repo/RepoException.h"
+
using std::endl;
using std::set;
@@ -47,10 +51,10 @@
*/
struct DownloadFileReportHack : public callback::ReceiveReportrepo::RepoReport
{
- virtual bool progress( int value )
+ virtual bool progress( const ProgressData &progress )
{
if ( _redirect )
- return _redirect( value );
+ return _redirect( progress.val() );
return true;
}
function
participants (1)
-
dmacvicar@svn.opensuse.org