libzypp  14.29.1
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/Logger.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 std::set<Url> &baseUrls() const
78  {
79  if ( _baseUrls.empty() && ! (getmirrorListUrl().asString().empty()) )
80  {
81  emptybaseurls = true;
82  repo::RepoMirrorList *rmirrorlist = NULL;
83 
84  DBG << "MetadataPath: " << metadatapath << endl;
85  if( metadatapath.empty() )
86  rmirrorlist = new repo::RepoMirrorList (getmirrorListUrl() );
87  else
88  rmirrorlist = new repo::RepoMirrorList (getmirrorListUrl(), metadatapath );
89 
90  std::vector<Url> rmurls = rmirrorlist->getUrls();
91  delete rmirrorlist;
92  rmirrorlist = NULL;
93  _baseUrls.insert(rmurls.begin(), rmurls.end());
94  }
95  return _baseUrls;
96  }
97 
98  std::set<Url> &baseUrls()
99  { return _baseUrls; }
100 
101  bool baseurl2dump() const
102  { return !emptybaseurls && !_baseUrls.empty(); }
103 
104 
105  void addContent( const std::string & keyword_r )
106  { _keywords.insert( keyword_r ); }
107 
108  bool hasContent( const std::string & keyword_r ) const
109  {
110  if ( _keywords.empty() && ! metadatapath.empty() )
111  {
112  // HACK directly check master index file until RepoManager offers
113  // some content probing ans zypepr uses it.
115  MIL << "Empty keywords...." << metadatapath << endl;
116  Pathname master;
117  if ( PathInfo( (master=metadatapath/"/repodata/repomd.xml") ).isFile() )
118  {
119  //MIL << "GO repomd.." << endl;
120  xml::Reader reader( master );
121  while ( reader.seekToNode( 2, "content" ) )
122  {
123  _keywords.insert( reader.nodeText().asString() );
124  reader.seekToEndNode( 2, "content" );
125  }
126  _keywords.insert( "" ); // valid content in _keywords even if empty
127  }
128  else if ( PathInfo( (master=metadatapath/"/content") ).isFile() )
129  {
130  //MIL << "GO content.." << endl;
131  iostr::forEachLine( InputStream( master ),
132  [this]( int num_r, std::string line_r )->bool
133  {
134  if ( str::startsWith( line_r, "REPOKEYWORDS" ) )
135  {
136  std::vector<std::string> words;
137  if ( str::split( line_r, std::back_inserter(words) ) > 1
138  && words[0].length() == 12 /*"REPOKEYWORDS"*/ )
139  {
140  this->_keywords.insert( ++words.begin(), words.end() );
141  }
142  return true; // mult. occurrances are ok.
143  }
144  return( ! str::startsWith( line_r, "META " ) ); // no need to parse into META section.
145  } );
146  _keywords.insert( "" );
147  }
149  }
150  return( _keywords.find( keyword_r ) != _keywords.end() );
151 
152  }
153 
154  public:
159  Pathname path;
160  std::string service;
161  std::string targetDistro;
162  Pathname metadatapath;
163  Pathname packagespath;
165  mutable bool emptybaseurls;
167 
168  private:
170  mutable std::set<Url> _baseUrls;
171  mutable std::set<std::string> _keywords;
172 
173  friend Impl * rwcowClone<Impl>( const Impl * rhs );
175  Impl * clone() const
176  { return new Impl( *this ); }
177  };
179 
181  inline std::ostream & operator<<( std::ostream & str, const RepoInfo::Impl & obj )
182  {
183  return str << "RepoInfo::Impl";
184  }
185 
187  //
188  // CLASS NAME : RepoInfo
189  //
191 
193 
195  //
196  // METHOD NAME : RepoInfo::RepoInfo
197  // METHOD TYPE : Ctor
198  //
200  : _pimpl( new Impl() )
201  {}
202 
204  //
205  // METHOD NAME : RepoInfo::~RepoInfo
206  // METHOD TYPE : Dtor
207  //
209  {
210  //MIL << std::endl;
211  }
212 
213  unsigned RepoInfo::priority() const
214  { return _pimpl->priority; }
215 
217  { return Impl::defaultPriority; }
218 
219  void RepoInfo::setPriority( unsigned newval_r )
220  { _pimpl->priority = newval_r ? newval_r : Impl::defaultPriority; }
221 
223  { _pimpl->gpgcheck = check; }
224 
226  { _pimpl->setmirrorListUrl() = url; }
227 
229  { _pimpl->gpgkey_url = url; }
230 
231  void RepoInfo::addBaseUrl( const Url &url )
232  { _pimpl->baseUrls().insert(url); }
233 
234  void RepoInfo::setBaseUrl( const Url &url )
235  {
236  _pimpl->baseUrls().clear();
237  addBaseUrl(url);
238  }
239 
240  void RepoInfo::setPath( const Pathname &path )
241  { _pimpl->path = path; }
242 
244  { _pimpl->type = t; }
245 
247  { _pimpl->setProbedType( t ); }
248 
249 
250  void RepoInfo::setMetadataPath( const Pathname &path )
251  { _pimpl->metadatapath = path; }
252 
253  void RepoInfo::setPackagesPath( const Pathname &path )
254  { _pimpl->packagespath = path; }
255 
256  void RepoInfo::setKeepPackages( bool keep )
257  { _pimpl->keeppackages = keep; }
258 
259  void RepoInfo::setService( const std::string& name )
260  { _pimpl->service = name; }
261 
262  void RepoInfo::setTargetDistribution( const std::string & targetDistribution )
264 
265  bool RepoInfo::gpgCheck() const
266  { return indeterminate(_pimpl->gpgcheck) ? true : (bool)_pimpl->gpgcheck; }
267 
269  { return indeterminate(_pimpl->keeppackages) ? false : (bool)_pimpl->keeppackages; }
270 
271  Pathname RepoInfo::metadataPath() const
272  { return _pimpl->metadatapath; }
273 
274  Pathname RepoInfo::packagesPath() const
275  { return _pimpl->packagespath; }
276 
278  { return _pimpl->type; }
279 
281  { return _pimpl->getmirrorListUrl(); }
282 
284  { return _pimpl->gpgkey_url; }
285 
286  std::set<Url> RepoInfo::baseUrls() const
287  {
288  RepoInfo::url_set replaced_urls;
289  for ( url_set::const_iterator it = _pimpl->baseUrls().begin();
290  it != _pimpl->baseUrls().end();
291  ++it )
292  {
293  replaced_urls.insert(_pimpl->replacer(*it));
294  }
295  return replaced_urls;
296  }
297 
298  Pathname RepoInfo::path() const
299  { return _pimpl->path; }
300 
301  std::string RepoInfo::service() const
302  { return _pimpl->service; }
303 
304  std::string RepoInfo::targetDistribution() const
305  { return _pimpl->targetDistro; }
306 
308  {
309  return make_transform_iterator( _pimpl->baseUrls().begin(),
310  _pimpl->replacer );
311  //return _pimpl->baseUrls.begin();
312  }
313 
315  {
316  //return _pimpl->baseUrls.end();
317  return make_transform_iterator( _pimpl->baseUrls().end(),
318  _pimpl->replacer );
319  }
320 
322  { return _pimpl->baseUrls().size(); }
323 
325  { return _pimpl->baseUrls().empty(); }
326 
327  bool RepoInfo::baseUrlSet() const
328  { return _pimpl->baseurl2dump(); }
329 
330 
331  void RepoInfo::addContent( const std::string & keyword_r )
332  { _pimpl->addContent( keyword_r ); }
333 
334  bool RepoInfo::hasContent( const std::string & keyword_r ) const
335  { return _pimpl->hasContent( keyword_r ); }
336 
338 
339  bool RepoInfo::hasLicense() const
340  {
341  Pathname licenseTgz( _pimpl->licenseTgz() );
342  SEC << licenseTgz << endl;
343  SEC << PathInfo(licenseTgz) << endl;
344 
345  return ! licenseTgz.empty() && PathInfo(licenseTgz).isFile();
346  }
347 
349  {
350  static const std::string noAcceptanceFile = "no-acceptance-needed\n";
351  bool accept = true;
352 
353  Pathname licenseTgz( _pimpl->licenseTgz() );
354  if ( licenseTgz.empty() || ! PathInfo( licenseTgz ).isFile() )
355  return false; // no licenses at all
356 
358  cmd.push_back( "tar" );
359  cmd.push_back( "-t" );
360  cmd.push_back( "-z" );
361  cmd.push_back( "-f" );
362  cmd.push_back( licenseTgz.asString() );
363 
365  for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
366  {
367  if ( output == noAcceptanceFile )
368  {
369  accept = false;
370  }
371  }
372  MIL << "License for " << this->name() << " has to be accepted: " << (accept?"true":"false" ) << endl;
373  return accept;
374  }
375 
376  std::string RepoInfo::getLicense( const Locale & lang_r )
377  {
378  LocaleSet avlocales( getLicenseLocales() );
379  if ( avlocales.empty() )
380  return std::string();
381 
382  Locale getLang( Locale::bestMatch( avlocales, lang_r ) );
383  if ( getLang == Locale::noCode
384  && avlocales.find( Locale::noCode ) == avlocales.end() )
385  {
386  WAR << "License.tar.gz contains no fallback text! " << *this << endl;
387  // Using the fist locale instead of returning no text at all.
388  // So the user might recognize that there is a license, even if he
389  // can't read it.
390  getLang = *avlocales.begin();
391  }
392 
393  // now extract the license file.
394  static const std::string licenseFileFallback( "license.txt" );
395  std::string licenseFile( getLang == Locale::noCode
396  ? licenseFileFallback
397  : str::form( "license.%s.txt", getLang.code().c_str() ) );
398 
400  cmd.push_back( "tar" );
401  cmd.push_back( "-x" );
402  cmd.push_back( "-z" );
403  cmd.push_back( "-O" );
404  cmd.push_back( "-f" );
405  cmd.push_back( _pimpl->licenseTgz().asString() ); // if it not exists, avlocales was empty.
406  cmd.push_back( licenseFile );
407 
408  std::string ret;
410  for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
411  {
412  ret += output;
413  }
414  prog.close();
415  return ret;
416  }
417 
419  {
420  Pathname licenseTgz( _pimpl->licenseTgz() );
421  if ( licenseTgz.empty() || ! PathInfo( licenseTgz ).isFile() )
422  return LocaleSet();
423 
425  cmd.push_back( "tar" );
426  cmd.push_back( "-t" );
427  cmd.push_back( "-z" );
428  cmd.push_back( "-f" );
429  cmd.push_back( licenseTgz.asString() );
430 
431  LocaleSet ret;
433  for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
434  {
435  static const C_Str license( "license." );
436  static const C_Str dotTxt( ".txt\n" );
437  if ( str::hasPrefix( output, license ) && str::hasSuffix( output, dotTxt ) )
438  {
439  if ( output.size() <= license.size() + dotTxt.size() ) // license.txt
440  ret.insert( Locale() );
441  else
442  ret.insert( Locale( std::string( output.c_str()+license.size(), output.size()- license.size() - dotTxt.size() ) ) );
443  }
444  }
445  prog.close();
446  return ret;
447  }
448 
450 
451  std::ostream & RepoInfo::dumpOn( std::ostream & str ) const
452  {
454  if ( _pimpl->baseurl2dump() )
455  {
456  for ( urls_const_iterator it = baseUrlsBegin();
457  it != baseUrlsEnd();
458  ++it )
459  {
460  str << "- url : " << *it << std::endl;
461  }
462  }
463 
464  // print if non empty value
465  auto strif( [&] ( const std::string & tag_r, const std::string & value_r ) {
466  if ( ! value_r.empty() )
467  str << tag_r << value_r << std::endl;
468  });
469 
470  strif( "- mirrorlist : ", _pimpl->getmirrorListUrl().asString() );
471  strif( "- path : ", path().asString() );
472  str << "- type : " << type() << std::endl;
473  str << "- priority : " << priority() << std::endl;
474  str << "- gpgcheck : " << gpgCheck() << std::endl;
475  strif( "- gpgkey : ", gpgKeyUrl().asString() );
476 
477  if ( ! indeterminate(_pimpl->keeppackages) )
478  str << "- keeppackages: " << keepPackages() << std::endl;
479 
480  strif( "- service : ", service() );
481  strif( "- targetdistro: ", targetDistribution() );
482  strif( "- metadataPath: ", metadataPath().asString() );
483  strif( "- packagesPath: ", packagesPath().asString() );
484 
485  return str;
486  }
487 
488  std::ostream & RepoInfo::dumpAsIniOn( std::ostream & str ) const
489  {
490  RepoInfoBase::dumpAsIniOn(str);
491 
492  if ( _pimpl->baseurl2dump() )
493  {
494  str << "baseurl=";
495  for ( url_set::const_iterator it = _pimpl->baseUrls().begin();
496  it != _pimpl->baseUrls().end();
497  ++it )
498  {
499  str << *it << endl;
500  }
501  }
502 
503  if ( ! _pimpl->path.empty() )
504  str << "path="<< path() << endl;
505 
506  if ( ! (_pimpl->getmirrorListUrl().asString().empty()) )
507  str << "mirrorlist=" << _pimpl->getmirrorListUrl() << endl;
508 
509  str << "type=" << type().asString() << endl;
510 
511  if ( priority() != defaultPriority() )
512  str << "priority=" << priority() << endl;
513 
514  if (!indeterminate(_pimpl->gpgcheck))
515  str << "gpgcheck=" << (gpgCheck() ? "1" : "0") << endl;
516  if ( ! (gpgKeyUrl().asString().empty()) )
517  str << "gpgkey=" <<gpgKeyUrl() << endl;
518 
519  if (!indeterminate(_pimpl->keeppackages))
520  str << "keeppackages=" << keepPackages() << endl;
521 
522  if( ! service().empty() )
523  str << "service=" << service() << endl;
524 
525  return str;
526  }
527 
528  std::ostream & RepoInfo::dumpAsXmlOn( std::ostream & str, const std::string & content ) const
529  {
530  std::string tmpstr;
531  str
532  << "<repo"
533  << " alias=\"" << escape(alias()) << "\""
534  << " name=\"" << escape(name()) << "\"";
535  if (type() != repo::RepoType::NONE)
536  str << " type=\"" << type().asString() << "\"";
537  str
538  << " priority=\"" << priority() << "\""
539  << " enabled=\"" << enabled() << "\""
540  << " autorefresh=\"" << autorefresh() << "\""
541  << " gpgcheck=\"" << gpgCheck() << "\"";
542  if (!(tmpstr = gpgKeyUrl().asString()).empty())
543  str << " gpgkey=\"" << escape(tmpstr) << "\"";
544  if (!(tmpstr = mirrorListUrl().asString()).empty())
545  str << " mirrorlist=\"" << escape(tmpstr) << "\"";
546  str << ">" << endl;
547 
548  if ( _pimpl->baseurl2dump() )
549  {
551  urlit != baseUrlsEnd(); ++urlit)
552  str << "<url>" << escape(urlit->asString()) << "</url>" << endl;
553  }
554 
555  str << "</repo>" << endl;
556  return str;
557  }
558 
559 
560  std::ostream & operator<<( std::ostream & str, const RepoInfo & obj )
561  {
562  return obj.dumpOn(str);
563  }
564 
565 
567 } // 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:418
std::string name() const
Repository short label.
std::string targetDistribution() const
Distribution for which is this repository meant.
Definition: RepoInfo.cc:304
#define MIL
Definition: Logger.h:47
void setGpgKeyUrl(const Url &gpgkey)
Key to use for gpg checking of this repository.
Definition: RepoInfo.cc:228
static unsigned defaultPriority()
The default priority (99).
Definition: RepoInfo.cc:216
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:488
void setPriority(unsigned newval_r)
Set repository priority for solver.
Definition: RepoInfo.cc:219
unsigned split(const C_Str &line_r, _OutputIterator result_r, const C_Str &sepchars_r=" \t")
Split line_r into words.
Definition: String.h:463
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: RepoInfo.h:392
void setMirrorListUrl(const Url &url)
Set mirror list url.
Definition: RepoInfo.cc:225
repo::RepoVariablesUrlReplacer replacer
Definition: RepoInfo.cc:166
urls_const_iterator baseUrlsBegin() const
iterator that points at begin of repository urls
Definition: RepoInfo.cc:307
std::string getLicense(const Locale &lang_r=Locale())
Return the best license for the current (or a specified) locale.
Definition: RepoInfo.cc:376
std::set< Url > & baseUrls()
Definition: RepoInfo.cc:98
std::string escape(const C_Str &str_r, const char sep_r)
Escape desired character c using a backslash.
Definition: String.cc:339
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:271
std::ostream & operator<<(std::ostream &str, const RepoInfo::Impl &obj)
Definition: RepoInfo.cc:181
Pathname metadatapath
Definition: RepoInfo.cc:162
String related utilities and Regular expression matching.
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:246
What is known about a repository.
Definition: RepoInfo.h:66
std::set< std::string > _keywords
Definition: RepoInfo.cc:171
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:234
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:314
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:274
unsigned priority() const
Repository priority for solver.
Definition: RepoInfo.cc:213
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:96
RepoInfo implementation.
Definition: RepoInfo.cc:42
bool keepPackages() const
Whether packages downloaded from this repository will be kept in local cache.
Definition: RepoInfo.cc:268
bool needToAcceptLicense() const
Whether the repo license has to be accepted, e.g.
Definition: RepoInfo.cc:348
virtual ~RepoInfo()
Definition: RepoInfo.cc:208
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:280
void addContent(const std::string &keyword_r)
Definition: RepoInfo.cc:105
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:240
void setService(const std::string &name)
sets service which added this repository
Definition: RepoInfo.cc:259
#define WAR
Definition: Logger.h:48
void setMetadataPath(const Pathname &path)
set the path where the local metadata is stored
Definition: RepoInfo.cc:250
bool gpgCheck() const
Whether to check or not this repository with gpg.
Definition: RepoInfo.cc:265
std::set< Url > _baseUrls
Definition: RepoInfo.cc:170
bool startsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasPrefix
Definition: String.h:1004
#define SEC
Definition: Logger.h:50
void setType(const repo::RepoType &t)
set the repository type
Definition: RepoInfo.cc:243
bool baseUrlSet() const
whether there are manualy configured repository urls
Definition: RepoInfo.cc:327
Impl * clone() const
clone for RWCOW_pointer
Definition: RepoInfo.cc:175
void setKeepPackages(bool keep)
Set if packaqes downloaded from this repository will be kept in local cache.
Definition: RepoInfo.cc:256
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:301
bool baseurl2dump() const
Definition: RepoInfo.cc:101
zypp::Url url
Definition: MediaCurl.cc:193
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:231
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:253
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:324
repo::RepoType type() const
Type of repository,.
Definition: RepoInfo.cc:277
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:95
bool hasSuffix(const C_Str &str_r, const C_Str &suffix_r)
Return whether str_r has suffix suffix_r.
Definition: String.h:982
void setTargetDistribution(const std::string &targetDistribution)
Sets the distribution for which is this repository meant.
Definition: RepoInfo.cc:262
Url getmirrorListUrl() const
Definition: RepoInfo.cc:71
bool autorefresh() const
If true, the repostory must be refreshed before creating resolvables from it.
std::set< Url > baseUrls() const
A Url under which the metadata are located, or a set of mirrors.
Definition: RepoInfo.cc:286
XmlString nodeText()
If the curent node is not empty, advances the reader to the next node, and returns the value...
Definition: Reader.cc:140
Pathname packagespath
Definition: RepoInfo.cc:163
bool hasLicense() const
Whether there is a license associated with the repo.
Definition: RepoInfo.cc:339
bool hasContent(const std::string &keyword_r=std::string()) const
Check for content keywords.
Definition: RepoInfo.cc:334
bool hasContent(const std::string &keyword_r) const
Definition: RepoInfo.cc:108
Url gpgKeyUrl() const
Key to use for gpg checking of this repository.
Definition: RepoInfo.cc:283
DefaultIntegral< unsigned, defaultPriority > priority
Definition: RepoInfo.cc:164
Url url() const
Pars pro toto: The first repository url.
Definition: RepoInfo.h:120
void setGpgCheck(bool check)
Whether to check or not this repository with gpg.
Definition: RepoInfo.cc:222
std::string targetDistro
Definition: RepoInfo.cc:161
static const RepoInfo noRepo
Represents no Repository (one with an empty alias).
Definition: RepoInfo.h:75
const std::set< Url > & baseUrls() const
Definition: RepoInfo.cc:77
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:331
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:528
repo::RepoType type
Definition: RepoInfo.cc:158
std::vector< Url > getUrls() const
Functor replacing repository variables.
Definition: RepoVariables.h:45
urls_size_type baseUrlsSize() const
number of repository urls
Definition: RepoInfo.cc:321
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
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition: String.h:974
Url manipulation class.
Definition: Url.h:87
Pathname path() const
Repository path.
Definition: RepoInfo.cc:298
virtual std::ostream & dumpOn(std::ostream &str) const
Write a human-readable representation of this RepoInfo object into the str stream.
Definition: RepoInfo.cc:451
#define DBG
Definition: Logger.h:46
std::string service
Definition: RepoInfo.cc:160
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
std::set< Url > url_set
Definition: RepoInfo.h:94