Hello community,
here is the log from the commit of package libzypp
checked in at Tue Nov 11 15:44:16 CET 2008.
--------
--- libzypp/libzypp.changes 2008-11-08 00:02:36.000000000 +0100
+++ /mounts/work_src_done/STABLE/libzypp/libzypp.changes 2008-11-11 14:57:55.846092000 +0100
@@ -1,0 +2,7 @@
+Tue Nov 11 14:48:52 CET 2008 - ma@suse.de
+
+- Prevent fetcher from processing the same index file twice. (bnc #443644)
+- revision 11648
+- version 5.22.0 (21)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libzypp-5.21.0.tar.bz2
New:
----
libzypp-5.22.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.V32429/_old 2008-11-11 15:42:10.000000000 +0100
+++ /var/tmp/diff_new_pack.V32429/_new 2008-11-11 15:42:10.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package libzypp (Version 5.21.0)
+# spec file for package libzypp (Version 5.22.0)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -24,9 +24,9 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReqProv: on
Summary: Package, Patch, Pattern, and Product Management
-Version: 5.21.0
+Version: 5.22.0
Release: 1
-Source: libzypp-5.21.0.tar.bz2
+Source: libzypp-5.22.0.tar.bz2
Source1: libzypp-rpmlintrc
Prefix: /usr
Provides: yast2-packagemanager
@@ -71,7 +71,7 @@
%package devel
License: GPL v2 or later
-Requires: libzypp == 5.21.0
+Requires: libzypp == 5.22.0
Requires: libxml2-devel curl-devel openssl-devel rpm-devel glibc-devel zlib-devel
Requires: bzip2 popt-devel dbus-1-devel glib2-devel hal-devel boost-devel libstdc++-devel
Requires: cmake libsatsolver-devel >= 0.10.14
@@ -228,6 +228,10 @@
%{_libdir}/pkgconfig/libzypp.pc
%changelog
+* Tue Nov 11 2008 ma@suse.de
+- Prevent fetcher from processing the same index file twice. (bnc #443644)
+- revision 11648
+- version 5.22.0 (21)
* Fri Nov 07 2008 ma@suse.de
- Fix retrieval of patch contents and references attributes. (bnc #442200)
- revision 11641
++++++ libzypp-5.21.0.tar.bz2 -> libzypp-5.22.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.21.0/package/libzypp.changes new/libzypp-5.22.0/package/libzypp.changes
--- old/libzypp-5.21.0/package/libzypp.changes 2008-11-07 23:59:49.000000000 +0100
+++ new/libzypp-5.22.0/package/libzypp.changes 2008-11-11 14:50:48.000000000 +0100
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Tue Nov 11 14:48:52 CET 2008 - ma@suse.de
+
+- Prevent fetcher from processing the same index file twice. (bnc #443644)
+- revision 11648
+- version 5.22.0 (21)
+
+-------------------------------------------------------------------
Fri Nov 7 23:55:47 CET 2008 - ma@suse.de
- Fix retrieval of patch contents and references attributes. (bnc #442200)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.21.0/tests/zypp/Fetcher_test.cc new/libzypp-5.22.0/tests/zypp/Fetcher_test.cc
--- old/libzypp-5.21.0/tests/zypp/Fetcher_test.cc 2008-11-07 23:59:51.000000000 +0100
+++ new/libzypp-5.22.0/tests/zypp/Fetcher_test.cc 2008-11-11 14:50:49.000000000 +0100
@@ -1,26 +1,11 @@
-#include
-#include <iostream>
-#define BOOST_TEST_MODULE fetcher_test
-#include
-#include
-#include
+#include "TestSetup.h"
-#include "zypp/base/Logger.h"
-#include "zypp/ZYppFactory.h"
#include "zypp/MediaSetAccess.h"
#include "zypp/Fetcher.h"
-#include "zypp/Url.h"
-#include "zypp/TmpPath.h"
#include "WebServer.h"
-#include
-using std::cout;
-using std::endl;
-using std::string;
-using namespace zypp;
-using namespace zypp::media;
-using namespace boost::unit_test;
+#define BOOST_TEST_MODULE fetcher_test
#define DATADIR (Pathname(TESTS_SRC_DIR) + "/zypp/data/Fetcher/remote-site")
@@ -47,6 +32,8 @@
BOOST_AUTO_TEST_CASE(fetcher_enqueuedir_autoindex)
{
+ base::LogControl::TmpLineWriter shutUp( new zypp::log::FileLineWriter( "/tmp/YLOG" ) );
+ MIL << "GO" << endl;
MediaSetAccess media( ( DATADIR).asUrl(), "/" );
// do the test by trusting the SHA1SUMS file signature key
{
@@ -192,7 +179,7 @@
{
MediaSetAccess media( (DATADIR).asUrl(), "/" );
Fetcher fetcher;
-
+
{
filesystem::TmpDir dest;
OnMediaLocation loc("/complexdir/subdir1/subdir1-file1.txt");
@@ -220,7 +207,7 @@
OnMediaLocation loc("/contentindex/subdir1/subdir1-file1.txt");
// trust the key manually
getZYpp()->keyRing()->importKey(PublicKey(DATADIR + "/contentindex/content.key"), true);
- fetcher.addIndex(OnMediaLocation("/contentindex/content", 1));
+ fetcher.addIndex(OnMediaLocation("/contentindex/content", 1));
fetcher.enqueue(loc);
fetcher.start(dest.path(), media);
fetcher.reset();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.21.0/VERSION.cmake new/libzypp-5.22.0/VERSION.cmake
--- old/libzypp-5.21.0/VERSION.cmake 2008-11-07 23:59:49.000000000 +0100
+++ new/libzypp-5.22.0/VERSION.cmake 2008-11-11 14:50:48.000000000 +0100
@@ -60,9 +60,9 @@
#
SET(LIBZYPP_MAJOR "5")
SET(LIBZYPP_COMPATMINOR "21")
-SET(LIBZYPP_MINOR "21")
+SET(LIBZYPP_MINOR "22")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 5.21.0 (21)
+# LAST RELEASED: 5.22.0 (21)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.21.0/zypp/Fetcher.cc new/libzypp-5.22.0/zypp/Fetcher.cc
--- old/libzypp-5.21.0/zypp/Fetcher.cc 2008-11-07 23:59:49.000000000 +0100
+++ new/libzypp-5.22.0/zypp/Fetcher.cc 2008-11-11 14:50:48.000000000 +0100
@@ -15,7 +15,8 @@
#include <map>
#include "zypp/base/Easy.h"
-#include "zypp/base/Logger.h"
+#include "zypp/base/LogControl.h"
+#include "zypp/base/LogTools.h"
#include "zypp/base/PtrTypes.h"
#include "zypp/base/DefaultIntegral.h"
#include "zypp/base/String.h"
@@ -27,6 +28,9 @@
using namespace std;
+#undef ZYPP_BASE_LOGGER_LOGGROUP
+#define ZYPP_BASE_LOGGER_LOGGROUP "zypp:fetcher"
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
@@ -40,13 +44,34 @@
{
FetcherIndex( const OnMediaLocation &loc )
: location(loc)
+ {}
+ /** Index localtion. */
+ OnMediaLocation location;
+ /** Whether we read this index. */
+ DefaultIntegral read;
+ };
+
+ typedef shared_ptr<FetcherIndex> FetcherIndex_Ptr;
+
+ /** std::set ordering (less semantic) */
+ struct SameFetcherIndex
+ {
+ bool operator()( const FetcherIndex_Ptr & lhs, const FetcherIndex_Ptr & rhs )
{
+ if ( lhs == rhs )
+ return false; // incl. NULL == NULL
+ if ( ! lhs )
+ return true; // NULL < nonNULL
+ if ( ! rhs )
+ return false; // nonNULL > NULL
+ // both nonNULL ==> compare medianr and path
+ if ( lhs->location.medianr() == rhs->location.medianr() )
+ return lhs->location.filename() < rhs->location.filename();
+ //else
+ return lhs->location.medianr() < rhs->location.medianr();
}
-
- OnMediaLocation location;
};
- typedef shared_ptr<FetcherIndex> FetcherIndex_Ptr;
-
+
/**
* Class to encapsulate the \ref OnMediaLocation object
* and the \ref FileChecker together
@@ -55,7 +80,7 @@
{
enum Flag
{
- None = 0x0000,
+ None = 0x0000,
Directory = 0x0001,
Recursive = 0x0002,
RecursiveDirectory = Directory | Recursive,
@@ -64,7 +89,7 @@
AlwaysVerifyChecksum = 0x0004,
};
ZYPP_DECLARE_FLAGS(Flags, Flag);
-
+
FetcherJob( const OnMediaLocation &loc )
: location(loc)
@@ -72,7 +97,7 @@
{
//MIL << location << endl;
}
-
+
~FetcherJob()
{
//MIL << location << " | * " << checkers.size() << endl;
@@ -83,7 +108,8 @@
list<FileChecker> checkers;
Flags flags;
};
- ZYPP_DECLARE_OPERATORS_FOR_FLAGS(FetcherJob::Flags);
+
+ ZYPP_DECLARE_OPERATORS_FOR_FLAGS(FetcherJob::Flags);
typedef shared_ptr<FetcherJob> FetcherJob_Ptr;
std::ostream & operator<<( std::ostream & str, const FetcherJob_Ptr & obj )
@@ -91,7 +117,6 @@
return str << obj->location;
}
-
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : Fetcher::Impl
@@ -100,23 +125,24 @@
class Fetcher::Impl
{
friend std::ostream & operator<<( std::ostream & str, const Fetcher::Impl & obj );
+
public:
- Impl();
-
+ Impl();
+
~Impl() {
MIL << endl;
- }
-
- void setOptions( Fetcher::Options options );
- Fetcher::Options options() const;
+ }
+
+ void setOptions( Fetcher::Options options );
+ Fetcher::Options options() const;
- void addIndex( const OnMediaLocation &resource );
+ void addIndex( const OnMediaLocation &resource );
- void enqueueDir( const OnMediaLocation &resource, bool recursive, const FileChecker &checker = FileChecker() );
- void enqueueDigestedDir( const OnMediaLocation &resource, bool recursive, const FileChecker &checker = FileChecker() );
+ void enqueueDir( const OnMediaLocation &resource, bool recursive, const FileChecker &checker = FileChecker() );
+ void enqueueDigestedDir( const OnMediaLocation &resource, bool recursive, const FileChecker &checker = FileChecker() );
- void enqueue( const OnMediaLocation &resource, const FileChecker &checker = FileChecker() );
- void enqueueDigested( const OnMediaLocation &resource, const FileChecker &checker = FileChecker() );
+ void enqueue( const OnMediaLocation &resource, const FileChecker &checker = FileChecker() );
+ void enqueueDigested( const OnMediaLocation &resource, const FileChecker &checker = FileChecker() );
void addCachePath( const Pathname &cache_dir );
void reset();
void start( const Pathname &dest_dir,
@@ -151,13 +177,13 @@
/** specific version of \ref readIndex for SHA1SUMS file */
void readSha1sumsIndex( const Pathname &index, const Pathname &basedir );
-
+
/** specific version of \ref readIndex for SHA1SUMS file */
void readContentFileIndex( const Pathname &index, const Pathname &basedir );
-
+
/** reads the content of a directory but keeps a cache **/
void getDirectoryContent( MediaSetAccess &media, const OnMediaLocation &resource, filesystem::DirContent &content );
-
+
/**
* tries to provide the file represented by job into dest_dir by
* looking at the cache. If success, returns true, and the desired
@@ -195,15 +221,15 @@
Impl * clone() const
{ return new Impl( *this ); }
- list _resources;
- list _indexes;
- list<Pathname> _caches;
+ list _resources;
+ std::set _indexes;
+ std::set<Pathname> _caches;
// checksums read from the indexes
map _checksums;
// cache of dir contents
map _dircontent;
-
- Fetcher::Options _options;
+
+ Fetcher::Options _options;
};
///////////////////////////////////////////////////////////////////
@@ -214,18 +240,18 @@
job->flags |= FetcherJob:: AlwaysVerifyChecksum;
_resources.push_back(job);
}
-
+
Fetcher::Impl::Impl()
: _options(0)
{
}
-
+
void Fetcher::Impl::setOptions( Fetcher::Options options )
{ _options = options; }
-
+
Fetcher::Options Fetcher::Impl::options() const
{ return _options; }
-
+
void Fetcher::Impl::enqueueDir( const OnMediaLocation &resource,
bool recursive,
const FileChecker &checker )
@@ -269,10 +295,8 @@
void Fetcher::Impl::addIndex( const OnMediaLocation &resource )
{
- MIL << "adding index " << resource << endl;
- FetcherIndex_Ptr index;
- index.reset(new FetcherIndex(resource));
- _indexes.push_back(index);
+ MIL << "adding index " << resource << endl;
+ _indexes.insert(FetcherIndex_Ptr(new FetcherIndex(resource)));
}
@@ -292,7 +316,7 @@
if ( info.isDir() )
{
DBG << "Adding fetcher cache: '" << cache_dir << "'." << endl;
- _caches.push_back(cache_dir);
+ _caches.insert(cache_dir);
}
else
{
@@ -361,7 +385,7 @@
} // iterate over caches
return false;
}
-
+
void Fetcher::Impl::validate( const OnMediaLocation &resource, const Pathname &dest_dir, const list<FileChecker> &checkers )
{
// no matter where did we got the file, try to validate it:
@@ -411,7 +435,7 @@
filesystem::DirEntry shafile;
shafile.name = "SHA1SUMS"; shafile.type = filesystem::FT_FILE;
if ( find( content.begin(), content.end(), shafile ) != content.end() )
- {
+ {
// add the index of this directory
OnMediaLocation indexloc(resource);
indexloc.changeFilename(resource.filename() + "SHA1SUMS");
@@ -426,7 +450,7 @@
filesystem::DirEntry contentfile;
contentfile.name = "content"; contentfile.type = filesystem::FT_FILE;
if ( find( content.begin(), content.end(), contentfile ) != content.end() )
- {
+ {
// add the index of this directory
OnMediaLocation indexloc(resource);
indexloc.changeFilename(resource.filename() + "content");
@@ -441,11 +465,11 @@
const OnMediaLocation &resource,
filesystem::DirContent &content )
{
- if ( _dircontent.find(resource.filename().asString())
+ if ( _dircontent.find(resource.filename().asString())
!= _dircontent.end() )
{
filesystem::DirContent filled(_dircontent[resource.filename().asString()]);
-
+
std::copy(filled.begin(), filled.end(), std::back_inserter(content));
}
else
@@ -459,7 +483,7 @@
_dircontent[resource.filename().asString()] = tofill;
}
}
-
+
void Fetcher::Impl::addDirJobs( MediaSetAccess &media,
const OnMediaLocation &resource,
const Pathname &dest_dir, FetcherJob::Flags flags )
@@ -469,11 +493,11 @@
MIL << "Adding directory " << resource.filename() << endl;
filesystem::DirContent content;
getDirectoryContent(media, resource, content);
-
+
// this method test for the option flags so indexes are added
// only if the options are enabled
autoaddIndexes(content, media, resource, dest_dir);
-
+
for ( filesystem::DirContent::const_iterator it = content.begin();
it != content.end();
++it )
@@ -489,7 +513,7 @@
case filesystem::FT_NOT_AVAIL: // old directory.yast contains no typeinfo at all
case filesystem::FT_FILE:
{
- CheckSum chksm(resource.checksum());
+ CheckSum chksm(resource.checksum());
if ( _checksums.find(filename.asString()) != _checksums.end() )
{
// the checksum can be replaced with the one in the index.
@@ -558,7 +582,7 @@
return;
}
else
- {
+ {
ZYPP_RETHROW(excpt_r);
}
}
@@ -578,7 +602,7 @@
{
setRepoIndexConsumer( bind( &ContentReaderHelper::consumeIndex, this, _1 ) );
}
-
+
void consumeIndex( const parser::susetags::RepoIndex_Ptr & data_r )
{ _repoindex = data_r; }
@@ -634,14 +658,13 @@
void Fetcher::Impl::downloadIndex( MediaSetAccess &media, const OnMediaLocation &resource, const Pathname &dest_dir)
{
MIL << "downloading index " << resource << endl;
-
// create a new fetcher with a different state to transfer the
// file containing checksums and its signature
Fetcher fetcher;
// signature checker for index. We havent got the signature from
// the nextwork yet.
SignatureFileChecker sigchecker;
-
+
// build the name of the index and the signature
OnMediaLocation idxloc(resource);
OnMediaLocation sigloc(resource);
@@ -651,27 +674,27 @@
// the checking will warn later
sigloc.setOptional(true);
keyloc.setOptional(true);
-
+
// calculate signature and key name
sigloc.changeFilename( sigloc.filename().extend(".asc") );
keyloc.changeFilename( keyloc.filename().extend(".key") );
-
+
//assert_dir(dest_dir + idxloc.filename().dirname());
-
+
// transfer the signature
fetcher.enqueue(sigloc);
fetcher.start( dest_dir, media );
// if we get the signature, update the checker
if ( PathInfo(dest_dir + sigloc.filename()).isExist() )
sigchecker = SignatureFileChecker(dest_dir + sigloc.filename());
-
+
fetcher.reset();
-
+
// now the key
fetcher.enqueue(keyloc);
fetcher.start( dest_dir, media );
fetcher.reset();
-
+
// now the index itself
fetcher.enqueue( idxloc, FileChecker(sigchecker) );
fetcher.start( dest_dir, media );
@@ -691,16 +714,26 @@
return;
}
- for ( list::const_iterator it_idx = _indexes.begin();
- it_idx != _indexes.end(); ++it_idx )
+ for_( it_idx, _indexes.begin(), _indexes.end() )
{
+ if ( (*it_idx)->read )
+ {
+ DBG << "Already read index " << PathInfo(dest_dir + (*it_idx)->location.filename()) << endl;
+ }
+ else
+ {
+ // base::LogControl::TmpLineWriter shutUp;
downloadIndex( media, (*it_idx)->location, dest_dir );
// now we have the indexes in dest_dir
readIndex( dest_dir + (*it_idx)->location.filename(), (*it_idx)->location.filename().dirname() );
+ // Take care we don't process it again
+ MIL << "Remember read index " << PathInfo(dest_dir + (*it_idx)->location.filename()) << endl;
+ (*it_idx)->read = true;
+ }
}
MIL << "done reading indexes" << endl;
}
-
+
// start processing all fetcher jobs.
// it processes any user pointed index first
void Fetcher::Impl::start( const Pathname &dest_dir,
@@ -738,7 +771,7 @@
MIL << "Autodiscovering signed indexes on '"
<< (*it_res)->location.filename().dirname() << "' for '"
<< (*it_res)->location.filename() << "'" << endl;
-
+
autoaddIndexes(content, media, (*it_res)->location.filename().dirname(), dest_dir);
// also look in the root of the media
@@ -749,9 +782,9 @@
MIL << "Autodiscovering signed indexes on '"
<< "/" << "' for '"
<< (*it_res)->location.filename() << "'" << endl;
-
+
autoaddIndexes(content, media, Pathname("/"), dest_dir);
- }
+ }
provideToDest(media, (*it_res)->location, dest_dir);
@@ -764,21 +797,21 @@
// indexes checksum, then add a checker
if ( (*it_res)->location.checksum().empty() )
{
- if ( _checksums.find((*it_res)->location.filename().asString())
+ if ( _checksums.find((*it_res)->location.filename().asString())
!= _checksums.end() )
{
CheckSum chksm = _checksums[(*it_res)->location.filename().asString()];
- ChecksumFileChecker digest_check(chksm);
+ ChecksumFileChecker digest_check(chksm);
(*it_res)->checkers.push_back(digest_check);
}
else
{
// if the index checksum is empty too, we only add the checker
// if the AlwaysVerifyChecksum option is set on
- if ( (*it_res)->flags & FetcherJob::AlwaysVerifyChecksum )
+ if ( (*it_res)->flags & FetcherJob::AlwaysVerifyChecksum )
{
// add the checker with the empty checksum
- ChecksumFileChecker digest_check((*it_res)->location.checksum());
+ ChecksumFileChecker digest_check((*it_res)->location.checksum());
(*it_res)->checkers.push_back(digest_check);
}
}
@@ -786,10 +819,10 @@
else
{
// checksum is not empty, so add a checksum checker
- ChecksumFileChecker digest_check((*it_res)->location.checksum());
+ ChecksumFileChecker digest_check((*it_res)->location.checksum());
(*it_res)->checkers.push_back(digest_check);
}
-
+
// validate job, this throws if not valid
validate((*it_res)->location, dest_dir, (*it_res)->checkers);
@@ -819,7 +852,7 @@
{
_pimpl->setOptions(options);
}
-
+
Fetcher::Options Fetcher::options() const
{
return _pimpl->options();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.21.0/zypp/Pathname.h new/libzypp-5.22.0/zypp/Pathname.h
--- old/libzypp-5.21.0/zypp/Pathname.h 2008-11-07 23:59:49.000000000 +0100
+++ new/libzypp-5.22.0/zypp/Pathname.h 2008-11-11 14:50:48.000000000 +0100
@@ -167,6 +167,10 @@
inline Pathname operator+( const Pathname & l, const Pathname & r )
{ return Pathname::cat( l, r ); }
+ /** \relates Pathname */
+ inline bool operator<( const Pathname & l, const Pathname & r )
+ { return l.asString() < r.asString(); }
+
///////////////////////////////////////////////////////////////////
/** \relates Pathname Stream output */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-5.21.0/zypp/RepoManager.cc new/libzypp-5.22.0/zypp/RepoManager.cc
--- old/libzypp-5.21.0/zypp/RepoManager.cc 2008-11-07 23:59:49.000000000 +0100
+++ new/libzypp-5.22.0/zypp/RepoManager.cc 2008-11-11 14:50:48.000000000 +0100
@@ -50,9 +50,6 @@
#include "zypp/ZYppCallbacks.h"
#include "sat/Pool.h"
-#include "satsolver/pool.h"
-#include "satsolver/repo.h"
-#include "satsolver/repo_solv.h"
using std::endl;
using std::string;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org