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