///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
+ class Service; //predef
/**
* Parses \a repo_file and returns a list of \ref RepoInfo objects
*/
struct RepoManagerOptions
{
- RepoManagerOptions();
+ /** Default ctor following \ref ZConfig global settings.
+ * If an optional \c root_r directory is given, all paths will
+ * be prefixed accordingly.
+ * \code
+ * root_r\repoCachePath
+ * \repoRawCachePath
+ * \repoSolvCachePath
+ * \repoPackagesCachePath
+ * \knownReposPath
+ * \endcode
+ */
+ RepoManagerOptions( const Pathname & root_r = Pathname() );
+
+ /** Test setup adjusting all paths to be located below one \c root_r directory.
+ * \code
+ * root_r\ - repoCachePath
+ * \raw - repoRawCachePath
+ * \solv - repoSolvCachePath
+ * \packages - repoPackagesCachePath
+ * \repos.d - knownReposPath
+ * \endcode
+ */
+ static RepoManagerOptions makeTestSetup( const Pathname & root_r );
Pathname repoCachePath;
Pathname repoRawCachePath;
+ Pathname repoSolvCachePath;
Pathname repoPackagesCachePath;
Pathname knownReposPath;
+ Pathname knownServicesPath;
bool probe;
};
+
+
/**
* \short creates and provides information about known sources.
*
/** Implementation */
class Impl;
+ /** service typedefs */
+ typedef std::set<Service> ServiceSet;
+ typedef ServiceSet::const_iterator ServiceConstIterator;
+ typedef ServiceSet::size_type ServiceSizeType;
+
public:
RepoManager( const RepoManagerOptions &options = RepoManagerOptions() );
/** Dtor */
* \param info
* \param url
* \param policy
- * \return state of repository
+ * \return state of repository
* \see RefreshCheckStatus
* \throws RepoUnknownTypeException
* \throws repo::RepoNoAliasException if can't figure an alias
*/
Pathname metadataPath( const RepoInfo &info ) const;
+
+ /**
+ * \short Path where the rpm packages are downloaded and kept
+ *
+ * Given a repoinfo, tells where \ref RepoProvidePackage will download
+ * and keep the .rpm files.
+ *
+ * \param info Repository information
+ *
+ * \throws repo::RepoNoAliasException if can't figure an alias
+ */
+ Pathname packagesPath( const RepoInfo &info ) const;
+
+
/**
* \short Refresh local raw cache
*
const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
/**
- * Clean target system (rpm db) cache.
- */
- void cleanTargetCache(const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc());
-
- /**
* \short Whether a repository exists in cache
*
* \param RepoInfo to be checked.
const url::ViewOption & urlview = url::ViewOption::DEFAULTS,
const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+ void addService( const std::string& name, const Url& url );
+
+ void removeService( const std::string& name );
+
+ bool serviceEmpty() const;
+
+ ServiceSizeType serviceSize() const;
+
+ ServiceConstIterator serviceBegin() const;
+
+ ServiceConstIterator serviceEnd() const;
+
+ const Service& getService( const std::string& name ) const;
+
+ void refreshServices();
+
+ /**
+ * modify service, except name change
+ * ( you need remove and add if you want change name )
+ */
+ void modifyService(const Service& service) const;
+
protected:
RepoStatus rawMetadataStatus( const RepoInfo &info );
- void setCacheStatus( const std::string &alias, const RepoStatus &status );
+ void setCacheStatus( const RepoInfo &info, const RepoStatus &status );
/**
* Update timestamp of repository index file for the specified repository \a info.