From: Duncan Mac-Vicar P Date: Thu, 23 Aug 2007 22:38:37 +0000 (+0000) Subject: Don't lose the checkers when adding jobs. X-Git-Tag: BASE-SuSE-Linux-10_3-Branch~220 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22d8053326c69dae025cbf9f6970926b451f715a;p=platform%2Fupstream%2Flibzypp.git Don't lose the checkers when adding jobs. 1sr step to fix checksum and signature blockers --- diff --git a/zypp/Fetcher.cc b/zypp/Fetcher.cc index faeb601..84399d5 100644 --- a/zypp/Fetcher.cc +++ b/zypp/Fetcher.cc @@ -81,14 +81,16 @@ namespace zypp CompositeFileChecker composite; composite.add(ChecksumFileChecker(resource.checksum())); composite.add(checker); - enqueue(resource, composite); + FetcherJob job(resource); + job.checkers = composite; + _resources.push_back(job); } void Fetcher::Impl::enqueue( const OnMediaLocation &resource, const FileChecker &checker ) { FetcherJob job(resource); job.checkers.add(checker); - _resources.push_back(resource); + _resources.push_back(job); } void Fetcher::Impl::reset() @@ -189,6 +191,7 @@ namespace zypp Pathname localfile = dest_dir + (*it_res).location.filename(); // call the checker function try { + MIL << "Checking " << localfile << endl; (*it_res).checkers(localfile); } catch ( const FileCheckException &e ) diff --git a/zypp/FileChecker.cc b/zypp/FileChecker.cc index ba92b89..5368eb1 100644 --- a/zypp/FileChecker.cc +++ b/zypp/FileChecker.cc @@ -69,15 +69,20 @@ namespace zypp void CompositeFileChecker::operator()(const Pathname &file ) const { + MIL << _checkers.size() << " checkers" << endl; for ( list::const_iterator it = _checkers.begin(); it != _checkers.end(); ++it ) - { + { + MIL << "checking..." << endl; (*it)(file); } } void CompositeFileChecker::add( const FileChecker &checker ) { + //MIL << "||# " << _checkers.size() << endl; _checkers.push_back(checker); + //MIL << "||* " << _checkers.size() << endl; + } SignatureFileChecker::SignatureFileChecker( const Pathname &signature ) diff --git a/zypp/FileChecker.h b/zypp/FileChecker.h index e19f3c9..5c7c2cf 100644 --- a/zypp/FileChecker.h +++ b/zypp/FileChecker.h @@ -145,6 +145,8 @@ namespace zypp * \throws FileCheckException if validation fails */ void operator()( const Pathname &file ) const; + + int checkersSize() const { return _checkers.size(); } private: std::list _checkers; };