libzypp: zypp/RepoInfo.cc Source File

libzypp 17.38.6

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