#
SET(LIBZYPP_MAJOR "15")
SET(LIBZYPP_COMPATMINOR "11")
-SET(LIBZYPP_MINOR "12")
+SET(LIBZYPP_MINOR "13")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 15.12.0 (11)
+# LAST RELEASED: 15.13.0 (11)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
-------------------------------------------------------------------
+Thu Aug 13 18:16:52 CEST 2015 - ma@suse.de
+
+- Support caching of service metadata. A TTL for the service
+ metadata may be provided in the repoindex.xml itself. The
+ default is 'no caching'. (FATE#318136)
+- Fix setting dup_allow* solver options (bnc#941463)
+- Don't make zypper encode {} around repo vars (bnc#941453)
+- version 15.13.0 (11)
+
+-------------------------------------------------------------------
+Thu Aug 13 01:13:43 CEST 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
Tue Aug 11 18:48:57 CEST 2015 - ma@suse.de
- History: Add 'command' tag showing who triggered the commit.
}
}
+BOOST_AUTO_TEST_CASE( test_url5)
+{
+ std::string str( "file:/some/${var:+path}/${var:-with}/${vars}" );
+ BOOST_CHECK_EQUAL( Url(str).asString(), str );
+ BOOST_CHECK_EQUAL( Url(zypp::url::encode( str, URL_SAFE_CHARS )).asString(), str );
+}
+
BOOST_AUTO_TEST_CASE(plugin_querystring_args)
{
// url querysting options without value must be possible
public:
typedef time_t ValueType;
+ typedef time_t Duration;
static const ValueType second = 1;
static const ValueType minute = 60;
ServiceInfo service( getService( alias ) );
assert_alias( service );
assert_url( service );
+ MIL << "Going to refresh service '" << service.alias() << "', url: " << service.url() << ", opts: " << options_r << endl;
+
+ if ( service.ttl() && !options_r.testFlag( RefreshService_forceRefresh ) )
+ {
+ // Service defines a TTL; maybe we can re-use existing data without refresh.
+ Date lrf = service.lrf();
+ if ( lrf )
+ {
+ Date now( Date::now() );
+ if ( lrf <= now )
+ {
+ if ( (lrf+=service.ttl()) > now ) // lrf+= !
+ {
+ MIL << "Skip: '" << service.alias() << "' metadata valid until " << lrf << endl;
+ return;
+ }
+ }
+ else
+ WAR << "Force: '" << service.alias() << "' metadata last refresh in the future: " << lrf << endl;
+ }
+ }
+
// NOTE: It might be necessary to modify and rewrite the service info.
// Either when probing the type, or when adjusting the repositories
// enable/disable state.:
bool serviceModified = false;
- MIL << "Going to refresh service '" << service.alias() << "', url: "<< service.url() << ", opts: " << options_r << endl;
- //! \todo add callbacks for apps (start, end, repo removed, repo added, repo changed)
+ //! \todo add callbacks for apps (start, end, repo removed, repo added, repo changed)?
// if the type is unknown, try probing.
if ( service.type() == repo::ServiceType::NONE )
DBG << "ServicesTargetDistro: " << servicesTargetDistro << endl;
// parse it
+ Date::Duration origTtl = service.ttl(); // FIXME Ugly hack: const service.ttl modified when parsing
RepoCollector collector(servicesTargetDistro);
// FIXME Ugly hack: ServiceRepos may throw ServicePluginInformalException
// which is actually a notification. Using an exception for this
// and in zypper.
std::pair<DefaultIntegral<bool,false>, repo::ServicePluginInformalException> uglyHack;
try {
- ServiceRepos repos(service, bind( &RepoCollector::collect, &collector, _1 ));
+ ServiceRepos( service, bind( &RepoCollector::collect, &collector, _1 ) );
}
catch ( const repo::ServicePluginInformalException & e )
{
uglyHack.first = true;
uglyHack.second = e;
}
-
+ if ( service.ttl() != origTtl ) // repoindex.xml changed ttl
+ {
+ if ( !service.ttl() )
+ service.setLrf( Date() ); // don't need lrf when zero ttl
+ serviceModified = true;
+ }
////////////////////////////////////////////////////////////////////////////
// On the fly remember the new repo states as defined the reopoindex.xml.
// Move into ServiceInfo later.
////////////////////////////////////////////////////////////////////////////
// save service if modified: (unless a plugin service)
- if ( serviceModified && service.type() != ServiceType::PLUGIN )
+ if ( service.type() != ServiceType::PLUGIN )
{
- // write out modified service file.
- modifyService( service.alias(), service );
+ if ( service.ttl() )
+ {
+ service.setLrf( Date::now() ); // remember last refresh
+ serviceModified = true; // or use a cookie file
+ }
+
+ if ( serviceModified )
+ {
+ // write out modified service file.
+ modifyService( service.alias(), service );
+ }
}
if ( uglyHack.first )
/** Flags for tuning RefreshService */
enum RefreshServiceBit
{
- RefreshService_restoreStatus = (1<<0) ///< Force restoring repo enabled/disabled staus
+ RefreshService_restoreStatus = (1<<0), ///< Force restoring repo enabled/disabled status
+ RefreshService_forceRefresh = (1<<1), ///< Force refresh even if TTL is not reached
};
ZYPP_DECLARE_FLAGS(RefreshServiceFlags,RefreshServiceBit);
#include <iostream>
#include "zypp/base/String.h"
+#include "zypp/base/DefaultIntegral.h"
#include "zypp/parser/xml/XmlEscape.h"
#include "zypp/RepoInfo.h"
typedef ServiceInfo::ReposToDisable ReposToDisable;
public:
- RepoVariablesReplacedUrl url;
- repo::ServiceType type;
- ReposToEnable reposToEnable;
- ReposToDisable reposToDisable;
- RepoStates repoStates;
-
+ RepoVariablesReplacedUrl _url;
+ repo::ServiceType _type;
+ ReposToEnable _reposToEnable;
+ ReposToDisable _reposToDisable;
+ RepoStates _repoStates;
+ DefaultIntegral<Date::Duration,0> _ttl;
+ Date _lrf;
public:
Impl()
- : type(repo::ServiceType::NONE_e)
{}
- Impl(const Url & url_)
- : url(url_)
- , type(repo::ServiceType::NONE_e)
+ Impl( const Url & url_r )
+ : _url( url_r )
{}
~Impl()
{}
- void setProbedType( const repo::ServiceType & t ) const
+ void setProbedType( const repo::ServiceType & type_r ) const
{
- if ( type == repo::ServiceType::NONE
- && t != repo::ServiceType::NONE )
+ if ( _type == repo::ServiceType::NONE
+ && type_r != repo::ServiceType::NONE )
{
// lazy init!
- const_cast<Impl*>(this)->type = t;
+ const_cast<Impl*>(this)->_type = type_r;
}
}
{}
Url ServiceInfo::url() const // Variables replaced
- { return _pimpl->url.transformed(); }
+ { return _pimpl->_url.transformed(); }
Url ServiceInfo::rawUrl() const // Raw
- { return _pimpl->url.raw(); }
+ { return _pimpl->_url.raw(); }
void ServiceInfo::setUrl( const Url& url ) // Raw
- { _pimpl->url.raw() = url; }
-
- repo::ServiceType ServiceInfo::type() const
- { return _pimpl->type; }
- void ServiceInfo::setType( const repo::ServiceType & type )
- { _pimpl->type = type; }
-
- void ServiceInfo::setProbedType( const repo::ServiceType &t ) const
- { _pimpl->setProbedType( t ); }
+ { _pimpl->_url.raw() = url; }
- bool ServiceInfo::reposToEnableEmpty() const
- { return _pimpl->reposToEnable.empty(); }
+ repo::ServiceType ServiceInfo::type() const { return _pimpl->_type; }
+ void ServiceInfo::setType( const repo::ServiceType & type ) { _pimpl->_type = type; }
+ void ServiceInfo::setProbedType( const repo::ServiceType &t ) const { _pimpl->setProbedType( t ); }
- ServiceInfo::ReposToEnable::size_type ServiceInfo::reposToEnableSize() const
- { return _pimpl->reposToEnable.size(); }
+ Date::Duration ServiceInfo::ttl() const { return _pimpl->_ttl; }
+ void ServiceInfo::setTtl( Date::Duration ttl_r ) { _pimpl->_ttl = ttl_r; }
+ void ServiceInfo::setProbedTtl( Date::Duration ttl_r ) const { const_cast<ServiceInfo*>(this)->setTtl( ttl_r ); }
- ServiceInfo::ReposToEnable::const_iterator ServiceInfo::reposToEnableBegin() const
- { return _pimpl->reposToEnable.begin(); }
+ Date ServiceInfo::lrf() const { return _pimpl->_lrf; }
+ void ServiceInfo::setLrf( Date lrf_r ) { _pimpl->_lrf = lrf_r; }
- ServiceInfo::ReposToEnable::const_iterator ServiceInfo::reposToEnableEnd() const
- { return _pimpl->reposToEnable.end(); }
+ bool ServiceInfo::reposToEnableEmpty() const { return _pimpl->_reposToEnable.empty(); }
+ ServiceInfo::ReposToEnable::size_type ServiceInfo::reposToEnableSize() const { return _pimpl->_reposToEnable.size(); }
+ ServiceInfo::ReposToEnable::const_iterator ServiceInfo::reposToEnableBegin() const { return _pimpl->_reposToEnable.begin(); }
+ ServiceInfo::ReposToEnable::const_iterator ServiceInfo::reposToEnableEnd() const { return _pimpl->_reposToEnable.end(); }
bool ServiceInfo::repoToEnableFind( const std::string & alias_r ) const
- { return( _pimpl->reposToEnable.find( alias_r ) != _pimpl->reposToEnable.end() ); }
+ { return( _pimpl->_reposToEnable.find( alias_r ) != _pimpl->_reposToEnable.end() ); }
void ServiceInfo::addRepoToEnable( const std::string & alias_r )
{
- _pimpl->reposToEnable.insert( alias_r );
- _pimpl->reposToDisable.erase( alias_r );
+ _pimpl->_reposToEnable.insert( alias_r );
+ _pimpl->_reposToDisable.erase( alias_r );
}
void ServiceInfo::delRepoToEnable( const std::string & alias_r )
- { _pimpl->reposToEnable.erase( alias_r ); }
+ { _pimpl->_reposToEnable.erase( alias_r ); }
void ServiceInfo::clearReposToEnable()
- { _pimpl->reposToEnable.clear(); }
-
-
- bool ServiceInfo::reposToDisableEmpty() const
- { return _pimpl->reposToDisable.empty(); }
+ { _pimpl->_reposToEnable.clear(); }
- ServiceInfo::ReposToDisable::size_type ServiceInfo::reposToDisableSize() const
- { return _pimpl->reposToDisable.size(); }
- ServiceInfo::ReposToDisable::const_iterator ServiceInfo::reposToDisableBegin() const
- { return _pimpl->reposToDisable.begin(); }
-
- ServiceInfo::ReposToDisable::const_iterator ServiceInfo::reposToDisableEnd() const
- { return _pimpl->reposToDisable.end(); }
+ bool ServiceInfo::reposToDisableEmpty() const { return _pimpl->_reposToDisable.empty(); }
+ ServiceInfo::ReposToDisable::size_type ServiceInfo::reposToDisableSize() const { return _pimpl->_reposToDisable.size(); }
+ ServiceInfo::ReposToDisable::const_iterator ServiceInfo::reposToDisableBegin() const { return _pimpl->_reposToDisable.begin(); }
+ ServiceInfo::ReposToDisable::const_iterator ServiceInfo::reposToDisableEnd() const { return _pimpl->_reposToDisable.end(); }
bool ServiceInfo::repoToDisableFind( const std::string & alias_r ) const
- { return( _pimpl->reposToDisable.find( alias_r ) != _pimpl->reposToDisable.end() ); }
+ { return( _pimpl->_reposToDisable.find( alias_r ) != _pimpl->_reposToDisable.end() ); }
void ServiceInfo::addRepoToDisable( const std::string & alias_r )
{
- _pimpl->reposToDisable.insert( alias_r );
- _pimpl->reposToEnable.erase( alias_r );
+ _pimpl->_reposToDisable.insert( alias_r );
+ _pimpl->_reposToEnable.erase( alias_r );
}
void ServiceInfo::delRepoToDisable( const std::string & alias_r )
- { _pimpl->reposToDisable.erase( alias_r ); }
+ { _pimpl->_reposToDisable.erase( alias_r ); }
void ServiceInfo::clearReposToDisable()
- { _pimpl->reposToDisable.clear(); }
+ { _pimpl->_reposToDisable.clear(); }
+
- const ServiceInfo::RepoStates & ServiceInfo::repoStates() const
- { return _pimpl->repoStates; }
+ const ServiceInfo::RepoStates & ServiceInfo::repoStates() const { return _pimpl->_repoStates; }
+ void ServiceInfo::setRepoStates( RepoStates newStates_r ) { swap( _pimpl->_repoStates, newStates_r ); }
- void ServiceInfo::setRepoStates( RepoStates newStates_r )
- { swap( _pimpl->repoStates, newStates_r ); }
std::ostream & operator<<( std::ostream & str, const ServiceInfo::RepoState & obj )
{
<< "url = " << rawUrl() << endl
<< "type = " << type() << endl;
+ if ( ttl() )
+ str << "ttl_sec = " << ttl() << endl;
+
+ if ( lrf() )
+ str << "lrf_dat = " << lrf().asSeconds() << endl;
+
if ( ! repoStates().empty() )
{
unsigned cnt = 0U;
<< " enabled=\"" << enabled() << "\""
<< " autorefresh=\"" << autorefresh() << "\""
<< " url=\"" << escape(url().asString()) << "\""
- << " type=\"" << type().asString() << "\"";
+ << " type=\"" << type().asString() << "\""
+ << " ttl_sec\"" << ttl() << "\"";
if (content.empty())
str << "/>" << endl;
#include "zypp/Url.h"
+#include "zypp/base/Iterable.h"
#include "zypp/repo/ServiceType.h"
#include "zypp/RepoInfo.h"
-
+#include "zypp/Date.h"
///////////////////////////////////////////////////////////////////
namespace zypp
/** Lazy init service type */
void setProbedType( const repo::ServiceType & t ) const;
+ /** \name Housekeeping data
+ * You don't want to use the setters unless you are a \ref RepoManager.
+ */
+ //@{
+ /** Sugested TTL between two metadata auto-refreshs.
+ * The value (in seconds) may be provided in repoindex.xml:xpath:/repoindex@ttl.
+ * Default is \a 0 - perform each auto-refresh request.
+ */
+ Date::Duration ttl() const;
+
+ /** Set sugested TTL. */
+ void setTtl( Date::Duration ttl_r );
+
+ /** Lazy init sugested TTL. */
+ void setProbedTtl( Date::Duration ttl_r ) const;
+ /** Date of last refresh (if known). */
+ Date lrf() const;
+
+ /** Set date of last refresh. */
+ void setLrf( Date lrf_r );
+ //@}
+ //
/** \name Set of repos (repository aliases) to enable on next refresh.
*
* Per default new repositories are created in disabled state. But repositories
ReposToEnable::size_type reposToEnableSize() const;
ReposToEnable::const_iterator reposToEnableBegin() const;
ReposToEnable::const_iterator reposToEnableEnd() const;
+ Iterable<ReposToEnable::const_iterator> reposToEnable() const
+ { return makeIterable( reposToEnableBegin(), reposToEnableEnd() ); }
/** Whether \c alias_r is mentioned in ReposToEnable. */
bool repoToEnableFind( const std::string & alias_r ) const;
ReposToDisable::size_type reposToDisableSize() const;
ReposToDisable::const_iterator reposToDisableBegin() const;
ReposToDisable::const_iterator reposToDisableEnd() const;
+ Iterable<ReposToDisable::const_iterator> reposToDisable() const
+ { return makeIterable( reposToDisableBegin(), reposToDisableEnd() ); }
/** Whether \c alias_r is mentioned in ReposToDisable. */
bool repoToDisableFind( const std::string & alias_r ) const;
Str & operator<<( const _Tp & val )
{ _str << val; return *this; }
+ Str & operator<<( std::ostream& (*iomanip)( std::ostream& ) )
+ { _str << iomanip; return *this; }
+
operator std::string() const
{ return _str.str(); }
#include "zypp/base/Logger.h"
#include "zypp/base/Gettext.h"
#include "zypp/base/InputStream.h"
+#include "zypp/base/DefaultIntegral.h"
#include "zypp/Pathname.h"
/** */
void setVar( const std::string & key_r, const std::string & val_r )
{
- MIL << "*** Inject " << key_r << " = " << val_r;
+ //MIL << "*** Inject " << key_r << " = " << val_r;
_vars[key_r] = replace( val_r );
- MIL << " (" << _vars[key_r] << ")" << endl;
+ //MIL << " (" << _vars[key_r] << ")" << endl;
}
std::string replace( const std::string & val_r ) const
*/
bool consumeNode( Reader & reader_r );
+ DefaultIntegral<Date::Duration,2> _ttl;
+
private:
bool getAttrValue( const std::string & key_r, Reader & reader_r, std::string & value_r )
{
if ( reader_r->name() == "repoindex" )
{
while ( reader_r.nextNodeAttribute() )
- _replacer.setVar( reader_r->localName().asString(), reader_r->value().asString() );
+ {
+ const std::string & name( reader_r->localName().asString() );
+ const std::string & value( reader_r->value().asString() );
+ _replacer.setVar( name, value );
+ // xpath: /repoindex@ttl
+ if ( name == "ttl" )
+ _ttl = str::strtonum<Date::Duration>(value);
+ }
return true;
}
//
///////////////////////////////////////////////////////////////////
- RepoindexFileReader::RepoindexFileReader(
- const Pathname & repoindex_file, const ProcessResource & callback)
- :
- _pimpl(new Impl(InputStream(repoindex_file), callback))
+ RepoindexFileReader::RepoindexFileReader( const Pathname & repoindex_file, const ProcessResource & callback )
+ : _pimpl(new Impl(InputStream(repoindex_file), callback))
{}
- RepoindexFileReader::RepoindexFileReader(
- const InputStream &is, const ProcessResource & callback )
- : _pimpl(new Impl(is, callback))
+ RepoindexFileReader::RepoindexFileReader( const InputStream &is, const ProcessResource & callback )
+ : _pimpl(new Impl(is, callback))
{}
RepoindexFileReader::~RepoindexFileReader()
{}
+ Date::Duration RepoindexFileReader::ttl() const { return _pimpl->_ttl; }
} // ns parser
} // ns zypp
#include "zypp/base/Function.h"
#include "zypp/base/InputStream.h"
#include "zypp/Pathname.h"
+#include "zypp/Date.h"
namespace zypp
{
* First parameter is a \ref RepoInfo object with the resource
* FIXME return value is ignored
*/
- typedef function< bool(
- const RepoInfo & )>
- ProcessResource;
+ typedef function< bool( const RepoInfo & )> ProcessResource;
/**
* CTOR. Creates also \ref xml::Reader and starts reading.
*/
~RepoindexFileReader();
+ /** Metadata TTL (repoindex.xml:xpath:/repoindex@ttl or 0). */
+ Date::Duration ttl() const;
+
private:
class Impl;
RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl;
service.setAutorefresh( str::strToTrue( it->second ) );
else if ( it->first == "type" )
service.setType( repo::ServiceType(it->second) );
+ else if ( it->first == "ttl_sec" )
+ service.setTtl( str::strtonum<Date::Duration>(it->second) );
+ else if ( it->first == "lrf_dat" )
+ service.setLrf( Date( it->second ) );
else if ( it->first == "repostoenable" )
{
std::vector<std::string> aliases;
using std::stringstream;
using std::endl;
+///////////////////////////////////////////////////////////////////
namespace zypp
{
-namespace repo
-{
+ ///////////////////////////////////////////////////////////////////
+ namespace repo
+ {
+ struct ServiceRepos::Impl
+ { virtual ~Impl() {} };
-class ServiceRepos::Impl
-{
-public:
- Impl()
- {
- }
+ ///////////////////////////////////////////////////////////////////
- virtual ~Impl()
+ struct RIMServiceRepos : public ServiceRepos::Impl
{
- }
-};
-
-class RIMServiceRepos : public ServiceRepos::Impl
-{
-public:
- ServiceRepos::ProcessRepo _callback;
-
- RIMServiceRepos(const ServiceInfo &service,
- const ServiceRepos::ProcessRepo & callback,
- const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() )
- : _callback(callback)
- {
- // repoindex.xml must be fetched always without using cookies (bnc #573897)
- Url serviceUrl( service.url() );
- serviceUrl.setQueryParam( "cookies", "0" );
-
- // download the repo index file
- media::MediaManager mediamanager;
- media::MediaAccessId mid = mediamanager.open( serviceUrl );
- mediamanager.attach( mid );
- mediamanager.provideFile( mid, "repo/repoindex.xml" );
- Pathname path = mediamanager.localPath(mid, "repo/repoindex.xml" );
- parser::RepoindexFileReader reader(path, _callback);
- mediamanager.release( mid );
- mediamanager.close( mid );
- }
-
- ~RIMServiceRepos()
- {
-
- }
-};
+ RIMServiceRepos( const ServiceInfo & service,
+ const ServiceRepos::ProcessRepo & callback,
+ const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc() )
+ {
+ // repoindex.xml must be fetched always without using cookies (bnc #573897)
+ Url serviceUrl( service.url() );
+ serviceUrl.setQueryParam( "cookies", "0" );
+
+ // download the repo index file
+ media::MediaManager mediamanager;
+ media::MediaAccessId mid = mediamanager.open( serviceUrl );
+ mediamanager.attach( mid );
+ mediamanager.provideFile( mid, "repo/repoindex.xml" );
+ Pathname path = mediamanager.localPath(mid, "repo/repoindex.xml" );
+ parser::RepoindexFileReader reader(path, callback);
+ service.setProbedTtl( reader.ttl() ); // hack! Modifying the const Service to set parsed TTL
+ mediamanager.release( mid );
+ mediamanager.close( mid );
+ }
+ };
-class PluginServiceRepos : public ServiceRepos::Impl
-{
-public:
- ServiceRepos::ProcessRepo _callback;
+ ///////////////////////////////////////////////////////////////////
- PluginServiceRepos(const ServiceInfo &service,
- const ServiceRepos::ProcessRepo & callback,
- const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() )
- : _callback(callback)
+ struct PluginServiceRepos : public ServiceRepos::Impl
{
- Url serviceUrl( service.url() );
- stringstream buffer;
-
- ExternalProgram::Arguments args;
- args.reserve( 3 );
- args.push_back( "/bin/sh" );
- args.push_back( "-c" );
- args.push_back( serviceUrl.getPathName() );
- ExternalProgramWithStderr prog( args );
- prog >> buffer;
-
- if ( prog.close() != 0 )
+ PluginServiceRepos( const ServiceInfo & service,
+ const ServiceRepos::ProcessRepo & callback,
+ const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc() )
{
- // ServicePluginInformalException:
- // Ignore this error but we'd like to report it somehow...
- std::string errbuffer;
- prog.stderrGetUpTo( errbuffer, '\0' );
- ERR << "Capture plugin error:[" << endl << errbuffer << endl << ']' << endl;
- ZYPP_THROW( repo::ServicePluginInformalException( service, errbuffer ) );
+ Url serviceUrl( service.url() );
+ stringstream buffer;
+
+ ExternalProgram::Arguments args;
+ args.reserve( 3 );
+ args.push_back( "/bin/sh" );
+ args.push_back( "-c" );
+ args.push_back( serviceUrl.getPathName() );
+ ExternalProgramWithStderr prog( args );
+ prog >> buffer;
+
+ if ( prog.close() != 0 )
+ {
+ // ServicePluginInformalException:
+ // Ignore this error but we'd like to report it somehow...
+ std::string errbuffer;
+ prog.stderrGetUpTo( errbuffer, '\0' );
+ ERR << "Capture plugin error:[" << endl << errbuffer << endl << ']' << endl;
+ ZYPP_THROW( repo::ServicePluginInformalException( service, errbuffer ) );
+ }
+ parser::RepoFileReader parser( buffer, callback );
}
+ };
- parser::RepoFileReader parser(buffer, _callback);
- }
+ ///////////////////////////////////////////////////////////////////
- ~PluginServiceRepos()
+ ServiceRepos::ServiceRepos( const ServiceInfo & service,
+ const ServiceRepos::ProcessRepo & callback,
+ const ProgressData::ReceiverFnc &progress )
+ : _impl( ( service.type() == ServiceType::PLUGIN )
+ ? static_cast<ServiceRepos::Impl*>( new PluginServiceRepos( service, callback, progress ) )
+ : static_cast<ServiceRepos::Impl*>( new RIMServiceRepos (service, callback, progress ) ) )
{}
-};
-
-
-ServiceRepos::ServiceRepos(const ServiceInfo &service,
- const ServiceRepos::ProcessRepo & callback,
- const ProgressData::ReceiverFnc &progress)
- : _impl( (service.type() == ServiceType::PLUGIN) ? (ServiceRepos::Impl *)(new PluginServiceRepos(service, callback, progress)) : (ServiceRepos::Impl *)(new RIMServiceRepos(service, callback, progress)))
-{
-}
-
-ServiceRepos::~ServiceRepos()
-{
-}
+ ServiceRepos::~ServiceRepos()
+ {}
-}
-}
+ } // namespace repo
+ ///////////////////////////////////////////////////////////////////
+} //namespace zypp
+///////////////////////////////////////////////////////////////////
namespace repo
{
/**
- * Retrieval of repository list for
- * a service
+ * Retrieval of repository list for a service.
*/
class ServiceRepos : private base::NonCopyable
{
public:
-
/**
- * Callback definition.
- * First parameter is a \ref RepoInfo object with the resource
- * second parameter is the resource type.
- *
* Return false from the callback to get a \ref AbortRequestException
* to be thrown and the processing to be cancelled.
*/
typedef function< bool( const RepoInfo & )> ProcessRepo;
- ServiceRepos(const ServiceInfo &service,
- const ProcessRepo & callback,
- const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() );
+ ServiceRepos( const ServiceInfo & service,
+ const ProcessRepo & callback,
+ const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() );
~ServiceRepos();
- /** Implementation */
- class Impl;
+ public:
+ class Impl; //!< Expose type only
private:
RW_pointer<Impl> _impl;
};
solver_set_flag(_solv, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
solver_set_flag(_solv, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires);
solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
- solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allownamechange );
- solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowarchchange );
- solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allowvendorchange );
+ solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
+ solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
+ solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowvendorchange );
#if 1
#define HACKENV(X,D) solver_set_flag(_solv, X, env::HACKENV( #X, D ) );
HACKENV( SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
- HACKENV( SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allownamechange );
- HACKENV( SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,_dup_allowarchchange );
- HACKENV( SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allowvendorchange );
+ HACKENV( SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
+ HACKENV( SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
+ HACKENV( SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,_dup_allowvendorchange );
#undef HACKENV
#endif
sat::Pool::instance().prepareForSolving();
#include <map>
/** Characters that are safe for URL without percent-encoding. */
-#define URL_SAFE_CHARS ":/?#[]@!$&'()*+,;="
+#define URL_SAFE_CHARS ":/?#[]@!$&'(){}*+,;="
//////////////////////////////////////////////////////////////////////
namespace zypp