Author: dmacvicar
Date: Fri Jul 13 12:55:53 2007
New Revision: 6000
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6000&view=rev
Log:
Add support for gpgkey and gpgcheck hints to RepoInfo
Modified:
branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc
branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc?rev=6000&r1=5999&r2=6000&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc Fri Jul 13 12:55:53 2007
@@ -42,9 +42,12 @@
public:
boost::tribool enabled;
boost::tribool autorefresh;
+ boost::tribool gpgcheck;
+ Url gpgkey_url;
repo::RepoType type;
Url mirrorlist_url;
std::set<Url> baseUrls;
+ Pathname path;
std::string alias;
std::string name;
Pathname filepath;
@@ -100,12 +103,24 @@
_pimpl->autorefresh = autorefresh;
return *this;
}
+
+ RepoInfo & RepoInfo::setGpgCheck( boost::tribool check )
+ {
+ _pimpl->gpgcheck = check;
+ return *this;
+ }
RepoInfo & RepoInfo::setMirrorListUrl( const Url &url )
{
_pimpl->mirrorlist_url = url;
return *this;
}
+
+ RepoInfo & RepoInfo::setGpgKeyUrl( const Url &url )
+ {
+ _pimpl->gpgkey_url = url;
+ return *this;
+ }
RepoInfo & RepoInfo::addBaseUrl( const Url &url )
{
@@ -120,6 +135,12 @@
return *this;
}
+ RepoInfo & RepoInfo::setPath( const Pathname &path )
+ {
+ _pimpl->path = path;
+ return *this;
+ }
+
RepoInfo & RepoInfo::setAlias( const std::string &alias )
{
_pimpl->alias = alias;
@@ -149,6 +170,9 @@
tribool RepoInfo::autorefresh() const
{ return _pimpl->autorefresh; }
+
+ tribool RepoInfo::gpgCheck() const
+ { return _pimpl->gpgcheck; }
std::string RepoInfo::alias() const
{ return _pimpl->alias; }
@@ -164,10 +188,16 @@
Url RepoInfo::mirrorListUrl() const
{ return _pimpl->mirrorlist_url; }
+
+ Url RepoInfo::gpgKeyUrl() const
+ { return _pimpl->gpgkey_url; }
std::set<Url> RepoInfo::baseUrls() const
{ return _pimpl->baseUrls; }
+ Pathname RepoInfo::path() const
+ { return _pimpl->path; }
+
RepoInfo::urls_const_iterator RepoInfo::baseUrlsBegin() const
{ return _pimpl->baseUrls.begin(); }
@@ -191,11 +221,14 @@
{
str << "- url : " << *it << std::endl;
}
-
+ str << "- path : " << path() << std::endl;
str << "- type : " << type() << std::endl;
str << "- enabled : " << enabled() << std::endl;
+
str << "- autorefresh : " << autorefresh() << std::endl;
- //str << "- path : " << path() << std::endl;
+ str << "- gpgcheck : " << gpgCheck() << std::endl;
+ str << "- gpgkey : " << gpgKeyUrl() << std::endl;
+
return str;
}
@@ -212,10 +245,24 @@
{
str << *it << endl;
}
- str << "mirrorlist=" << mirrorListUrl() << endl;
+
+ if ( ! path().empty() )
+ str << "path="<< path() << endl;
+
+ if ( ! (mirrorListUrl().asString().empty()) )
+ str << "mirrorlist=" << mirrorListUrl() << endl;
+
str << "type=" << type().asString() << endl;
- str << "enabled=" << (enabled() ? "1" : "0") << endl;
- str << "autorefresh=" << (autorefresh() ? "1" : "0") << endl;
+
+ if ( enabled() != indeterminate )
+ str << "enabled=" << (enabled() ? "1" : "0") << endl;
+ if ( autorefresh() != indeterminate )
+ str << "autorefresh=" << (autorefresh() ? "1" : "0") << endl;
+ if ( autorefresh() != indeterminate )
+ str << "gpgcheck=" << (gpgCheck() ? "1" : "0") << endl;
+ if ( ! (gpgKeyUrl().asString().empty()) )
+ str << "gpgkey=" <