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