libzypp  14.32.0
RepoInfo.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 #include <vector>
14 
15 #include "zypp/base/LogTools.h"
18 
19 #include "zypp/RepoInfo.h"
20 #include "zypp/TriBool.h"
21 #include "zypp/Pathname.h"
23 #include "zypp/ExternalProgram.h"
24 #include "zypp/media/MediaAccess.h"
25 
26 #include "zypp/base/IOStream.h"
27 #include "zypp/base/InputStream.h"
28 #include "zypp/parser/xml/Reader.h"
29 
30 using std::endl;
31 using zypp::xml::escape;
32 
34 namespace zypp
35 {
36 
38  //
39  // CLASS NAME : RepoInfo::Impl
40  //
43  {
44  Impl()
45  : gpgcheck(indeterminate)
46  , keeppackages(indeterminate)
47  , type(repo::RepoType::NONE_e)
48  , emptybaseurls(false)
49  {}
50 
52  {}
53 
54  public:
55  static const unsigned defaultPriority = 99;
56 
57  void setProbedType( const repo::RepoType & t ) const
58  {
60  && t != repo::RepoType::NONE )
61  {
62  // lazy init!
63  const_cast<Impl*>(this)->type = t;
64  }
65  }
66 
67  public:
68  Pathname licenseTgz() const
69  { return metadatapath.empty() ? Pathname() : metadatapath / path / "license.tar.gz"; }
70 
72  { return replacer(mirrorlist_url); }
73 
75  { return mirrorlist_url; }
76 
77  const url_set & baseUrls() const
78  {
79  if ( _baseUrls.empty() && ! getmirrorListUrl().asString().empty() )
80  {
81  emptybaseurls = true;
82  DBG << "MetadataPath: " << metadatapath << endl;
84  _baseUrls.insert( _baseUrls.end(), rmurls.getUrls().begin(), rmurls.getUrls().end() );
85  }
86  return _baseUrls;
87  }
88 
90  { return _baseUrls; }
91 
92  bool baseurl2dump() const
93  { return !emptybaseurls && !_baseUrls.empty(); }
94 
95 
96  void addContent( const std::string & keyword_r )
97  { _keywords.insert( keyword_r ); }
98 
99  bool hasContent( const std::string & keyword_r ) const
100  {
101  if ( _keywords.empty() && ! metadatapath.empty() )
102  {
103  // HACK directly check master index file until RepoManager offers
104  // some content probing ans zypepr uses it.
106  MIL << "Empty keywords...." << metadatapath << endl;
107  Pathname master;
108  if ( PathInfo( (master=metadatapath/"/repodata/repomd.xml") ).isFile() )
109  {
110  //MIL << "GO repomd.." << endl;
111  xml::Reader reader( master );
112  while ( reader.seekToNode( 2, "content" ) )
113  {
114  _keywords.insert( reader.nodeText().asString() );
115  reader.seekToEndNode( 2, "content" );
116  }
117  _keywords.insert( "" ); // valid content in _keywords even if empty
118  }
119  else if ( PathInfo( (master=metadatapath/"/content") ).isFile() )
120  {
121  //MIL << "GO content.." << endl;
122  iostr::forEachLine( InputStream( master ),
123  [this]( int num_r, std::string line_r )->bool
124  {
125  if ( str::startsWith( line_r, "REPOKEYWORDS" ) )
126  {
127  std::vector<std::string> words;
128  if ( str::split( line_r, std::back_inserter(words) ) > 1
129  && words[0].length() == 12 /*"REPOKEYWORDS"*/ )
130  {
131  this->_keywords.insert( ++words.begin(), words.end() );
132  }
133  return true; // mult. occurrances are ok.
134  }
135  return( ! str::startsWith( line_r, "META " ) ); // no need to parse into META section.
136  } );
137  _keywords.insert( "" );
138  }
140  }
141  return( _keywords.find( keyword_r ) != _keywords.end() );
142 
143  }
144 
145  public:
150  Pathname path;
151  std::string service;
152  std::string targetDistro;
153  Pathname metadatapath;
154  Pathname packagespath;
156  mutable bool emptybaseurls;
158 
159  private:
162  mutable std::set<std::string> _keywords;
163 
164  friend Impl * rwcowClone<Impl>( const Impl * rhs );
166  Impl * clone() const
167  { return new Impl( *this ); }
168  };
170 
172  inline std::ostream & operator<<( std::ostream & str, const RepoInfo::Impl & obj )
173  {
174  return str << "RepoInfo::Impl";
175  }
176 
178  //
179  // CLASS NAME : RepoInfo
180  //
182 
184 
186  //
187  // METHOD NAME : RepoInfo::RepoInfo
188  // METHOD TYPE : Ctor
189  //
191  : _pimpl( new Impl() )
192  {}
193 
195  //
196  // METHOD NAME : RepoInfo::~RepoInfo
197  // METHOD TYPE : Dtor
198  //
200  {
201  //MIL << std::endl;
202  }
203 
204  unsigned RepoInfo::priority() const
205  { return _pimpl->priority; }
206 
208  { return Impl::defaultPriority; }
209 
210  void RepoInfo::setPriority( unsigned newval_r )
211  { _pimpl->priority = newval_r ? newval_r : Impl::defaultPriority; }
212 
214  { _pimpl->gpgcheck = check; }
215 
216  void RepoInfo::setMirrorListUrl( const Url & url_r )
217  { _pimpl->setmirrorListUrl() = url_r; }
218 
219  void RepoInfo::setGpgKeyUrl( const Url & url_r )
220  { _pimpl->gpgkey_url = url_r; }
221 
222  void RepoInfo::addBaseUrl( const Url & url_r )
223  {
224  for ( const auto & url : _pimpl->baseUrls() ) // unique!
225  if ( url == url_r )
226  return;
227  _pimpl->baseUrls().push_back( url_r );
228  }
229 
230  void RepoInfo::setBaseUrl( const Url & url_r )
231  {
232  _pimpl->baseUrls().clear();
233  _pimpl->baseUrls().push_back( url_r );
234  }
235 
236  void RepoInfo::setPath( const Pathname &path )
237  { _pimpl->path = path; }
238 
240  { _pimpl->type = t; }
241 
243  { _pimpl->setProbedType( t ); }
244 
245 
246  void RepoInfo::setMetadataPath( const Pathname &path )
247  { _pimpl->metadatapath = path; }
248 
249  void RepoInfo::setPackagesPath( const Pathname &path )
250  { _pimpl->packagespath = path; }
251 
252  void RepoInfo::setKeepPackages( bool keep )
253  { _pimpl->keeppackages = keep; }
254 
255  void RepoInfo::setService( const std::string& name )
256  { _pimpl->service = name; }
257 
258  void RepoInfo::setTargetDistribution( const std::string & targetDistribution )
260 
261  bool RepoInfo::gpgCheck() const
262  { return indeterminate(_pimpl->gpgcheck) ? true : (bool)_pimpl->gpgcheck; }
263 
265  { return indeterminate(_pimpl->keeppackages) ? false : (bool)_pimpl->keeppackages; }
266 
267  Pathname RepoInfo::metadataPath() const
268  { return _pimpl->metadatapath; }
269 
270  Pathname RepoInfo::packagesPath() const
271  { return _pimpl->packagespath; }
272 
274  { return _pimpl->type; }
275 
277  { return _pimpl->getmirrorListUrl(); }
278 
280  { return _pimpl->gpgkey_url; }
281 
283  { return url_set( baseUrlsBegin(), baseUrlsEnd() ); } // Variables replaced!
284 
285  Pathname RepoInfo::path() const
286  { return _pimpl->path; }
287 
288  std::string RepoInfo::service() const
289  { return _pimpl->service; }
290 
291  std::string RepoInfo::targetDistribution() const
292  { return _pimpl->targetDistro; }
293 
295  {
296  return make_transform_iterator( _pimpl->baseUrls().begin(),
297  _pimpl->replacer );
298  }
299 
301  {
302  return make_transform_iterator( _pimpl->baseUrls().end(),
303  _pimpl->replacer );
304  }
305 
307  { return _pimpl->baseUrls().size(); }
308 
310  { return _pimpl->baseUrls().empty(); }
311 
312  bool RepoInfo::baseUrlSet() const
313  { return _pimpl->baseurl2dump(); }
314 
315 
316  void RepoInfo::addContent( const std::string & keyword_r )
317  { _pimpl->addContent( keyword_r ); }
318 
319  bool RepoInfo::hasContent( const std::string & keyword_r ) const
320  { return _pimpl->hasContent( keyword_r ); }
321 
323 
324  bool RepoInfo::hasLicense() const
325  {
326  Pathname licenseTgz( _pimpl->licenseTgz() );
327  return ! licenseTgz.empty() && PathInfo(licenseTgz).isFile();
328  }
329 
331  {
332  static const std::string noAcceptanceFile = "no-acceptance-needed\n";
333  bool accept = true;
334 
335  Pathname licenseTgz( _pimpl->licenseTgz() );
336  if ( licenseTgz.empty() || ! PathInfo( licenseTgz ).isFile() )
337  return false; // no licenses at all
338 
340  cmd.push_back( "tar" );
341  cmd.push_back( "-t" );
342  cmd.push_back( "-z" );
343  cmd.push_back( "-f" );
344  cmd.push_back( licenseTgz.asString() );
345 
347  for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
348  {
349  if ( output == noAcceptanceFile )
350  {
351  accept = false;
352  }
353  }
354  MIL << "License for " << this->name() << " has to be accepted: " << (accept?"true":"false" ) << endl;
355  return accept;
356  }
357 
358  std::string RepoInfo::getLicense( const Locale & lang_r )
359  { return const_cast<const RepoInfo *>(this)->getLicense( lang_r ); }
360 
361  std::string RepoInfo::getLicense( const Locale & lang_r ) const
362  {
363  LocaleSet avlocales( getLicenseLocales() );
364  if ( avlocales.empty() )
365  return std::string();
366 
367  Locale getLang( Locale::bestMatch( avlocales, lang_r ) );
368  if ( getLang == Locale::noCode
369  && avlocales.find( Locale::noCode ) == avlocales.end() )
370  {
371  WAR << "License.tar.gz contains no fallback text! " << *this << endl;
372  // Using the fist locale instead of returning no text at all.
373  // So the user might recognize that there is a license, even if he
374  // can't read it.
375  getLang = *avlocales.begin();
376  }
377 
378  // now extract the license file.
379  static const std::string licenseFileFallback( "license.txt" );
380  std::string licenseFile( getLang == Locale::noCode
381  ? licenseFileFallback
382  : str::form( "license.%s.txt", getLang.code().c_str() ) );
383 
385  cmd.push_back( "tar" );
386  cmd.push_back( "-x" );
387  cmd.push_back( "-z" );
388  cmd.push_back( "-O" );
389  cmd.push_back( "-f" );
390  cmd.push_back( _pimpl->licenseTgz().asString() ); // if it not exists, avlocales was empty.
391  cmd.push_back( licenseFile );
392 
393  std::string ret;
395  for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
396  {
397  ret += output;
398  }
399  prog.close();
400  return ret;
401  }
402 
404  {
405  Pathname licenseTgz( _pimpl->licenseTgz() );
406  if ( licenseTgz.empty() || ! PathInfo( licenseTgz ).isFile() )
407  return LocaleSet();
408 
410  cmd.push_back( "tar" );
411  cmd.push_back( "-t" );
412  cmd.push_back( "-z" );
413  cmd.push_back( "-f" );
414  cmd.push_back( licenseTgz.asString() );
415 
416  LocaleSet ret;
418  for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
419  {
420  static const C_Str license( "license." );
421  static const C_Str dotTxt( ".txt\n" );
422  if ( str::hasPrefix( output, license ) && str::hasSuffix( output, dotTxt ) )
423  {
424  if ( output.size() <= license.size() + dotTxt.size() ) // license.txt
425  ret.insert( Locale() );
426  else
427  ret.insert( Locale( std::string( output.c_str()+license.size(), output.size()- license.size() - dotTxt.size() ) ) );
428  }
429  }
430  prog.close();
431  return ret;
432  }
433 
435 
436  std::ostream & RepoInfo::dumpOn( std::ostream & str ) const
437  {
439  if ( _pimpl->baseurl2dump() )
440  {
441  for ( const auto & url : _pimpl->baseUrls() )
442  {
443  str << "- url : " << url << std::endl;
444  }
445  }
446 
447  // print if non empty value
448  auto strif( [&] ( const std::string & tag_r, const std::string & value_r ) {
449  if ( ! value_r.empty() )
450  str << tag_r << value_r << std::endl;
451  });
452 
453  strif( "- mirrorlist : ", _pimpl->getmirrorListUrl().asString() );
454  strif( "- path : ", path().asString() );
455  str << "- type : " << type() << std::endl;
456  str << "- priority : " << priority() << std::endl;
457  str << "- gpgcheck : " << gpgCheck() << std::endl;
458  strif( "- gpgkey : ", gpgKeyUrl().asString() );
459 
460  if ( ! indeterminate(_pimpl->keeppackages) )
461  str << "- keeppackages: " << keepPackages() << std::endl;
462 
463  strif( "- service : ", service() );
464  strif( "- targetdistro: ", targetDistribution() );
465  strif( "- metadataPath: ", metadataPath().asString() );
466  strif( "- packagesPath: ", packagesPath().asString() );
467 
468  return str;
469  }
470 
471  std::ostream & RepoInfo::dumpAsIniOn( std::ostream & str ) const
472  {
473  RepoInfoBase::dumpAsIniOn(str);
474 
475  if ( _pimpl->baseurl2dump() )
476  {
477  str << "baseurl=";
478  std::string indent;
479  for ( const auto & url : _pimpl->baseUrls() )
480  {
481  str << indent << url << endl;
482  if ( indent.empty() ) indent = " "; // "baseurl="
483  }
484  }
485 
486  if ( ! _pimpl->path.empty() )
487  str << "path="<< path() << endl;
488 
489  if ( ! (_pimpl->getmirrorListUrl().asString().empty()) )
490  str << "mirrorlist=" << _pimpl->getmirrorListUrl() << endl;
491 
492  str << "type=" << type().asString() << endl;
493 
494  if ( priority() != defaultPriority() )
495  str << "priority=" << priority() << endl;
496 
497  if (!indeterminate(_pimpl->gpgcheck))
498  str << "gpgcheck=" << (gpgCheck() ? "1" : "0") << endl;
499  if ( ! (gpgKeyUrl().asString().empty()) )
500  str << "gpgkey=" <<gpgKeyUrl() << endl;
501 
502  if (!indeterminate(_pimpl->keeppackages))
503  str << "keeppackages=" << keepPackages() << endl;
504 
505  if( ! service().empty() )
506  str << "service=" << service() << endl;
507 
508  return str;
509  }
510 
511  std::ostream & RepoInfo::dumpAsXmlOn( std::ostream & str, const std::string & content ) const
512  {
513  std::string tmpstr;
514  str
515  << "<repo"
516  << " alias=\"" << escape(alias()) << "\""
517  << " name=\"" << escape(name()) << "\"";
518  if (type() != repo::RepoType::NONE)
519  str << " type=\"" << type().asString() << "\"";
520  str
521  << " priority=\"" << priority() << "\""
522  << " enabled=\"" << enabled() << "\""
523  << " autorefresh=\"" << autorefresh() << "\""
524  << " gpgcheck=\"" << gpgCheck() << "\"";
525  if (!(tmpstr = gpgKeyUrl().asString()).empty())
526  str << " gpgkey=\"" << escape(tmpstr) << "\"";
527  if (!(tmpstr = mirrorListUrl().asString()).empty())
528  str << " mirrorlist=\"" << escape(tmpstr) << "\"";
529  str << ">" << endl;
530 
531  if ( _pimpl->baseurl2dump() )
532  {
533  for ( const auto & url : _pimpl->baseUrls() )
534  str << "<url>" << escape(url.asString()) << "</url>" << endl;
535  }
536 
537  str << "</repo>" << endl;
538  return str;
539  }
540 
541 
542  std::ostream & operator<<( std::ostream & str, const RepoInfo & obj )
543  {
544  return obj.dumpOn(str);
545  }
546 
547 
549 } // namespace zypp
Url & setmirrorListUrl()
Definition: RepoInfo.cc:74
static const Locale noCode
No or empty code.
Definition: Locale.h:71
LocaleSet getLicenseLocales() const
Return the locales the license is available for.
Definition: RepoInfo.cc:403
std::string name() const
Repository short label.
std::string targetDistribution() const
Distribution for which is this repository meant.
Definition: RepoInfo.cc:291
#define MIL
Definition: Logger.h:47
void setGpgKeyUrl(const Url &gpgkey)
Key to use for gpg checking of this repository.
Definition: RepoInfo.cc:219
static unsigned defaultPriority()
The default priority (99).
Definition: RepoInfo.cc:207
std::string alias() const
unique identifier for this source.
virtual std::ostream & dumpAsIniOn(std::ostream &str) const
Write this RepoInfo object into str in a .repo file format.
Definition: RepoInfo.cc:471
void setPriority(unsigned newval_r)
Set repository priority for solver.
Definition: RepoInfo.cc:210
unsigned split(const C_Str &line_r, _OutputIterator result_r, const C_Str &sepchars_r=" \t")
Split line_r into words.
Definition: String.h:464
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: RepoInfo.h:392
void setMirrorListUrl(const Url &url)
Set mirror list url.
Definition: RepoInfo.cc:216
repo::RepoVariablesUrlReplacer replacer
Definition: RepoInfo.cc:157
urls_const_iterator baseUrlsBegin() const
iterator that points at begin of repository urls
Definition: RepoInfo.cc:294
std::string escape(const C_Str &str_r, const char sep_r)
Escape desired character c using a backslash.
Definition: String.cc:345
std::ostream & dumpOn(std::ostream &str, const zypp::shared_ptr< void > &obj)
Definition: PtrTypes.h:151
Pathname metadataPath() const
Path where this repo metadata was read from.
Definition: RepoInfo.cc:267
std::ostream & operator<<(std::ostream &str, const RepoInfo::Impl &obj)
Definition: RepoInfo.cc:172
Pathname metadatapath
Definition: RepoInfo.cc:153
String related utilities and Regular expression matching.
std::list< Url > url_set
Definition: RepoInfo.h:95
void setProbedType(const repo::RepoType &t) const
This allows to adjust the RepoType lazy, from NONE to some probed value, even for const objects...
Definition: RepoInfo.cc:242
What is known about a repository.
Definition: RepoInfo.h:67
std::set< std::string > _keywords
Definition: RepoInfo.cc:162
Helper to create and pass std::istream.
Definition: InputStream.h:56
void setBaseUrl(const Url &url)
Clears current base URL list and adds url.
Definition: RepoInfo.cc:230
bool enabled() const
If enabled is false, then this repository must be ignored as if does not exists, except when checking...
urls_const_iterator baseUrlsEnd() const
iterator that points at end of repository urls
Definition: RepoInfo.cc:300
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition: String.cc:34
Pathname packagesPath() const
Path where this repo packages are cached.
Definition: RepoInfo.cc:270
unsigned priority() const
Repository priority for solver.
Definition: RepoInfo.cc:204
std::vector< std::string > Arguments
bool seekToNode(int depth_r, const std::string &name_r)
Definition: Reader.cc:212
std::string asString() const
Returns a default string representation of the Url object.
Definition: Url.cc:491
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: TriBool.h:39
transform_iterator< repo::RepoVariablesUrlReplacer, url_set::const_iterator > urls_const_iterator
Definition: RepoInfo.h:97
RepoInfo implementation.
Definition: RepoInfo.cc:42
bool keepPackages() const
Whether packages downloaded from this repository will be kept in local cache.
Definition: RepoInfo.cc:264
bool needToAcceptLicense() const
Whether the repo license has to be accepted, e.g.
Definition: RepoInfo.cc:330
virtual ~RepoInfo()
Definition: RepoInfo.cc:199
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:120
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
Url mirrorListUrl() const
Url of a file which contains a list of Urls If empty, the base url will be used.
Definition: RepoInfo.cc:276
void addContent(const std::string &keyword_r)
Definition: RepoInfo.cc:96
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string...
Definition: String.h:111
int forEachLine(std::istream &str_r, function< bool(int, std::string)> consume_r)
Simple lineparser: Call functor consume_r for each line.
Definition: IOStream.cc:100
void setPath(const Pathname &path)
set the product path.
Definition: RepoInfo.cc:236
void setService(const std::string &name)
sets service which added this repository
Definition: RepoInfo.cc:255
#define WAR
Definition: Logger.h:48
void setMetadataPath(const Pathname &path)
set the path where the local metadata is stored
Definition: RepoInfo.cc:246
bool gpgCheck() const
Whether to check or not this repository with gpg.
Definition: RepoInfo.cc:261
bool startsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasPrefix
Definition: String.h:1005
void setType(const repo::RepoType &t)
set the repository type
Definition: RepoInfo.cc:239
bool baseUrlSet() const
whether there are manualy configured repository urls
Definition: RepoInfo.cc:312
Impl * clone() const
clone for RWCOW_pointer
Definition: RepoInfo.cc:166
void setKeepPackages(bool keep)
Set if packaqes downloaded from this repository will be kept in local cache.
Definition: RepoInfo.cc:252
std::string service() const
Gets name of the service to which this repository belongs or empty string if it has been added manual...
Definition: RepoInfo.cc:288
bool baseurl2dump() const
Definition: RepoInfo.cc:92
const std::string & asString() const
Definition: RepoType.cc:56
std::tr1::unordered_set< Locale > LocaleSet
Definition: Locale.h:28
bool seekToEndNode(int depth_r, const std::string &name_r)
Definition: Reader.cc:232
void addBaseUrl(const Url &url)
Add a base url.
Definition: RepoInfo.cc:222
std::string receiveLine()
Read one line from the input stream.
static const RepoType NONE
Definition: RepoType.h:32
std::string asString(const Patch::SeverityFlag &obj)
Definition: Patch.cc:166
void setPackagesPath(const Pathname &path)
set the path where the local packages are stored
Definition: RepoInfo.cc:249
url_set baseUrls() const
A Url under which the metadata are located, or a set of mirrors.
Definition: RepoInfo.cc:282
const std::vector< Url > & getUrls() const
std::string asString() const
Explicit conversion to std::string.
Definition: XmlString.h:77
int close()
Wait for the progamm to complete.
bool baseUrlsEmpty() const
whether repository urls are available
Definition: RepoInfo.cc:309
repo::RepoType type() const
Type of repository,.
Definition: RepoInfo.cc:273
void setProbedType(const repo::RepoType &t) const
Definition: RepoInfo.cc:57
std::string code() const
Return the locale code.
Definition: Locale.cc:207
Pathname licenseTgz() const
Definition: RepoInfo.cc:68
url_set::size_type urls_size_type
Definition: RepoInfo.h:96
bool hasSuffix(const C_Str &str_r, const C_Str &suffix_r)
Return whether str_r has suffix suffix_r.
Definition: String.h:983
void setTargetDistribution(const std::string &targetDistribution)
Sets the distribution for which is this repository meant.
Definition: RepoInfo.cc:258
Url getmirrorListUrl() const
Definition: RepoInfo.cc:71
std::string getLicense(const Locale &lang_r=Locale()) const
Return the best license for the current (or a specified) locale.
Definition: RepoInfo.cc:361
bool autorefresh() const
If true, the repostory must be refreshed before creating resolvables from it.
XmlString nodeText()
If the curent node is not empty, advances the reader to the next node, and returns the value...
Definition: Reader.cc:140
url_set & baseUrls()
Definition: RepoInfo.cc:89
Pathname packagespath
Definition: RepoInfo.cc:154
bool hasLicense() const
Whether there is a license associated with the repo.
Definition: RepoInfo.cc:324
bool hasContent(const std::string &keyword_r=std::string()) const
Check for content keywords.
Definition: RepoInfo.cc:319
bool hasContent(const std::string &keyword_r) const
Definition: RepoInfo.cc:99
Url gpgKeyUrl() const
Key to use for gpg checking of this repository.
Definition: RepoInfo.cc:279
DefaultIntegral< unsigned, defaultPriority > priority
Definition: RepoInfo.cc:155
Url url() const
Pars pro toto: The first repository url.
Definition: RepoInfo.h:121
void setGpgCheck(bool check)
Whether to check or not this repository with gpg.
Definition: RepoInfo.cc:213
std::string targetDistro
Definition: RepoInfo.cc:152
static const RepoInfo noRepo
Represents no Repository (one with an empty alias).
Definition: RepoInfo.h:76
bool check(const std::string &sequenceinfo_r, bool quick_r)
Check via sequence info.
void addContent(const std::string &keyword_r)
Add content keywords.
Definition: RepoInfo.cc:316
size_type size() const
Definition: String.h:125
virtual std::ostream & dumpAsXmlOn(std::ostream &str, const std::string &content="") const
Write an XML representation of this RepoInfo object.
Definition: RepoInfo.cc:511
repo::RepoType type
Definition: RepoInfo.cc:149
Functor replacing repository variables.
Definition: RepoVariables.h:45
urls_size_type baseUrlsSize() const
number of repository urls
Definition: RepoInfo.cc:306
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
static Locale bestMatch(const LocaleSet &avLocales_r, const Locale &requested_r=Locale())
Return the best match for Locale requested_r within the available avLocales_r.
Definition: Locale.cc:229
static const unsigned defaultPriority
Definition: RepoInfo.cc:55
const url_set & baseUrls() const
Definition: RepoInfo.cc:77
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition: String.h:975
Url manipulation class.
Definition: Url.h:87
Pathname path() const
Repository path.
Definition: RepoInfo.cc:285
virtual std::ostream & dumpOn(std::ostream &str) const
Write a human-readable representation of this RepoInfo object into the str stream.
Definition: RepoInfo.cc:436
#define DBG
Definition: Logger.h:46
std::string service
Definition: RepoInfo.cc:151
detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
Definition: XmlEscape.h:51
Repository type enumeration.
Definition: RepoType.h:27