libzypp 17.38.6
solvable.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <iostream>
13
14#include "solvable.h"
15#include "solvableident.h"
16
20#include <zypp-core/base/Xml.h>
21#include <zypp-core/ByteCount.h>
22#include <zypp-core/CheckSum.h>
23#include <zypp-core/Date.h>
24
25
27
28#include "pool.h"
31#include <zypp/ng/sat/queue.h>
32
33using std::endl;
34
36namespace zyppng
37{
39 namespace sat
40 {
41 namespace detail {
42 template<> Pool & poolFromType( Solvable & s )
43 {
44 const auto id = s.id();
47 ZYPP_PRECONDITION( cp->solvables[id].repo, "Solvable has no repo — already freed?" );
48 ZYPP_PRECONDITION( cp->appdata );
49 return *static_cast<Pool *>( cp->appdata );
50 }
51 template<> const Pool & poolFromType( const Solvable & s )
52 {
53 const auto id = s.id();
56 ZYPP_PRECONDITION( cp->solvables[id].repo, "Solvable has no repo — already freed?" );
57 ZYPP_PRECONDITION( cp->appdata );
58 return *static_cast<const Pool *>( cp->appdata );
59 }
60 }
62 // class Solvable
64
65 const Solvable Solvable::noSolvable;
66
67 const IdString Solvable::patternToken { "pattern()" };
68 const IdString Solvable::productToken { "product()" };
69
70 const IdString Solvable::retractedToken { "retracted-patch-package()" };
71 const IdString Solvable::ptfMasterToken { "ptf()" };
72 const IdString Solvable::ptfPackageToken { "ptf-package()" };
73
75
77 {
79 return nullptr;
80 return pool().getSolvable( _id );
81 }
82
83#define NO_SOLVABLE_RETURN( VAL ) \
84 detail::CSolvable * _solvable( get() ); \
85 if ( ! _solvable ) return VAL
86
88 {
90 return Solvable( pool().getNextId( _id ) );
91 }
92
94 {
96 for ( detail::SolvableIdType next = _id+1; next < unsigned(_solvable->repo->end); ++next )
97 {
98 detail::CSolvable * nextS( pool().getSolvable( next ) );
99 if ( nextS && nextS->repo == _solvable->repo )
100 {
101 return Solvable( next );
102 }
103 }
104 return noSolvable;
105 }
106
107 std::string Solvable::lookupStrAttribute( const SolvAttr & attr ) const
108 {
109 NO_SOLVABLE_RETURN( std::string() );
110 const char * s = ::solvable_lookup_str( _solvable, attr.id() );
111 return s ? s : std::string();
112 }
113
114 std::string Solvable::lookupStrAttribute( const SolvAttr & attr, const Locale & lang_r ) const
115 {
116 NO_SOLVABLE_RETURN( std::string() );
117 const char * s = 0;
118 if ( !lang_r )
119 {
120 s = ::solvable_lookup_str_poollang( _solvable, attr.id() );
121 }
122 else
123 {
124 for ( Locale l( lang_r ); l; l = l.fallback() )
125 {
126 if ( (s = ::solvable_lookup_str_lang( _solvable, attr.id(), l.c_str(), 0 )) )
127 return s;
128 }
129 // here: no matching locale, so use default
130 s = ::solvable_lookup_str_lang( _solvable, attr.id(), 0, 0 );
131 }
132 return s ? s : std::string();
133 }
134
135 unsigned long long Solvable::lookupNumAttribute( const SolvAttr & attr ) const
136 {
138 return ::solvable_lookup_num( _solvable, attr.id(), 0 );
139 }
140
141 unsigned long long Solvable::lookupNumAttribute( const SolvAttr & attr, unsigned long long notfound_r ) const
142 {
143 NO_SOLVABLE_RETURN( notfound_r );
144 return ::solvable_lookup_num( _solvable, attr.id(), notfound_r );
145 }
146
147 bool Solvable::lookupBoolAttribute( const SolvAttr & attr ) const
148 {
149 NO_SOLVABLE_RETURN( false );
150 return ::solvable_lookup_bool( _solvable, attr.id() );
151 }
152
154 {
156 return ::solvable_lookup_id( _solvable, attr.id() );
157 }
158
160 {
162 detail::IdType chksumtype = 0;
163 const char * s = ::solvable_lookup_checksum( _solvable, attr.id(), &chksumtype );
164 if ( ! s )
165 return zypp::CheckSum();
166 switch ( chksumtype )
167 {
168 case REPOKEY_TYPE_MD5: return zypp::CheckSum::md5( s );
169 case REPOKEY_TYPE_SHA1: return zypp::CheckSum::sha1( s );
170 case REPOKEY_TYPE_SHA224: return zypp::CheckSum::sha224( s );
171 case REPOKEY_TYPE_SHA256: return zypp::CheckSum::sha256( s );
172 case REPOKEY_TYPE_SHA384: return zypp::CheckSum::sha384( s );
173 case REPOKEY_TYPE_SHA512: return zypp::CheckSum::sha512( s );
174 }
175 return zypp::CheckSum( std::string(), s ); // try to autodetect
176 }
177
179 {
181 return IdString( _solvable->name );
182 }
183
185 {
187 // detect srcpackages by 'arch'
188 switch ( _solvable->arch )
189 {
190 case ARCH_SRC:
191 case ARCH_NOSRC:
192 return ResKind::srcpackage;
193 break;
194 }
195
196 // either explicitly prefixed...
197 const char * ident = IdString( _solvable->name ).c_str();
198 ResKind knownKind( ResKind::explicitBuiltin( ident ) );
199 if ( knownKind )
200 return knownKind;
201
202 // ...or no ':' in package names (hopefully)...
203 const char * sep = ::strchr( ident, ':' );
204 if ( ! sep )
205 return ResKind::package;
206
207 // ...or something unknown.
208 return ResKind( std::string( ident, sep-ident ) );
209 }
210
211 bool Solvable::isKind( const ResKind & kind_r ) const
212 {
213 NO_SOLVABLE_RETURN( false );
214
215 // detect srcpackages by 'arch'
216 switch ( _solvable->arch )
217 {
218 case ARCH_SRC:
219 case ARCH_NOSRC:
220 return( kind_r == ResKind::srcpackage );
221 break;
222 }
223
224 // no ':' in package names (hopefully)
225 const char * ident = IdString( _solvable->name ).c_str();
226 if ( kind_r == ResKind::package )
227 {
228 return( ::strchr( ident, ':' ) == 0 );
229 }
230
231 // look for a 'kind:' prefix
232 const char * kind = kind_r.c_str();
233 unsigned ksize = ::strlen( kind );
234 return( ::strncmp( ident, kind, ksize ) == 0
235 && ident[ksize] == ':' );
236 }
237
238 std::string Solvable::name() const
239 {
240 NO_SOLVABLE_RETURN( std::string() );
241 const char * ident = IdString( _solvable->name ).c_str();
242 const char * sep = ::strchr( ident, ':' );
243 return( sep ? sep+1 : ident );
244 }
245
247 {
249 return Edition( _solvable->evr );
250 }
251
253 {
254 NO_SOLVABLE_RETURN( Arch_noarch ); //ArchId() );
255 switch ( _solvable->arch )
256 {
257 case ARCH_SRC:
258 case ARCH_NOSRC:
259 return Arch_noarch; //ArchId( ARCH_NOARCH );
260 break;
261 }
262 return Arch( IdString(_solvable->arch).asString() );
263 //return ArchId( _solvable->arch );
264 }
265
267 {
269 return IdString( _solvable->vendor );
270 }
271
273 {
275 return _solvable->repo;
276 }
277
279 {
281 return pool().isSystemRepo( _solvable->repo );
282 }
283
289
295
296#if 0
297 std::string Solvable::asString() const
298 {
299 NO_SOLVABLE_RETURN( (_id == detail::systemSolvableId ? "systemSolvable" : "noSolvable") );
300 return str::form( "%s-%s.%s",
301 IdString( _solvable->name ).c_str(),
302 IdString( _solvable->evr ).c_str(),
303 IdString( _solvable->arch ).c_str() );
304 }
305
306 std::string Solvable::asUserString() const\
307 {
308 NO_SOLVABLE_RETURN( (_id == detail::systemSolvableId ? "systemSolvable" : "noSolvable") );
309 return str::form( "%s-%s.%s (%s)",
310 IdString( _solvable->name ).c_str(),
311 IdString( _solvable->evr ).c_str(),
312 IdString( _solvable->arch ).c_str(),
313 repository().asUserString().c_str() );
314 }
315#endif
316
317 bool Solvable::identical( const Solvable & rhs ) const
318 {
319 NO_SOLVABLE_RETURN( ! rhs.get() );
320 detail::CSolvable * rhssolvable( rhs.get() );
321 return rhssolvable && ( _solvable == rhssolvable || ::solvable_identical( _solvable, rhssolvable ) );
322 }
323
325 namespace
326 {
327 inline Capabilities _getCapabilities( detail::IdType * idarraydata_r, ::Offset offs_r )
328 {
329 return offs_r ? Capabilities( idarraydata_r + offs_r ) : Capabilities();
330 }
331 } // namespace
333
335 {
337 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_provides );
338 }
340 {
342 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_requires );
343 }
345 {
347 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_conflicts );
348 }
350 {
352 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_obsoletes );
353 }
355 {
357 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_recommends );
358 }
360 {
362 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_suggests );
363 }
365 {
367 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_enhances );
368 }
370 {
372 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_supplements );
373 }
375 {
377 // prerequires are a subset of requires
378 ::Offset offs = _solvable->dep_requires;
379 return offs ? Capabilities( _solvable->repo->idarraydata + offs, detail::solvablePrereqMarker )
380 : Capabilities();
381 }
382
383 CapabilitySet Solvable::providesNamespace( const std::string & namespace_r ) const
384 {
386 CapabilitySet ret;
387 Capabilities caps( dep_provides() );
388 for_( it, caps.begin(), caps.end() )
389 {
390 CapDetail caprep( it->detail() );
391 if ( zypp::str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) == '(' )
392 ret.insert( *it );
393 }
394 return ret;
395 }
396
397 CapabilitySet Solvable::valuesOfNamespace( const std::string & namespace_r ) const
398 {
400 CapabilitySet ret;
401 Capabilities caps( dep_provides() );
402 for_( it, caps.begin(), caps.end() )
403 {
404 CapDetail caprep( it->detail() );
405 if ( zypp::str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) == '(' )
406 {
407 std::string value( caprep.name().c_str()+namespace_r.size()+1 );
408 value[value.size()-1] = '\0'; // erase the trailing ')'
409 ret.insert( Capability( value, caprep.op(), caprep.ed() ) );
410 }
411 }
412 return ret;
413 }
414
415 std::pair<bool, CapabilitySet> Solvable::matchesSolvable(const SolvAttr &attr, const Solvable &solv) const
416 {
417 sat::Queue capQueue;
418 int res = solvable_matchessolvable( get(), attr.id(), static_cast<Id>( solv.id() ), capQueue, 0 );
419
420 CapabilitySet caps;
421 if ( capQueue.size() )
422 std::for_each( capQueue.begin(), capQueue.end(), [ &caps ]( auto cap ){ caps.insert( Capability(cap) );});
423
424 return std::make_pair( res == 1, std::move(caps) );
425 }
426
428 namespace
429 {
434 int invokeOnEachSupportedLocale( Capability cap_r, const std::function<bool (const Locale &)>& fnc_r )
435 {
436 CapDetail detail( cap_r );
437 if ( detail.kind() == CapDetail::EXPRESSION )
438 {
439 switch ( detail.capRel() )
440 {
443 // expand
444 {
445 int res = invokeOnEachSupportedLocale( detail.lhs(), fnc_r );
446 if ( res < 0 )
447 return res; // negative on abort.
448 int res2 = invokeOnEachSupportedLocale( detail.rhs(), fnc_r );
449 if ( res2 < 0 )
450 return -res + res2; // negative on abort.
451 return res + res2;
452 }
453 break;
454
456 if ( detail.lhs().id() == NAMESPACE_LANGUAGE )
457 {
458 return ( !fnc_r || fnc_r( Locale( IdString(detail.rhs().id()) ) ) ) ? 1 : -1; // negative on abort.
459 }
460 break;
461
462 default:
463 break; // unwanted
464 }
465 }
466 return 0;
467 }
468
473 inline int invokeOnEachSupportedLocale( Capabilities cap_r, const std::function<bool (const Locale &)>& fnc_r )
474 {
475 int cnt = 0;
476 for_( cit, cap_r.begin(), cap_r.end() )
477 {
478 int res = invokeOnEachSupportedLocale( *cit, fnc_r );
479 if ( res < 0 )
480 return -cnt + res; // negative on abort.
481 cnt += res;
482 }
483 return cnt;
484 }
486
487 // Functor returning false if a Locale is in the set.
488 struct NoMatchIn
489 {
490 NoMatchIn( const LocaleSet & locales_r ) : _locales( locales_r ) {}
491
492 bool operator()( const Locale & locale_r ) const
493 {
494 return _locales.find( locale_r ) == _locales.end();
495 }
496
497 const LocaleSet & _locales;
498 };
499 } // namespace
501
503 {
504 // false_c stops on 1st Locale.
505 return invokeOnEachSupportedLocale( dep_supplements(), zypp::functor::false_c() ) < 0;
506 }
507
508 bool Solvable::supportsLocale( const Locale & locale_r ) const
509 {
510 // not_equal_to stops on == Locale.
511 return invokeOnEachSupportedLocale( dep_supplements(), [&]( const Locale & locale ){ return std::not_equal_to<Locale>()( locale, locale_r ); } ) < 0;
512 }
513
514 bool Solvable::supportsLocale( const LocaleSet & locales_r ) const
515 {
516 if ( locales_r.empty() )
517 return false;
518 // NoMatchIn stops if Locale is included.
519 return invokeOnEachSupportedLocale( dep_supplements(), NoMatchIn(locales_r) ) < 0;
520 }
521
523 {
524 LocaleSet ret;
525 invokeOnEachSupportedLocale( dep_supplements(), [&](const Locale & l){
526 ret.insert ( l );
527 return true;
528 } );
529 return ret;
530 }
531
537
538 unsigned Solvable::mediaNr() const
539 {
540 NO_SOLVABLE_RETURN( 0U );
541 // medianumber and path
542 unsigned medianr = 0U;
543 const char * file = ::solvable_lookup_location( _solvable, &medianr );
544 if ( ! file )
545 medianr = 0U;
546 else if ( ! medianr )
547 medianr = 1U;
548 return medianr;
549 }
550
556
562
563 std::string Solvable::distribution() const
564 {
565 NO_SOLVABLE_RETURN( std::string() );
567 }
568
569 std::string Solvable::summary( const Locale & lang_r ) const
570 {
571 NO_SOLVABLE_RETURN( std::string() );
572 return lookupStrAttribute( SolvAttr::summary, lang_r );
573 }
574
575 std::string Solvable::description( const Locale & lang_r ) const
576 {
577 NO_SOLVABLE_RETURN( std::string() );
579 }
580
581 std::string Solvable::insnotify( const Locale & lang_r ) const
582 {
583 NO_SOLVABLE_RETURN( std::string() );
584 return lookupStrAttribute( SolvAttr::insnotify, lang_r );
585 }
586
587 std::string Solvable::delnotify( const Locale & lang_r ) const
588 {
589 NO_SOLVABLE_RETURN( std::string() );
590 return lookupStrAttribute( SolvAttr::delnotify, lang_r );
591 }
592
593
594#if 0
595 std::string Solvable::licenseToConfirm( const Locale & lang_r ) const
596 {
597 NO_SOLVABLE_RETURN( std::string() );
598 std::string ret = lookupStrAttribute( SolvAttr::eula, lang_r );
599 if ( ret.empty() && isKind<Product>() )
600 {
601 const RepoInfo & ri( repoInfo() );
602 std::string riname( name() ); // "license-"+name with fallback "license"
603 if ( ! ri.hasLicense( riname ) )
604 riname.clear();
605
606 if ( ri.needToAcceptLicense( riname ) || ! ui::Selectable::get( *this )->hasInstalledObj() )
607 ret = ri.getLicense( riname, lang_r ); // bnc#908976: suppress informal license upon update
608 }
609 return ret;
610 }
611
613 {
614 NO_SOLVABLE_RETURN( false );
615 if ( isKind<Product>() )
616 {
617 const RepoInfo & ri( repoInfo() );
618 std::string riname( name() ); // "license-"+name with fallback "license"
619 if ( ! ri.hasLicense( riname ) )
620 riname.clear();
621
622 return ri.needToAcceptLicense( riname );
623 }
624 return true;
625 }
626 std::ostream & dumpOn( std::ostream & str, const Solvable & obj )
627 {
628 str << obj;
629 if ( obj )
630 {
631#define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X]
632 OUTS(PROVIDES);
633 OUTS(PREREQUIRES);
634 OUTS(REQUIRES);
635 OUTS(CONFLICTS);
636 OUTS(OBSOLETES);
637 OUTS(RECOMMENDS);
638 OUTS(SUGGESTS);
639 OUTS(ENHANCES);
640 OUTS(SUPPLEMENTS);
641#undef OUTS
642 }
643 return str;
644 }
645
646 std::ostream & dumpAsXmlOn( std::ostream & str, const Solvable & obj )
647 {
648 xmlout::Node guard( str, "solvable" );
649
650 dumpAsXmlOn( *guard, obj.kind() );
651 *xmlout::Node( *guard, "name" ) << obj.name();
652 dumpAsXmlOn( *guard, obj.edition() );
653 dumpAsXmlOn( *guard, obj.arch() );
654 dumpAsXmlOn( *guard, obj.repository() );
655 return str;
656 }
657#endif
658
659 } // namespace sat
661} // namespace zypp
#define OUTS(VAL)
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
#define NO_SOLVABLE_RETURN(VAL)
Definition Solvable.cc:113
Architecture.
Definition Arch.h:37
Store and operate with byte count.
Definition ByteCount.h:32
static CheckSum md5(const std::string &checksum)
Definition CheckSum.h:73
static CheckSum sha384(const std::string &checksum)
Definition CheckSum.h:78
static CheckSum sha1(const std::string &checksum)
Definition CheckSum.h:75
static CheckSum sha512(const std::string &checksum)
Definition CheckSum.h:79
static CheckSum sha256(const std::string &checksum)
Definition CheckSum.h:77
static CheckSum sha224(const std::string &checksum)
Definition CheckSum.h:76
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
Definition CpeId.h:33
Store and operate on date (time_t).
Definition Date.h:33
Edition represents [epoch:]version[-release].
Definition Edition.h:60
Access to the sat-pools string space.
Definition IdString.h:55
const char * c_str() const
Conversion to const char *.
Definition IdString.cc:51
std::string asString() const
Conversion to std::string.
Definition IdString.h:110
'Language[_Country]' codes.
Definition Locale.h:51
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
Definition Locale.cc:211
What is known about a repository.
Definition RepoInfo.h:72
Resolvable kinds.
Definition ResKind.h:33
Solvable attribute keys.
Definition SolvAttr.h:41
Capabilities dep_suggests() const
Definition Solvable.cc:513
static const IdString patternToken
Indicator provides pattern().
Definition Solvable.h:58
Capabilities dep_conflicts() const
Definition Solvable.cc:498
bool lookupBoolAttribute(const SolvAttr &attr) const
returns the boolean attribute value for attr or false if it does not exists.
Definition Solvable.cc:174
IdString vendor() const
The vendor.
Definition Solvable.cc:361
ByteCount installSize() const
Installed (unpacked) size.
Definition Solvable.cc:722
Date buildtime() const
The items build time.
Definition Solvable.cc:440
bool needToAcceptLicense() const
True except for well known exceptions (i.e show license but no need to accept it).
Definition Solvable.cc:781
ResKind kind() const
The Solvables ResKind.
Definition Solvable.cc:279
CapabilitySet providesNamespace(const std::string &namespace_r) const
Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
Definition Solvable.cc:554
static const Solvable noSolvable
Represents no Solvable.
Definition Solvable.h:83
Capabilities dep_supplements() const
Definition Solvable.cc:523
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
Definition Solvable.cc:452
std::string distribution() const
The distribution string.
Definition Solvable.cc:734
unsigned mediaNr() const
Media number the solvable is located on (0 if no media access required).
Definition Solvable.cc:709
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
Capabilities dep_enhances() const
Definition Solvable.cc:518
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
Capabilities dep_recommends() const
Definition Solvable.cc:508
CpeId cpeId() const
The solvables CpeId if available.
Definition Solvable.cc:703
Solvable nextInRepo() const
Return next Solvable in Repo (or noSolvable).
Definition Solvable.cc:120
Date installtime() const
The items install time (false if not installed).
Definition Solvable.cc:446
Edition edition() const
The edition (version-release).
Definition Solvable.cc:341
Capabilities dep_obsoletes() const
Definition Solvable.cc:503
LocaleSet getSupportedLocales() const
Return the supported locales.
Definition Solvable.cc:696
detail::CSolvable * get() const
Expert backdoor.
Definition Solvable.cc:110
Arch arch() const
The architecture.
Definition Solvable.cc:347
bool isSystem() const
Return whether this Solvable belongs to the system repo.
Definition Solvable.cc:377
Solvable nextInPool() const
Return next Solvable in Pool (or noSolvable).
Definition Solvable.cc:117
std::string licenseToConfirm(const Locale &lang_r=Locale()) const
License or agreement to accept before installing the solvable (opt.
Definition Solvable.cc:764
bool supportsLocales() const
Whether this Solvable claims to support locales.
Definition Solvable.cc:673
std::string asUserString() const
String representation "ident-edition.arch(repo)" or "noSolvable".
Definition Solvable.cc:461
std::string summary(const Locale &lang_r=Locale()) const
Short (singleline) text describing the solvable (opt.
Definition Solvable.cc:740
Capabilities dep_prerequires() const
Definition Solvable.cc:528
Capabilities dep_provides() const
Definition Solvable.cc:488
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
std::pair< bool, CapabilitySet > matchesSolvable(const SolvAttr &attr, const sat::Solvable &solv) const
Definition Solvable.cc:586
std::string name() const
The name (without any ResKind prefix).
Definition Solvable.cc:333
bool supportsLocale(const Locale &locale_r) const
Whether this Solvable supports a specific Locale.
Definition Solvable.cc:679
Capabilities dep_requires() const
Definition Solvable.cc:493
ByteCount downloadSize() const
Download size.
Definition Solvable.cc:728
std::string delnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for uninstall (opt.
Definition Solvable.cc:758
CapabilitySet valuesOfNamespace(const std::string &namespace_r) const
Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
Definition Solvable.cc:568
IdString ident() const
The identifier.
Definition Solvable.cc:273
static const IdString productToken
Indicator provides product().
Definition Solvable.h:59
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
std::string description(const Locale &lang_r=Locale()) const
Long (multiline) text describing the solvable (opt.
Definition Solvable.cc:746
Repository repository() const
The Repository this Solvable belongs to.
Definition Solvable.cc:367
bool isKind() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition Solvable.h:106
std::string insnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for install (opt.
Definition Solvable.cc:752
bool identical(const Solvable &rhs) const
Test whether two Solvables have the same content.
Definition Solvable.cc:471
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
Definition Selectable.cc:29
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
Definition CpeId.h:63
const char * c_str() const
IdType id() const
static const ResKind srcpackage
Definition ResKind.h:44
static ResKind explicitBuiltin(const char *str_r)
Return the builtin kind if str_r explicitly prefixed.
Definition ResKind.cc:46
static const ResKind package
Definition ResKind.h:40
Helper providing more detailed information about a Capability.
Definition capability.h:339
Edition ed() const
Definition capability.h:394
IdString name() const
Definition capability.h:392
Container of Capability (currently read only).
const_iterator begin() const
Iterator pointing to the first Capability.
const_iterator end() const
Iterator pointing behind the last Capability.
A sat capability.
Definition capability.h:74
Orchestrator for a libsolv pool instance.
Definition pool.h:37
detail::CSolvable * getSolvable(detail::SolvableIdType id_r) const
Return pointer to the sat-solvable or NULL if it is not valid.
Definition pool.h:227
bool isSystemRepo(detail::CRepo *repo_r) const
Definition pool.h:132
Libsolv Id queue wrapper.
Definition queue.h:37
size_type size() const
Definition queue.cc:55
const_iterator end() const
Definition queue.cc:61
const_iterator begin() const
Definition queue.cc:58
static const SolvAttr cpeid
Definition SolvAttr.h:100
static const SolvAttr buildtime
Definition SolvAttr.h:96
static const SolvAttr distribution
Definition SolvAttr.h:111
static const SolvAttr description
Definition SolvAttr.h:91
static const SolvAttr delnotify
Definition SolvAttr.h:93
static const SolvAttr installsize
Definition SolvAttr.h:97
static const SolvAttr downloadsize
Definition SolvAttr.h:98
static const SolvAttr insnotify
Definition SolvAttr.h:92
static const SolvAttr summary
Definition SolvAttr.h:90
static const SolvAttr installtime
Definition SolvAttr.h:95
static const SolvAttr eula
Definition SolvAttr.h:94
A Solvable object within the sat Pool.
Definition solvable.h:65
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:107
static const IdString ptfPackageToken
Indicator provides ptf-package().
Definition solvable.h:74
detail::CSolvable * get() const
Expert backdoor.
Definition solvable.cc:76
Solvable()
Default ctor creates noSolvable.
Definition solvable.h:78
std::string name() const
The name (without any ResKind prefix).
Definition solvable.cc:238
ResKind kind() const
The Solvables ResKind.
Definition solvable.cc:184
bool isKind() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition solvable.h:117
static const IdString retractedToken
Indicator provides retracted-patch-package().
Definition solvable.h:72
Capabilities dep_supplements() const
Definition solvable.cc:369
IdString ident() const
The identifier.
Definition solvable.cc:178
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:135
IdType id() const
Expert backdoor.
Definition solvable.h:338
Capabilities dep_provides() const
Definition solvable.cc:334
static const Solvable noSolvable
Represents no Solvable.
Definition solvable.h:94
detail::RepoIdType repository() const
The repo id this Solvable belongs to.
Definition solvable.cc:272
static const IdString ptfMasterToken
Indicator provides ptf().
Definition solvable.h:73
detail::CPool * getPool() const
Explicit accessor for the raw sat-pool.
Definition stringpool.h:60
static StringPool & instance()
Access the global StringPool instance.
Definition stringpool.cc:18
False false_c()
Convenience function for creating a False.
Definition Functional.h:104
std::ostream & dumpAsXmlOn(std::ostream &str, const FileConflicts &obj)
relates: FileConflicts XML output
std::ostream & dumpOn(std::ostream &str, const LocaleSupport &obj)
relates: LocaleSupport More verbose stream output including dependencies
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition String.h:1097
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
std::string asUserString(VendorSupportOption opt)
converts the support option to a name intended to be printed to the user.
CLASS NAME : detail::DIWrap.
Definition cap2str.cc:14
zypp::sat::detail::CSolvable CSolvable
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
zypp::sat::detail::RepoIdType RepoIdType
zypp::sat::detail::CPool CPool
Pool & poolFromType(T &)
zypp::sat::detail::SolvableIdType SolvableIdType
static const IdType noId(0)
static const SolvableIdType noSolvableId(0)
Id to denote Solvable::noSolvable.
static const RepoIdType noRepoId(0)
Id to denote Repo::noRepository.
zypp::sat::detail::IdType IdType
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
This file contains private API, this might break at any time between releases.
bool isKind(const Solvable &solvable_r)
relates: Solvable Test whether a Solvable is of a certain Kind.
Definition solvable.h:359
std::unordered_set< Capability > CapabilitySet
Definition capability.h:35
zypp::IdString IdString
Definition idstring.h:16
zypp::RepoInfo RepoInfo
Definition repomanager.h:38
Always-on precondition checking for NG code.
#define ZYPP_PRECONDITION(EXPR,...)
Always-on precondition check — fires in debug AND release builds.