libzypp 17.37.10

RepoInfo.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <zypp/ng/workflows/contextfacade.h>
13#include <iostream>
14#include <vector>
15
16#include <zypp/base/Gettext.h>
17#include <zypp/base/LogTools.h>
18#include <zypp-core/base/DefaultIntegral>
19#include <zypp/parser/xml/XmlEscape.h>
20
21#include <zypp/ManagedFile.h>
22#include <zypp-common/PublicKey.h>
23#include <zypp/MediaSetAccess.h>
24#include <zypp/RepoInfo.h>
25#include <zypp/Glob.h>
26#include <zypp/TriBool.h>
27#include <zypp/Pathname.h>
28#include <zypp/ZConfig.h>
29#include <zypp/repo/RepoMirrorList.h>
30#include <zypp/repo/SUSEMediaVerifier.h>
31#include <zypp/ExternalProgram.h>
32
33#include <zypp/base/IOStream.h>
34#include <zypp-core/base/InputStream>
35#include <zypp/parser/xml/Reader.h>
36
37
38#include <zypp/base/StrMatcher.h>
39#include <zypp/KeyRing.h>
40#include <zypp/TmpPath.h>
41#include <zypp/ZYppFactory.h>
42#include <zypp/ZYppCallbacks.h>
43
44#include <zypp/ng/workflows/repoinfowf.h>
45#include <zypp-curl/private/curlhelper_p.h>
46
47 using std::endl;
48 using zypp::xml::escape;
49
51 namespace zypp
52{
53
54 namespace
55 {
56 repo::RepoType probeCache( const Pathname & path_r )
57 {
58 repo::RepoType ret = repo::RepoType::NONE;
59 if ( PathInfo(path_r).isDir() )
60 {
61 if ( PathInfo(path_r/"/repodata/repomd.xml").isFile() )
62 { ret = repo::RepoType::RPMMD; }
63 else if ( PathInfo(path_r/"/content").isFile() )
64 { ret = repo::RepoType::YAST2; }
65 else if ( PathInfo(path_r/"/cookie").isFile() )
66 { ret = repo::RepoType::RPMPLAINDIR; }
67 }
68 DBG << "Probed cached type " << ret << " at " << path_r << endl;
69 return ret;
70 }
71 } // namespace
72
74 //
75 // CLASS NAME : RepoInfo::Impl
76 //
78 struct RepoInfo::Impl
79 {
80 Impl()
81 : _rawGpgCheck( indeterminate )
82 , _rawRepoGpgCheck( indeterminate )
83 , _rawPkgGpgCheck( indeterminate )
84 , _validRepoSignature( indeterminate )
85 , _type(repo::RepoType::NONE_e)
86 , keeppackages(indeterminate)
87 {}
88
89 Impl(const Impl &) = default;
90 Impl(Impl &&) = delete;
91 Impl &operator=(const Impl &) = delete;
92 Impl &operator=(Impl &&) = delete;
93
94 ~Impl() {}
95
96 public:
97 static const unsigned defaultPriority = 99;
98 static const unsigned noPriority = unsigned(-1);
99
100 void setType( const repo::RepoType & t )
101 { _type = t; }
102
103 void setProbedType( const repo::RepoType & t ) const
104 {
105 if ( _type == repo::RepoType::NONE && t != repo::RepoType::NONE )
106 { const_cast<Impl*>(this)->_type = t; }
107 }
108
109 repo::RepoType type() const
110 {
111 if ( _type == repo::RepoType::NONE && not metadataPath().empty() )
112 setProbedType( probeCache( metadataPath() / path ) );
113 return _type;
114 }
115
116 public:
118 Pathname licenseTgz( const std::string & name_r ) const
119 {
120 Pathname ret;
121 if ( !metadataPath().empty() )
122 {
123 std::string licenseStem( "license" );
124 if ( !name_r.empty() )
125 {
126 licenseStem += "-";
127 licenseStem += name_r;
128 }
129
130 filesystem::Glob g;
131 // TODO: REPOMD: this assumes we know the name of the tarball. In fact
132 // we'd need to get the file from repomd.xml (<data type="license[-name_r]">)
133 g.add( metadataPath() / path / ("repodata/*"+licenseStem+".tar.gz") );
134 if ( g.empty() )
135 g.add( metadataPath() / path / (licenseStem+".tar.gz") );
136
137 if ( !g.empty() )
138 ret = *g.begin();
139 }
140 return ret;
141 }
142
143 RepoVariablesReplacedUrl baseUrl() const {
144 if ( !_baseUrls.empty() ) {
145 return RepoVariablesReplacedUrl( _baseUrls.raw ().front(), _baseUrls.transformator() );
146 }
147 if ( !mirrorUrls().empty() ){
148 return RepoVariablesReplacedUrl( _mirrorUrls.front (), _baseUrls.transformator() );
149 }
150 return RepoVariablesReplacedUrl();
151 }
152
153 const RepoVariablesReplacedUrlList & baseUrls() const
154 {
155 return _baseUrls;
156 }
157
158 Url location() const {
159 if ( !_baseUrls.empty() )
160 return *_baseUrls.transformedBegin ();
161 return mirrorListUrl().transformed();
162 }
163
164 void resetMirrorUrls() const {
165 _mirrorUrls.clear ();
166 _lastMirrorUrlsUpdate = std::chrono::steady_clock::time_point::min();
167 }
168
174 url_set &mirrorUrls() const
175 {
176 if ( !_mirrorUrls.empty()
177 && ( std::chrono::steady_clock::now() - _lastMirrorUrlsUpdate < std::chrono::hours(1) ) )
178 return _mirrorUrls;
179
180 _mirrorUrls.clear();
181 _lastMirrorUrlsUpdate = std::chrono::steady_clock::now();
182
183 bool isAutoMirrorList = false; // bsc#1243901 Allows mirrorlist parsing to fail if automatically switched on
184
185 Url mlurl( mirrorListUrl().transformed() ); // Variables replaced!
186 if ( mlurl.asString().empty()
187 && _baseUrls.raw().size() == 1
188 && repo::RepoMirrorList::urlSupportsMirrorLink( *_baseUrls.transformedBegin() ) ) {
189
190 mlurl = *_baseUrls.transformedBegin ();
191 mlurl.pathNameSetTrailingSlash();
192 mlurl.setQueryParam("mirrorlist", std::string() );
193
194 MIL << "Detected opensuse.org baseUrl with no mirrors, requesting them from : " << mlurl.asString() << std::endl;
195 isAutoMirrorList = true;
196 }
197
198 if ( !mlurl.asString().empty() ) {
199 try {
200 DBG << "MetadataPath: " << metadataPath() << endl;
201 repo::RepoMirrorList rmurls( mlurl, metadataPath() );
202
203 // propagate internally used URL params like 'proxy' to the mirrors
204 const auto &tf = [urlTemplate =mirrorListUrl().transformed()]( const zypp::Url &in ){
205 return internal::propagateQueryParams ( in , urlTemplate );
206 };
207 _mirrorUrls.insert( _mirrorUrls.end(), make_transform_iterator( rmurls.getUrls().begin(), tf ), make_transform_iterator( rmurls.getUrls().end(), tf ) );
208 } catch ( const zypp::Exception & e ) {
209 // failed to fetch the mirrorlist/metalink, if we still have a baseUrl we can go on, otherwise this is a error
210 MIL << "Mirrorlist failed, repo either returns invalid data or has no mirrors at all!" << std::endl;
211 if ( !isAutoMirrorList ) {
212 callback::UserData data( JobReport::repoRefreshMirrorlist );
213 data.set("error", e );
214 JobReport::warning( _("Failed to fetch mirrorlist/metalink data."), data );
215 }
216 }
217 }
218 return _mirrorUrls;
219 }
220
221 MirroredOriginSet repoOrigins() const
222 {
223 MirroredOriginSet origins;
224 origins.addEndpoints( _baseUrls.transformedBegin(), _baseUrls.transformedEnd() );
225
226 const auto &mirrs = mirrorUrls ();
227 origins.addEndpoints( mirrs.begin(), mirrs.end() );
228
229 return origins;
230 }
231
232 RepoVariablesReplacedUrlList & baseUrls()
233 { return _baseUrls; }
234
235 bool baseurl2dump() const
236 { return !_baseUrls.empty(); }
237
238
239 const RepoVariablesReplacedUrlList & gpgKeyUrls() const
240 { return _gpgKeyUrls; }
241
242 RepoVariablesReplacedUrlList & gpgKeyUrls()
243 { return _gpgKeyUrls; }
244
245 std::string repoStatusString() const
246 {
247 if ( mirrorListUrl().transformed().isValid() )
248 return mirrorListUrl().transformed().asString();
249 if ( !baseUrls().empty() )
250 return (*baseUrls().transformedBegin()).asString();
251 return std::string();
252 }
253
254 const std::set<std::string> & contentKeywords() const
255 { hasContent()/*init if not yet done*/; return _keywords.second; }
256
257 void addContent( const std::string & keyword_r )
258 { _keywords.second.insert( keyword_r ); if ( ! hasContent() ) _keywords.first = true; }
259
260 bool hasContent() const
261 {
262 if ( !_keywords.first && ! metadataPath().empty() )
263 {
264 // HACK directly check master index file until RepoManager offers
265 // some content probing and zypper uses it.
267 MIL << "Empty keywords...." << metadataPath() << endl;
268 Pathname master;
269 if ( PathInfo( (master=metadataPath()/"/repodata/repomd.xml") ).isFile() )
270 {
271 //MIL << "GO repomd.." << endl;
272 xml::Reader reader( master );
273 while ( reader.seekToNode( 2, "content" ) )
274 {
275 _keywords.second.insert( reader.nodeText().asString() );
276 reader.seekToEndNode( 2, "content" );
277 }
278 _keywords.first = true; // valid content in _keywords even if empty
279 }
280 else if ( PathInfo( (master=metadataPath()/"/content") ).isFile() )
281 {
282 //MIL << "GO content.." << endl;
283 iostr::forEachLine( InputStream( master ),
284 [this]( int num_r, const std::string& line_r )->bool
285 {
286 if ( str::startsWith( line_r, "REPOKEYWORDS" ) )
287 {
288 std::vector<std::string> words;
289 if ( str::split( line_r, std::back_inserter(words) ) > 1
290 && words[0].length() == 12 /*"REPOKEYWORDS"*/ )
291 {
292 this->_keywords.second.insert( ++words.begin(), words.end() );
293 }
294 return true; // mult. occurrances are ok.
295 }
296 return( ! str::startsWith( line_r, "META " ) ); // no need to parse into META section.
297 } );
298 _keywords.first = true; // valid content in _keywords even if empty
299 }
301 }
302 return _keywords.first;
303 }
304
305 bool hasContent( const std::string & keyword_r ) const
306 { return( hasContent() && _keywords.second.find( keyword_r ) != _keywords.second.end() ); }
307
312 TriBool internalValidRepoSignature() const
313 {
314 if ( ! indeterminate(_validRepoSignature) )
315 return _validRepoSignature;
316 // check metadata:
317 if ( ! metadataPath().empty() )
318 {
319 // A missing ".repo_gpgcheck" might be plaindir(no Downloader) or not yet refreshed signed repo!
320 TriBool linkval = triBoolFromPath( metadataPath() / ".repo_gpgcheck" );
321 return linkval;
322 }
323 return indeterminate;
324 }
325
326 void internalSetValidRepoSignature( TriBool value_r )
327 {
328 if ( PathInfo(metadataPath()).isDir() )
329 {
330 Pathname gpgcheckFile( metadataPath() / ".repo_gpgcheck" );
331 if ( PathInfo(gpgcheckFile).isExist() )
332 {
333 TriBool linkval( indeterminate );
334 if ( triBoolFromPath( gpgcheckFile, linkval ) && linkval == value_r )
335 return; // existing symlink fits value_r
336 else
337 filesystem::unlink( gpgcheckFile ); // will write a new one
338 }
339 filesystem::symlink( asString(value_r), gpgcheckFile );
340 }
341 _validRepoSignature = value_r;
342 }
343
348 bool internalUnsignedConfirmed() const
349 {
350 TriBool linkval( true ); // want to see it being switched to indeterminate
351 return triBoolFromPath( metadataPath() / ".repo_gpgcheck", linkval ) && indeterminate(linkval);
352 }
353
354 bool triBoolFromPath( const Pathname & path_r, TriBool & ret_r ) const
355 {
356 static const Pathname truePath( "true" );
357 static const Pathname falsePath( "false" );
358 static const Pathname indeterminatePath( "indeterminate" );
359
360 // Quiet readlink;
361 static const ssize_t bufsiz = 63;
362 static char buf[bufsiz+1];
363 ssize_t ret = ::readlink( path_r.c_str(), buf, bufsiz );
364 buf[ret == -1 ? 0 : ret] = '\0';
365
366 Pathname linkval( buf );
367
368 bool known = true;
369 if ( linkval == truePath )
370 ret_r = true;
371 else if ( linkval == falsePath )
372 ret_r = false;
373 else if ( linkval == indeterminatePath )
374 ret_r = indeterminate;
375 else
376 known = false;
377 return known;
378 }
379
380 TriBool triBoolFromPath( const Pathname & path_r ) const
381 { TriBool ret(indeterminate); triBoolFromPath( path_r, ret ); return ret; }
382
384
385 private:
386 TriBool _rawGpgCheck;
387 TriBool _rawRepoGpgCheck;
388 TriBool _rawPkgGpgCheck;
389
390 public:
391 TriBool rawGpgCheck() const { return _rawGpgCheck; }
392 TriBool rawRepoGpgCheck() const { return _rawRepoGpgCheck; }
393 TriBool rawPkgGpgCheck() const { return _rawPkgGpgCheck; }
394
395 void rawGpgCheck( TriBool val_r ) { _rawGpgCheck = val_r; }
396 void rawRepoGpgCheck( TriBool val_r ) { _rawRepoGpgCheck = val_r; }
397 void rawPkgGpgCheck( TriBool val_r ) { _rawPkgGpgCheck = val_r; }
398
399 bool cfgGpgCheck() const
400 { return indeterminate(_rawGpgCheck) ? ZConfig::instance().gpgCheck() : (bool)_rawGpgCheck; }
401 TriBool cfgRepoGpgCheck() const
402 { return indeterminate(_rawGpgCheck) && indeterminate(_rawRepoGpgCheck) ? ZConfig::instance().repoGpgCheck() : _rawRepoGpgCheck; }
403 TriBool cfgPkgGpgCheck() const
404 { return indeterminate(_rawGpgCheck) && indeterminate(_rawPkgGpgCheck) ? ZConfig::instance().pkgGpgCheck() : _rawPkgGpgCheck; }
405
406 private:
407 TriBool _validRepoSignature;
408 repo::RepoType _type;
409
410 private:
411 RepoVariablesReplacedUrl _cfgMirrorlistUrl;
412 RepoVariablesReplacedUrl _cfgMetalinkUrl;
413 public:
415 const RepoVariablesReplacedUrl & mirrorListUrl() const
416 { return _cfgMirrorlistUrl.transformed().isValid() ? _cfgMirrorlistUrl : _cfgMetalinkUrl; }
417
418 void setMirrorlistUrl( const Url & url_r ) // Raw
419 { _cfgMirrorlistUrl.raw() = url_r; }
420
421 void setMetalinkUrl( const Url & url_r ) // Raw
422 { _cfgMetalinkUrl.raw() = url_r; }
423
425 const RepoVariablesReplacedUrl & cfgMirrorlistUrl() const
426 { return _cfgMirrorlistUrl; }
427
428 const RepoVariablesReplacedUrl & cfgMetalinkUrl() const
429 { return _cfgMetalinkUrl; }
430
431 public:
432 TriBool keeppackages;
433 Pathname path;
434 std::string service;
435 std::string targetDistro;
436
437 void metadataPath( Pathname new_r )
438 { _metadataPath = std::move( new_r ); }
439
440 void packagesPath( Pathname new_r )
441 { _packagesPath = std::move( new_r ); }
442
443 bool usesAutoMetadataPaths() const
444 { return str::hasSuffix( _metadataPath.asString(), "/%AUTO%" ); }
445
446 Pathname metadataPath() const
447 {
448 if ( usesAutoMetadataPaths() )
449 return _metadataPath.dirname() / "%RAW%";
450 return _metadataPath;
451 }
452
453 Pathname packagesPath() const
454 {
455 if ( _packagesPath.empty() && usesAutoMetadataPaths() )
456 return _metadataPath.dirname() / "%PKG%";
457 return _packagesPath;
458 }
459
460 Pathname predownloadPath() const
461 {
462 return packagesPath() / ".preload";
463 }
464
465 DefaultIntegral<unsigned,defaultPriority> priority;
466
467 private:
468 Pathname _metadataPath;
469 Pathname _packagesPath;
470
471 mutable RepoVariablesReplacedUrlList _baseUrls; //< baseUrls as configured
472
473 mutable url_set _mirrorUrls; //< possible mirrors as fetched via mirrorlist or metalink
474 mutable std::chrono::steady_clock::time_point _lastMirrorUrlsUpdate = std::chrono::steady_clock::time_point::min();
475 mutable std::vector<MirroredOrigin> _repoOrigins;
476
477 mutable std::pair<FalseBool, std::set<std::string> > _keywords;
478
479 RepoVariablesReplacedUrlList _gpgKeyUrls;
480
481 friend Impl * rwcowClone<Impl>( const Impl * rhs );
483 Impl * clone() const
484 { return new Impl( *this ); }
485 };
486
487
489 inline std::ostream & operator<<( std::ostream & str, const RepoInfo::Impl & obj )
490 {
491 return str << "RepoInfo::Impl";
492 }
493
495 //
496 // CLASS NAME : RepoInfo
497 //
499
500 const RepoInfo RepoInfo::noRepo;
501
502 RepoInfo::RepoInfo()
503 : _pimpl( new Impl() )
504 {}
505
506 RepoInfo::~RepoInfo()
507 {}
508
509 unsigned RepoInfo::priority() const
510 { return _pimpl->priority; }
511
512 unsigned RepoInfo::defaultPriority()
513 { return Impl::defaultPriority; }
514
515 unsigned RepoInfo::noPriority()
516 { return Impl::noPriority; }
517
518 void RepoInfo::setPriority( unsigned newval_r )
519 { _pimpl->priority = newval_r ? newval_r : Impl::defaultPriority; }
520
521
522 bool RepoInfo::gpgCheck() const
523 { return _pimpl->cfgGpgCheck(); }
524
525 void RepoInfo::setGpgCheck( TriBool value_r )
526 { _pimpl->rawGpgCheck( value_r ); }
527
528 void RepoInfo::setGpgCheck( bool value_r ) // deprecated legacy and for squid
529 { setGpgCheck( TriBool(value_r) ); }
530
531
532 bool RepoInfo::repoGpgCheck() const
533 { return gpgCheck() || bool(_pimpl->cfgRepoGpgCheck()); }
534
535 bool RepoInfo::repoGpgCheckIsMandatory() const
536 {
537 bool ret = ( gpgCheck() && indeterminate(_pimpl->cfgRepoGpgCheck()) ) || bool(_pimpl->cfgRepoGpgCheck());
538 if ( ret && _pimpl->internalUnsignedConfirmed() ) // relax if unsigned repo was confirmed in the past
539 ret = false;
540 return ret;
541 }
542
543 void RepoInfo::setRepoGpgCheck( TriBool value_r )
544 { _pimpl->rawRepoGpgCheck( value_r ); }
545
546
547 bool RepoInfo::pkgGpgCheck() const
548 { return bool(_pimpl->cfgPkgGpgCheck()) || ( gpgCheck() && !bool(validRepoSignature())/*enforced*/ ) ; }
549
550 bool RepoInfo::pkgGpgCheckIsMandatory() const
551 { return bool(_pimpl->cfgPkgGpgCheck()) || ( gpgCheck() && indeterminate(_pimpl->cfgPkgGpgCheck()) && !bool(validRepoSignature())/*enforced*/ ); }
552
553 void RepoInfo::setPkgGpgCheck( TriBool value_r )
554 { _pimpl->rawPkgGpgCheck( value_r ); }
555
556
557 void RepoInfo::getRawGpgChecks( TriBool & g_r, TriBool & r_r, TriBool & p_r ) const
558 {
559 g_r = _pimpl->rawGpgCheck();
560 r_r = _pimpl->rawRepoGpgCheck();
561 p_r = _pimpl->rawPkgGpgCheck();
562 }
563
564
565 TriBool RepoInfo::validRepoSignature() const
566 {
567 TriBool ret( _pimpl->internalValidRepoSignature() );
568 if ( ret && !repoGpgCheck() ) ret = false; // invalidate any old signature if repoGpgCheck is off
569 return ret;
570 }
571
572 void RepoInfo::setValidRepoSignature( TriBool value_r )
573 { _pimpl->internalSetValidRepoSignature( value_r ); }
574
576 namespace
577 {
578 inline bool changeGpgCheckTo( TriBool & lhs, TriBool rhs )
579 { if ( ! sameTriboolState( lhs, rhs ) ) { lhs = rhs; return true; } return false; }
580
581 inline bool changeGpgCheckTo( TriBool ogpg[3], TriBool g, TriBool r, TriBool p )
582 {
583 bool changed = false;
584 if ( changeGpgCheckTo( ogpg[0], g ) ) changed = true;
585 if ( changeGpgCheckTo( ogpg[1], r ) ) changed = true;
586 if ( changeGpgCheckTo( ogpg[2], p ) ) changed = true;
587 return changed;
588 }
589 } // namespace
591 bool RepoInfo::setGpgCheck( GpgCheck mode_r )
592 {
593 TriBool ogpg[3]; // Gpg RepoGpg PkgGpg
594 getRawGpgChecks( ogpg[0], ogpg[1], ogpg[2] );
595
596 bool changed = false;
597 switch ( mode_r )
598 {
599 case GpgCheck::On:
600 changed = changeGpgCheckTo( ogpg, true, indeterminate, indeterminate );
601 break;
602 case GpgCheck::Strict:
603 changed = changeGpgCheckTo( ogpg, true, true, true );
604 break;
605 case GpgCheck::AllowUnsigned:
606 changed = changeGpgCheckTo( ogpg, true, false, false );
607 break;
608 case GpgCheck::AllowUnsignedRepo:
609 changed = changeGpgCheckTo( ogpg, true, false, indeterminate );
610 break;
611 case GpgCheck::AllowUnsignedPackage:
612 changed = changeGpgCheckTo( ogpg, true, indeterminate, false );
613 break;
614 case GpgCheck::Default:
615 changed = changeGpgCheckTo( ogpg, indeterminate, indeterminate, indeterminate );
616 break;
617 case GpgCheck::Off:
618 changed = changeGpgCheckTo( ogpg, false, indeterminate, indeterminate );
619 break;
620 case GpgCheck::indeterminate: // no change
621 break;
622 }
623
624 if ( changed )
625 {
626 setGpgCheck ( ogpg[0] );
627 setRepoGpgCheck( ogpg[1] );
628 setPkgGpgCheck ( ogpg[2] );
629 }
630 return changed;
631 }
632
633 void RepoInfo::setMirrorlistUrl( const Url & url_r ) // Raw
634 { _pimpl->setMirrorlistUrl( url_r ); }
635
636 void RepoInfo::setMetalinkUrl( const Url & url_r ) // Raw
637 { _pimpl->setMetalinkUrl( url_r ); }
638
639 Url RepoInfo::rawCfgMirrorlistUrl() const
640 { return _pimpl->cfgMirrorlistUrl().raw(); }
641
642 Url RepoInfo::rawCfgMetalinkUrl() const
643 { return _pimpl->cfgMetalinkUrl().raw(); }
644
645#if LEGACY(1735)
646 void RepoInfo::setMirrorListUrl( const Url & url_r ) // Raw
647 { setMirrorlistUrl( url_r ); }
648 void RepoInfo::setMirrorListUrls( url_set urls ) // Raw
649 { _pimpl->setMirrorlistUrl( urls.empty() ? Url() : urls.front() ); }
650 void RepoInfo::setMetalinkUrls( url_set urls ) // Raw
651 { _pimpl->setMetalinkUrl( urls.empty() ? Url() : urls.front() ); }
652#endif
653
654 void RepoInfo::setGpgKeyUrls( url_set urls )
655 { _pimpl->gpgKeyUrls().raw().swap( urls ); }
656
657 void RepoInfo::setGpgKeyUrl( const Url & url_r )
658 {
659 _pimpl->gpgKeyUrls().raw().clear();
660 _pimpl->gpgKeyUrls().raw().push_back( url_r );
661 }
662
663 std::string RepoInfo::repoStatusString() const
664 { return _pimpl->repoStatusString(); }
665
666 void RepoInfo::addBaseUrl( Url url_r )
667 {
668 for ( const auto & url : _pimpl->baseUrls().raw() ) // Raw unique!
669 if ( url == url_r )
670 return;
671
672 _pimpl->baseUrls().raw().push_back( url_r );
673 _pimpl->resetMirrorUrls ();
674 }
675
676 void RepoInfo::setBaseUrl( Url url_r )
677 {
678 _pimpl->baseUrls().raw().clear();
679 _pimpl->resetMirrorUrls ();
680 _pimpl->baseUrls().raw().push_back( std::move(url_r) );
681 }
682
683 void RepoInfo::setBaseUrls( url_set urls )
684 {
685 _pimpl->resetMirrorUrls ();
686 _pimpl->baseUrls().raw().swap( urls );
687 }
688
689 MirroredOriginSet RepoInfo::repoOrigins() const
690 {
691 return _pimpl->repoOrigins();
692 }
693
694 bool RepoInfo::repoOriginsEmpty() const
695 {
696 return ( _pimpl->baseUrls().empty () && _pimpl->mirrorUrls().empty() );
697 }
698
699 void RepoInfo::setPath( const Pathname &path )
700 { _pimpl->path = path; }
701
702 void RepoInfo::setType( const repo::RepoType &t )
703 { _pimpl->setType( t ); }
704
705 void RepoInfo::setProbedType( const repo::RepoType &t ) const
706 { _pimpl->setProbedType( t ); }
707
708
709 void RepoInfo::setMetadataPath( const Pathname &path )
710 { _pimpl->metadataPath( path ); }
711
712 void RepoInfo::setPackagesPath( const Pathname &path )
713 { _pimpl->packagesPath( path ); }
714
715 Pathname RepoInfo::predownloadPath() const
716 { return _pimpl->predownloadPath(); }
717
718 void RepoInfo::setKeepPackages( bool keep )
719 { _pimpl->keeppackages = keep; }
720
721 void RepoInfo::setService( const std::string& name )
722 { _pimpl->service = name; }
723
724 void RepoInfo::setTargetDistribution( const std::string & targetDistribution )
725 { _pimpl->targetDistro = targetDistribution; }
726
727 bool RepoInfo::keepPackages() const
728 { return indeterminate(_pimpl->keeppackages) ? false : (bool)_pimpl->keeppackages; }
729
730 bool RepoInfo::effectiveKeepPackages() const
731 { return keepPackages() || PathInfo(packagesPath().dirname()/".keep_packages").isExist(); }
732
733 Pathname RepoInfo::metadataPath() const
734 { return _pimpl->metadataPath(); }
735
736 Pathname RepoInfo::packagesPath() const
737 { return _pimpl->packagesPath(); }
738
739 bool RepoInfo::usesAutoMetadataPaths() const
740 { return _pimpl->usesAutoMetadataPaths(); }
741
742 repo::RepoType RepoInfo::type() const
743 { return _pimpl->type(); }
744
745 Url RepoInfo::mirrorListUrl() const // Variables replaced!
746 { return _pimpl->mirrorListUrl().transformed(); }
747
748 Url RepoInfo::rawMirrorListUrl() const // Raw
749 { return _pimpl->mirrorListUrl().raw(); }
750
751 bool RepoInfo::gpgKeyUrlsEmpty() const
752 { return _pimpl->gpgKeyUrls().empty(); }
753
754 RepoInfo::urls_size_type RepoInfo::gpgKeyUrlsSize() const
755 { return _pimpl->gpgKeyUrls().size(); }
756
757 RepoInfo::url_set RepoInfo::gpgKeyUrls() const // Variables replaced!
758 { return _pimpl->gpgKeyUrls().transformed(); }
759
760 RepoInfo::url_set RepoInfo::rawGpgKeyUrls() const // Raw
761 { return _pimpl->gpgKeyUrls().raw(); }
762
763 Url RepoInfo::gpgKeyUrl() const // Variables replaced!
764 { return( _pimpl->gpgKeyUrls().empty() ? Url() : *_pimpl->gpgKeyUrls().transformedBegin() ); }
765
766 Url RepoInfo::rawGpgKeyUrl() const // Raw
767 { return( _pimpl->gpgKeyUrls().empty() ? Url() : *_pimpl->gpgKeyUrls().rawBegin() ) ; }
768
769 RepoInfo::url_set RepoInfo::baseUrls() const // Variables replaced!
770 { return _pimpl->baseUrls().transformed(); }
771
772 RepoInfo::url_set RepoInfo::rawBaseUrls() const // Raw
773 { return _pimpl->baseUrls().raw(); }
774
775 Pathname RepoInfo::path() const
776 { return _pimpl->path; }
777
778 std::string RepoInfo::service() const
779 { return _pimpl->service; }
780
781 std::string RepoInfo::targetDistribution() const
782 { return _pimpl->targetDistro; }
783
784 Url RepoInfo::rawUrl() const
785 { return _pimpl->baseUrl().raw(); }
786
787 Url RepoInfo::location() const
788 { return _pimpl->location (); }
789
790 RepoInfo::urls_const_iterator RepoInfo::baseUrlsBegin() const
791 { return _pimpl->baseUrls().transformedBegin(); }
792
793 RepoInfo::urls_const_iterator RepoInfo::baseUrlsEnd() const
794 { return _pimpl->baseUrls().transformedEnd(); }
795
796 RepoInfo::urls_size_type RepoInfo::baseUrlsSize() const
797 { return _pimpl->baseUrls().size(); }
798
799 bool RepoInfo::baseUrlsEmpty() const
800 { return _pimpl->baseUrls().empty(); }
801
802 bool RepoInfo::baseUrlSet() const
803 { return _pimpl->baseurl2dump(); }
804
805 Url RepoInfo::url() const
806 {
807 return _pimpl->baseUrl().transformed();
808 }
809
810 const std::set<std::string> & RepoInfo::contentKeywords() const
811 { return _pimpl->contentKeywords(); }
812
813 void RepoInfo::addContent( const std::string & keyword_r )
814 { _pimpl->addContent( keyword_r ); }
815
816 bool RepoInfo::hasContent() const
817 { return _pimpl->hasContent(); }
818
819 bool RepoInfo::hasContent( const std::string & keyword_r ) const
820 { return _pimpl->hasContent( keyword_r ); }
821
823
824 bool RepoInfo::hasLicense() const
825 { return hasLicense( std::string() ); }
826
827 bool RepoInfo::hasLicense( const std::string & name_r ) const
828 { return !_pimpl->licenseTgz( name_r ).empty(); }
829
830
831 bool RepoInfo::needToAcceptLicense() const
832 { return needToAcceptLicense( std::string() ); }
833
834 bool RepoInfo::needToAcceptLicense( const std::string & name_r ) const
835 {
836 const Pathname & licenseTgz( _pimpl->licenseTgz( name_r ) );
837 if ( licenseTgz.empty() )
838 return false; // no licenses at all
839
840 ExternalProgram::Arguments cmd;
841 cmd.push_back( "tar" );
842 cmd.push_back( "-t" );
843 cmd.push_back( "-z" );
844 cmd.push_back( "-f" );
845 cmd.push_back( licenseTgz.asString() );
846 ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
847
848 bool accept = true;
849 static const std::string noAcceptanceFile = "no-acceptance-needed\n";
850 for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
851 {
852 if ( output == noAcceptanceFile )
853 {
854 accept = false;
855 }
856 }
857 prog.close();
858 MIL << "License(" << name_r << ") in " << name() << " has to be accepted: " << (accept?"true":"false" ) << endl;
859 return accept;
860 }
861
862
863 std::string RepoInfo::getLicense( const Locale & lang_r )
864 { return const_cast<const RepoInfo *>(this)->getLicense( std::string(), lang_r ); }
865
866 std::string RepoInfo::getLicense( const Locale & lang_r ) const
867 { return getLicense( std::string(), lang_r ); }
868
869 std::string RepoInfo::getLicense( const std::string & name_r, const Locale & lang_r ) const
870 {
871 LocaleSet avlocales( getLicenseLocales( name_r ) );
872 if ( avlocales.empty() )
873 return std::string();
874
875 Locale getLang( Locale::bestMatch( avlocales, lang_r ) );
876 if ( !getLang && avlocales.find( Locale::noCode ) == avlocales.end() )
877 {
878 WAR << "License(" << name_r << ") in " << name() << " contains no fallback text!" << endl;
879 // Using the fist locale instead of returning no text at all.
880 // So the user might recognize that there is a license, even if they
881 // can't read it.
882 getLang = *avlocales.begin();
883 }
884
885 // now extract the license file.
886 static const std::string licenseFileFallback( "license.txt" );
887 std::string licenseFile( !getLang ? licenseFileFallback
888 : str::form( "license.%s.txt", getLang.c_str() ) );
889
890 ExternalProgram::Arguments cmd;
891 cmd.push_back( "tar" );
892 cmd.push_back( "-x" );
893 cmd.push_back( "-z" );
894 cmd.push_back( "-O" );
895 cmd.push_back( "-f" );
896 cmd.push_back( _pimpl->licenseTgz( name_r ).asString() ); // if it not exists, avlocales was empty.
897 cmd.push_back( licenseFile );
898
899 std::string ret;
900 ExternalProgram prog( cmd, ExternalProgram::Discard_Stderr );
901 for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
902 {
903 ret += output;
904 }
905 prog.close();
906 return ret;
907 }
908
909
910 LocaleSet RepoInfo::getLicenseLocales() const
911 { return getLicenseLocales( std::string() ); }
912
913 LocaleSet RepoInfo::getLicenseLocales( const std::string & name_r ) const
914 {
915 const Pathname & licenseTgz( _pimpl->licenseTgz( name_r ) );
916 if ( licenseTgz.empty() )
917 return LocaleSet();
918
919 ExternalProgram::Arguments cmd;
920 cmd.push_back( "tar" );
921 cmd.push_back( "-t" );
922 cmd.push_back( "-z" );
923 cmd.push_back( "-f" );
924 cmd.push_back( licenseTgz.asString() );
925
926 LocaleSet ret;
927 ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
928 for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
929 {
930 static const C_Str license( "license." );
931 static const C_Str dotTxt( ".txt\n" );
932 if ( str::hasPrefix( output, license ) && str::hasSuffix( output, dotTxt ) )
933 {
934 if ( output.size() <= license.size() + dotTxt.size() ) // license.txt
935 ret.insert( Locale() );
936 else
937 ret.insert( Locale( std::string( output.c_str()+license.size(), output.size()- license.size() - dotTxt.size() ) ) );
938 }
939 }
940 prog.close();
941 return ret;
942 }
943
945
946 std::ostream & RepoInfo::dumpOn( std::ostream & str ) const
947 {
948 RepoInfoBase::dumpOn(str);
949 if ( _pimpl->baseurl2dump() )
950 {
951 for ( const auto & url : _pimpl->baseUrls().raw() )
952 {
953 str << "- url : " << url << std::endl;
954 }
955 }
956
957 // print if non empty value
958 auto strif( [&] ( const std::string & tag_r, const std::string & value_r ) {
959 if ( ! value_r.empty() )
960 str << tag_r << value_r << std::endl;
961 });
962
963 strif( "- mirrorlist : ", _pimpl->cfgMirrorlistUrl().raw().asString() );
964 strif( "- metalink : ", _pimpl->cfgMetalinkUrl().raw().asString() );
965 strif( "- path : ", path().asString() );
966 str << "- type : " << type() << std::endl;
967 str << "- priority : " << priority() << std::endl;
968
969 // Yes No Default(Y) Default(N)
970#define OUTS(T,B) ( indeterminate(T) ? (std::string("D(")+(B?"Y":"N")+")") : ((bool)T?"Y":"N") )
971 str << "- gpgcheck : " << OUTS(_pimpl->rawGpgCheck(),gpgCheck())
972 << " repo" << OUTS(_pimpl->rawRepoGpgCheck(),repoGpgCheck()) << (repoGpgCheckIsMandatory() ? "* ": " " )
973 << "sig" << asString( validRepoSignature(), "?", "Y", "N" )
974 << " pkg" << OUTS(_pimpl->rawPkgGpgCheck(),pkgGpgCheck()) << (pkgGpgCheckIsMandatory() ? "* ": " " )
975 << std::endl;
976#undef OUTS
977
978 for ( const auto & url : _pimpl->gpgKeyUrls().raw() )
979 {
980 str << "- gpgkey : " << url << std::endl;
981 }
982
983 if ( ! indeterminate(_pimpl->keeppackages) )
984 str << "- keeppackages: " << keepPackages() << std::endl;
985
986 strif( "- service : ", service() );
987 strif( "- targetdistro: ", targetDistribution() );
988 strif( "- filePath: ", filepath().asString() );
989 strif( "- metadataPath: ", metadataPath().asString() );
990 strif( "- packagesPath: ", packagesPath().asString() );
991
992 return str;
993 }
994
995 std::ostream & RepoInfo::dumpAsIniOn( std::ostream & str ) const
996 {
997 // libzypp/#638: Add a note to service maintained repo entries
998 if( ! service().empty() ) {
999 str << "# Repository '"<<alias()<<"' is maintained by the '"<<service()<<"' service." << endl;
1000 str << "# Manual changes may be overwritten by a service refresh." << endl;
1001 str << "# See also 'man zypper', section 'Services'." << endl;
1002 }
1003 RepoInfoBase::dumpAsIniOn(str);
1004
1005 if ( _pimpl->baseurl2dump() )
1006 {
1007 str << "baseurl=";
1008 std::string indent;
1009 for ( const auto & url : _pimpl->baseUrls().raw() )
1010 {
1011 str << indent << hotfix1050625::asString( url ) << endl;
1012 if ( indent.empty() ) indent = " "; // "baseurl="
1013 }
1014 }
1015
1016 if ( ! _pimpl->path.empty() )
1017 str << "path="<< path() << endl;
1018
1019 if ( ! _pimpl->cfgMirrorlistUrl().raw().asString().empty() )
1020 str << "mirrorlist=" << hotfix1050625::asString( _pimpl->cfgMirrorlistUrl().raw() ) << endl;
1021
1022 if ( ! _pimpl->cfgMetalinkUrl().raw().asString().empty() )
1023 str << "metalink=" << hotfix1050625::asString( _pimpl->cfgMetalinkUrl().raw() ) << endl;
1024
1025 if ( type() != repo::RepoType::NONE )
1026 str << "type=" << type().asString() << endl;
1027
1028 if ( priority() != defaultPriority() )
1029 str << "priority=" << priority() << endl;
1030
1031 if ( ! indeterminate(_pimpl->rawGpgCheck()) )
1032 str << "gpgcheck=" << (_pimpl->rawGpgCheck() ? "1" : "0") << endl;
1033
1034 if ( ! indeterminate(_pimpl->rawRepoGpgCheck()) )
1035 str << "repo_gpgcheck=" << (_pimpl->rawRepoGpgCheck() ? "1" : "0") << endl;
1036
1037 if ( ! indeterminate(_pimpl->rawPkgGpgCheck()) )
1038 str << "pkg_gpgcheck=" << (_pimpl->rawPkgGpgCheck() ? "1" : "0") << endl;
1039
1040 {
1041 std::string indent( "gpgkey=");
1042 for ( const auto & url : _pimpl->gpgKeyUrls().raw() )
1043 {
1044 str << indent << url << endl;
1045 if ( indent[0] != ' ' )
1046 indent = " ";
1047 }
1048 }
1049
1050 if (!indeterminate(_pimpl->keeppackages))
1051 str << "keeppackages=" << keepPackages() << endl;
1052
1053 if( ! service().empty() )
1054 str << "service=" << service() << endl;
1055
1056 return str;
1057 }
1058
1059 std::ostream & RepoInfo::dumpAsXmlOn( std::ostream & str, const std::string & content ) const
1060 {
1061 std::string tmpstr;
1062 str
1063 << "<repo"
1064 << " alias=\"" << escape(alias()) << "\""
1065 << " name=\"" << escape(name()) << "\"";
1066 if (type() != repo::RepoType::NONE)
1067 str << " type=\"" << type().asString() << "\"";
1068 str
1069 << " priority=\"" << priority() << "\""
1070 << " enabled=\"" << enabled() << "\""
1071 << " autorefresh=\"" << autorefresh() << "\""
1072 << " gpgcheck=\"" << gpgCheck() << "\""
1073 << " repo_gpgcheck=\"" << repoGpgCheck() << "\""
1074 << " pkg_gpgcheck=\"" << pkgGpgCheck() << "\"";
1075 if ( ! indeterminate(_pimpl->rawGpgCheck()) )
1076 str << " raw_gpgcheck=\"" << (_pimpl->rawGpgCheck() ? "1" : "0") << "\"";
1077 if ( ! indeterminate(_pimpl->rawRepoGpgCheck()) )
1078 str << " raw_repo_gpgcheck=\"" << (_pimpl->rawRepoGpgCheck() ? "1" : "0") << "\"";
1079 if ( ! indeterminate(_pimpl->rawPkgGpgCheck()) )
1080 str << " raw_pkg_gpgcheck=\"" << (_pimpl->rawPkgGpgCheck() ? "1" : "0") << "\"";
1081 if (!(tmpstr = gpgKeyUrl().asString()).empty())
1082 str << " gpgkey=\"" << escape(tmpstr) << "\"";
1083 if ( ! (tmpstr = _pimpl->cfgMirrorlistUrl().transformed().asString()).empty() )
1084 str << " mirrorlist=\"" << escape(tmpstr) << "\"";
1085 if ( ! (tmpstr = _pimpl->cfgMetalinkUrl().transformed().asString()).empty() )
1086 str << " metalink=\"" << escape(tmpstr) << "\"";
1087 str << ">" << endl;
1088
1089 if ( _pimpl->baseurl2dump() )
1090 {
1091 for_( it, baseUrlsBegin(), baseUrlsEnd() ) // !transform iterator replaces variables
1092 str << "<url>" << escape((*it).asString()) << "</url>" << endl;
1093 }
1094
1095 str << "</repo>" << endl;
1096 return str;
1097 }
1098
1099
1100 std::ostream & operator<<( std::ostream & str, const RepoInfo & obj )
1101 {
1102 return obj.dumpOn(str);
1103 }
1104
1105 std::ostream & operator<<( std::ostream & str, const RepoInfo::GpgCheck & obj )
1106 {
1107 switch ( obj )
1108 {
1109#define OUTS( V ) case RepoInfo::V: return str << #V; break
1110 OUTS( GpgCheck::On );
1111 OUTS( GpgCheck::Strict );
1112 OUTS( GpgCheck::AllowUnsigned );
1113 OUTS( GpgCheck::AllowUnsignedRepo );
1114 OUTS( GpgCheck::AllowUnsignedPackage );
1115 OUTS( GpgCheck::Default );
1116 OUTS( GpgCheck::Off );
1117 OUTS( GpgCheck::indeterminate );
1118#undef OUTS
1119 }
1120 return str << "GpgCheck::UNKNOWN";
1121 }
1122
1123 bool RepoInfo::requireStatusWithMediaFile () const
1124 {
1125 // We skip the check for downloading media unless a local copy of the
1126 // media file exists and states that there is more than one medium.
1127 const auto &origins = _pimpl->repoOrigins ();
1128 bool canSkipMediaCheck = std::all_of( origins.begin(), origins.end(), []( const MirroredOrigin &origin ) { return origin.authority().url().schemeIsDownloading(); });
1129 if ( canSkipMediaCheck ) {
1130 const auto &mDataPath = metadataPath();
1131 if ( not mDataPath.empty() ) {
1132 PathInfo mediafile { mDataPath/"media.1/media" };
1133 if ( mediafile.isExist() ) {
1134 repo::SUSEMediaVerifier lverifier { mediafile.path() };
1135 if ( lverifier && lverifier.totalMedia() > 1 ) {
1136 canSkipMediaCheck = false;
1137 }
1138 }
1139 }
1140 }
1141 if ( canSkipMediaCheck )
1142 DBG << "Can SKIP media.1/media check for status calc of repo " << alias() << endl;
1143 return not canSkipMediaCheck;
1144 }
1145
1147} // namespace zypp
Glob.h
KeyRing.h
MediaSetAccess.h
Reader.h
escape
ZYPP_API detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
Definition XmlEscape.h:51
RepoInfo.h
RepoMirrorList.h
RepoVariablesReplacedUrl
base::ValueTransform< Url, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrl
Helper managing repo variables replaced urls.
Definition RepoVariables.h:133
RepoVariablesReplacedUrlList
base::ContainerTransform< std::list< Url >, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrlList
Helper managing repo variables replaced url lists.
Definition RepoVariables.h:136
SUSEMediaVerifier.h
OUTS
#define OUTS(V)
StrMatcher.h
ZConfig.h
ZYppCallbacks.h
ZYppFactory.h
bool
zypp::C_Str
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
Definition String.h:92
zypp::C_Str::size
size_type size() const
Definition String.h:109
zypp::DefaultIntegral
Integral type with defined initial value when default constructed.
Definition defaultintegral.h:42
zypp::Exception
Base class for Exception.
Definition Exception.h:153
zypp::ExternalProgram
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
Definition ExternalProgram.h:64
zypp::ExternalProgram::close
int close() override
Wait for the progamm to complete.
Definition ExternalProgram.cc:357
zypp::ExternalProgram::Arguments
std::vector< std::string > Arguments
Definition ExternalProgram.h:68
zypp::ExternalProgram::Discard_Stderr
@ Discard_Stderr
Definition ExternalProgram.h:76
zypp::ExternalProgram::Stderr_To_Stdout
@ Stderr_To_Stdout
Definition ExternalProgram.h:77
zypp::IdStringType::c_str
const char * c_str() const
Definition IdStringType.h:107
zypp::InputStream
Helper to create and pass std::istream.
Definition inputstream.h:57
zypp::Locale
'Language[_Country]' codes.
Definition Locale.h:51
zypp::Locale::noCode
static const Locale noCode
Empty code.
Definition Locale.h:75
zypp::Locale::bestMatch
static Locale bestMatch(const LocaleSet &avLocales_r, Locale requested_r=Locale())
Return the best match for Locale requested_r within the available avLocales_r.
Definition Locale.cc:213
zypp::MirroredOriginSet
A smart container that manages a collection of MirroredOrigin objects, automatically grouping endpoin...
Definition MirroredOrigin.h:325
zypp::MirroredOriginSet::addEndpoints
void addEndpoints(InputIterator first, InputIterator last)
A convenience method to add multiple endpoints from a range.
Definition MirroredOrigin.h:387
zypp::MirroredOrigin
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
Definition MirroredOrigin.h:170
zypp::RepoInfo::setPkgGpgCheck
void setPkgGpgCheck(TriBool value_r)
Set the value for pkgGpgCheck (or indeterminate to use the default).
Definition RepoInfo.cc:553
zypp::RepoInfo::dumpAsXmlOn
std::ostream & dumpAsXmlOn(std::ostream &str, const std::string &content="") const override
Write an XML representation of this RepoInfo object.
Definition RepoInfo.cc:1059
zypp::RepoInfo::setGpgKeyUrls
void setGpgKeyUrls(url_set urls)
Set a list of gpgkey URLs defined for this repo.
Definition RepoInfo.cc:654
zypp::RepoInfo::setMetalinkUrl
void setMetalinkUrl(const Url &url)
Set the raw metalink url.
Definition RepoInfo.cc:636
zypp::RepoInfo::dumpOn
std::ostream & dumpOn(std::ostream &str) const override
Write a human-readable representation of this RepoInfo object into the str stream.
Definition RepoInfo.cc:946
zypp::RepoInfo::metadataPath
Pathname metadataPath() const
Path where this repo metadata was read from.
Definition RepoInfo.cc:733
zypp::RepoInfo::setMirrorlistUrl
void setMirrorlistUrl(const Url &url)
Set the raw mirrorlist url.
Definition RepoInfo.cc:633
zypp::RepoInfo::urls_size_type
url_set::size_type urls_size_type
Definition RepoInfo.h:109
zypp::RepoInfo::setGpgKeyUrl
void setGpgKeyUrl(const Url &gpgkey)
(leagcy API) Set the gpgkey URL defined for this repo
Definition RepoInfo.cc:657
zypp::RepoInfo::usesAutoMetadataPaths
bool usesAutoMetadataPaths() const
Whether metadataPath uses AUTO% setup.
Definition RepoInfo.cc:739
zypp::RepoInfo::GpgCheck
GpgCheck
Some predefined settings.
Definition RepoInfo.h:412
zypp::RepoInfo::GpgCheck::Strict
@ Strict
Definition RepoInfo.h:415
zypp::RepoInfo::GpgCheck::indeterminate
@ indeterminate
Definition RepoInfo.h:413
zypp::RepoInfo::GpgCheck::On
@ On
Definition RepoInfo.h:414
zypp::RepoInfo::GpgCheck::AllowUnsignedPackage
@ AllowUnsignedPackage
Definition RepoInfo.h:418
zypp::RepoInfo::GpgCheck::Default
@ Default
Definition RepoInfo.h:419
zypp::RepoInfo::GpgCheck::AllowUnsigned
@ AllowUnsigned
Definition RepoInfo.h:416
zypp::RepoInfo::GpgCheck::AllowUnsignedRepo
@ AllowUnsignedRepo
Definition RepoInfo.h:417
zypp::RepoInfo::GpgCheck::Off
@ Off
Definition RepoInfo.h:420
zypp::RepoInfo::baseUrlsEmpty
bool baseUrlsEmpty() const
whether repository urls are available
Definition RepoInfo.cc:799
zypp::RepoInfo::predownloadPath
Pathname predownloadPath() const
Path where this repo packages are predownloaded.
Definition RepoInfo.cc:715
zypp::RepoInfo::hasContent
bool hasContent() const
Check for content keywords.
Definition RepoInfo.cc:816
zypp::RepoInfo::repoOrigins
MirroredOriginSet repoOrigins() const
The repodata origins.
Definition RepoInfo.cc:689
zypp::RepoInfo::setKeepPackages
void setKeepPackages(bool keep)
Set if packaqes downloaded from this repository will be kept in local cache.
Definition RepoInfo.cc:718
zypp::RepoInfo::gpgKeyUrls
url_set gpgKeyUrls() const
The list of gpgkey URLs defined for this repo.
Definition RepoInfo.cc:757
zypp::RepoInfo::rawGpgKeyUrl
Url rawGpgKeyUrl() const
(leagcy API) The 1st raw gpgkey URL defined for this repo (no variables replaced)
Definition RepoInfo.cc:766
zypp::RepoInfo::~RepoInfo
~RepoInfo() override
Definition RepoInfo.cc:506
zypp::RepoInfo::urls_const_iterator
transform_iterator< repo::RepoVariablesUrlReplacer, url_set::const_iterator > urls_const_iterator
Definition RepoInfo.h:110
zypp::RepoInfo::rawUrl
Url rawUrl() const
Pars pro toto: The first repository raw url (no variables replaced) this is either rawBaseUrls()....
Definition RepoInfo.cc:784
zypp::RepoInfo::type
repo::RepoType type() const
Type of repository,.
Definition RepoInfo.cc:742
zypp::RepoInfo::rawGpgKeyUrls
url_set rawGpgKeyUrls() const
The list of raw gpgkey URLs defined for this repo (no variables replaced)
Definition RepoInfo.cc:760
zypp::RepoInfo::noPriority
static unsigned noPriority()
The least priority (unsigned(-1)).
Definition RepoInfo.cc:515
zypp::RepoInfo::baseUrlsSize
urls_size_type baseUrlsSize() const
number of repository urls
Definition RepoInfo.cc:796
zypp::RepoInfo::keepPackages
bool keepPackages() const
Whether packages downloaded from this repository will be kept in local cache.
Definition RepoInfo.cc:727
zypp::RepoInfo::url
Url url() const
Pars pro toto: The first repository url, this is either baseUrls().front() or if no baseUrl is define...
Definition RepoInfo.cc:805
zypp::RepoInfo::noRepo
static const RepoInfo noRepo
Represents no Repository (one with an empty alias).
Definition RepoInfo.h:85
zypp::RepoInfo::setBaseUrl
void setBaseUrl(Url url)
Clears current base URL list and adds url.
Definition RepoInfo.cc:676
zypp::RepoInfo::contentKeywords
const std::set< std::string > & contentKeywords() const
Content keywords defined.
Definition RepoInfo.cc:810
zypp::RepoInfo::baseUrlsEnd
urls_const_iterator baseUrlsEnd() const
iterator that points at end of repository urls
Definition RepoInfo.cc:793
zypp::RepoInfo::location
Url location() const
Returns the location URL for the repository, this is either the first configured baseUrl or a configu...
Definition RepoInfo.cc:787
zypp::RepoInfo::setPackagesPath
void setPackagesPath(const Pathname &path)
set the path where the local packages are stored
Definition RepoInfo.cc:712
zypp::RepoInfo::rawCfgMetalinkUrl
Url rawCfgMetalinkUrl() const
The configured raw metalink url.
Definition RepoInfo.cc:642
zypp::RepoInfo::getLicense
std::string getLicense(const Locale &lang_r=Locale()) const
Return the best license for the current (or a specified) locale.
Definition RepoInfo.cc:866
zypp::RepoInfo::baseUrlSet
bool baseUrlSet() const
Whether there are manualy configured repository urls.
Definition RepoInfo.cc:802
zypp::RepoInfo::setService
void setService(const std::string &name)
sets service which added this repository
Definition RepoInfo.cc:721
zypp::RepoInfo::setGpgCheck
void setGpgCheck(TriBool value_r)
Set the value for gpgCheck (or indeterminate to use the default).
Definition RepoInfo.cc:525
zypp::RepoInfo::effectiveKeepPackages
bool effectiveKeepPackages() const
keepPackages unless the package cache itself enforces keeping the packages.
Definition RepoInfo.cc:730
zypp::RepoInfo::path
Pathname path() const
Repository path.
Definition RepoInfo.cc:775
zypp::RepoInfo::gpgKeyUrlsSize
urls_size_type gpgKeyUrlsSize() const
Number of gpgkey URLs defined.
Definition RepoInfo.cc:754
zypp::RepoInfo::getLicenseLocales
LocaleSet getLicenseLocales() const
Return the locales the license is available for.
Definition RepoInfo.cc:910
zypp::RepoInfo::baseUrls
url_set baseUrls() const
The complete set of repository urls as configured.
Definition RepoInfo.cc:769
zypp::RepoInfo::requireStatusWithMediaFile
bool requireStatusWithMediaFile() const
Returns true if this repository requires the media.1/media file to be included in the metadata status...
Definition RepoInfo.cc:1123
zypp::RepoInfo::addBaseUrl
void addBaseUrl(Url url)
Add a base url.
Definition RepoInfo.cc:666
zypp::RepoInfo::pkgGpgCheckIsMandatory
bool pkgGpgCheckIsMandatory() const
Mandatory check (pkgGpgCheck is not off) must ask to confirm using unsigned packages.
Definition RepoInfo.cc:550
zypp::RepoInfo::rawBaseUrls
url_set rawBaseUrls() const
The complete set of raw repository urls (no variables replaced)
Definition RepoInfo.cc:772
zypp::RepoInfo::mirrorListUrl
Url mirrorListUrl() const
Url of a file which contains a list of repository urls.
Definition RepoInfo.cc:745
zypp::RepoInfo::setProbedType
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:705
zypp::RepoInfo::setBaseUrls
void setBaseUrls(url_set urls)
Clears current base URL list and adds an url_set.
Definition RepoInfo.cc:683
zypp::RepoInfo::service
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:778
zypp::RepoInfo::setTargetDistribution
void setTargetDistribution(const std::string &targetDistribution)
Sets the distribution for which is this repository meant.
Definition RepoInfo.cc:724
zypp::RepoInfo::dumpAsIniOn
std::ostream & dumpAsIniOn(std::ostream &str) const override
Write this RepoInfo object into str in a .repo file format.
Definition RepoInfo.cc:995
zypp::RepoInfo::priority
unsigned priority() const
Repository priority for solver.
Definition RepoInfo.cc:509
zypp::RepoInfo::gpgCheck
bool gpgCheck() const
Whether default signature checking should be performed.
Definition RepoInfo.cc:522
zypp::RepoInfo::setPath
void setPath(const Pathname &path)
set the product path.
Definition RepoInfo.cc:699
zypp::RepoInfo::gpgKeyUrl
Url gpgKeyUrl() const
(leagcy API) The 1st gpgkey URL defined for this repo
Definition RepoInfo.cc:763
zypp::RepoInfo::setValidRepoSignature
void setValidRepoSignature(TriBool value_r)
Set the value for validRepoSignature (or indeterminate if unsigned).
Definition RepoInfo.cc:572
zypp::RepoInfo::RepoInfo
RepoInfo()
Definition RepoInfo.cc:502
zypp::RepoInfo::defaultPriority
static unsigned defaultPriority()
The default priority (99).
Definition RepoInfo.cc:512
zypp::RepoInfo::needToAcceptLicense
bool needToAcceptLicense() const
Whether the repo license has to be accepted, e.g.
Definition RepoInfo.cc:831
zypp::RepoInfo::setPriority
void setPriority(unsigned newval_r)
Set repository priority for solver.
Definition RepoInfo.cc:518
zypp::RepoInfo::_pimpl
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition RepoInfo.h:617
zypp::RepoInfo::baseUrlsBegin
urls_const_iterator baseUrlsBegin() const
iterator that points at begin of repository urls
Definition RepoInfo.cc:790
zypp::RepoInfo::hasLicense
bool hasLicense() const
Whether there is a license associated with the repo.
Definition RepoInfo.cc:824
zypp::RepoInfo::repoGpgCheckIsMandatory
bool repoGpgCheckIsMandatory() const
Mandatory check (repoGpgCheck is on) must ask to confirm using unsigned repos.
Definition RepoInfo.cc:535
zypp::RepoInfo::setMetadataPath
void setMetadataPath(const Pathname &path)
Set the path where the local metadata is stored.
Definition RepoInfo.cc:709
zypp::RepoInfo::validRepoSignature
TriBool validRepoSignature() const
Whether the repo metadata are signed and successfully validated or indeterminate if unsigned.
Definition RepoInfo.cc:565
zypp::RepoInfo::setRepoGpgCheck
void setRepoGpgCheck(TriBool value_r)
Set the value for repoGpgCheck (or indeterminate to use the default).
Definition RepoInfo.cc:543
zypp::RepoInfo::packagesPath
Pathname packagesPath() const
Path where this repo packages are cached.
Definition RepoInfo.cc:736
zypp::RepoInfo::addContent
void addContent(const std::string &keyword_r)
Add content keywords.
Definition RepoInfo.cc:813
zypp::RepoInfo::repoGpgCheck
bool repoGpgCheck() const
Whether the signature of repo metadata should be checked for this repo.
Definition RepoInfo.cc:532
zypp::RepoInfo::targetDistribution
std::string targetDistribution() const
Distribution for which is this repository meant.
Definition RepoInfo.cc:781
zypp::RepoInfo::getRawGpgChecks
void getRawGpgChecks(TriBool &g_r, TriBool &r_r, TriBool &p_r) const
Raw values for RepoManager.
Definition RepoInfo.cc:557
zypp::RepoInfo::setType
void setType(const repo::RepoType &t)
set the repository type
Definition RepoInfo.cc:702
zypp::RepoInfo::pkgGpgCheck
bool pkgGpgCheck() const
Whether the signature of rpm packages should be checked for this repo.
Definition RepoInfo.cc:547
zypp::RepoInfo::repoStatusString
std::string repoStatusString() const
A string value to track changes requiring a refresh.
Definition RepoInfo.cc:663
zypp::RepoInfo::url_set
std::list< Url > url_set
Definition RepoInfo.h:108
zypp::RepoInfo::rawMirrorListUrl
Url rawMirrorListUrl() const
The raw mirrorListUrl (no variables replaced).
Definition RepoInfo.cc:748
zypp::RepoInfo::gpgKeyUrlsEmpty
bool gpgKeyUrlsEmpty() const
Whether gpgkey URLs are defined.
Definition RepoInfo.cc:751
zypp::RepoInfo::rawCfgMirrorlistUrl
Url rawCfgMirrorlistUrl() const
The configured raw mirrorlist url.
Definition RepoInfo.cc:639
zypp::RepoInfo::repoOriginsEmpty
bool repoOriginsEmpty() const
whether repo origins are available
Definition RepoInfo.cc:694
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::Url::asString
std::string asString() const
Returns a default string representation of the Url object.
Definition Url.cc:515
zypp::Url::setQueryParam
void setQueryParam(const std::string &param, const std::string &value)
Set or add value for the specified query parameter.
Definition Url.cc:894
zypp::Url::pathNameSetTrailingSlash
void pathNameSetTrailingSlash(bool apply_r=true)
Apply or remove a trailing '/' from pathName.
Definition Url.cc:829
zypp::ZConfig::gpgCheck
bool gpgCheck() const
Turn signature checking on/off (on)
Definition ZConfig.cc:1241
zypp::ZConfig::pkgGpgCheck
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck)
Definition ZConfig.cc:1243
zypp::ZConfig::instance
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:940
zypp::ZConfig::repoGpgCheck
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck)
Definition ZConfig.cc:1242
zypp::callback::UserData
Typesafe passing of user data via callbacks.
Definition UserData.h:40
zypp::callback::UserData::set
bool set(const std::string &key_r, AnyType val_r)
Set the value for key (nonconst version always returns true).
Definition UserData.h:119
zypp::externalprogram::ExternalDataSource::receiveLine
std::string receiveLine()
Read one line from the input stream.
Definition ExternalDataSource.cc:115
zypp::filesystem::Glob
Find pathnames matching a pattern.
Definition Glob.h:58
zypp::filesystem::Glob::empty
bool empty() const
Whether matches were found.
Definition Glob.h:189
zypp::filesystem::Glob::begin
const_iterator begin() const
Iterator pointing to the first result.
Definition Glob.h:197
zypp::filesystem::Glob::add
int add(const Pathname &pattern_r, Flags flags_r=Flags())
Add pathnames matching pattern_r to the current result.
Definition Glob.h:155
zypp::filesystem::PathInfo
Wrapper class for stat/lstat.
Definition PathInfo.h:226
zypp::filesystem::PathInfo::path
const Pathname & path() const
Return current Pathname.
Definition PathInfo.h:251
zypp::filesystem::PathInfo::isExist
bool isExist() const
Return whether valid stat info exists.
Definition PathInfo.h:286
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::filesystem::Pathname::c_str
const char * c_str() const
String representation.
Definition Pathname.h:112
zypp::filesystem::Pathname::asString
const std::string & asString() const
String representation.
Definition Pathname.h:93
zypp::filesystem::Pathname::empty
bool empty() const
Test for an empty path.
Definition Pathname.h:116
zypp::repo::RepoInfoBase::filepath
Pathname filepath() const
File where this repo was read from.
Definition RepoInfoBase.cc:127
zypp::repo::RepoInfoBase::autorefresh
bool autorefresh() const
If true, the repostory must be refreshed before creating resolvables from it.
Definition RepoInfoBase.cc:101
zypp::repo::RepoInfoBase::name
std::string name() const
Repository name.
Definition RepoInfoBase.cc:110
zypp::repo::RepoInfoBase::enabled
bool enabled() const
If enabled is false, then this repository must be ignored as if does not exists, except when checking...
Definition RepoInfoBase.cc:98
zypp::repo::RepoInfoBase::alias
std::string alias() const
unique identifier for this source.
Definition RepoInfoBase.cc:104
zypp::repo::RepoMirrorList
Definition RepoMirrorList.h:22
zypp::repo::RepoMirrorList::urlSupportsMirrorLink
static bool urlSupportsMirrorLink(const zypp::Url &url)
Definition RepoMirrorList.cc:417
zypp::repo::RepoMirrorList::getUrls
const std::vector< Url > & getUrls() const
Definition RepoMirrorList.h:31
zypp::repo::SUSEMediaVerifier
Implementation of the traditional SUSE media verifier.
Definition SUSEMediaVerifier.h:28
zypp::repo::SUSEMediaVerifier::totalMedia
media::MediaNr totalMedia() const
The total number of media in this set (or 0 if not known).
Definition SUSEMediaVerifier.cc:145
zypp::xml::Reader
xmlTextReader based interface to iterate xml streams.
Definition Reader.h:96
zypp::xml::Reader::seekToEndNode
bool seekToEndNode(int depth_r, const std::string &name_r)
Definition Reader.cc:214
zypp::xml::Reader::nodeText
XmlString nodeText()
If the current node is not empty, advances the reader to the next node, and returns the value.
Definition Reader.cc:122
zypp::xml::Reader::seekToNode
bool seekToNode(int depth_r, const std::string &name_r)
Definition Reader.cc:194
zypp::xml::XmlString::asString
std::string asString() const
Explicit conversion to std::string.
Definition XmlString.h:77
contextfacade.h
curlhelper_p.h
internal::propagateQueryParams
zypp::Url propagateQueryParams(zypp::Url url_r, const zypp::Url &template_r)
Definition curlhelper.cc:424
str
String related utilities and Regular expression matching.
zypp::filesystem::symlink
int symlink(const Pathname &oldpath, const Pathname &newpath)
Like 'symlink'.
Definition PathInfo.cc:860
zypp::filesystem::unlink
int unlink(const Pathname &path)
Like 'unlink'.
Definition PathInfo.cc:705
zypp::hotfix1050625::asString
std::string asString(const Url &url_r)
Definition Url.cc:948
zypp::iostr::forEachLine
int forEachLine(std::istream &str_r, const function< bool(int, std::string)> &consume_r)
Simple lineparser: Call functor consume_r for each line.
Definition IOStream.cc:100
zypp::repo
Definition DeltaCandidates.cc:30
zypp::str::hasSuffix
bool hasSuffix(const C_Str &str_r, const C_Str &suffix_r)
Return whether str_r has suffix suffix_r.
Definition String.h:1111
zypp::str::hasPrefix
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition String.h:1097
zypp::str::startsWith
bool startsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasPrefix
Definition String.h:1155
zypp::str::form
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition String.cc:39
zypp::str::split
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Definition String.h:602
zypp::xml::escape
ZYPP_API detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
Definition XmlEscape.h:51
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition SerialNumber.cc:52
zypp::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:31
zypp::asString
std::string asString(const Patch::Category &obj)
Definition Patch.cc:122
zyppng::Url
zypp::Url Url
Definition url.h:15
repoinfowf.h
zypp::JobReport::warning
static bool warning(const std::string &msg_r, const UserData &userData_r=UserData())
send warning text
Definition ZYppCallbacks.h:1103
zypp::JobReport::repoRefreshMirrorlist
static const ContentType repoRefreshMirrorlist
Definition ZYppCallbacks.h:1081
zypp::RepoInfo::Impl
RepoInfo implementation.
Definition RepoInfo.cc:79
zypp::RepoInfo::Impl::_type
repo::RepoType _type
Definition RepoInfo.cc:408
zypp::RepoInfo::Impl::_packagesPath
Pathname _packagesPath
Definition RepoInfo.cc:469
zypp::RepoInfo::Impl::rawPkgGpgCheck
TriBool rawPkgGpgCheck() const
Definition RepoInfo.cc:393
zypp::RepoInfo::Impl::_rawRepoGpgCheck
TriBool _rawRepoGpgCheck
need to check repo sign.: Y/N/(ZConf(Y/N/gpgCheck))
Definition RepoInfo.cc:387
zypp::RepoInfo::Impl::internalValidRepoSignature
TriBool internalValidRepoSignature() const
Signature check result needs to be stored/retrieved from _metadataPath.
Definition RepoInfo.cc:312
zypp::RepoInfo::Impl::repoStatusString
std::string repoStatusString() const
Definition RepoInfo.cc:245
zypp::RepoInfo::Impl::triBoolFromPath
bool triBoolFromPath(const Pathname &path_r, TriBool &ret_r) const
Definition RepoInfo.cc:354
zypp::RepoInfo::Impl::internalUnsignedConfirmed
bool internalUnsignedConfirmed() const
We definitely have a symlink pointing to "indeterminate" (for repoGpgCheckIsMandatory)?
Definition RepoInfo.cc:348
zypp::RepoInfo::Impl::triBoolFromPath
TriBool triBoolFromPath(const Pathname &path_r) const
Definition RepoInfo.cc:380
zypp::RepoInfo::Impl::mirrorUrls
url_set & mirrorUrls() const
Fetch the repo mirrors from the server.
Definition RepoInfo.cc:174
zypp::RepoInfo::Impl::Impl
Impl(const Impl &)=default
zypp::RepoInfo::Impl::packagesPath
void packagesPath(Pathname new_r)
Definition RepoInfo.cc:440
zypp::RepoInfo::Impl::rawRepoGpgCheck
void rawRepoGpgCheck(TriBool val_r)
Definition RepoInfo.cc:396
zypp::RepoInfo::Impl::rawPkgGpgCheck
void rawPkgGpgCheck(TriBool val_r)
Definition RepoInfo.cc:397
zypp::RepoInfo::Impl::predownloadPath
Pathname predownloadPath() const
Definition RepoInfo.cc:460
zypp::RepoInfo::Impl::_metadataPath
Pathname _metadataPath
Definition RepoInfo.cc:468
zypp::RepoInfo::Impl::licenseTgz
Pathname licenseTgz(const std::string &name_r) const
Path to a license tarball in case it exists in the repo.
Definition RepoInfo.cc:118
zypp::RepoInfo::Impl::clone
Impl * clone() const
clone for RWCOW_pointer
Definition RepoInfo.cc:483
zypp::RepoInfo::Impl::metadataPath
Pathname metadataPath() const
Definition RepoInfo.cc:446
zypp::RepoInfo::Impl::priority
DefaultIntegral< unsigned, defaultPriority > priority
Definition RepoInfo.cc:465
zypp::RepoInfo::Impl::_cfgMetalinkUrl
RepoVariablesReplacedUrl _cfgMetalinkUrl
Definition RepoInfo.cc:412
zypp::RepoInfo::Impl::cfgGpgCheck
bool cfgGpgCheck() const
Definition RepoInfo.cc:399
zypp::RepoInfo::Impl::setMetalinkUrl
void setMetalinkUrl(const Url &url_r)
Definition RepoInfo.cc:421
zypp::RepoInfo::Impl::_mirrorUrls
url_set _mirrorUrls
Definition RepoInfo.cc:473
zypp::RepoInfo::Impl::cfgMirrorlistUrl
const RepoVariablesReplacedUrl & cfgMirrorlistUrl() const
Config file writing needs to tell them appart.
Definition RepoInfo.cc:425
zypp::RepoInfo::Impl::setMirrorlistUrl
void setMirrorlistUrl(const Url &url_r)
Definition RepoInfo.cc:418
zypp::RepoInfo::Impl::operator<<
std::ostream & operator<<(std::ostream &str, const RepoInfo::Impl &obj)
Stream output.
Definition RepoInfo.cc:489
zypp::RepoInfo::Impl::setType
void setType(const repo::RepoType &t)
Definition RepoInfo.cc:100
zypp::RepoInfo::Impl::rwcowClone
friend Impl * rwcowClone(const Impl *rhs)
zypp::RepoInfo::Impl::baseUrl
RepoVariablesReplacedUrl baseUrl() const
Definition RepoInfo.cc:143
zypp::RepoInfo::Impl::_lastMirrorUrlsUpdate
std::chrono::steady_clock::time_point _lastMirrorUrlsUpdate
Definition RepoInfo.cc:474
zypp::RepoInfo::Impl::hasContent
bool hasContent(const std::string &keyword_r) const
Definition RepoInfo.cc:305
zypp::RepoInfo::Impl::contentKeywords
const std::set< std::string > & contentKeywords() const
Definition RepoInfo.cc:254
zypp::RepoInfo::Impl::cfgPkgGpgCheck
TriBool cfgPkgGpgCheck() const
Definition RepoInfo.cc:403
zypp::RepoInfo::Impl::location
Url location() const
Definition RepoInfo.cc:158
zypp::RepoInfo::Impl::baseurl2dump
bool baseurl2dump() const
Definition RepoInfo.cc:235
zypp::RepoInfo::Impl::cfgMetalinkUrl
const RepoVariablesReplacedUrl & cfgMetalinkUrl() const
Config file writing needs to tell them appart.
Definition RepoInfo.cc:428
zypp::RepoInfo::Impl::baseUrls
const RepoVariablesReplacedUrlList & baseUrls() const
Definition RepoInfo.cc:153
zypp::RepoInfo::Impl::hasContent
bool hasContent() const
Definition RepoInfo.cc:260
zypp::RepoInfo::Impl::_gpgKeyUrls
RepoVariablesReplacedUrlList _gpgKeyUrls
Definition RepoInfo.cc:479
zypp::RepoInfo::Impl::~Impl
~Impl()
Definition RepoInfo.cc:94
zypp::RepoInfo::Impl::_baseUrls
RepoVariablesReplacedUrlList _baseUrls
Definition RepoInfo.cc:471
zypp::RepoInfo::Impl::operator=
Impl & operator=(Impl &&)=delete
zypp::RepoInfo::Impl::_repoOrigins
std::vector< MirroredOrigin > _repoOrigins
Definition RepoInfo.cc:475
zypp::RepoInfo::Impl::service
std::string service
Definition RepoInfo.cc:434
zypp::RepoInfo::Impl::rawGpgCheck
void rawGpgCheck(TriBool val_r)
Definition RepoInfo.cc:395
zypp::RepoInfo::Impl::addContent
void addContent(const std::string &keyword_r)
Definition RepoInfo.cc:257
zypp::RepoInfo::Impl::_rawGpgCheck
TriBool _rawGpgCheck
default gpgcheck behavior: Y/N/ZConf
Definition RepoInfo.cc:386
zypp::RepoInfo::Impl::packagesPath
Pathname packagesPath() const
Definition RepoInfo.cc:453
zypp::RepoInfo::Impl::mirrorListUrl
const RepoVariablesReplacedUrl & mirrorListUrl() const
THE mirrorListUrl to work with (either_cfgMirrorlistUrl or _cfgMetalinkUrl)
Definition RepoInfo.cc:415
zypp::RepoInfo::Impl::metadataPath
void metadataPath(Pathname new_r)
Definition RepoInfo.cc:437
zypp::RepoInfo::Impl::rawGpgCheck
TriBool rawGpgCheck() const
Definition RepoInfo.cc:391
zypp::RepoInfo::Impl::rawRepoGpgCheck
TriBool rawRepoGpgCheck() const
Definition RepoInfo.cc:392
zypp::RepoInfo::Impl::internalSetValidRepoSignature
void internalSetValidRepoSignature(TriBool value_r)
Definition RepoInfo.cc:326
zypp::RepoInfo::Impl::resetMirrorUrls
void resetMirrorUrls() const
Definition RepoInfo.cc:164
zypp::RepoInfo::Impl::targetDistro
std::string targetDistro
Definition RepoInfo.cc:435
zypp::RepoInfo::Impl::gpgKeyUrls
const RepoVariablesReplacedUrlList & gpgKeyUrls() const
Definition RepoInfo.cc:239
zypp::RepoInfo::Impl::cfgRepoGpgCheck
TriBool cfgRepoGpgCheck() const
Definition RepoInfo.cc:401
zypp::RepoInfo::Impl::path
Pathname path
Definition RepoInfo.cc:433
zypp::RepoInfo::Impl::defaultPriority
static const unsigned defaultPriority
Definition RepoInfo.cc:97
zypp::RepoInfo::Impl::_rawPkgGpgCheck
TriBool _rawPkgGpgCheck
need to check pkg sign.: Y/N/(ZConf(Y/N/gpgCheck))
Definition RepoInfo.cc:388
zypp::RepoInfo::Impl::keeppackages
TriBool keeppackages
Definition RepoInfo.cc:432
zypp::RepoInfo::Impl::setProbedType
void setProbedType(const repo::RepoType &t) const
Definition RepoInfo.cc:103
zypp::RepoInfo::Impl::repoOrigins
MirroredOriginSet repoOrigins() const
Definition RepoInfo.cc:221
zypp::RepoInfo::Impl::baseUrls
RepoVariablesReplacedUrlList & baseUrls()
Definition RepoInfo.cc:232
zypp::RepoInfo::Impl::_validRepoSignature
TriBool _validRepoSignature
have signed and valid repo metadata
Definition RepoInfo.cc:407
zypp::RepoInfo::Impl::type
repo::RepoType type() const
Definition RepoInfo.cc:109
zypp::RepoInfo::Impl::operator=
Impl & operator=(const Impl &)=delete
zypp::RepoInfo::Impl::_cfgMirrorlistUrl
RepoVariablesReplacedUrl _cfgMirrorlistUrl
Definition RepoInfo.cc:411
zypp::RepoInfo::Impl::_keywords
std::pair< FalseBool, std::set< std::string > > _keywords
Definition RepoInfo.cc:477
zypp::RepoInfo::Impl::gpgKeyUrls
RepoVariablesReplacedUrlList & gpgKeyUrls()
Definition RepoInfo.cc:242
zypp::RepoInfo::Impl::Impl
Impl()
Definition RepoInfo.cc:80
zypp::RepoInfo::Impl::usesAutoMetadataPaths
bool usesAutoMetadataPaths() const
Definition RepoInfo.cc:443
zypp::RepoInfo::Impl::noPriority
static const unsigned noPriority
Definition RepoInfo.cc:98
zypp::RepoInfo::Impl::Impl
Impl(Impl &&)=delete
zypp::repo::RepoType
Repository type enumeration.
Definition RepoType.h:29
zypp::repo::RepoType::YAST2
static const RepoType YAST2
Definition RepoType.h:31
zypp::repo::RepoType::asString
const std::string & asString() const
Definition RepoType.cc:56
zypp::repo::RepoType::RPMMD
static const RepoType RPMMD
Definition RepoType.h:30
zypp::repo::RepoType::NONE
static const RepoType NONE
Definition RepoType.h:33
zypp::repo::RepoType::RPMPLAINDIR
static const RepoType RPMPLAINDIR
Definition RepoType.h:32
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
_
#define _(MSG)
Definition Gettext.h:39
DBG
#define DBG
Definition Logger.h:99
MIL
#define MIL
Definition Logger.h:100
WAR
#define WAR
Definition Logger.h:101
ExternalProgram.h
ManagedFile.h
Pathname.h
TmpPath.h
TriBool.h
Gettext.h
Interface to gettext.
IOStream.h
LogTools.h
XmlEscape.h