libzypp 17.37.10

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