-------------------------------------------------------------------
-Wed Jul 9 12:13:58 CEST 2008 - ma@suse.de
+Wed Jul 9 13:13:58 CEST 2008 - ma@suse.de
- Provide Package::url() if available in solv file. (bnc #402434)
-- revision 10523
+- A missing cookie file must not be treated as an error. Simply
+ rebuild the cache (bnc #405867)
+- revision 10525
-------------------------------------------------------------------
Mon Jul 7 13:39:09 CEST 2008 - schubi@suse.de
RepoManagerOptions options;
RepoSet repos;
-
+
ServiceSet services;
public:
}
void saveService( const Service& service ) const;
-
+
Pathname generateNonExistingName( const Pathname &dir,
const std::string &basefilename ) const;
-
+
std::string generateFilename( const RepoInfo &info ) const;
std::string generateFilename( const Service &info ) const;
if ( isCached( info ) )
{
MIL << info.alias() << " is already cached." << endl;
- //data::RecordId id = store.lookupRepository(info.alias());
RepoStatus cache_status = cacheStatus(info);
if ( cache_status.checksum() == raw_metadata_status.checksum() )
info.setBaseUrl(url);
ZYPP_THROW(RepoNotFoundException(info));
}
-
+
void RepoManager::addService( const std::string& name, const Url& url )
{
addService( Service(name,url) );
}
//now remove all repositories added by this service
- getRepositoriesInService( name,
+ getRepositoriesInService( name,
boost::make_function_output_iterator(bind(&RepoManager::removeRepository, this, _1, ProgressData::ReceiverFnc()) ) );
}
//compare old and new repositories (hope not to much, if it change
// then construct set and use set operation on it)
-
+
std::list<RepoInfo> oldRepos;
getRepositoriesInService(service.name(),
insert_iterator<std::list<RepoInfo> >
str::regex allowedServiceExt("^\\.service(_[0-9]+)?$");
for_(it, entries.begin(), entries.end() )
{
- parser::ServiceFileReader reader(*it,
+ parser::ServiceFileReader reader(*it,
bind(&ServiceCollector::collect, collector, _1) );
}
}
*/
#include <iostream>
#include <sstream>
-#include <vector>
-#include <algorithm>
#include <fstream>
-//#include "zypp/base/Logger.h"
+#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
#include "zypp/RepoStatus.h"
#include "zypp/PathInfo.h"
RepoStatus RepoStatus::fromCookieFile( const Pathname &cookiefile )
{
- RepoStatus status;
-
std::ifstream file(cookiefile.c_str());
if (!file) {
- ZYPP_THROW (Exception( "Can't open " + cookiefile.asString() ) );
+ WAR << "No cookie file " << cookiefile << endl;
+ return RepoStatus();
}
+ RepoStatus status;
std::string buffer;
file >> buffer;
status.setChecksum(buffer);
friend std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
public:
-
+
/**
* reads the status from a file which contains the
* checksum and timestamp in each line.
*
- * \throws Exception If the file is not valid or accessible
+ * \returns An empty \ref RepoStatus if the file does not
+ * exist or is not readable.
*/
static RepoStatus fromCookieFile( const Pathname &path );
-
+
/**
* save the status information to a cookie file
* \throws Exception if the file can't be saved
* in any way is sufficient.
*/
std::string checksum() const;
-
+
/**
* timestamp of the repository. If the repository
* changes, it has to be updated as well with the
* new timestamp.
*/
Date timestamp() const;
-
+
/**
* \short Is the status empty?
*
* \param checksum
*/
RepoStatus & setChecksum( const std::string &checksum );
-
+
/**
* set the repository timestamp \see timestamp
* \param timestamp
public:
/** Default ctor */
RepoStatus();
-
+
/**
* \short Status from a single file
* As most repository state is represented
* file will result in an empty status
*/
RepoStatus( const Pathname &file );
-
+
/** Dtor */
~RepoStatus();