Author: mlandres Date: Mon Mar 10 14:20:03 2008 New Revision: 9081 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9081&view=rev Log: Throw exception if a contentfile does not define a single metadata file Modified: trunk/libzypp/zypp/RepoManager.cc trunk/libzypp/zypp/parser/susetags/RepoIndex.cc trunk/libzypp/zypp/parser/susetags/RepoIndex.h trunk/libzypp/zypp/repo/susetags/Downloader.cc Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=9081&r1=9080&r2=9081&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Mon Mar 10 14:20:03 2008 @@ -86,20 +86,14 @@ struct RepoCollector { RepoCollector() - { - MIL << endl; - } + {} ~RepoCollector() - { - MIL << endl; - } + {} bool collect( const RepoInfo &repo ) { - //MIL << "here in collector: " << repo.alias() << endl; repos.push_back(repo); - //MIL << "added: " << repo.alias() << endl; return true; } Modified: trunk/libzypp/zypp/parser/susetags/RepoIndex.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/susetags/RepoIndex.cc?rev=9081&r1=9080&r2=9081&view=diff ============================================================================== --- trunk/libzypp/zypp/parser/susetags/RepoIndex.cc (original) +++ trunk/libzypp/zypp/parser/susetags/RepoIndex.cc Mon Mar 10 14:20:03 2008 @@ -10,7 +10,7 @@ * */ #include <iostream> -//#include "zypp/base/Logger.h" +#include "zypp/base/LogTools.h" #include "zypp/parser/susetags/RepoIndex.h" @@ -30,6 +30,14 @@ IMPL_PTR_TYPE(RepoIndex); + std::ostream & RepoIndex::dumpOn( std::ostream & str ) const + { + return str + << "RepoIndex checksums: META files " << metaFileChecksums.size() + << ", HASH files " << mediaFileChecksums.size() + << ", KEY files " << signingKeys.size(); + } + ///////////////////////////////////////////////////////////////// } // namespace susetags /////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/parser/susetags/RepoIndex.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/susetags/RepoIndex.h?rev=9081&r1=9080&r2=9081&view=diff ============================================================================== --- trunk/libzypp/zypp/parser/susetags/RepoIndex.h (original) +++ trunk/libzypp/zypp/parser/susetags/RepoIndex.h Mon Mar 10 14:20:03 2008 @@ -65,7 +65,7 @@ protected: /** Overload to realize std::ostream & operator\<\<. */ - //virtual std::ostream & dumpOn( std::ostream & str ) const; + virtual std::ostream & dumpOn( std::ostream & str ) const; }; ////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/repo/susetags/Downloader.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/susetags/Downloader.cc?rev=9081&r1=9080&r2=9081&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/susetags/Downloader.cc (original) +++ trunk/libzypp/zypp/repo/susetags/Downloader.cc Mon Mar 10 14:20:03 2008 @@ -85,11 +85,21 @@ { ZYPP_THROW( ParseException( (dest_dir+_path).asString() + ": " + "No repository index in content file." ) ); } - + MIL << "RepoIndex: " << _repoindex << endl; + if ( _repoindex->metaFileChecksums.empty() ) + { + ZYPP_THROW( ParseException( (dest_dir+_path).asString() + ": " + "No metadata checksums in content file." ) ); + } + if ( _repoindex->signingKeys.empty() ) + { + WAR << "No signing keys defined." << endl; + } + // Prepare parsing descr_dir = _repoindex->descrdir; // path below reporoot //_datadir = _repoIndex->datadir; // path below reporoot - + + for ( RepoIndex::FileChecksumMap::const_iterator it = _repoindex->metaFileChecksums.begin(); it != _repoindex->metaFileChecksums.end(); ++it ) @@ -125,7 +135,7 @@ { // take all patterns in one go } - else if ( str::endsWith( it->first, ".pat" ) + else if ( str::endsWith( it->first, ".pat" ) || str::endsWith( it->first, ".pat.gz" ) ) { @@ -166,7 +176,7 @@ location.setChecksum( it->second ); this->enqueueDigested(location); } - + for ( RepoIndex::FileChecksumMap::const_iterator it = _repoindex->signingKeys.begin(); it != _repoindex->signingKeys.end(); ++it ) @@ -175,7 +185,7 @@ location.setChecksum( it->second ); this->enqueueDigested(location); } - + this->start( dest_dir, media ); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org