libzypp 17.38.5

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
48 using std::endl;
49 using zypp::xml::escape;
50
52 namespace 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 origins.addEndpoints( _baseUrls.transformedBegin(), _baseUrls.transformedEnd() );
255
256 const auto &mirrs = mirrorUrls ();
257 origins.addEndpoints( mirrs.transformedBegin(), mirrs.transformedEnd() );
258
259 return origins;
260 }
261
262 RepoVariablesReplacedUrlList & baseUrls()
263 { return _baseUrls; }
264
265 bool baseurl2dump() const
266 { return !_baseUrls.empty(); }
267
268
269 const RepoVariablesReplacedUrlList & gpgKeyUrls() const
270 { return _gpgKeyUrls; }
271
272 RepoVariablesReplacedUrlList & gpgKeyUrls()
273 { return _gpgKeyUrls; }
274
275 std::string repoStatusString() const
276 {
277 if ( mirrorListUrl().transformed().isValid() )
278 return mirrorListUrl().transformed().asString();
279 if ( !baseUrls().empty() )
280 return (*baseUrls().transformedBegin()).asString();
281 return std::string();
282 }
283
284 const std::set<std::string> & contentKeywords() const
285 { hasContent()/*init if not yet done*/; return _keywords.second; }
286
287 void addContent( const std::string & keyword_r )
288 { _keywords.second.insert( keyword_r ); if ( ! hasContent() ) _keywords.first = true; }
289
290 bool hasContent() const
291 {
292 if ( !_keywords.first && ! metadataPath().empty() )
293 {
294 // HACK directly check master index file until RepoManager offers
295 // some content probing and zypper uses it.
297 MIL << "Empty keywords...." << metadataPath() << endl;
298 Pathname master;
299 if ( PathInfo( (master=metadataPath()/"/repodata/repomd.xml") ).isFile() )
300 {
301 //MIL << "GO repomd.." << endl;
302 xml::Reader reader( master );
303 while ( reader.seekToNode( 2, "content" ) )
304 {
305 _keywords.second.insert( reader.nodeText().asString() );
306 reader.seekToEndNode( 2, "content" );
307 }
308 _keywords.first = true; // valid content in _keywords even if empty
309 }
310 else if ( PathInfo( (master=metadataPath()/"/content") ).isFile() )
311 {
312 //MIL << "GO content.." << endl;
313 iostr::forEachLine( InputStream( master ),
314 [this]( int num_r, const std::string& line_r )->bool
315 {
316 if ( str::startsWith( line_r, "REPOKEYWORDS" ) )
317 {
318 std::vector<std::string> words;
319 if ( str::split( line_r, std::back_inserter(words) ) > 1
320 && words[0].length() == 12 /*"REPOKEYWORDS"*/ )
321 {
322 this->_keywords.second.insert( ++words.begin(), words.end() );
323 }
324 return true; // mult. occurrances are ok.
325 }
326 return( ! str::startsWith( line_r, "META " ) ); // no need to parse into META section.
327 } );
328 _keywords.first = true; // valid content in _keywords even if empty
329 }
331 }
332 return _keywords.first;
333 }
334
335 bool hasContent( const std::string & keyword_r ) const
336 { return( hasContent() && _keywords.second.find( keyword_r ) != _keywords.second.end() ); }
337
342 TriBool internalValidRepoSignature() const
343 {
344 if ( ! indeterminate(_validRepoSignature) )
345 return _validRepoSignature;
346 // check metadata:
347 if ( ! metadataPath().empty() )
348 {
349 // A missing ".repo_gpgcheck" might be plaindir(no Downloader) or not yet refreshed signed repo!
350 TriBool linkval = triBoolFromPath( metadataPath() / ".repo_gpgcheck" );
351 return linkval;
352 }
353 return indeterminate;
354 }
355
356 void internalSetValidRepoSignature( TriBool value_r )
357 {
358 if ( PathInfo(metadataPath()).isDir() )
359 {
360 Pathname gpgcheckFile( metadataPath() / ".repo_gpgcheck" );
361 if ( PathInfo(gpgcheckFile).isExist() )
362 {
363 TriBool linkval( indeterminate );
364 if ( triBoolFromPath( gpgcheckFile, linkval ) && linkval == value_r )
365 return; // existing symlink fits value_r
366 else
367 filesystem::unlink( gpgcheckFile ); // will write a new one
368 }
369 filesystem::symlink( asString(value_r), gpgcheckFile );
370 }
371 _validRepoSignature = value_r;
372 }
373
378 bool internalUnsignedConfirmed() const
379 {
380 TriBool linkval( true ); // want to see it being switched to indeterminate
381 return triBoolFromPath( metadataPath() / ".repo_gpgcheck", linkval ) && indeterminate(linkval);
382 }
383
384 bool triBoolFromPath( const Pathname & path_r, TriBool & ret_r ) const
385 {
386 static const Pathname truePath( "true" );
387 static const Pathname falsePath( "false" );
388 static const Pathname indeterminatePath( "indeterminate" );
389
390 // Quiet readlink;
391 static const ssize_t bufsiz = 63;
392 static char buf[bufsiz+1];
393 ssize_t ret = ::readlink( path_r.c_str(), buf, bufsiz );
394 buf[ret == -1 ? 0 : ret] = '\0';
395
396 Pathname linkval( buf );
397
398 bool known = true;
399 if ( linkval == truePath )
400 ret_r = true;
401 else if ( linkval == falsePath )
402 ret_r = false;
403 else if ( linkval == indeterminatePath )
404 ret_r = indeterminate;
405 else
406 known = false;
407 return known;
408 }
409
410 TriBool triBoolFromPath( const Pathname & path_r ) const
411 { TriBool ret(indeterminate); triBoolFromPath( path_r, ret ); return ret; }
412
414
415 private:
416 TriBool _rawGpgCheck;
417 TriBool _rawRepoGpgCheck;
418 TriBool _rawPkgGpgCheck;
419
420 public:
421 TriBool rawGpgCheck() const { return _rawGpgCheck; }
422 TriBool rawRepoGpgCheck() const { return _rawRepoGpgCheck; }
423 TriBool rawPkgGpgCheck() const { return _rawPkgGpgCheck; }
424
425 void rawGpgCheck( TriBool val_r ) { _rawGpgCheck = val_r; }
426 void rawRepoGpgCheck( TriBool val_r ) { _rawRepoGpgCheck = val_r; }
427 void rawPkgGpgCheck( TriBool val_r ) { _rawPkgGpgCheck = val_r; }
428
429 bool cfgGpgCheck() const
430 { return indeterminate(_rawGpgCheck) ? ZConfig::instance().gpgCheck() : (bool)_rawGpgCheck; }
431 TriBool cfgRepoGpgCheck() const
432 { return indeterminate(_rawGpgCheck) && indeterminate(_rawRepoGpgCheck) ? ZConfig::instance().repoGpgCheck() : _rawRepoGpgCheck; }
433 TriBool cfgPkgGpgCheck() const
434 { return indeterminate(_rawGpgCheck) && indeterminate(_rawPkgGpgCheck) ? ZConfig::instance().pkgGpgCheck() : _rawPkgGpgCheck; }
435
436 private:
437 TriBool _validRepoSignature;
438 repo::RepoType _type;
439
440 private:
441 RepoVariablesReplacedUrl _cfgMirrorlistUrl;
442 RepoVariablesReplacedUrl _cfgMetalinkUrl;
443 public:
445 const RepoVariablesReplacedUrl & mirrorListUrl() const
446 { return _cfgMirrorlistUrl.transformed().isValid() ? _cfgMirrorlistUrl : _cfgMetalinkUrl; }
447
448 void setMirrorlistUrl( const Url & url_r ) // Raw
449 { _cfgMirrorlistUrl.raw() = url_r; }
450
451 void setMetalinkUrl( const Url & url_r ) // Raw
452 { _cfgMetalinkUrl.raw() = url_r; }
453
455 const RepoVariablesReplacedUrl & cfgMirrorlistUrl() const
456 { return _cfgMirrorlistUrl; }
457
458 const RepoVariablesReplacedUrl & cfgMetalinkUrl() const
459 { return _cfgMetalinkUrl; }
460
461 public:
462 TriBool keeppackages;
463 Pathname path;
464 std::string service;
465 std::string targetDistro;
466
467 void metadataPath( Pathname new_r )
468 { _metadataPath = std::move( new_r ); }
469
470 void packagesPath( Pathname new_r )
471 {
472 _packagesPath = std::move( new_r );
473 if ( not _packagesPath.empty() && zypp::IamNotRoot() && not userMayWriteOrCreateDir( _packagesPath ) ) {
474 _alternatePackagesPath = zypp::repo::env::XDG_CACHE_HOME() / "zypp/packages" / _packagesPath.basename();
475 WAR << "systemPackagesPath " << _packagesPath << " is not user writable, may use " << *_alternatePackagesPath << endl;
476 } else {
477 _alternatePackagesPath.reset();
478 }
479 }
480
481 bool usesAutoMetadataPaths() const
482 { return str::hasSuffix( _metadataPath.asString(), "/%AUTO%" ); }
483
484 Pathname metadataPath() const
485 {
486 if ( usesAutoMetadataPaths() )
487 return _metadataPath.dirname() / "%RAW%";
488 return _metadataPath;
489 }
490
491 Pathname systemPackagesPath() const
492 {
493 if ( _packagesPath.empty() && usesAutoMetadataPaths() )
494 return _metadataPath.dirname() / "%PKG%";
495 return _packagesPath;
496 }
497
498 Pathname packagesPath() const
499 {
500 return _alternatePackagesPath ? *_alternatePackagesPath : systemPackagesPath();
501 }
502
503 Pathname predownloadPath() const
504 {
505 return packagesPath() / ".preload";
506 }
507
508 DefaultIntegral<unsigned,defaultPriority> priority;
509
510 private:
511 Pathname _metadataPath;
512 Pathname _packagesPath;
513 std::optional<Pathname> _alternatePackagesPath;
514
515 mutable RepoVariablesReplacedUrlList _baseUrls;
516
517 mutable RepoVariablesReplacedUrlList _mirrorUrls;
518 mutable std::chrono::steady_clock::time_point _lastMirrorUrlsUpdate = std::chrono::steady_clock::time_point::min();
519 mutable std::vector<MirroredOrigin> _repoOrigins;
520
521 mutable std::pair<FalseBool, std::set<std::string> > _keywords;
522
523 RepoVariablesReplacedUrlList _gpgKeyUrls;
524
525 friend Impl * rwcowClone<Impl>( const Impl * rhs );
527 Impl * clone() const
528 { return new Impl( *this ); }
529 };
530
531
533 inline std::ostream & operator<<( std::ostream & str, const RepoInfo::Impl & obj )
534 {
535 return str << "RepoInfo::Impl";
536 }
537
539 //
540 // CLASS NAME : RepoInfo
541 //
543
544 const RepoInfo RepoInfo::noRepo;
545
546 RepoInfo::RepoInfo()
547 : _pimpl( new Impl() )
548 {}
549
550 RepoInfo::~RepoInfo()
551 {}
552
553 unsigned RepoInfo::priority() const
554 { return _pimpl->priority; }
555
556 unsigned RepoInfo::defaultPriority()
557 { return Impl::defaultPriority; }
558
559 unsigned RepoInfo::noPriority()
560 { return Impl::noPriority; }
561
562 void RepoInfo::setPriority( unsigned newval_r )
563 { _pimpl->priority = newval_r ? newval_r : Impl::defaultPriority; }
564
565
566 bool RepoInfo::gpgCheck() const
567 { return _pimpl->cfgGpgCheck(); }
568
569 void RepoInfo::setGpgCheck( TriBool value_r )
570 { _pimpl->rawGpgCheck( value_r ); }
571
572 void RepoInfo::setGpgCheck( bool value_r ) // deprecated legacy and for squid
573 { setGpgCheck( TriBool(value_r) ); }
574
575
576 bool RepoInfo::repoGpgCheck() const
577 { return gpgCheck() || bool(_pimpl->cfgRepoGpgCheck()); }
578
579 bool RepoInfo::repoGpgCheckIsMandatory() const
580 {
581 bool ret = ( gpgCheck() && indeterminate(_pimpl->cfgRepoGpgCheck()) ) || bool(_pimpl->cfgRepoGpgCheck());
582 if ( ret && _pimpl->internalUnsignedConfirmed() ) // relax if unsigned repo was confirmed in the past
583 ret = false;
584 return ret;
585 }
586
587 void RepoInfo::setRepoGpgCheck( TriBool value_r )
588 { _pimpl->rawRepoGpgCheck( value_r ); }
589
590
591 bool RepoInfo::pkgGpgCheck() const
592 { return bool(_pimpl->cfgPkgGpgCheck()) || ( gpgCheck() && !bool(validRepoSignature())/*enforced*/ ) ; }
593
594 bool RepoInfo::pkgGpgCheckIsMandatory() const
595 { return bool(_pimpl->cfgPkgGpgCheck()) || ( gpgCheck() && indeterminate(_pimpl->cfgPkgGpgCheck()) && !bool(validRepoSignature())/*enforced*/ ); }
596
597 void RepoInfo::setPkgGpgCheck( TriBool value_r )
598 { _pimpl->rawPkgGpgCheck( value_r ); }
599
600
601 void RepoInfo::getRawGpgChecks( TriBool & g_r, TriBool & r_r, TriBool & p_r ) const
602 {
603 g_r = _pimpl->rawGpgCheck();
604 r_r = _pimpl->rawRepoGpgCheck();
605 p_r = _pimpl->rawPkgGpgCheck();
606 }
607
608
609 TriBool RepoInfo::validRepoSignature() const
610 {
611 TriBool ret( _pimpl->internalValidRepoSignature() );
612 if ( ret && !repoGpgCheck() ) ret = false; // invalidate any old signature if repoGpgCheck is off
613 return ret;
614 }
615
616 void RepoInfo::setValidRepoSignature( TriBool value_r )
617 { _pimpl->internalSetValidRepoSignature( value_r ); }
618
620 namespace
621 {
622 inline bool changeGpgCheckTo( TriBool & lhs, TriBool rhs )
623 { if ( ! sameTriboolState( lhs, rhs ) ) { lhs = rhs; return true; } return false; }
624
625 inline bool changeGpgCheckTo( TriBool ogpg[3], TriBool g, TriBool r, TriBool p )
626 {
627 bool changed = false;
628 if ( changeGpgCheckTo( ogpg[0], g ) ) changed = true;
629 if ( changeGpgCheckTo( ogpg[1], r ) ) changed = true;
630 if ( changeGpgCheckTo( ogpg[2], p ) ) changed = true;
631 return changed;
632 }
633 } // namespace
635 bool RepoInfo::setGpgCheck( GpgCheck mode_r )
636 {
637 TriBool ogpg[3]; // Gpg RepoGpg PkgGpg
638 getRawGpgChecks( ogpg[0], ogpg[1], ogpg[2] );
639
640 bool changed = false;
641 switch ( mode_r )
642 {
643 case GpgCheck::On:
644 changed = changeGpgCheckTo( ogpg, true, indeterminate, indeterminate );
645 break;
646 case GpgCheck::Strict:
647 changed = changeGpgCheckTo( ogpg, true, true, true );
648 break;
649 case GpgCheck::AllowUnsigned:
650 changed = changeGpgCheckTo( ogpg, true, false, false );
651 break;
652 case GpgCheck::AllowUnsignedRepo:
653 changed = changeGpgCheckTo( ogpg, true, false, indeterminate );
654 break;
655 case GpgCheck::AllowUnsignedPackage:
656 changed = changeGpgCheckTo( ogpg, true, indeterminate, false );
657 break;
658 case GpgCheck::Default:
659 changed = changeGpgCheckTo( ogpg, indeterminate, indeterminate, indeterminate );
660 break;
661 case GpgCheck::Off:
662 changed = changeGpgCheckTo( ogpg, false, indeterminate, indeterminate );
663 break;
664 case GpgCheck::indeterminate: // no change
665 break;
666 }
667
668 if ( changed )
669 {
670 setGpgCheck ( ogpg[0] );
671 setRepoGpgCheck( ogpg[1] );
672 setPkgGpgCheck ( ogpg[2] );
673 }
674 return changed;
675 }
676
677 void RepoInfo::setMirrorlistUrl( const Url & url_r ) // Raw
678 { _pimpl->setMirrorlistUrl( url_r ); }
679
680 void RepoInfo::setMetalinkUrl( const Url & url_r ) // Raw
681 { _pimpl->setMetalinkUrl( url_r ); }
682
683 Url RepoInfo::rawCfgMirrorlistUrl() const
684 { return _pimpl->cfgMirrorlistUrl().raw(); }
685
686 Url RepoInfo::rawCfgMetalinkUrl() const
687 { return _pimpl->cfgMetalinkUrl().raw(); }
688
689#if LEGACY(1735)
690 void RepoInfo::setMirrorListUrl( const Url & url_r ) // Raw
691 { setMirrorlistUrl( url_r ); }
692 void RepoInfo::setMirrorListUrls( url_set urls ) // Raw
693 { _pimpl->setMirrorlistUrl( urls.empty() ? Url() : urls.front() ); }
694 void RepoInfo::setMetalinkUrls( url_set urls ) // Raw
695 { _pimpl->setMetalinkUrl( urls.empty() ? Url() : urls.front() ); }
696#endif
697
698 void RepoInfo::setGpgKeyUrls( url_set urls )
699 { _pimpl->gpgKeyUrls().raw().swap( urls ); }
700
701 void RepoInfo::setGpgKeyUrl( const Url & url_r )
702 {
703 _pimpl->gpgKeyUrls().raw().clear();
704 _pimpl->gpgKeyUrls().raw().push_back( url_r );
705 }
706
707 std::string RepoInfo::repoStatusString() const
708 { return _pimpl->repoStatusString(); }
709
710 void RepoInfo::addBaseUrl( Url url_r )
711 {
712 for ( const auto & url : _pimpl->baseUrls().raw() ) // Raw unique!
713 if ( url == url_r )
714 return;
715
716 _pimpl->baseUrls().raw().push_back( url_r );
717 _pimpl->resetMirrorUrls ();
718 }
719
720 void RepoInfo::setBaseUrl( Url url_r )
721 {
722 _pimpl->baseUrls().raw().clear();
723 _pimpl->resetMirrorUrls ();
724 _pimpl->baseUrls().raw().push_back( std::move(url_r) );
725 }
726
727 void RepoInfo::setBaseUrls( url_set urls )
728 {
729 _pimpl->resetMirrorUrls ();
730 _pimpl->baseUrls().raw().swap( urls );
731 }
732
733 MirroredOriginSet RepoInfo::repoOrigins() const
734 {
735 return _pimpl->repoOrigins();
736 }
737
738 bool RepoInfo::repoOriginsEmpty() const
739 {
740 return ( _pimpl->baseUrls().empty () && _pimpl->mirrorUrls().empty() );
741 }
742
743 void RepoInfo::setPath( const Pathname &path )
744 { _pimpl->path = path; }
745
746 void RepoInfo::setType( const repo::RepoType &t )
747 { _pimpl->setType( t ); }
748
749 void RepoInfo::setProbedType( const repo::RepoType &t ) const
750 { _pimpl->setProbedType( t ); }
751
752
753 void RepoInfo::setMetadataPath( const Pathname &path )
754 { _pimpl->metadataPath( path ); }
755
756 void RepoInfo::setPackagesPath( const Pathname &path )
757 { _pimpl->packagesPath( path ); }
758
759 Pathname RepoInfo::predownloadPath() const
760 { return _pimpl->predownloadPath(); }
761
762 void RepoInfo::setKeepPackages( bool keep )
763 { _pimpl->keeppackages = keep; }
764
765 void RepoInfo::setService( const std::string& name )
766 { _pimpl->service = name; }
767
768 void RepoInfo::setTargetDistribution( const std::string & targetDistribution )
769 { _pimpl->targetDistro = targetDistribution; }
770
771 bool RepoInfo::keepPackages() const
772 { return indeterminate(_pimpl->keeppackages) ? false : (bool)_pimpl->keeppackages; }
773
774 bool RepoInfo::effectiveKeepPackages() const
775 { return keepPackages() || PathInfo(packagesPath().dirname()/".keep_packages").isExist(); }
776
777 Pathname RepoInfo::metadataPath() const
778 { return _pimpl->metadataPath(); }
779
780 Pathname RepoInfo::systemPackagesPath() const
781 { return _pimpl->systemPackagesPath(); }
782
783 Pathname RepoInfo::packagesPath() const
784 { return _pimpl->packagesPath(); }
785
786 bool RepoInfo::usesAutoMetadataPaths() const
787 { return _pimpl->usesAutoMetadataPaths(); }
788
789 repo::RepoType RepoInfo::type() const
790 { return _pimpl->type(); }
791
792 Url RepoInfo::mirrorListUrl() const // Variables replaced!
793 { return _pimpl->mirrorListUrl().transformed(); }
794
795 Url RepoInfo::rawMirrorListUrl() const // Raw
796 { return _pimpl->mirrorListUrl().raw(); }
797
798 bool RepoInfo::gpgKeyUrlsEmpty() const
799 { return _pimpl->gpgKeyUrls().empty(); }
800
801 RepoInfo::urls_size_type RepoInfo::gpgKeyUrlsSize() const
802 { return _pimpl->gpgKeyUrls().size(); }
803
804 RepoInfo::url_set RepoInfo::gpgKeyUrls() const // Variables replaced!
805 { return _pimpl->gpgKeyUrls().transformed(); }
806
807 RepoInfo::url_set RepoInfo::rawGpgKeyUrls() const // Raw
808 { return _pimpl->gpgKeyUrls().raw(); }
809
810 Url RepoInfo::gpgKeyUrl() const // Variables replaced!
811 { return( _pimpl->gpgKeyUrls().empty() ? Url() : *_pimpl->gpgKeyUrls().transformedBegin() ); }
812
813 Url RepoInfo::rawGpgKeyUrl() const // Raw
814 { return( _pimpl->gpgKeyUrls().empty() ? Url() : *_pimpl->gpgKeyUrls().rawBegin() ) ; }
815
816 RepoInfo::url_set RepoInfo::baseUrls() const // Variables replaced!
817 { return _pimpl->baseUrls().transformed(); }
818
819 RepoInfo::url_set RepoInfo::rawBaseUrls() const // Raw
820 { return _pimpl->baseUrls().raw(); }
821
822 Pathname RepoInfo::path() const
823 { return _pimpl->path; }
824
825 std::string RepoInfo::service() const
826 { return _pimpl->service; }
827
828 std::string RepoInfo::targetDistribution() const
829 { return _pimpl->targetDistro; }
830
831 Url RepoInfo::rawUrl() const
832 { return _pimpl->baseUrl().raw(); }
833
834 Url RepoInfo::location() const
835 { return _pimpl->location (); }
836
837 RepoInfo::urls_const_iterator RepoInfo::baseUrlsBegin() const
838 { return _pimpl->baseUrls().transformedBegin(); }
839
840 RepoInfo::urls_const_iterator RepoInfo::baseUrlsEnd() const
841 { return _pimpl->baseUrls().transformedEnd(); }
842
843 RepoInfo::urls_size_type RepoInfo::baseUrlsSize() const
844 { return _pimpl->baseUrls().size(); }
845
846 bool RepoInfo::baseUrlsEmpty() const
847 { return _pimpl->baseUrls().empty(); }
848
849 bool RepoInfo::baseUrlSet() const
850 { return _pimpl->baseurl2dump(); }
851
852 Url RepoInfo::url() const
853 {
854 return _pimpl->baseUrl().transformed();
855 }
856
857 const std::set<std::string> & RepoInfo::contentKeywords() const
858 { return _pimpl->contentKeywords(); }
859
860 void RepoInfo::addContent( const std::string & keyword_r )
861 { _pimpl->addContent( keyword_r ); }
862
863 bool RepoInfo::hasContent() const
864 { return _pimpl->hasContent(); }
865
866 bool RepoInfo::hasContent( const std::string & keyword_r ) const
867 { return _pimpl->hasContent( keyword_r ); }
868
870
871 bool RepoInfo::hasLicense() const
872 { return hasLicense( std::string() ); }
873
874 bool RepoInfo::hasLicense( const std::string & name_r ) const
875 { return !_pimpl->licenseTgz( name_r ).empty(); }
876
877
878 bool RepoInfo::needToAcceptLicense() const
879 { return needToAcceptLicense( std::string() ); }
880
881 bool RepoInfo::needToAcceptLicense( const std::string & name_r ) const
882 {
883 const Pathname & licenseTgz( _pimpl->licenseTgz( name_r ) );
884 if ( licenseTgz.empty() )
885 return false; // no licenses at all
886
887 ExternalProgram::Arguments cmd;
888 cmd.push_back( "tar" );
889 cmd.push_back( "-t" );
890 cmd.push_back( "-z" );
891 cmd.push_back( "-f" );
892 cmd.push_back( licenseTgz.asString() );
893 ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
894
895 bool accept = true;
896 static const std::string noAcceptanceFile = "no-acceptance-needed\n";
897 for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
898 {
899 if ( output == noAcceptanceFile )
900 {
901 accept = false;
902 }
903 }
904 prog.close();
905 MIL << "License(" << name_r << ") in " << name() << " has to be accepted: " << (accept?"true":"false" ) << endl;
906 return accept;
907 }
908
909
910 std::string RepoInfo::getLicense( const Locale & lang_r )
911 { return const_cast<const RepoInfo *>(this)->getLicense( std::string(), lang_r ); }
912
913 std::string RepoInfo::getLicense( const Locale & lang_r ) const
914 { return getLicense( std::string(), lang_r ); }
915
916 std::string RepoInfo::getLicense( const std::string & name_r, const Locale & lang_r ) const
917 {
918 LocaleSet avlocales( getLicenseLocales( name_r ) );
919 if ( avlocales.empty() )
920 return std::string();
921
922 Locale getLang( Locale::bestMatch( avlocales, lang_r ) );
923 if ( !getLang && avlocales.find( Locale::noCode ) == avlocales.end() )
924 {
925 WAR << "License(" << name_r << ") in " << name() << " contains no fallback text!" << endl;
926 // Using the fist locale instead of returning no text at all.
927 // So the user might recognize that there is a license, even if they
928 // can't read it.
929 getLang = *avlocales.begin();
930 }
931
932 // now extract the license file.
933 static const std::string licenseFileFallback( "license.txt" );
934 std::string licenseFile( !getLang ? licenseFileFallback
935 : str::form( "license.%s.txt", getLang.c_str() ) );
936
937 ExternalProgram::Arguments cmd;
938 cmd.push_back( "tar" );
939 cmd.push_back( "-x" );
940 cmd.push_back( "-z" );
941 cmd.push_back( "-O" );
942 cmd.push_back( "-f" );
943 cmd.push_back( _pimpl->licenseTgz( name_r ).asString() ); // if it not exists, avlocales was empty.
944 cmd.push_back( licenseFile );
945
946 std::string ret;
947 ExternalProgram prog( cmd, ExternalProgram::Discard_Stderr );
948 for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
949 {
950 ret += output;
951 }
952 prog.close();
953 return ret;
954 }
955
956
957 LocaleSet RepoInfo::getLicenseLocales() const
958 { return getLicenseLocales( std::string() ); }
959
960 LocaleSet RepoInfo::getLicenseLocales( const std::string & name_r ) const
961 {
962 const Pathname & licenseTgz( _pimpl->licenseTgz( name_r ) );
963 if ( licenseTgz.empty() )
964 return LocaleSet();
965
966 ExternalProgram::Arguments cmd;
967 cmd.push_back( "tar" );
968 cmd.push_back( "-t" );
969 cmd.push_back( "-z" );
970 cmd.push_back( "-f" );
971 cmd.push_back( licenseTgz.asString() );
972
973 LocaleSet ret;
974 ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
975 for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() )
976 {
977 static const C_Str license( "license." );
978 static const C_Str dotTxt( ".txt\n" );
979 if ( str::hasPrefix( output, license ) && str::hasSuffix( output, dotTxt ) )
980 {
981 if ( output.size() <= license.size() + dotTxt.size() ) // license.txt
982 ret.insert( Locale() );
983 else
984 ret.insert( Locale( std::string( output.c_str()+license.size(), output.size()- license.size() - dotTxt.size() ) ) );
985 }
986 }
987 prog.close();
988 return ret;
989 }
990
992
993 std::ostream & RepoInfo::dumpOn( std::ostream & str ) const
994 {
995 RepoInfoBase::dumpOn(str);
996 if ( _pimpl->baseurl2dump() )
997 {
998 for ( const auto & url : _pimpl->baseUrls().raw() )
999 {
1000 str << "- url : " << url << std::endl;
1001 }
1002 }
1003
1004 // print if non empty value
1005 auto strif( [&] ( const std::string & tag_r, const std::string & value_r ) {
1006 if ( ! value_r.empty() )
1007 str << tag_r << value_r << std::endl;
1008 });
1009
1010 strif( "- mirrorlist : ", _pimpl->cfgMirrorlistUrl().raw().asString() );
1011 strif( "- metalink : ", _pimpl->cfgMetalinkUrl().raw().asString() );
1012 strif( "- path : ", path().asString() );
1013 str << "- type : " << type() << std::endl;
1014 str << "- priority : " << priority() << std::endl;
1015
1016 // Yes No Default(Y) Default(N)
1017#define OUTS(T,B) ( indeterminate(T) ? (std::string("D(")+(B?"Y":"N")+")") : ((bool)T?"Y":"N") )
1018 str << "- gpgcheck : " << OUTS(_pimpl->rawGpgCheck(),gpgCheck())
1019 << " repo" << OUTS(_pimpl->rawRepoGpgCheck(),repoGpgCheck()) << (repoGpgCheckIsMandatory() ? "* ": " " )
1020 << "sig" << asString( validRepoSignature(), "?", "Y", "N" )
1021 << " pkg" << OUTS(_pimpl->rawPkgGpgCheck(),pkgGpgCheck()) << (pkgGpgCheckIsMandatory() ? "* ": " " )
1022 << std::endl;
1023#undef OUTS
1024
1025 for ( const auto & url : _pimpl->gpgKeyUrls().raw() )
1026 {
1027 str << "- gpgkey : " << url << std::endl;
1028 }
1029
1030 if ( ! indeterminate(_pimpl->keeppackages) )
1031 str << "- keeppackages: " << keepPackages() << std::endl;
1032
1033 strif( "- service : ", service() );
1034 strif( "- targetdistro: ", targetDistribution() );
1035 strif( "- filePath: ", filepath().asString() );
1036 strif( "- metadataPath: ", metadataPath().asString() );
1037 strif( "- packagesPath: ", packagesPath().asString() );
1038
1039 return str;
1040 }
1041
1042 std::ostream & RepoInfo::dumpAsIniOn( std::ostream & str ) const
1043 {
1044 // libzypp/#638: Add a note to service maintained repo entries
1045 if( ! service().empty() ) {
1046 str << "# Repository '"<<alias()<<"' is maintained by the '"<<service()<<"' service." << endl;
1047 str << "# Manual changes may be overwritten by a service refresh." << endl;
1048 str << "# See also 'man zypper', section 'Services'." << endl;
1049 }
1050 RepoInfoBase::dumpAsIniOn(str);
1051
1052 if ( _pimpl->baseurl2dump() )
1053 {
1054 str << "baseurl=";
1055 std::string indent;
1056 for ( const auto & url : _pimpl->baseUrls().raw() )
1057 {
1058 str << indent << hotfix1050625::asString( url ) << endl;
1059 if ( indent.empty() ) indent = " "; // "baseurl="
1060 }
1061 }
1062
1063 if ( ! _pimpl->path.empty() )
1064 str << "path="<< path() << endl;
1065
1066 if ( ! _pimpl->cfgMirrorlistUrl().raw().asString().empty() )
1067 str << "mirrorlist=" << hotfix1050625::asString( _pimpl->cfgMirrorlistUrl().raw() ) << endl;
1068
1069 if ( ! _pimpl->cfgMetalinkUrl().raw().asString().empty() )
1070 str << "metalink=" << hotfix1050625::asString( _pimpl->cfgMetalinkUrl().raw() ) << endl;
1071
1072 if ( type() != repo::RepoType::NONE )
1073 str << "type=" << type().asString() << endl;
1074
1075 if ( priority() != defaultPriority() )
1076 str << "priority=" << priority() << endl;
1077
1078 if ( ! indeterminate(_pimpl->rawGpgCheck()) )
1079 str << "gpgcheck=" << (_pimpl->rawGpgCheck() ? "1" : "0") << endl;
1080
1081 if ( ! indeterminate(_pimpl->rawRepoGpgCheck()) )
1082 str << "repo_gpgcheck=" << (_pimpl->rawRepoGpgCheck() ? "1" : "0") << endl;
1083
1084 if ( ! indeterminate(_pimpl->rawPkgGpgCheck()) )
1085 str << "pkg_gpgcheck=" << (_pimpl->rawPkgGpgCheck() ? "1" : "0") << endl;
1086
1087 {
1088 std::string indent( "gpgkey=");
1089 for ( const auto & url : _pimpl->gpgKeyUrls().raw() )
1090 {
1091 str << indent << url << endl;
1092 if ( indent[0] != ' ' )
1093 indent = " ";
1094 }
1095 }
1096
1097 if (!indeterminate(_pimpl->keeppackages))
1098 str << "keeppackages=" << keepPackages() << endl;
1099
1100 if( ! service().empty() )
1101 str << "service=" << service() << endl;
1102
1103 return str;
1104 }
1105
1106 std::ostream & RepoInfo::dumpAsXmlOn( std::ostream & str, const std::string & content ) const
1107 {
1108 std::string tmpstr;
1109 str
1110 << "<repo"
1111 << " alias=\"" << escape(alias()) << "\""
1112 << " name=\"" << escape(name()) << "\"";
1113 if (type() != repo::RepoType::NONE)
1114 str << " type=\"" << type().asString() << "\"";
1115 str
1116 << " priority=\"" << priority() << "\""
1117 << " enabled=\"" << enabled() << "\""
1118 << " autorefresh=\"" << autorefresh() << "\""
1119 << " gpgcheck=\"" << gpgCheck() << "\""
1120 << " repo_gpgcheck=\"" << repoGpgCheck() << "\""
1121 << " pkg_gpgcheck=\"" << pkgGpgCheck() << "\"";
1122 if ( ! indeterminate(_pimpl->rawGpgCheck()) )
1123 str << " raw_gpgcheck=\"" << (_pimpl->rawGpgCheck() ? "1" : "0") << "\"";
1124 if ( ! indeterminate(_pimpl->rawRepoGpgCheck()) )
1125 str << " raw_repo_gpgcheck=\"" << (_pimpl->rawRepoGpgCheck() ? "1" : "0") << "\"";
1126 if ( ! indeterminate(_pimpl->rawPkgGpgCheck()) )
1127 str << " raw_pkg_gpgcheck=\"" << (_pimpl->rawPkgGpgCheck() ? "1" : "0") << "\"";
1128 if (!(tmpstr = gpgKeyUrl().asString()).empty())
1129 str << " gpgkey=\"" << escape(tmpstr) << "\"";
1130 if ( ! (tmpstr = _pimpl->cfgMirrorlistUrl().transformed().asString()).empty() )
1131 str << " mirrorlist=\"" << escape(tmpstr) << "\"";
1132 if ( ! (tmpstr = _pimpl->cfgMetalinkUrl().transformed().asString()).empty() )
1133 str << " metalink=\"" << escape(tmpstr) << "\"";
1134 str << ">" << endl;
1135
1136 if ( _pimpl->baseurl2dump() )
1137 {
1138 for_( it, baseUrlsBegin(), baseUrlsEnd() ) // !transform iterator replaces variables
1139 str << "<url>" << escape((*it).asString()) << "</url>" << endl;
1140 }
1141
1142 str << "</repo>" << endl;
1143 return str;
1144 }
1145
1146
1147 std::ostream & operator<<( std::ostream & str, const RepoInfo & obj )
1148 {
1149 return obj.dumpOn(str);
1150 }
1151
1152 std::ostream & operator<<( std::ostream & str, const RepoInfo::GpgCheck & obj )
1153 {
1154 switch ( obj )
1155 {
1156#define OUTS( V ) case RepoInfo::V: return str << #V; break
1157 OUTS( GpgCheck::On );
1158 OUTS( GpgCheck::Strict );
1159 OUTS( GpgCheck::AllowUnsigned );
1160 OUTS( GpgCheck::AllowUnsignedRepo );
1161 OUTS( GpgCheck::AllowUnsignedPackage );
1162 OUTS( GpgCheck::Default );
1163 OUTS( GpgCheck::Off );
1164 OUTS( GpgCheck::indeterminate );
1165#undef OUTS
1166 }
1167 return str << "GpgCheck::UNKNOWN";
1168 }
1169
1170 bool RepoInfo::requireStatusWithMediaFile () const
1171 {
1172 // We skip the check for downloading media unless a local copy of the
1173 // media file exists and states that there is more than one medium.
1174 const auto &origins = _pimpl->repoOrigins ();
1175 bool canSkipMediaCheck = std::all_of( origins.begin(), origins.end(), []( const MirroredOrigin &origin ) { return origin.authority().url().schemeIsDownloading(); });
1176 if ( canSkipMediaCheck ) {
1177 const auto &mDataPath = metadataPath();
1178 if ( not mDataPath.empty() ) {
1179 PathInfo mediafile { mDataPath/"media.1/media" };
1180 if ( mediafile.isExist() ) {
1181 repo::SUSEMediaVerifier lverifier { mediafile.path() };
1182 if ( lverifier && lverifier.totalMedia() > 1 ) {
1183 canSkipMediaCheck = false;
1184 }
1185 }
1186 }
1187 }
1188 if ( canSkipMediaCheck )
1189 DBG << "Can SKIP media.1/media check for status calc of repo " << alias() << endl;
1190 return not canSkipMediaCheck;
1191 }
1192
1194} // namespace zypp
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:99
MIL
#define MIL
Definition Logger.h:100
WAR
#define WAR
Definition Logger.h:101
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
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
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::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:597
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:1106
zypp::RepoInfo::setGpgKeyUrls
void setGpgKeyUrls(url_set urls)
Set a list of gpgkey URLs defined for this repo.
Definition RepoInfo.cc:698
zypp::RepoInfo::setMetalinkUrl
void setMetalinkUrl(const Url &url)
Set the raw metalink url.
Definition RepoInfo.cc:680
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:993
zypp::RepoInfo::metadataPath
Pathname metadataPath() const
Path where this repo metadata was read from.
Definition RepoInfo.cc:777
zypp::RepoInfo::setMirrorlistUrl
void setMirrorlistUrl(const Url &url)
Set the raw mirrorlist url.
Definition RepoInfo.cc:677
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:701
zypp::RepoInfo::usesAutoMetadataPaths
bool usesAutoMetadataPaths() const
Whether metadataPath uses AUTO% setup.
Definition RepoInfo.cc:786
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:846
zypp::RepoInfo::predownloadPath
Pathname predownloadPath() const
Path where this repo packages are predownloaded.
Definition RepoInfo.cc:759
zypp::RepoInfo::hasContent
bool hasContent() const
Check for content keywords.
Definition RepoInfo.cc:863
zypp::RepoInfo::repoOrigins
MirroredOriginSet repoOrigins() const
The repodata origins.
Definition RepoInfo.cc:733
zypp::RepoInfo::setKeepPackages
void setKeepPackages(bool keep)
Set if packaqes downloaded from this repository will be kept in local cache.
Definition RepoInfo.cc:762
zypp::RepoInfo::gpgKeyUrls
url_set gpgKeyUrls() const
The list of gpgkey URLs defined for this repo.
Definition RepoInfo.cc:804
zypp::RepoInfo::rawGpgKeyUrl
Url rawGpgKeyUrl() const
(leagcy API) The 1st raw gpgkey URL defined for this repo (no variables replaced)
Definition RepoInfo.cc:813
zypp::RepoInfo::~RepoInfo
~RepoInfo() override
Definition RepoInfo.cc:550
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:831
zypp::RepoInfo::type
repo::RepoType type() const
Type of repository,.
Definition RepoInfo.cc:789
zypp::RepoInfo::rawGpgKeyUrls
url_set rawGpgKeyUrls() const
The list of raw gpgkey URLs defined for this repo (no variables replaced).
Definition RepoInfo.cc:807
zypp::RepoInfo::noPriority
static unsigned noPriority()
The least priority (unsigned(-1)).
Definition RepoInfo.cc:559
zypp::RepoInfo::baseUrlsSize
urls_size_type baseUrlsSize() const
number of repository urls
Definition RepoInfo.cc:843
zypp::RepoInfo::keepPackages
bool keepPackages() const
Whether packages downloaded from this repository will be kept in local cache.
Definition RepoInfo.cc:771
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:852
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:720
zypp::RepoInfo::contentKeywords
const std::set< std::string > & contentKeywords() const
Content keywords defined.
Definition RepoInfo.cc:857
zypp::RepoInfo::baseUrlsEnd
urls_const_iterator baseUrlsEnd() const
iterator that points at end of repository urls
Definition RepoInfo.cc:840
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:834
zypp::RepoInfo::setPackagesPath
void setPackagesPath(const Pathname &path)
set the path where the local packages are stored
Definition RepoInfo.cc:756
zypp::RepoInfo::rawCfgMetalinkUrl
Url rawCfgMetalinkUrl() const
The configured raw metalink url.
Definition RepoInfo.cc:686
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:913
zypp::RepoInfo::baseUrlSet
bool baseUrlSet() const
Whether there are manualy configured repository urls.
Definition RepoInfo.cc:849
zypp::RepoInfo::setService
void setService(const std::string &name)
sets service which added this repository
Definition RepoInfo.cc:765
zypp::RepoInfo::setGpgCheck
void setGpgCheck(TriBool value_r)
Set the value for gpgCheck (or indeterminate to use the default).
Definition RepoInfo.cc:569
zypp::RepoInfo::effectiveKeepPackages
bool effectiveKeepPackages() const
keepPackages unless the package cache itself enforces keeping the packages.
Definition RepoInfo.cc:774
zypp::RepoInfo::path
Pathname path() const
Repository path.
Definition RepoInfo.cc:822
zypp::RepoInfo::gpgKeyUrlsSize
urls_size_type gpgKeyUrlsSize() const
Number of gpgkey URLs defined.
Definition RepoInfo.cc:801
zypp::RepoInfo::getLicenseLocales
LocaleSet getLicenseLocales() const
Return the locales the license is available for.
Definition RepoInfo.cc:957
zypp::RepoInfo::baseUrls
url_set baseUrls() const
The complete set of repository urls as configured.
Definition RepoInfo.cc:816
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:1170
zypp::RepoInfo::addBaseUrl
void addBaseUrl(Url url)
Add a base url.
Definition RepoInfo.cc:710
zypp::RepoInfo::pkgGpgCheckIsMandatory
bool pkgGpgCheckIsMandatory() const
Mandatory check (pkgGpgCheck is not off) must ask to confirm using unsigned packages.
Definition RepoInfo.cc:594
zypp::RepoInfo::rawBaseUrls
url_set rawBaseUrls() const
The complete set of raw repository urls (no variables replaced).
Definition RepoInfo.cc:819
zypp::RepoInfo::mirrorListUrl
Url mirrorListUrl() const
Url of a file which contains a list of repository urls.
Definition RepoInfo.cc:792
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:749
zypp::RepoInfo::setBaseUrls
void setBaseUrls(url_set urls)
Clears current base URL list and adds an url_set.
Definition RepoInfo.cc:727
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:825
zypp::RepoInfo::setTargetDistribution
void setTargetDistribution(const std::string &targetDistribution)
Sets the distribution for which is this repository meant.
Definition RepoInfo.cc:768
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:1042
zypp::RepoInfo::priority
unsigned priority() const
Repository priority for solver.
Definition RepoInfo.cc:553
zypp::RepoInfo::gpgCheck
bool gpgCheck() const
Whether default signature checking should be performed.
Definition RepoInfo.cc:566
zypp::RepoInfo::setPath
void setPath(const Pathname &path)
set the product path.
Definition RepoInfo.cc:743
zypp::RepoInfo::gpgKeyUrl
Url gpgKeyUrl() const
(leagcy API) The 1st gpgkey URL defined for this repo
Definition RepoInfo.cc:810
zypp::RepoInfo::setValidRepoSignature
void setValidRepoSignature(TriBool value_r)
Set the value for validRepoSignature (or indeterminate if unsigned).
Definition RepoInfo.cc:616
zypp::RepoInfo::RepoInfo
RepoInfo()
Definition RepoInfo.cc:546
zypp::RepoInfo::defaultPriority
static unsigned defaultPriority()
The default priority (99).
Definition RepoInfo.cc:556
zypp::RepoInfo::needToAcceptLicense
bool needToAcceptLicense() const
Whether the repo license has to be accepted, e.g.
Definition RepoInfo.cc:878
zypp::RepoInfo::setPriority
void setPriority(unsigned newval_r)
Set repository priority for solver.
Definition RepoInfo.cc:562
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:837
zypp::RepoInfo::hasLicense
bool hasLicense() const
Whether there is a license associated with the repo.
Definition RepoInfo.cc:871
zypp::RepoInfo::repoGpgCheckIsMandatory
bool repoGpgCheckIsMandatory() const
Mandatory check (repoGpgCheck is on) must ask to confirm using unsigned repos.
Definition RepoInfo.cc:579
zypp::RepoInfo::setMetadataPath
void setMetadataPath(const Pathname &path)
Set the path where the local metadata is stored.
Definition RepoInfo.cc:753
zypp::RepoInfo::validRepoSignature
TriBool validRepoSignature() const
Whether the repo metadata are signed and successfully validated or indeterminate if unsigned.
Definition RepoInfo.cc:609
zypp::RepoInfo::setRepoGpgCheck
void setRepoGpgCheck(TriBool value_r)
Set the value for repoGpgCheck (or indeterminate to use the default).
Definition RepoInfo.cc:587
zypp::RepoInfo::packagesPath
Pathname packagesPath() const
packagesPath Checks if the effective user is allowed to write into the system package cache.
Definition RepoInfo.cc:783
zypp::RepoInfo::addContent
void addContent(const std::string &keyword_r)
Add content keywords.
Definition RepoInfo.cc:860
zypp::RepoInfo::repoGpgCheck
bool repoGpgCheck() const
Whether the signature of repo metadata should be checked for this repo.
Definition RepoInfo.cc:576
zypp::RepoInfo::targetDistribution
std::string targetDistribution() const
Distribution for which is this repository meant.
Definition RepoInfo.cc:828
zypp::RepoInfo::getRawGpgChecks
void getRawGpgChecks(TriBool &g_r, TriBool &r_r, TriBool &p_r) const
Raw values for RepoManager.
Definition RepoInfo.cc:601
zypp::RepoInfo::setType
void setType(const repo::RepoType &t)
set the repository type
Definition RepoInfo.cc:746
zypp::RepoInfo::pkgGpgCheck
bool pkgGpgCheck() const
Whether the signature of rpm packages should be checked for this repo.
Definition RepoInfo.cc:591
zypp::RepoInfo::repoStatusString
std::string repoStatusString() const
A string value to track changes requiring a refresh.
Definition RepoInfo.cc:707
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:795
zypp::RepoInfo::gpgKeyUrlsEmpty
bool gpgKeyUrlsEmpty() const
Whether gpgkey URLs are defined.
Definition RepoInfo.cc:798
zypp::RepoInfo::systemPackagesPath
Pathname systemPackagesPath() const
Returns a path to the system-defined package cache.
Definition RepoInfo.cc:780
zypp::RepoInfo::rawCfgMirrorlistUrl
Url rawCfgMirrorlistUrl() const
The configured raw mirrorlist url.
Definition RepoInfo.cc:683
zypp::RepoInfo::repoOriginsEmpty
bool repoOriginsEmpty() const
whether repo origins are available
Definition RepoInfo.cc:738
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:1272
zypp::ZConfig::pkgGpgCheck
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck).
Definition ZConfig.cc:1274
zypp::ZConfig::instance
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:971
zypp::ZConfig::repoGpgCheck
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck).
Definition ZConfig.cc:1273
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
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::IamNotRoot
bool IamNotRoot()
Definition PathInfo.h:42
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition SerialNumber.cc:52
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:101
zypp::RepoInfo::Impl::_type
repo::RepoType _type
Definition RepoInfo.cc:438
zypp::RepoInfo::Impl::_packagesPath
Pathname _packagesPath
Definition RepoInfo.cc:512
zypp::RepoInfo::Impl::rawPkgGpgCheck
TriBool rawPkgGpgCheck() const
Definition RepoInfo.cc:423
zypp::RepoInfo::Impl::_rawRepoGpgCheck
TriBool _rawRepoGpgCheck
need to check repo sign.: Y/N/(ZConf(Y/N/gpgCheck))
Definition RepoInfo.cc:417
zypp::RepoInfo::Impl::internalValidRepoSignature
TriBool internalValidRepoSignature() const
Signature check result needs to be stored/retrieved from _metadataPath.
Definition RepoInfo.cc:342
zypp::RepoInfo::Impl::repoStatusString
std::string repoStatusString() const
Definition RepoInfo.cc:275
zypp::RepoInfo::Impl::triBoolFromPath
bool triBoolFromPath(const Pathname &path_r, TriBool &ret_r) const
Definition RepoInfo.cc:384
zypp::RepoInfo::Impl::internalUnsignedConfirmed
bool internalUnsignedConfirmed() const
We definitely have a symlink pointing to "indeterminate" (for repoGpgCheckIsMandatory)?
Definition RepoInfo.cc:378
zypp::RepoInfo::Impl::triBoolFromPath
TriBool triBoolFromPath(const Pathname &path_r) const
Definition RepoInfo.cc:410
zypp::RepoInfo::Impl::Impl
Impl(const Impl &)=default
zypp::RepoInfo::Impl::packagesPath
void packagesPath(Pathname new_r)
Definition RepoInfo.cc:470
zypp::RepoInfo::Impl::rawRepoGpgCheck
void rawRepoGpgCheck(TriBool val_r)
Definition RepoInfo.cc:426
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:427
zypp::RepoInfo::Impl::predownloadPath
Pathname predownloadPath() const
Definition RepoInfo.cc:503
zypp::RepoInfo::Impl::_metadataPath
Pathname _metadataPath
Definition RepoInfo.cc:511
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:527
zypp::RepoInfo::Impl::metadataPath
Pathname metadataPath() const
Definition RepoInfo.cc:484
zypp::RepoInfo::Impl::priority
DefaultIntegral< unsigned, defaultPriority > priority
Definition RepoInfo.cc:508
zypp::RepoInfo::Impl::_cfgMetalinkUrl
RepoVariablesReplacedUrl _cfgMetalinkUrl
Definition RepoInfo.cc:442
zypp::RepoInfo::Impl::cfgGpgCheck
bool cfgGpgCheck() const
Definition RepoInfo.cc:429
zypp::RepoInfo::Impl::setMetalinkUrl
void setMetalinkUrl(const Url &url_r)
Definition RepoInfo.cc:451
zypp::RepoInfo::Impl::cfgMirrorlistUrl
const RepoVariablesReplacedUrl & cfgMirrorlistUrl() const
Config file writing needs to tell them appart.
Definition RepoInfo.cc:455
zypp::RepoInfo::Impl::_alternatePackagesPath
std::optional< Pathname > _alternatePackagesPath
in case _packagesPath is not writable
Definition RepoInfo.cc:513
zypp::RepoInfo::Impl::setMirrorlistUrl
void setMirrorlistUrl(const Url &url_r)
Definition RepoInfo.cc:448
zypp::RepoInfo::Impl::operator<<
std::ostream & operator<<(std::ostream &str, const RepoInfo::Impl &obj)
Stream output.
Definition RepoInfo.cc:533
zypp::RepoInfo::Impl::_mirrorUrls
RepoVariablesReplacedUrlList _mirrorUrls
possible mirrors as fetched via mirrorlist or metalink
Definition RepoInfo.cc:517
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:518
zypp::RepoInfo::Impl::hasContent
bool hasContent(const std::string &keyword_r) const
Definition RepoInfo.cc:335
zypp::RepoInfo::Impl::contentKeywords
const std::set< std::string > & contentKeywords() const
Definition RepoInfo.cc:284
zypp::RepoInfo::Impl::cfgPkgGpgCheck
TriBool cfgPkgGpgCheck() const
Definition RepoInfo.cc:433
zypp::RepoInfo::Impl::location
Url location() const
Definition RepoInfo.cc:180
zypp::RepoInfo::Impl::baseurl2dump
bool baseurl2dump() const
Definition RepoInfo.cc:265
zypp::RepoInfo::Impl::cfgMetalinkUrl
const RepoVariablesReplacedUrl & cfgMetalinkUrl() const
Config file writing needs to tell them appart.
Definition RepoInfo.cc:458
zypp::RepoInfo::Impl::baseUrls
const RepoVariablesReplacedUrlList & baseUrls() const
Definition RepoInfo.cc:175
zypp::RepoInfo::Impl::hasContent
bool hasContent() const
Definition RepoInfo.cc:290
zypp::RepoInfo::Impl::_gpgKeyUrls
RepoVariablesReplacedUrlList _gpgKeyUrls
Definition RepoInfo.cc:523
zypp::RepoInfo::Impl::~Impl
~Impl()
Definition RepoInfo.cc:116
zypp::RepoInfo::Impl::_baseUrls
RepoVariablesReplacedUrlList _baseUrls
baseUrls as configured
Definition RepoInfo.cc:515
zypp::RepoInfo::Impl::operator=
Impl & operator=(Impl &&)=delete
zypp::RepoInfo::Impl::_repoOrigins
std::vector< MirroredOrigin > _repoOrigins
Definition RepoInfo.cc:519
zypp::RepoInfo::Impl::service
std::string service
Definition RepoInfo.cc:464
zypp::RepoInfo::Impl::rawGpgCheck
void rawGpgCheck(TriBool val_r)
Definition RepoInfo.cc:425
zypp::RepoInfo::Impl::addContent
void addContent(const std::string &keyword_r)
Definition RepoInfo.cc:287
zypp::RepoInfo::Impl::_rawGpgCheck
TriBool _rawGpgCheck
default gpgcheck behavior: Y/N/ZConf
Definition RepoInfo.cc:416
zypp::RepoInfo::Impl::packagesPath
Pathname packagesPath() const
Definition RepoInfo.cc:498
zypp::RepoInfo::Impl::mirrorListUrl
const RepoVariablesReplacedUrl & mirrorListUrl() const
THE mirrorListUrl to work with (either_cfgMirrorlistUrl or _cfgMetalinkUrl).
Definition RepoInfo.cc:445
zypp::RepoInfo::Impl::metadataPath
void metadataPath(Pathname new_r)
Definition RepoInfo.cc:467
zypp::RepoInfo::Impl::rawGpgCheck
TriBool rawGpgCheck() const
Definition RepoInfo.cc:421
zypp::RepoInfo::Impl::rawRepoGpgCheck
TriBool rawRepoGpgCheck() const
Definition RepoInfo.cc:422
zypp::RepoInfo::Impl::internalSetValidRepoSignature
void internalSetValidRepoSignature(TriBool value_r)
Definition RepoInfo.cc:356
zypp::RepoInfo::Impl::resetMirrorUrls
void resetMirrorUrls() const
Definition RepoInfo.cc:186
zypp::RepoInfo::Impl::targetDistro
std::string targetDistro
Definition RepoInfo.cc:465
zypp::RepoInfo::Impl::gpgKeyUrls
const RepoVariablesReplacedUrlList & gpgKeyUrls() const
Definition RepoInfo.cc:269
zypp::RepoInfo::Impl::cfgRepoGpgCheck
TriBool cfgRepoGpgCheck() const
Definition RepoInfo.cc:431
zypp::RepoInfo::Impl::path
Pathname path
Definition RepoInfo.cc:463
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:418
zypp::RepoInfo::Impl::keeppackages
TriBool keeppackages
Definition RepoInfo.cc:462
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:262
zypp::RepoInfo::Impl::_validRepoSignature
TriBool _validRepoSignature
have signed and valid repo metadata
Definition RepoInfo.cc:437
zypp::RepoInfo::Impl::type
repo::RepoType type() const
Definition RepoInfo.cc:131
zypp::RepoInfo::Impl::systemPackagesPath
Pathname systemPackagesPath() const
Definition RepoInfo.cc:491
zypp::RepoInfo::Impl::operator=
Impl & operator=(const Impl &)=delete
zypp::RepoInfo::Impl::_cfgMirrorlistUrl
RepoVariablesReplacedUrl _cfgMirrorlistUrl
Definition RepoInfo.cc:441
zypp::RepoInfo::Impl::_keywords
std::pair< FalseBool, std::set< std::string > > _keywords
Definition RepoInfo.cc:521
zypp::RepoInfo::Impl::gpgKeyUrls
RepoVariablesReplacedUrlList & gpgKeyUrls()
Definition RepoInfo.cc:272
zypp::RepoInfo::Impl::Impl
Impl()
Definition RepoInfo.cc:102
zypp::RepoInfo::Impl::usesAutoMetadataPaths
bool usesAutoMetadataPaths() const
Definition RepoInfo.cc:481
zypp::RepoInfo::Impl::noPriority
static const unsigned noPriority
Definition RepoInfo.cc:120
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
ManagedFile.h
TmpPath.h