Author: dmacvicar
Date: Fri Jun 1 16:12:55 2007
New Revision: 5657
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5657&view=rev
Log:
backup
Modified:
trunk/libzypp/zypp2/RepoManager.cc
trunk/libzypp/zypp2/RepoManager.h
trunk/libzypp/zypp2/repo/RepoException.h
trunk/libzypp/zypp2/repo/RepositoryImpl.cc
trunk/libzypp/zypp2/repo/RepositoryImpl.h
trunk/libzypp/zypp2/repo/cached/RepoImpl.cc
trunk/libzypp/zypp2/repo/cached/RepoImpl.h
Modified: trunk/libzypp/zypp2/RepoManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/RepoManager.cc?rev=5657&r1=5656&r2=5657&view=diff
==============================================================================
--- trunk/libzypp/zypp2/RepoManager.cc (original)
+++ trunk/libzypp/zypp2/RepoManager.cc Fri Jun 1 16:12:55 2007
@@ -13,16 +13,17 @@
#include <iostream>
#include <list>
#include <algorithm>
-#include "zypp/base/Exception.h"
#include "zypp/base/InputStream.h"
#include "zypp/base/Logger.h"
#include "zypp/PathInfo.h"
#include "zypp/parser/IniDict.h"
+#include "zypp2/repo/RepoException.h"
#include "zypp2/RepoManager.h"
using namespace std;
using namespace zypp;
+using namespace zypp::repo;
using namespace zypp::filesystem;
using parser::IniDict;
@@ -170,6 +171,45 @@
RepoManager::~RepoManager()
{}
+ static void assert_alias( const RepoInfo &info )
+ {
+ if (info.alias().empty())
+ ZYPP_THROW(RepoNoAliasException());
+ }
+
+ static Pathname rawcache_path_for_alias( const RepoManagerOptions &opt, const string &alias )
+ {
+ //repoRawCachePath
+ return Pathname();
+ }
+
+ void RepoManager::refreshMetadata( const RepoInfo &info )
+ {
+ assert_alias(info);
+
+
+ }
+
+ void RepoManager::cleanMetadata( const RepoInfo &info )
+ {
+
+ }
+
+ void RepoManager::buildCache( const RepoInfo &info )
+ {
+
+ }
+
+ void RepoManager::cleanCache( const RepoInfo &info )
+ {
+
+ }
+
+ Repository RepoManager::createFromCache( const RepoInfo &info )
+ {
+ return Repository::noRepository;
+ }
+
/******************************************************************
**
** FUNCTION NAME : operator<<
Modified: trunk/libzypp/zypp2/RepoManager.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/RepoManager.h?rev=5657&r1=5656&r2=5657&view=diff
==============================================================================
--- trunk/libzypp/zypp2/RepoManager.h (original)
+++ trunk/libzypp/zypp2/RepoManager.h Fri Jun 1 16:12:55 2007
@@ -20,7 +20,7 @@
//#include "zypp/base/NonCopyable.h"
#include "zypp/Pathname.h"
#include "zypp/ZConfig.h"
-
+#include "zypp2/Repository.h"
#include "zypp2/RepoInfo.h"
#include "zypp2/repo/RepoException.h"
@@ -55,7 +55,9 @@
public:
RepoManager( const RepoManagerOptions &options = RepoManagerOptions() );
-
+ /** Dtor */
+ ~RepoManager();
+
/**
* \short List known repositories.
*
@@ -66,8 +68,60 @@
*/
std::list<RepoInfo> knownRepositories();
- /** Dtor */
- ~RepoManager();
+ /**
+ * \short Refresh local cache
+ *
+ * Will try to download the metadata
+ *
+ * \throws RepoNoUrl if no urls are available.
+ * \throws RepoNoAlias if can't figure an alias
+ * \throws Exception on unknown error.
+ */
+ void refreshMetadata( const RepoInfo &info );
+
+ /**
+ * \short Clean local metadata
+ *
+ * Empty local metadata.
+ *
+ * \throws RepoNoAlias if can't figure an alias
+ * \throws Exception on unknown error.
+ */
+ void cleanMetadata( const RepoInfo &info );
+
+ /**
+ * \short Refresh local cache
+ *
+ * Will try to build the cache from
+ * local metadata.
+ *
+ * If the cache exists it will be overwriten.
+ *
+ * \note the local metadata must be valid.
+ *
+ * \throws RepoNoAlias if can't figure an alias to look in cache
+ * \throws Exception on unknown error.
+ */
+ void buildCache( const RepoInfo &info );
+
+ /**
+ * \short clean local cache
+ *
+ * Clean the cached version of the metadata
+ *
+ * \note the local metadata must be valid.
+ *
+ * \throws RepoNoAlias if can't figure an alias to look in cache
+ * \throws Exception on unknown error.
+ */
+ void cleanCache( const RepoInfo &info );
+
+ /**
+ * \short Create a repository object from the cache data
+ *
+ * \throw RepoNotCachedException When the source is not cached.
+ */
+ Repository createFromCache( const RepoInfo &info );
public:
Modified: trunk/libzypp/zypp2/repo/RepoException.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/repo/RepoException.h?rev=5657&r1=5656&r2=5657&view=diff
==============================================================================
--- trunk/libzypp/zypp2/repo/RepoException.h (original)
+++ trunk/libzypp/zypp2/repo/RepoException.h Fri Jun 1 16:12:55 2007
@@ -56,7 +56,7 @@
* thrown when it was impossible to
* determine one url for this repo.
*/
- class RepoNoUrl : public RepoException
+ class RepoNoUrlException : public RepoException
{
};
@@ -65,7 +65,7 @@
* thrown when it was impossible to
* determine an alias for this repo.
*/
- class RepoNoAlias : public RepoException
+ class RepoNoAliasException : public RepoException
{
};
Modified: trunk/libzypp/zypp2/repo/RepositoryImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/repo/RepositoryImpl.cc?rev=5657&r1=5656&r2=5657&view=diff
==============================================================================
--- trunk/libzypp/zypp2/repo/RepositoryImpl.cc (original)
+++ trunk/libzypp/zypp2/repo/RepositoryImpl.cc Fri Jun 1 16:12:55 2007
@@ -5,11 +5,17 @@
IMPL_PTR_TYPE(RepositoryImpl)
-RepositoryImpl::RepositoryImpl()
+RepositoryImpl::RepositoryImpl( const RepoInfo &info )
+ : _info(info)
{
}
+const RepoInfo RepositoryImpl::info() const
+{
+ return _info;
+}
+
RepositoryImpl::~RepositoryImpl()
{
@@ -19,5 +25,11 @@
: base::ProvideNumericId