)
SET( zypp2_repository_data_SRCS
- repo/memory/DPackageImpl.cc
- repo/memory/DPatternImpl.cc
- repo/memory/DProductImpl.cc
- repo/memory/DSrcPackageImpl.cc
+ repo/memory/PackageImpl.cc
+ repo/memory/PatternImpl.cc
+ repo/memory/ProductImpl.cc
+ repo/memory/SrcPackageImpl.cc
)
SET( zypp2_repository_data_HEADERS
- repo/memory/DPackageImpl.h
- repo/memory/DPatternImpl.h
- repo/memory/DProductImpl.h
- repo/memory/DSrcPackageImpl.h
+ repo/memory/PackageImpl.h
+ repo/memory/PatternImpl.h
+ repo/memory/ProductImpl.h
+ repo/memory/SrcPackageImpl.h
)
SET( zypp2_parser_susetags_SRCS
boost::tribool enabled;
boost::tribool autorefresh;
std::string type;
- Url baseurl;
+ Url mirrorlist_url;
std::set<Url> urls;
- Pathname path;
std::string alias;
std::string name;
- CheckSum checksum;
- Date timestamp;
public:
/** Offer default Impl. */
return *this;
}
- RepoInfo & RepoInfo::setBaseUrl( const Url &url )
+ RepoInfo & RepoInfo::setMirrorListUrl( const Url &url )
{
- _pimpl->baseurl = url;
+ _pimpl->mirrorlist_url = url;
return *this;
}
- RepoInfo & RepoInfo::setPath( const Pathname &p )
+ RepoInfo & RepoInfo::addBaseUrl( const Url &url )
{
- _pimpl->path = p;
+ _pimpl->urls.insert(url);
return *this;
}
return *this;
}
- RepoInfo & RepoInfo::setChecksum( const CheckSum &checksum )
- {
- _pimpl->checksum = checksum;
- return *this;
- }
-
- RepoInfo & RepoInfo::setTimestamp( const Date ×tamp )
- {
- _pimpl->timestamp = timestamp;
- return *this;
- }
-
tribool RepoInfo::enabled() const
{ return _pimpl->enabled; }
tribool RepoInfo::autorefresh() const
{ return _pimpl->autorefresh; }
-
- Pathname RepoInfo::path() const
- { return _pimpl->path; }
-
std::string RepoInfo::alias() const
{ return _pimpl->alias; }
std::string RepoInfo::name() const
{ return _pimpl->name; }
- CheckSum RepoInfo::checksum() const
- { return _pimpl->checksum; }
-
- Date RepoInfo::timestamp() const
- { return _pimpl->timestamp; }
-
std::string RepoInfo::type() const
{ return _pimpl->type; }
- Url RepoInfo::baseUrl() const
- { return _pimpl->baseurl; }
+ Url RepoInfo::mirrorListUrl() const
+ { return _pimpl->mirrorlist_url; }
std::set<Url> RepoInfo::urls() const
{ return _pimpl->urls; }
{
str << "--------------------------------------" << std::endl;
str << "- alias : " << alias() << std::endl;
- str << "- url : " << baseUrl() << std::endl;
+ //str << "- url : " << baseUrl() << std::endl;
str << "- type : " << type() << std::endl;
str << "- enabled : " << enabled() << std::endl;
str << "- autorefresh : " << autorefresh() << std::endl;
- str << "- path : " << path() << std::endl;
+ //str << "- path : " << path() << std::endl;
return str;
}
#include <boost/logic/tribool.hpp>
#include "zypp/Pathname.h"
#include "zypp/Url.h"
-#include "zypp/CheckSum.h"
-#include "zypp/Date.h"
///////////////////////////////////////////////////////////////////
namespace zypp
* the base url is http://updates.novell.com/10.2
*
* This can't be empty in order the repository to be valid
+ * unless the download of the mirror list succeeds and it
+ * contains a valid url.
*/
- Url baseUrl() const;
+ std::set<Url> urls() const;
/**
- * Urls is a list of Urls where this repository
- * is located.
+ * Url of a file which contains a list of Urls
* If empty, the base url will be used.
*/
- std::set<Url> urls() const;
+ Url mirrorListUrl() const;
typedef std::set<Url>::const_iterator urls_const_iterator;
urls_const_iterator urlsEnd() const;
/**
- * Path on the url where the repository root
- * is located.
- */
- Pathname path() const;
-
- /**
* If enabled is false, then this repository must be ignored as if does
* not exists, except when checking for duplicate alias.
*/
* ie: "SUSE Linux 10.2 updates"
*/
std::string name() const;
-
- /**
- * Checksum of the repository.
- * Usually the checksum of the index, but any
- * checksum that changes when the repository changes
- * in any way is sufficient.
- */
- CheckSum checksum() const;
-
+
/**
- * timestamp of the repository. If the repository
- * changes, it has to be updated as well with the
- * new timestamp.
+ * Add a base url. \see baseUrl
+ * \param url The base url for the repository.
*/
- Date timestamp() const;
+ RepoInfo & addBaseUrl( const Url &url );
/**
- * Set the base url. \see baseUrl
- * \param url The base url for the repository.
+ * Set mirror list url. \see mirrorListUrl
+ * \param url The base url for the list
*/
- RepoInfo & setBaseUrl( const Url &url );
+ RepoInfo & setMirrorListUrl( const Url &url );
/**
* enable or disable the repository \see enabled
RepoInfo & setAutorefresh( boost::tribool autorefresh );
/**
- * set the repository path \see path
- * \param p
- */
- RepoInfo & setPath( const Pathname &p );
-
- /**
* set the repository alias \see alias
* \param alias
*/
* \param name
*/
RepoInfo & setName( const std::string &name );
-
- /**
- * set the repository checksum \see checksum
- * \param checksum
- */
- RepoInfo & setChecksum( const CheckSum &checksum );
-
- /**
- * set the repository timestamp \see timestamp
- * \param timestamp
- */
- RepoInfo & setTimestamp( const Date ×tamp );
-
+
std::ostream & dumpOn( std::ostream & str ) const;
class Impl;
MIL << (*its) << endl;
RepoInfo info;
-
+ info.setAlias(*its);
+
for ( IniDict::entry_const_iterator it = dict.entriesBegin(*its);
it != dict.entriesEnd(*its);
++it )
{
MIL << (*it).first << endl;
+ if (it->first == "name" )
+ info.setName(it-> second);
+ else if ( it->first == "enabled" )
+ info.setEnabled( it->second == "1" );
+ else if ( it->first == "baseurl" )
+ info.addBaseUrl( Url(it->second) );
}
+
+ // add it to the list.
}
// dictionary *d = iniparser_new(file.c_str());
//#include "zypp/base/Logger.h"
#include "zypp2/RepoStatus.h"
+
using std::endl;
///////////////////////////////////////////////////////////////////
{
public:
+
+ CheckSum checksum;
+ Date timestamp;
+
/** Offer default Impl. */
static shared_ptr<Impl> nullimpl()
{
RepoStatus::~RepoStatus()
{}
+ RepoStatus & RepoStatus::setChecksum( const CheckSum &checksum )
+ {
+ _pimpl->checksum = checksum;
+ return *this;
+ }
+
+ RepoStatus & RepoStatus::setTimestamp( const Date ×tamp )
+ {
+ _pimpl->timestamp = timestamp;
+ return *this;
+ }
+
+ CheckSum RepoStatus::checksum() const
+ { return _pimpl->checksum; }
+
+ Date RepoStatus::timestamp() const
+ { return _pimpl->timestamp; }
+
/******************************************************************
**
** FUNCTION NAME : operator<<
#include <iosfwd>
#include "zypp/base/PtrTypes.h"
+#include "zypp/CheckSum.h"
+#include "zypp/Date.h"
///////////////////////////////////////////////////////////////////
namespace zypp
//
// CLASS NAME : RepoStatus
//
- /** */
+ /**
+ * \short Local facts about a repository
+ * This class represents the status of a
+ * repository on the system.
+ *
+ * Anything that is not provided on the metadata
+ * files, like the timestamp of the downloaded
+ * metadata, and its checksum.
+ */
class RepoStatus
{
friend std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
public:
+
+ /**
+ * Checksum of the repository.
+ * Usually the checksum of the index, but any
+ * checksum that changes when the repository changes
+ * in any way is sufficient.
+ */
+ CheckSum checksum() const;
+
+ /**
+ * timestamp of the repository. If the repository
+ * changes, it has to be updated as well with the
+ * new timestamp.
+ */
+ Date timestamp() const;
+
+ /**
+ * set the repository checksum \see checksum
+ * \param checksum
+ */
+ RepoStatus & setChecksum( const CheckSum &checksum );
+
+ /**
+ * set the repository timestamp \see timestamp
+ * \param timestamp
+ */
+ RepoStatus & setTimestamp( const Date ×tamp );
+
/** Implementation */
class Impl;
*
*/
-#include "zypp2/repo/memory/DPackageImpl.h"
+#include "zypp2/repo/memory/PackageImpl.h"
using namespace std;
/** \file zypp2/repository/memory/PatternImpl.cc
*
*/
-#include "zypp2/repo/memory/DPatternImpl.h"
+#include "zypp2/repo/memory/PatternImpl.h"
using namespace std;
/** \file zypp2/repo/memory/ProductImpl.cc
*
*/
-#include "zypp2/repo/memory/DProductImpl.h"
+#include "zypp2/repo/memory/ProductImpl.h"
using namespace std;
/** \file zypp2/repo/memory/SrcPackageImpl.cc
*
*/
-#include "zypp2/repo/memory/DSrcPackageImpl.h"
+#include "zypp2/repo/memory/SrcPackageImpl.h"
using namespace std;