libzypp: zypp/sat/Solvable.cc Source File

libzypp 17.38.11

Solvable.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <iostream>
13
14#include <zypp-core/base/Logger.h>
15#include <zypp-core/base/Gettext.h>
16#include <zypp-core/base/Exception.h>
17#include <zypp-core/base/Functional.h>
18#include <zypp/base/Collector.h>
19#include <zypp-core/base/Xml.h>
20
21#include <zypp/sat/detail/PoolImpl.h>
22#include <zypp/sat/Solvable.h>
23#include <zypp/sat/Pool.h>
24#include <zypp/sat/LookupAttr.h>
25
26#include <zypp/Repository.h>
27#include <utility>
28#include <zypp-core/OnMediaLocation>
29#include <zypp/ZConfig.h>
30
31#include <zypp/ui/Selectable.h>
32
33using std::endl;
34
36namespace zypp
37{
39 namespace sat
40 {
42 namespace
43 {
44 void _doSplit( IdString & _ident, ResKind & _kind, IdString & _name )
45 {
46 if ( ! _ident )
47 return;
48
49 ResKind explicitKind = ResKind::explicitBuiltin( _ident.c_str() );
50 // NOTE: kind package and srcpackage do not have namespaced ident!
51 if ( ! explicitKind )
52 {
53 _name = _ident;
54 // No kind defaults to package
55 if ( !_kind )
56 _kind = ResKind::package;
57 else if ( ! ( _kind == ResKind::package || _kind == ResKind::srcpackage ) )
58 _ident = IdString( str::form( "%s:%s", _kind.c_str(), _ident.c_str() ) );
59 }
60 else
61 {
62 // strip kind spec from name
63 _name = IdString( ::strchr( _ident.c_str(), ':' )+1 );
64 _kind = explicitKind;
65 if ( _kind == ResKind::package || _kind == ResKind::srcpackage )
66 _ident = _name;
67 }
68 return;
69 }
70 } // namespace
72
73 Solvable::SplitIdent::SplitIdent( IdString ident_r )
74 : _ident( ident_r )
75 { _doSplit( _ident, _kind, _name ); }
76
77 Solvable::SplitIdent::SplitIdent( const char * ident_r )
78 : _ident( ident_r )
79 { _doSplit( _ident, _kind, _name ); }
80
81 Solvable::SplitIdent::SplitIdent( const std::string & ident_r )
82 : _ident( ident_r )
83 { _doSplit( _ident, _kind, _name ); }
84
85 Solvable::SplitIdent::SplitIdent( ResKind kind_r, IdString name_r )
86 : _ident( name_r )
87 , _kind(std::move( kind_r ))
88 { _doSplit( _ident, _kind, _name ); }
89
90 Solvable::SplitIdent::SplitIdent( ResKind kind_r, const C_Str & name_r )
91 : _ident( name_r )
92 , _kind(std::move( kind_r ))
93 { _doSplit( _ident, _kind, _name ); }
94
96 // class Solvable
98
99 const Solvable Solvable::noSolvable;
100
101 const IdString Solvable::patternToken { "pattern()" };
102 const IdString Solvable::productToken { "product()" };
103
104 const IdString Solvable::retractedToken { "retracted-patch-package()" };
105 const IdString Solvable::ptfMasterToken { "ptf()" };
106 const IdString Solvable::ptfPackageToken { "ptf-package()" };
107
109
110 detail::CSolvable * Solvable::get() const
111 { return myPool().getSolvable( _id ); }
112
113#define NO_SOLVABLE_RETURN( VAL ) \
114 detail::CSolvable * _solvable( get() ); \
115 if ( ! _solvable ) return VAL
116
117 Solvable Solvable::nextInPool() const
118 { return Solvable( myPool().getNextId( _id ) ); }
119
120 Solvable Solvable::nextInRepo() const
121 {
122 NO_SOLVABLE_RETURN( noSolvable );
123 for ( detail::SolvableIdType next = _id+1; next < unsigned(_solvable->repo->end); ++next )
124 {
125 detail::CSolvable * nextS( myPool().getSolvable( next ) );
126 if ( nextS && nextS->repo == _solvable->repo )
127 {
128 return Solvable( next );
129 }
130 }
131 return noSolvable;
132 }
133
134 std::string Solvable::lookupStrAttribute( const SolvAttr & attr ) const
135 {
136 NO_SOLVABLE_RETURN( std::string() );
137 const char * s = ::solvable_lookup_str( _solvable, attr.id() );
138 return s ? s : std::string();
139 }
140
141 std::string Solvable::lookupStrAttribute( const SolvAttr & attr, const Locale & lang_r ) const
142 {
143 NO_SOLVABLE_RETURN( std::string() );
144 const char * s = 0;
145 if ( !lang_r )
146 {
147 s = ::solvable_lookup_str_poollang( _solvable, attr.id() );
148 }
149 else
150 {
151 for ( Locale l( lang_r ); l; l = l.fallback() )
152 {
153 if ( (s = ::solvable_lookup_str_lang( _solvable, attr.id(), l.c_str(), 0 )) )
154 return s;
155 }
156 // here: no matching locale, so use default
157 s = ::solvable_lookup_str_lang( _solvable, attr.id(), 0, 0 );
158 }
159 return s ? s : std::string();
160 }
161
162 unsigned long long Solvable::lookupNumAttribute( const SolvAttr & attr ) const
163 {
164 NO_SOLVABLE_RETURN( 0 );
165 return ::solvable_lookup_num( _solvable, attr.id(), 0 );
166 }
167
168 unsigned long long Solvable::lookupNumAttribute( const SolvAttr & attr, unsigned long long notfound_r ) const
169 {
170 NO_SOLVABLE_RETURN( notfound_r );
171 return ::solvable_lookup_num( _solvable, attr.id(), notfound_r );
172 }
173
174 bool Solvable::lookupBoolAttribute( const SolvAttr & attr ) const
175 {
176 NO_SOLVABLE_RETURN( false );
177 return ::solvable_lookup_bool( _solvable, attr.id() );
178 }
179
180 detail::IdType Solvable::lookupIdAttribute( const SolvAttr & attr ) const
181 {
182 NO_SOLVABLE_RETURN( detail::noId );
183 return ::solvable_lookup_id( _solvable, attr.id() );
184 }
185
186 CheckSum Solvable::lookupCheckSumAttribute( const SolvAttr & attr ) const
187 {
188 NO_SOLVABLE_RETURN( CheckSum() );
189 detail::IdType chksumtype = 0;
190 const char * s = ::solvable_lookup_checksum( _solvable, attr.id(), &chksumtype );
191 if ( ! s )
192 return CheckSum();
193 switch ( chksumtype )
194 {
195 case REPOKEY_TYPE_MD5: return CheckSum::md5( s );
196 case REPOKEY_TYPE_SHA1: return CheckSum::sha1( s );
197 case REPOKEY_TYPE_SHA224: return CheckSum::sha224( s );
198 case REPOKEY_TYPE_SHA256: return CheckSum::sha256( s );
199 case REPOKEY_TYPE_SHA384: return CheckSum::sha384( s );
200 case REPOKEY_TYPE_SHA512: return CheckSum::sha512( s );
201 }
202 return CheckSum( std::string(), s ); // try to autodetect
203 }
204
206 namespace
207 {
208 inline Pathname lookupDatadirIn( Repository repor_r )
209 {
210 static const SolvAttr susetagsDatadir( "susetags:datadir" );
211 Pathname ret;
212 // First look for repo attribute "susetags:datadir". If not found,
213 // look into the solvables as Code11 libsolv placed it there.
214 LookupRepoAttr datadir( susetagsDatadir, repor_r );
215 if ( ! datadir.empty() )
216 ret = datadir.begin().asString();
217 else
218 {
219 LookupAttr datadir( susetagsDatadir, repor_r );
220 if ( ! datadir.empty() )
221 ret = datadir.begin().asString();
222 }
223 return ret;
224 }
225 } // namespace
227
228 OnMediaLocation Solvable::lookupLocation() const
229 {
230 NO_SOLVABLE_RETURN( OnMediaLocation() );
231 // medianumber and path
232 unsigned medianr = 0;
233 const char * file = ::solvable_lookup_location( _solvable, &medianr );
234 if ( ! file )
235 return OnMediaLocation();
236 if ( ! medianr )
237 medianr = 1;
238
239 OnMediaLocation ret;
240
241 Pathname path;
242 switch ( repository().info().type().toEnum() )
243 {
244 case repo::RepoType::NONE_e:
245 {
246 path = lookupDatadirIn( repository() );
247 if ( ! path.empty() )
248 repository().info().setProbedType( repo::RepoType::YAST2_e );
249 }
250 break;
251
252 case repo::RepoType::YAST2_e:
253 {
254 path = lookupDatadirIn( repository() );
255 if ( path.empty() )
256 path = "suse";
257 }
258 break;
259
260 default:
261 break;
262 }
263 ret.setLocation ( path/file, medianr );
264 ret.setDownloadSize( ByteCount( lookupNumAttribute( SolvAttr::downloadsize ) ) );
265 ret.setChecksum ( lookupCheckSumAttribute( SolvAttr::checksum ) );
266 // Not needed/available for solvables?
267 //ret.setOpenSize ( ByteCount( lookupNumAttribute( SolvAttr::opensize ) ) );
268 //ret.setOpenChecksum( lookupCheckSumAttribute( SolvAttr::openchecksum ) );
269 return ret;
270 }
271
272
273 IdString Solvable::ident() const
274 {
275 NO_SOLVABLE_RETURN( IdString() );
276 return IdString( _solvable->name );
277 }
278
279 ResKind Solvable::kind() const
280 {
281 NO_SOLVABLE_RETURN( ResKind() );
282 // detect srcpackages by 'arch'
283 switch ( _solvable->arch )
284 {
285 case ARCH_SRC:
286 case ARCH_NOSRC:
287 return ResKind::srcpackage;
288 break;
289 }
290
291 // either explicitly prefixed...
292 const char * ident = IdString( _solvable->name ).c_str();
293 ResKind knownKind( ResKind::explicitBuiltin( ident ) );
294 if ( knownKind )
295 return knownKind;
296
297 // ...or no ':' in package names (hopefully)...
298 const char * sep = ::strchr( ident, ':' );
299 if ( ! sep )
300 return ResKind::package;
301
302 // ...or something unknown.
303 return ResKind( std::string( ident, sep-ident ) );
304 }
305
306 bool Solvable::isKind( const ResKind & kind_r ) const
307 {
308 NO_SOLVABLE_RETURN( false );
309
310 // detect srcpackages by 'arch'
311 switch ( _solvable->arch )
312 {
313 case ARCH_SRC:
314 case ARCH_NOSRC:
315 return( kind_r == ResKind::srcpackage );
316 break;
317 }
318
319 // no ':' in package names (hopefully)
320 const char * ident = IdString( _solvable->name ).c_str();
321 if ( kind_r == ResKind::package )
322 {
323 return( ::strchr( ident, ':' ) == 0 );
324 }
325
326 // look for a 'kind:' prefix
327 const char * kind = kind_r.c_str();
328 unsigned ksize = ::strlen( kind );
329 return( ::strncmp( ident, kind, ksize ) == 0
330 && ident[ksize] == ':' );
331 }
332
333 std::string Solvable::name() const
334 {
335 NO_SOLVABLE_RETURN( std::string() );
336 const char * ident = IdString( _solvable->name ).c_str();
337 const char * sep = ::strchr( ident, ':' );
338 return( sep ? sep+1 : ident );
339 }
340
341 Edition Solvable::edition() const
342 {
343 NO_SOLVABLE_RETURN( Edition() );
344 return Edition( _solvable->evr );
345 }
346
347 Arch Solvable::arch() const
348 {
349 NO_SOLVABLE_RETURN( Arch_noarch ); //ArchId() );
350 switch ( _solvable->arch )
351 {
352 case ARCH_SRC:
353 case ARCH_NOSRC:
354 return Arch_noarch; //ArchId( ARCH_NOARCH );
355 break;
356 }
357 return Arch( IdString(_solvable->arch).asString() );
358 //return ArchId( _solvable->arch );
359 }
360
361 IdString Solvable::vendor() const
362 {
363 NO_SOLVABLE_RETURN( IdString() );
364 return IdString( _solvable->vendor );
365 }
366
367 Repository Solvable::repository() const
368 {
369 NO_SOLVABLE_RETURN( Repository::noRepository );
370 return Repository( _solvable->repo );
371 }
372
373 RepoInfo Solvable::repoInfo() const
374 { return repository().info(); }
375
376
377 bool Solvable::isSystem() const
378 {
379 NO_SOLVABLE_RETURN( _id == detail::systemSolvableId );
380 return myPool().isSystemRepo( _solvable->repo );
381 }
382
383 bool Solvable::onSystemByUser() const
384 {
385 return isSystem() && myPool().isOnSystemByUser( ident() );
386 }
387
388 bool Solvable::onSystemByAuto() const
389 {
390 return isSystem() && myPool().isOnSystemByAuto( ident() );
391 }
392
393 bool Solvable::identIsAutoInstalled( const IdString & ident_r )
394 {
395 return myPool().isOnSystemByAuto( ident_r );
396 }
397
398 bool Solvable::isNeedreboot() const
399 {
400 NO_SOLVABLE_RETURN( false );
401 return myPool().isNeedreboot( *this );
402 }
403
404 // TODO: Optimize
405 bool Solvable::isBlacklisted() const
406 { return isPtf() || isRetracted(); }
407
408 bool Solvable::isRetracted() const
409 {
410 NO_SOLVABLE_RETURN( false );
411 if ( isKind<Package>() )
412 return myPool().isRetracted( *this );
413 if ( isKind<Patch>() )
414 return lookupStrAttribute( SolvAttr::updateStatus ) == "retracted";
415 return false;
416 }
417
418 bool Solvable::isPtf() const
419 { return isPtfPackage() || isPtfMaster(); }
420
421 bool Solvable::isPtfMaster() const
422 {
423 NO_SOLVABLE_RETURN( false );
424 return myPool().isPtfMaster( *this );
425 }
426
427 bool Solvable::isPtfPackage() const
428 {
429 NO_SOLVABLE_RETURN( false );
430 return myPool().isPtfPackage( *this );
431 }
432
433
434 bool Solvable::multiversionInstall() const
435 {
436 NO_SOLVABLE_RETURN( false );
437 return myPool().isMultiversion( *this );
438 }
439
440 Date Solvable::buildtime() const
441 {
442 NO_SOLVABLE_RETURN( Date() );
443 return Date( lookupNumAttribute( SolvAttr::buildtime ) );
444 }
445
446 Date Solvable::installtime() const
447 {
448 NO_SOLVABLE_RETURN( Date() );
449 return Date( lookupNumAttribute( SolvAttr::installtime ) );
450 }
451
452 std::string Solvable::asString() const
453 {
454 NO_SOLVABLE_RETURN( (_id == detail::systemSolvableId ? "systemSolvable" : "noSolvable") );
455 return str::form( "%s-%s.%s",
456 IdString( _solvable->name ).c_str(),
457 IdString( _solvable->evr ).c_str(),
458 IdString( _solvable->arch ).c_str() );
459 }
460
461 std::string Solvable::asUserString() const\
462 {
463 NO_SOLVABLE_RETURN( (_id == detail::systemSolvableId ? "systemSolvable" : "noSolvable") );
464 return str::form( "%s-%s.%s (%s)",
465 IdString( _solvable->name ).c_str(),
466 IdString( _solvable->evr ).c_str(),
467 IdString( _solvable->arch ).c_str(),
468 repository().asUserString().c_str() );
469 }
470
471 bool Solvable::identical( const Solvable & rhs ) const
472 {
473 NO_SOLVABLE_RETURN( ! rhs.get() );
474 detail::CSolvable * rhssolvable( rhs.get() );
475 return rhssolvable && ( _solvable == rhssolvable || ::solvable_identical( _solvable, rhssolvable ) );
476 }
477
479 namespace
480 {
481 inline Capabilities _getCapabilities( detail::IdType * idarraydata_r, ::Offset offs_r )
482 {
483 return offs_r ? Capabilities( idarraydata_r + offs_r ) : Capabilities();
484 }
485 } // namespace
487
488 Capabilities Solvable::dep_provides() const
489 {
490 NO_SOLVABLE_RETURN( Capabilities() );
491 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_provides );
492 }
493 Capabilities Solvable::dep_requires() const
494 {
495 NO_SOLVABLE_RETURN( Capabilities() );
496 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_requires );
497 }
498 Capabilities Solvable::dep_conflicts() const
499 {
500 NO_SOLVABLE_RETURN( Capabilities() );
501 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_conflicts );
502 }
503 Capabilities Solvable::dep_obsoletes() const
504 {
505 NO_SOLVABLE_RETURN( Capabilities() );
506 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_obsoletes );
507 }
508 Capabilities Solvable::dep_recommends() const
509 {
510 NO_SOLVABLE_RETURN( Capabilities() );
511 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_recommends );
512 }
513 Capabilities Solvable::dep_suggests() const
514 {
515 NO_SOLVABLE_RETURN( Capabilities() );
516 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_suggests );
517 }
518 Capabilities Solvable::dep_enhances() const
519 {
520 NO_SOLVABLE_RETURN( Capabilities() );
521 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_enhances );
522 }
523 Capabilities Solvable::dep_supplements() const
524 {
525 NO_SOLVABLE_RETURN( Capabilities() );
526 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_supplements );
527 }
528 Capabilities Solvable::dep_prerequires() const
529 {
530 NO_SOLVABLE_RETURN( Capabilities() );
531 // prerequires are a subset of requires
532 ::Offset offs = _solvable->dep_requires;
533 return offs ? Capabilities( _solvable->repo->idarraydata + offs, detail::solvablePrereqMarker )
534 : Capabilities();
535 }
536
537#if __cplusplus < 202002L
538#define DECLARE_CAP_FWD(_Fnc_Name) \
539 Capabilities Solvable::_Fnc_Name() const \
540 { return dep_##_Fnc_Name(); }
541
542 DECLARE_CAP_FWD(provides)
543 DECLARE_CAP_FWD(requires)
544 DECLARE_CAP_FWD(conflicts)
545 DECLARE_CAP_FWD(obsoletes)
546 DECLARE_CAP_FWD(recommends)
547 DECLARE_CAP_FWD(suggests)
548 DECLARE_CAP_FWD(enhances)
549 DECLARE_CAP_FWD(supplements)
550 DECLARE_CAP_FWD(prerequires)
551#undef DECLARE_CAP_FWD
552#endif
553
554 CapabilitySet Solvable::providesNamespace( const std::string & namespace_r ) const
555 {
556 NO_SOLVABLE_RETURN( CapabilitySet() );
557 CapabilitySet ret;
558 Capabilities caps( dep_provides() );
559 for_( it, caps.begin(), caps.end() )
560 {
561 CapDetail caprep( it->detail() );
562 if ( str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) == '(' )
563 ret.insert( *it );
564 }
565 return ret;
566 }
567
568 CapabilitySet Solvable::valuesOfNamespace( const std::string & namespace_r ) const
569 {
570 NO_SOLVABLE_RETURN( CapabilitySet() );
571 CapabilitySet ret;
572 Capabilities caps( dep_provides() );
573 for_( it, caps.begin(), caps.end() )
574 {
575 CapDetail caprep( it->detail() );
576 if ( str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) == '(' )
577 {
578 std::string value( caprep.name().c_str()+namespace_r.size()+1 );
579 value[value.size()-1] = '\0'; // erase the trailing ')'
580 ret.insert( Capability( value, caprep.op(), caprep.ed() ) );
581 }
582 }
583 return ret;
584 }
585
586 std::pair<bool, CapabilitySet> Solvable::matchesSolvable(const SolvAttr &attr, const Solvable &solv) const
587 {
588 sat::Queue capQueue;
589 int res = solvable_matchessolvable( get(), attr.id(), static_cast<Id>( solv.id() ), capQueue, 0 );
590
591 CapabilitySet caps;
592 if ( capQueue.size() )
593 std::for_each( capQueue.begin(), capQueue.end(), [ &caps ]( auto cap ){ caps.insert( Capability(cap) );});
594
595 return std::make_pair( res == 1, std::move(caps) );
596 }
597
599 namespace
600 {
605 int invokeOnEachSupportedLocale( Capability cap_r, const function<bool (const Locale &)>& fnc_r )
606 {
607 CapDetail detail( cap_r );
608 if ( detail.kind() == CapDetail::EXPRESSION )
609 {
610 switch ( detail.capRel() )
611 {
612 case CapDetail::CAP_AND:
613 case CapDetail::CAP_OR:
614 // expand
615 {
616 int res = invokeOnEachSupportedLocale( detail.lhs(), fnc_r );
617 if ( res < 0 )
618 return res; // negative on abort.
619 int res2 = invokeOnEachSupportedLocale( detail.rhs(), fnc_r );
620 if ( res2 < 0 )
621 return -res + res2; // negative on abort.
622 return res + res2;
623 }
624 break;
625
626 case CapDetail::CAP_NAMESPACE:
627 if ( detail.lhs().id() == NAMESPACE_LANGUAGE )
628 {
629 return ( !fnc_r || fnc_r( Locale( IdString(detail.rhs().id()) ) ) ) ? 1 : -1; // negative on abort.
630 }
631 break;
632
633 default:
634 break; // unwanted
635 }
636 }
637 return 0;
638 }
639
644 inline int invokeOnEachSupportedLocale( Capabilities cap_r, const function<bool (Locale)>& fnc_r )
645 {
646 int cnt = 0;
647 for_( cit, cap_r.begin(), cap_r.end() )
648 {
649 int res = invokeOnEachSupportedLocale( *cit, fnc_r );
650 if ( res < 0 )
651 return -cnt + res; // negative on abort.
652 cnt += res;
653 }
654 return cnt;
655 }
657
658 // Functor returning false if a Locale is in the set.
659 struct NoMatchIn
660 {
661 NoMatchIn( const LocaleSet & locales_r ) : _locales( locales_r ) {}
662
663 bool operator()( const Locale & locale_r ) const
664 {
665 return _locales.find( locale_r ) == _locales.end();
666 }
667
668 const LocaleSet & _locales;
669 };
670 } // namespace
672
673 bool Solvable::supportsLocales() const
674 {
675 // false_c stops on 1st Locale.
676 return invokeOnEachSupportedLocale( dep_supplements(), functor::false_c() ) < 0;
677 }
678
679 bool Solvable::supportsLocale( const Locale & locale_r ) const
680 {
681 // not_equal_to stops on == Locale.
682 return invokeOnEachSupportedLocale( dep_supplements(), bind( std::not_equal_to<Locale>(), locale_r, _1 ) ) < 0;
683 }
684
685 bool Solvable::supportsLocale( const LocaleSet & locales_r ) const
686 {
687 if ( locales_r.empty() )
688 return false;
689 // NoMatchIn stops if Locale is included.
690 return invokeOnEachSupportedLocale( dep_supplements(), NoMatchIn(locales_r) ) < 0;
691 }
692
693 bool Solvable::supportsRequestedLocales() const
694 { return supportsLocale( myPool().getRequestedLocales() ); }
695
696 LocaleSet Solvable::getSupportedLocales() const
697 {
698 LocaleSet ret;
699 invokeOnEachSupportedLocale( dep_supplements(), functor::collector( std::inserter( ret, ret.begin() ) ) );
700 return ret;
701 }
702
703 CpeId Solvable::cpeId() const
704 {
705 NO_SOLVABLE_RETURN( CpeId() );
706 return CpeId( lookupStrAttribute( SolvAttr::cpeid ), CpeId::noThrow );
707 }
708
709 unsigned Solvable::mediaNr() const
710 {
711 NO_SOLVABLE_RETURN( 0U );
712 // medianumber and path
713 unsigned medianr = 0U;
714 const char * file = ::solvable_lookup_location( _solvable, &medianr );
715 if ( ! file )
716 medianr = 0U;
717 else if ( ! medianr )
718 medianr = 1U;
719 return medianr;
720 }
721
722 ByteCount Solvable::installSize() const
723 {
724 NO_SOLVABLE_RETURN( ByteCount() );
725 return ByteCount( lookupNumAttribute( SolvAttr::installsize ) );
726 }
727
728 ByteCount Solvable::downloadSize() const
729 {
730 NO_SOLVABLE_RETURN( ByteCount() );
731 return ByteCount( lookupNumAttribute( SolvAttr::downloadsize ) );
732 }
733
734 std::string Solvable::distribution() const
735 {
736 NO_SOLVABLE_RETURN( std::string() );
737 return lookupStrAttribute( SolvAttr::distribution );
738 }
739
740 std::string Solvable::summary( const Locale & lang_r ) const
741 {
742 NO_SOLVABLE_RETURN( std::string() );
743 return lookupStrAttribute( SolvAttr::summary, lang_r );
744 }
745
746 std::string Solvable::description( const Locale & lang_r ) const
747 {
748 NO_SOLVABLE_RETURN( std::string() );
749 return lookupStrAttribute( SolvAttr::description, lang_r );
750 }
751
752 std::string Solvable::insnotify( const Locale & lang_r ) const
753 {
754 NO_SOLVABLE_RETURN( std::string() );
755 return lookupStrAttribute( SolvAttr::insnotify, lang_r );
756 }
757
758 std::string Solvable::delnotify( const Locale & lang_r ) const
759 {
760 NO_SOLVABLE_RETURN( std::string() );
761 return lookupStrAttribute( SolvAttr::delnotify, lang_r );
762 }
763
764 std::string Solvable::licenseToConfirm( const Locale & lang_r ) const
765 {
766 NO_SOLVABLE_RETURN( std::string() );
767 std::string ret = lookupStrAttribute( SolvAttr::eula, lang_r );
768 if ( ret.empty() && isKind<Product>() )
769 {
770 const RepoInfo & ri( repoInfo() );
771 std::string riname( name() ); // "license-"+name with fallback "license"
772 if ( ! ri.hasLicense( riname ) )
773 riname.clear();
774
775 if ( ri.needToAcceptLicense( riname ) || ! ui::Selectable::get( *this )->hasInstalledObj() )
776 ret = ri.getLicense( riname, lang_r ); // bnc#908976: suppress informal license upon update
777 }
778 return ret;
779 }
780
781 bool Solvable::needToAcceptLicense() const
782 {
783 NO_SOLVABLE_RETURN( false );
784 if ( isKind<Product>() )
785 {
786 const RepoInfo & ri( repoInfo() );
787 std::string riname( name() ); // "license-"+name with fallback "license"
788 if ( ! ri.hasLicense( riname ) )
789 riname.clear();
790
791 return ri.needToAcceptLicense( riname );
792 }
793 return true;
794 }
795
796
797 std::ostream & operator<<( std::ostream & str, const Solvable & obj )
798 {
799 if ( ! obj )
800 return str << (obj.isSystem() ? "systemSolvable" : "noSolvable" );
801
802 return str << "(" << obj.id() << ")"
803 << ( obj.isKind( ResKind::srcpackage ) ? "srcpackage:" : "" ) << obj.ident()
804 << '-' << obj.edition() << '.' << obj.arch() << "("
805 << obj.repository().alias() << ")";
806 }
807
808 std::ostream & dumpOn( std::ostream & str, const Solvable & obj )
809 {
810 str << obj;
811 if ( obj )
812 {
813#define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X]
814 OUTS(PROVIDES);
815 OUTS(PREREQUIRES);
816 OUTS(REQUIRES);
817 OUTS(CONFLICTS);
818 OUTS(OBSOLETES);
819 OUTS(RECOMMENDS);
820 OUTS(SUGGESTS);
821 OUTS(ENHANCES);
822 OUTS(SUPPLEMENTS);
823#undef OUTS
824 }
825 return str;
826 }
827
828 std::ostream & dumpAsXmlOn( std::ostream & str, const Solvable & obj )
829 {
830 xmlout::Node guard( str, "solvable" );
831
832 dumpAsXmlOn( *guard, obj.kind() );
833 *xmlout::Node( *guard, "name" ) << obj.name();
834 dumpAsXmlOn( *guard, obj.edition() );
835 dumpAsXmlOn( *guard, obj.arch() );
836 dumpAsXmlOn( *guard, obj.repository() );
837 return str;
838 }
839
840 } // namespace sat
842} // namespace zypp
Collector.h
OUTS
#define OUTS(VAL)
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
Exception.h
Functional.h
Gettext.h
Logger.h
LookupAttr.h
Pool.h
Repository.h
Selectable.h
DECLARE_CAP_FWD
#define DECLARE_CAP_FWD(_Fnc_Name)
Definition Solvable.cc:538
NO_SOLVABLE_RETURN
#define NO_SOLVABLE_RETURN(VAL)
Definition Solvable.cc:113
Solvable.h
Xml.h
ZConfig.h
zypp::Arch
Architecture.
Definition Arch.h:37
zypp::ByteCount
Store and operate with byte count.
Definition ByteCount.h:32
zypp::C_Str
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
Definition String.h:92
zypp::CapDetail
Helper providing more detailed information about a Capability.
Definition Capability.h:366
zypp::CapDetail::EXPRESSION
@ EXPRESSION
Definition Capability.h:373
zypp::CapDetail::name
IdString name() const
Definition Capability.h:419
zypp::CapDetail::ed
Edition ed() const
Definition Capability.h:421
zypp::CapDetail::op
Rel op() const
Definition Capability.h:420
zypp::CapDetail::CAP_OR
@ CAP_OR
or
Definition Capability.h:383
zypp::CapDetail::CAP_AND
@ CAP_AND
and
Definition Capability.h:382
zypp::CapDetail::CAP_NAMESPACE
@ CAP_NAMESPACE
Definition Capability.h:392
zypp::Capabilities
Container of Capability (currently read only).
Definition Capabilities.h:35
zypp::Capabilities::begin
const_iterator begin() const
Iterator pointing to the first Capability.
Definition Capabilities.h:171
zypp::Capabilities::end
const_iterator end() const
Iterator pointing behind the last Capability.
Definition Capabilities.h:174
zypp::Capability
A sat capability.
Definition Capability.h:63
zypp::CheckSum
Definition CheckSum.h:34
zypp::CheckSum::md5
static CheckSum md5(const std::string &checksum)
Definition CheckSum.h:73
zypp::CheckSum::sha384
static CheckSum sha384(const std::string &checksum)
Definition CheckSum.h:78
zypp::CheckSum::sha1
static CheckSum sha1(const std::string &checksum)
Definition CheckSum.h:75
zypp::CheckSum::sha512
static CheckSum sha512(const std::string &checksum)
Definition CheckSum.h:79
zypp::CheckSum::sha256
static CheckSum sha256(const std::string &checksum)
Definition CheckSum.h:77
zypp::CheckSum::sha224
static CheckSum sha224(const std::string &checksum)
Definition CheckSum.h:76
zypp::CpeId
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
Definition CpeId.h:33
zypp::CpeId::noThrow
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
Definition CpeId.h:63
zypp::Date
Store and operate on date (time_t).
Definition Date.h:33
zypp::Edition
Edition represents [epoch:]version[-release].
Definition Edition.h:60
zypp::IdString
Access to the sat-pools string space.
Definition IdString.h:55
zypp::IdString::c_str
const char * c_str() const
Conversion to const char *.
Definition IdString.cc:51
zypp::IdString::asString
std::string asString() const
Conversion to std::string.
Definition IdString.h:110
zypp::Locale
'Language[_Country]' codes.
Definition Locale.h:51
zypp::Locale::fallback
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
Definition Locale.cc:211
zypp::OnMediaLocation
Describes a resource file located on a medium.
Definition onmedialocation.h:37
zypp::OnMediaLocation::setDownloadSize
OnMediaLocation & setDownloadSize(ByteCount val_r)
Set the downloadSize.
Definition onmedialocation.cc:120
zypp::OnMediaLocation::setChecksum
OnMediaLocation & setChecksum(CheckSum val_r)
Set the checksum.
Definition onmedialocation.cc:126
zypp::OnMediaLocation::setLocation
OnMediaLocation & setLocation(Pathname filename_r, unsigned medianr_r=1)
Set filename_r and medianr_r (defaults to 1).
Definition onmedialocation.cc:96
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
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:970
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:806
zypp::RepoInfo::needToAcceptLicense
bool needToAcceptLicense() const
Whether the repo license has to be accepted, e.g.
Definition RepoInfo.cc:935
zypp::RepoInfo::hasLicense
bool hasLicense() const
Whether there is a license associated with the repo.
Definition RepoInfo.cc:928
zypp::Repository
Definition Repository.h:40
zypp::Repository::noRepository
static const Repository noRepository
Represents no Repository.
Definition Repository.h:67
zypp::Repository::alias
std::string alias() const
Short unique string to identify a repo.
Definition Repository.cc:60
zypp::Repository::info
RepoInfo info() const
Return any associated RepoInfo.
Definition Repository.cc:274
zypp::ResKind
Resolvable kinds.
Definition ResKind.h:33
zypp::ResKind::srcpackage
static const ResKind srcpackage
Definition ResKind.h:44
zypp::ResKind::explicitBuiltin
static ResKind explicitBuiltin(const char *str_r)
Return the builtin kind if str_r explicitly prefixed.
Definition ResKind.cc:46
zypp::ResKind::package
static const ResKind package
Definition ResKind.h:40
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
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::sat::LookupAttr
Lightweight attribute value lookup.
Definition LookupAttr.h:110
zypp::sat::LookupRepoAttr
Lightweight repository attribute value lookup.
Definition LookupAttr.h:265
zypp::sat::Queue
Libsolv Id queue wrapper.
Definition Queue.h:36
zypp::sat::Queue::size
size_type size() const
Definition Queue.cc:49
zypp::sat::Queue::end
const_iterator end() const
Definition Queue.cc:55
zypp::sat::Queue::begin
const_iterator begin() const
Definition Queue.cc:52
zypp::sat::SolvAttr
Solvable attribute keys.
Definition SolvAttr.h:41
zypp::sat::SolvAttr::cpeid
static const SolvAttr cpeid
Definition SolvAttr.h:100
zypp::sat::SolvAttr::buildtime
static const SolvAttr buildtime
Definition SolvAttr.h:96
zypp::sat::SolvAttr::distribution
static const SolvAttr distribution
Definition SolvAttr.h:111
zypp::sat::SolvAttr::description
static const SolvAttr description
Definition SolvAttr.h:91
zypp::sat::SolvAttr::delnotify
static const SolvAttr delnotify
Definition SolvAttr.h:93
zypp::sat::SolvAttr::installsize
static const SolvAttr installsize
Definition SolvAttr.h:97
zypp::sat::SolvAttr::downloadsize
static const SolvAttr downloadsize
Definition SolvAttr.h:98
zypp::sat::SolvAttr::insnotify
static const SolvAttr insnotify
Definition SolvAttr.h:92
zypp::sat::SolvAttr::summary
static const SolvAttr summary
Definition SolvAttr.h:90
zypp::sat::SolvAttr::checksum
static const SolvAttr checksum
Definition SolvAttr.h:105
zypp::sat::SolvAttr::updateStatus
static const SolvAttr updateStatus
Definition SolvAttr.h:134
zypp::sat::SolvAttr::installtime
static const SolvAttr installtime
Definition SolvAttr.h:95
zypp::sat::SolvAttr::eula
static const SolvAttr eula
Definition SolvAttr.h:94
zypp::sat::Solvable::SplitIdent::_name
IdString _name
Definition Solvable.h:397
zypp::sat::Solvable::SplitIdent::SplitIdent
SplitIdent()
Definition Solvable.h:383
zypp::sat::Solvable::SplitIdent::_ident
IdString _ident
Definition Solvable.h:395
zypp::sat::Solvable::SplitIdent::_kind
ResKind _kind
Definition Solvable.h:396
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition Solvable.h:54
zypp::sat::Solvable::id
IdType id() const
Expert backdoor.
Definition Solvable.h:464
zypp::sat::Solvable::isPtfPackage
bool isPtfPackage() const
Subset of isPtf (provides ptfPackageToken).
Definition Solvable.cc:427
zypp::sat::Solvable::isNeedreboot
bool isNeedreboot() const
Whether this solvable triggers the reboot-needed hint if installed/updated.
Definition Solvable.cc:398
zypp::sat::Solvable::supplements
Capabilities supplements() const ZYPP_DEPRECATED
zypp::sat::Solvable::identIsAutoInstalled
bool identIsAutoInstalled() const
Whether an installed solvable with the same ident is flagged as AutoInstalled.
Definition Solvable.h:146
zypp::sat::Solvable::lookupLocation
OnMediaLocation lookupLocation() const
returns OnMediaLocation data: This is everything we need to download e.g.
Definition Solvable.cc:228
zypp::sat::Solvable::dep_suggests
Capabilities dep_suggests() const
Definition Solvable.cc:513
zypp::sat::Solvable::patternToken
static const IdString patternToken
Indicator provides pattern().
Definition Solvable.h:58
zypp::sat::Solvable::dep_conflicts
Capabilities dep_conflicts() const
Definition Solvable.cc:498
zypp::sat::Solvable::lookupBoolAttribute
bool lookupBoolAttribute(const SolvAttr &attr) const
returns the boolean attribute value for attr or false if it does not exists.
Definition Solvable.cc:174
zypp::sat::Solvable::vendor
IdString vendor() const
The vendor.
Definition Solvable.cc:361
zypp::sat::Solvable::recommends
Capabilities recommends() const ZYPP_DEPRECATED
zypp::sat::Solvable::_id
IdType _id
Definition Solvable.h:467
zypp::sat::Solvable::installSize
ByteCount installSize() const
Installed (unpacked) size.
Definition Solvable.cc:722
zypp::sat::Solvable::buildtime
Date buildtime() const
The items build time.
Definition Solvable.cc:440
zypp::sat::Solvable::needToAcceptLicense
bool needToAcceptLicense() const
True except for well known exceptions (i.e show license but no need to accept it).
Definition Solvable.cc:781
zypp::sat::Solvable::kind
ResKind kind() const
The Solvables ResKind.
Definition Solvable.cc:279
zypp::sat::Solvable::providesNamespace
CapabilitySet providesNamespace(const std::string &namespace_r) const
Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
Definition Solvable.cc:554
zypp::sat::Solvable::noSolvable
static const Solvable noSolvable
Represents no Solvable.
Definition Solvable.h:83
zypp::sat::Solvable::dep_supplements
Capabilities dep_supplements() const
Definition Solvable.cc:523
zypp::sat::Solvable::asString
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
Definition Solvable.cc:452
zypp::sat::Solvable::suggests
Capabilities suggests() const ZYPP_DEPRECATED
zypp::sat::Solvable::distribution
std::string distribution() const
The distribution string.
Definition Solvable.cc:734
zypp::sat::Solvable::mediaNr
unsigned mediaNr() const
Media number the solvable is located on (0 if no media access required).
Definition Solvable.cc:709
zypp::sat::Solvable::isBlacklisted
bool isBlacklisted() const
Whether this solvable is blacklisted (retracted,ptf,...).
Definition Solvable.cc:405
zypp::sat::Solvable::lookupNumAttribute
unsigned long long lookupNumAttribute(const SolvAttr &attr) const
returns the numeric attribute value for attr or 0 if it does not exists.
Definition Solvable.cc:162
zypp::sat::Solvable::dep_enhances
Capabilities dep_enhances() const
Definition Solvable.cc:518
zypp::sat::Solvable::lookupStrAttribute
std::string lookupStrAttribute(const SolvAttr &attr) const
returns the string attribute value for attr or an empty string if it does not exists.
Definition Solvable.cc:134
zypp::sat::Solvable::dep_recommends
Capabilities dep_recommends() const
Definition Solvable.cc:508
zypp::sat::Solvable::conflicts
Capabilities conflicts() const ZYPP_DEPRECATED
zypp::sat::Solvable::multiversionInstall
bool multiversionInstall() const
Whether different versions of this package can be installed at the same time.
Definition Solvable.cc:434
zypp::sat::Solvable::cpeId
CpeId cpeId() const
The solvables CpeId if available.
Definition Solvable.cc:703
zypp::sat::Solvable::nextInRepo
Solvable nextInRepo() const
Return next Solvable in Repo (or noSolvable).
Definition Solvable.cc:120
zypp::sat::Solvable::installtime
Date installtime() const
The items install time (false if not installed).
Definition Solvable.cc:446
zypp::sat::Solvable::edition
Edition edition() const
The edition (version-release).
Definition Solvable.cc:341
zypp::sat::Solvable::ptfMasterToken
static const IdString ptfMasterToken
Indicator provides ptf().
Definition Solvable.h:62
zypp::sat::Solvable::isPtfMaster
bool isPtfMaster() const
Subset of isPtf (provides ptfMasterToken).
Definition Solvable.cc:421
zypp::sat::Solvable::Solvable
Solvable()
Default ctor creates noSolvable.
Definition Solvable.h:67
zypp::sat::Solvable::dep_obsoletes
Capabilities dep_obsoletes() const
Definition Solvable.cc:503
zypp::sat::Solvable::getSupportedLocales
LocaleSet getSupportedLocales() const
Return the supported locales.
Definition Solvable.cc:696
zypp::sat::Solvable::supportsRequestedLocales
bool supportsRequestedLocales() const
Whether this Solvable supports at least one requested locale.
Definition Solvable.cc:693
zypp::sat::Solvable::get
detail::CSolvable * get() const
Expert backdoor.
Definition Solvable.cc:110
zypp::sat::Solvable::arch
Arch arch() const
The architecture.
Definition Solvable.cc:347
zypp::sat::Solvable::ptfPackageToken
static const IdString ptfPackageToken
Indicator provides ptf-package().
Definition Solvable.h:63
zypp::sat::Solvable::isSystem
bool isSystem() const
Return whether this Solvable belongs to the system repo.
Definition Solvable.cc:377
zypp::sat::Solvable::nextInPool
Solvable nextInPool() const
Return next Solvable in Pool (or noSolvable).
Definition Solvable.cc:117
zypp::sat::Solvable::licenseToConfirm
std::string licenseToConfirm(const Locale &lang_r=Locale()) const
License or agreement to accept before installing the solvable (opt.
Definition Solvable.cc:764
zypp::sat::Solvable::supportsLocales
bool supportsLocales() const
Whether this Solvable claims to support locales.
Definition Solvable.cc:673
zypp::sat::Solvable::asUserString
std::string asUserString() const
String representation "ident-edition.arch(repo)" or "noSolvable".
Definition Solvable.cc:461
zypp::sat::Solvable::retractedToken
static const IdString retractedToken
Indicator provides retracted-patch-package().
Definition Solvable.h:61
zypp::sat::Solvable::obsoletes
Capabilities obsoletes() const ZYPP_DEPRECATED
zypp::sat::Solvable::summary
std::string summary(const Locale &lang_r=Locale()) const
Short (singleline) text describing the solvable (opt.
Definition Solvable.cc:740
zypp::sat::Solvable::dep_prerequires
Capabilities dep_prerequires() const
Definition Solvable.cc:528
zypp::sat::Solvable::dep_provides
Capabilities dep_provides() const
Definition Solvable.cc:488
zypp::sat::Solvable::lookupIdAttribute
detail::IdType lookupIdAttribute(const SolvAttr &attr) const
returns the id attribute value for attr or detail::noId if it does not exists.
Definition Solvable.cc:180
zypp::sat::Solvable::matchesSolvable
std::pair< bool, CapabilitySet > matchesSolvable(const SolvAttr &attr, const sat::Solvable &solv) const
Definition Solvable.cc:586
zypp::sat::Solvable::name
std::string name() const
The name (without any ResKind prefix).
Definition Solvable.cc:333
zypp::sat::Solvable::supportsLocale
bool supportsLocale(const Locale &locale_r) const
Whether this Solvable supports a specific Locale.
Definition Solvable.cc:679
zypp::sat::Solvable::dep_requires
Capabilities dep_requires() const
Definition Solvable.cc:493
zypp::sat::Solvable::downloadSize
ByteCount downloadSize() const
Download size.
Definition Solvable.cc:728
zypp::sat::Solvable::isKind
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
Definition Solvable.cc:306
zypp::sat::Solvable::onSystemByAuto
bool onSystemByAuto() const
Whether this is known to be automatically installed (as dependency of a user request package).
Definition Solvable.cc:388
zypp::sat::Solvable::delnotify
std::string delnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for uninstall (opt.
Definition Solvable.cc:758
zypp::sat::Solvable::valuesOfNamespace
CapabilitySet valuesOfNamespace(const std::string &namespace_r) const
Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
Definition Solvable.cc:568
zypp::sat::Solvable::ident
IdString ident() const
The identifier.
Definition Solvable.cc:273
zypp::sat::Solvable::productToken
static const IdString productToken
Indicator provides product().
Definition Solvable.h:59
zypp::sat::Solvable::lookupCheckSumAttribute
CheckSum lookupCheckSumAttribute(const SolvAttr &attr) const
returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist.
Definition Solvable.cc:186
zypp::sat::Solvable::description
std::string description(const Locale &lang_r=Locale()) const
Long (multiline) text describing the solvable (opt.
Definition Solvable.cc:746
zypp::sat::Solvable::onSystemByUser
bool onSystemByUser() const
Whether this is known to be installed on behalf of a user request.
Definition Solvable.cc:383
zypp::sat::Solvable::provides
Capabilities provides() const ZYPP_DEPRECATED
zypp::sat::Solvable::repoInfo
RepoInfo repoInfo() const
The repositories RepoInfo.
Definition Solvable.cc:373
zypp::sat::Solvable::enhances
Capabilities enhances() const ZYPP_DEPRECATED
zypp::sat::Solvable::prerequires
Capabilities prerequires() const ZYPP_DEPRECATED
zypp::sat::Solvable::repository
Repository repository() const
The Repository this Solvable belongs to.
Definition Solvable.cc:367
zypp::sat::Solvable::isPtf
bool isPtf() const
Whether this solvable belongs to a PTF (provides ptfMasterToken or ptfPackageToken).
Definition Solvable.cc:418
zypp::sat::Solvable::isRetracted
bool isRetracted() const
Whether this solvable is retracted (provides retractedToken).
Definition Solvable.cc:408
zypp::sat::Solvable::isKind
bool isKind() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition Solvable.h:106
zypp::sat::Solvable::insnotify
std::string insnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for install (opt.
Definition Solvable.cc:752
zypp::sat::Solvable::identical
bool identical(const Solvable &rhs) const
Test whether two Solvables have the same content.
Definition Solvable.cc:471
zypp::sat::detail::PoolImpl::isPtfMaster
bool isPtfMaster(const Solvable &solv_r) const
Definition PoolImpl.h:350
zypp::sat::detail::PoolImpl::isSystemRepo
bool isSystemRepo(CRepo *repo_r) const
Definition PoolImpl.h:105
zypp::sat::detail::PoolImpl::isPtfPackage
bool isPtfPackage(const Solvable &solv_r) const
Definition PoolImpl.h:352
zypp::sat::detail::PoolImpl::isNeedreboot
bool isNeedreboot(const Solvable &solv_r) const
Whether solv_r matches the spec.
Definition PoolImpl.h:341
zypp::sat::detail::PoolImpl::isOnSystemByAuto
bool isOnSystemByAuto(IdString ident_r) const
Definition PoolImpl.h:326
zypp::sat::detail::PoolImpl::isRetracted
bool isRetracted(const Solvable &solv_r) const
Definition PoolImpl.h:348
zypp::sat::detail::PoolImpl::getSolvable
CSolvable * getSolvable(SolvableIdType id_r) const
Return pointer to the sat-solvable or NULL if it is not valid.
Definition PoolImpl.h:186
zypp::sat::detail::PoolImpl::isMultiversion
bool isMultiversion(const Solvable &solv_r) const
Definition PoolImpl.cc:636
zypp::sat::detail::PoolImpl::isOnSystemByUser
bool isOnSystemByUser(IdString ident_r) const
Definition PoolImpl.h:323
zypp::ui::Selectable::get
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
Definition Selectable.cc:29
zyppng::IdStringType::c_str
const char * c_str() const
Definition IdStringType.h:115
zyppng::IdStringType::id
IdType id() const
Definition IdStringType.h:123
std
Definition ansi.h:855
str
String related utilities and Regular expression matching.
zypp::functor::false_c
False false_c()
Convenience function for creating a False.
Definition Functional.h:104
zypp::functor::collector
Collector< TOutputIterator > collector(TOutputIterator iter_r)
relates: Collector Convenience constructor.
Definition Collector.h:55
zypp::sat::detail
Definition PoolImpl.cc:73
zypp::sat::detail::solvablePrereqMarker
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
zypp::sat::detail::SolvableIdType
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition PoolDefines.h:63
zypp::sat::detail::noId
static const IdType noId(0)
zypp::sat::detail::IdType
int IdType
Generic Id type.
Definition PoolDefines.h:42
zypp::sat::detail::CSolvable
::s_Solvable CSolvable
Wrapped libsolv C data type exposed as backdoor.
Definition PoolDefines.h:37
zypp::sat::detail::systemSolvableId
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
zypp::sat
Libsolv interface
zypp::sat::dumpAsXmlOn
std::ostream & dumpAsXmlOn(std::ostream &str, const FileConflicts &obj)
relates: FileConflicts XML output
Definition FileConflicts.cc:132
zypp::sat::operator<<
std::ostream & operator<<(std::ostream &str, const FileConflicts &obj)
relates: FileConflicts Stream output
Definition FileConflicts.cc:109
zypp::sat::dumpOn
std::ostream & dumpOn(std::ostream &str, const LocaleSupport &obj)
relates: LocaleSupport More verbose stream output including dependencies
Definition LocaleSupport.cc:41
zypp::solver::detail
Definition PoolImpl.h:110
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::form
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition String.cc:39
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::CapabilitySet
std::unordered_set< Capability > CapabilitySet
Definition Capability.h:35
zyppng::IdString
zypp::IdString IdString
Definition idstring.h:16
PoolImpl.h
zypp::repo::RepoType::NONE_e
@ NONE_e
Definition RepoType.h:37
zypp::repo::RepoType::YAST2_e
@ YAST2_e
Definition RepoType.h:39
zypp::sat::detail::PoolMember::myPool
static PoolImpl & myPool()
Definition PoolMember.cc:41
zypp::xmlout::Node
RAII writing a nodes start/end tag.
Definition Xml.h:85