if nothing better is available.
return false;
}
+ std::string makeStupidAlias( const Url & url_r )
+ {
+ std::string ret( url_r.getScheme() );
+ if ( ret.empty() )
+ ret = "repo-";
+ else
+ ret += "-";
+
+ std::string host( url_r.getHost() );
+ if ( ! host.empty() )
+ {
+ ret += host;
+ ret += "-";
+ }
+
+ static Date::ValueType serial = Date::now();
+ ret += Digest::digest( Digest::sha1(), str::hexstring( ++serial ) +url_r.asCompleteString() ).substr(0,8);
+ return ret;
+ }
+
////////////////////////////////////////////////////////////////////////////
Pathname RepoManager::metadataPath( const RepoInfo &info ) const
/** \overload Take alias from RepoInfo. */
bool hasRepo( const RepoInfo & info_r ) const
{ return hasRepo( info_r.alias() ); }
+
+ /** Some stupid string but suitable as alias for your url if nothing better is available.
+ * Something like \c "http-download.opensuse.org-83df67e5"
+ */
+ static std::string makeStupidAlias( const Url & url_r = Url() );
//@}
/**