Author: dmacvicar Date: Wed Aug 29 18:10:01 2007 New Revision: 6994 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6994&view=rev Log: better fix for #304200, use both content and media.1/media instead of only media Modified: trunk/libzypp/zypp/RepoStatus.cc trunk/libzypp/zypp/RepoStatus.h trunk/libzypp/zypp/repo/susetags/Downloader.cc Modified: trunk/libzypp/zypp/RepoStatus.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoStatus.cc?rev=6994&r1=6993&r2=6994&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoStatus.cc (original) +++ trunk/libzypp/zypp/RepoStatus.cc Wed Aug 29 18:10:01 2007 @@ -10,6 +10,7 @@ * */ #include <iostream> +#include <sstream> //#include "zypp/base/Logger.h" #include "zypp/RepoStatus.h" #include "zypp/PathInfo.h" @@ -111,6 +112,19 @@ Date RepoStatus::timestamp() const { return _pimpl->timestamp; } + RepoStatus operator&&( const RepoStatus &lhs, const RepoStatus &rhs ) + { + RepoStatus result; + string combinedcs = (lhs.checksum() + rhs.checksum()); + stringstream ss(combinedcs); + CheckSum newcs(CheckSum::sha1(ss)); + result.setChecksum(newcs.checksum()); + result.setTimestamp(lhs.timestamp()); + if ( rhs.timestamp() > lhs.timestamp() ) + result.setTimestamp(rhs.timestamp()); + return result; + } + /****************************************************************** ** ** FUNCTION NAME : operator<< Modified: trunk/libzypp/zypp/RepoStatus.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoStatus.h?rev=6994&r1=6993&r2=6994&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoStatus.h (original) +++ trunk/libzypp/zypp/RepoStatus.h Wed Aug 29 18:10:01 2007 @@ -107,6 +107,12 @@ /** \relates RepoStatus Stream output */ std::ostream & operator<<( std::ostream & str, const RepoStatus & obj ); + /** + * combines 2 repostatus with a checksum based on both + * checksums and the newest timestamp + */ + RepoStatus operator&&( const RepoStatus &lhs, const RepoStatus &rhs ); + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/repo/susetags/Downloader.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/susetags/Downloader.cc?rev=6994&r1=6993&r2=6994&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/susetags/Downloader.cc (original) +++ trunk/libzypp/zypp/repo/susetags/Downloader.cc Wed Aug 29 18:10:01 2007 @@ -35,7 +35,9 @@ RepoStatus Downloader::status( MediaSetAccess &media ) { Pathname content = media.provideFile( _path + "/content"); - return RepoStatus(content); + Pathname mediafile = media.provideFile( _path + "/media.1/media" ); + + return RepoStatus(content) && RepoStatus(mediafile); } void Downloader::download( MediaSetAccess &media, -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org