libzypp  14.29.1
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 using std::endl;
31 
33 namespace zypp
34 {
35  namespace sat
37  {
38 
39  namespace
40  {
41  void _doSplit( IdString & _ident, ResKind & _kind, IdString & _name )
42  {
43  if ( ! _ident )
44  return;
45 
46  ResKind explicitKind = ResKind::explicitBuiltin( _ident.c_str() );
47  // NOTE: kind package and srcpackage do not have namespaced ident!
48  if ( ! explicitKind )
49  {
50  _name = _ident;
51  // No kind defaults to package
52  if ( !_kind )
53  _kind = ResKind::package;
54  else if ( ! ( _kind == ResKind::package || _kind == ResKind::srcpackage ) )
55  _ident = IdString( str::form( "%s:%s", _kind.c_str(), _ident.c_str() ) );
56  }
57  else
58  {
59  // strip kind spec from name
60  _name = IdString( ::strchr( _ident.c_str(), ':' )+1 );
61  _kind = explicitKind;
62  if ( _kind == ResKind::package || _kind == ResKind::srcpackage )
63  _ident = _name;
64  }
65  return;
66  }
67  }
68 
70  : _ident( ident_r )
71  { _doSplit( _ident, _kind, _name ); }
72 
73  Solvable::SplitIdent::SplitIdent( const char * ident_r )
74  : _ident( ident_r )
75  { _doSplit( _ident, _kind, _name ); }
76 
77  Solvable::SplitIdent::SplitIdent( const std::string & ident_r )
78  : _ident( ident_r )
79  { _doSplit( _ident, _kind, _name ); }
80 
82  : _ident( name_r )
83  , _kind( kind_r )
84  { _doSplit( _ident, _kind, _name ); }
85 
87  : _ident( name_r )
88  , _kind( kind_r )
89  { _doSplit( _ident, _kind, _name ); }
90 
92 
94 
96 
97  ::_Solvable * Solvable::get() const
98  { return myPool().getSolvable( _id ); }
99 
100 #define NO_SOLVABLE_RETURN( VAL ) \
101  ::_Solvable * _solvable( get() ); \
102  if ( ! _solvable ) return VAL
103 
105  { return Solvable( myPool().getNextId( _id ) ); }
106 
108  {
110  for ( detail::SolvableIdType next = _id+1; next < unsigned(_solvable->repo->end); ++next )
111  {
112  ::_Solvable * nextS( myPool().getSolvable( next ) );
113  if ( nextS && nextS->repo == _solvable->repo )
114  {
115  return Solvable( next );
116  }
117  }
118  return noSolvable;
119  }
120 
122  {
124  return Repository( _solvable->repo );
125  }
126 
127  bool Solvable::isSystem() const
128  {
130  return myPool().isSystemRepo( _solvable->repo );
131  }
132 
134  {
135  return isSystem() && myPool().isOnSystemByUser( ident() );
136  }
137 
139  {
141  return IdString( _solvable->name );
142  }
143 
144  std::string Solvable::lookupStrAttribute( const SolvAttr & attr ) const
145  {
146  NO_SOLVABLE_RETURN( std::string() );
147  const char * s = ::solvable_lookup_str( _solvable, attr.id() );
148  return s ? s : std::string();
149  }
150 
151  std::string Solvable::lookupStrAttribute( const SolvAttr & attr, const Locale & lang_r ) const
152  {
153  NO_SOLVABLE_RETURN( std::string() );
154  const char * s = 0;
155  if ( lang_r == Locale::noCode )
156  {
157  s = ::solvable_lookup_str_poollang( _solvable, attr.id() );
158  }
159  else
160  {
161  for ( Locale l( lang_r ); l != Locale::noCode; l = l.fallback() )
162  if ( (s = ::solvable_lookup_str_lang( _solvable, attr.id(), l.code().c_str(), 0 )) )
163  return s;
164  // here: no matching locale, so use default
165  s = ::solvable_lookup_str_lang( _solvable, attr.id(), 0, 0 );
166  }
167  return s ? s : std::string();
168  }
169 
170  unsigned long long Solvable::lookupNumAttribute( const SolvAttr & attr ) const
171  {
172  NO_SOLVABLE_RETURN( 0 );
173  return ::solvable_lookup_num( _solvable, attr.id(), 0 );
174  }
175 
177  {
178  NO_SOLVABLE_RETURN( false );
179  return ::solvable_lookup_bool( _solvable, attr.id() );
180  }
181 
183  {
185  return ::solvable_lookup_id( _solvable, attr.id() );
186  }
187 
189  {
191  detail::IdType chksumtype = 0;
192  const char * s = ::solvable_lookup_checksum( _solvable, attr.id(), &chksumtype );
193  if ( ! s )
194  return CheckSum();
195  switch ( chksumtype )
196  {
197  case REPOKEY_TYPE_MD5: return CheckSum::md5( s );
198  case REPOKEY_TYPE_SHA1: return CheckSum::sha1( s );
199  case REPOKEY_TYPE_SHA256: return CheckSum::sha256( s );
200  }
201  return CheckSum( std::string(), s ); // try to autodetect
202  }
203 
205  namespace
206  {
207  inline Pathname lookupDatadirIn( Repository repor_r )
208  {
209  static const sat::SolvAttr susetagsDatadir( "susetags:datadir" );
210  Pathname ret;
211  // First look for repo attribute "susetags:datadir". If not found,
212  // look into the solvables as Code11 libsolv placed it there.
213  sat::LookupRepoAttr datadir( susetagsDatadir, repor_r );
214  if ( ! datadir.empty() )
215  ret = datadir.begin().asString();
216  else
217  {
218  sat::LookupAttr datadir( susetagsDatadir, repor_r );
219  if ( ! datadir.empty() )
220  ret = datadir.begin().asString();
221  }
222  return ret;
223  }
224  }
226 
228  {
230  // medianumber and path
231  unsigned medianr;
232  const char * file = ::solvable_lookup_location( _solvable, &medianr );
233  if ( ! file )
234  return OnMediaLocation();
235  if ( ! medianr )
236  medianr = 1;
237 
238  OnMediaLocation ret;
239 
240  Pathname path;
241  switch ( repository().info().type().toEnum() )
242  {
244  {
245  path = lookupDatadirIn( repository() );
246  if ( ! path.empty() )
248  }
249  break;
250 
252  {
253  path = lookupDatadirIn( repository() );
254  if ( path.empty() )
255  path = "suse";
256  }
257  break;
258 
259  default:
260  break;
261  }
262  ret.setLocation ( path/file, medianr );
265  // Not needed/available for solvables?
266  //ret.setOpenSize ( ByteCount( lookupNumAttribute( SolvAttr::opensize ) ) );
267  //ret.setOpenChecksum( lookupCheckSumAttribute( SolvAttr::openchecksum ) );
268  return ret;
269  }
270 
272  {
274  // detect srcpackages by 'arch'
275  switch ( _solvable->arch )
276  {
277  case ARCH_SRC:
278  case ARCH_NOSRC:
279  return ResKind::srcpackage;
280  break;
281  }
282 
283  // either explicitly prefixed...
284  const char * ident = IdString( _solvable->name ).c_str();
285  ResKind knownKind( ResKind::explicitBuiltin( ident ) );
286  if ( knownKind )
287  return knownKind;
288 
289  // ...or no ':' in package names (hopefully)...
290  const char * sep = ::strchr( ident, ':' );
291  if ( ! sep )
292  return ResKind::package;
293 
294  // ...or something unknown.
295  return ResKind( std::string( ident, sep-ident ) );
296  }
297 
298  bool Solvable::isKind( const ResKind & kind_r ) const
299  {
300  NO_SOLVABLE_RETURN( false );
301 
302  // detect srcpackages by 'arch'
303  switch ( _solvable->arch )
304  {
305  case ARCH_SRC:
306  case ARCH_NOSRC:
307  return( kind_r == ResKind::srcpackage );
308  break;
309  }
310 
311  // no ':' in package names (hopefully)
312  const char * ident = IdString( _solvable->name ).c_str();
313  if ( kind_r == ResKind::package )
314  {
315  return( ::strchr( ident, ':' ) == 0 );
316  }
317 
318  // look for a 'kind:' prefix
319  const char * kind = kind_r.c_str();
320  unsigned ksize = ::strlen( kind );
321  return( ::strncmp( ident, kind, ksize ) == 0
322  && ident[ksize] == ':' );
323  }
324 
325  std::string Solvable::name() const
326  {
327  NO_SOLVABLE_RETURN( std::string() );
328  const char * ident = IdString( _solvable->name ).c_str();
329  const char * sep = ::strchr( ident, ':' );
330  return( sep ? sep+1 : ident );
331  }
332 
334  {
336  return Edition( _solvable->evr );
337  }
338 
340  {
341  NO_SOLVABLE_RETURN( Arch_noarch ); //ArchId() );
342  switch ( _solvable->arch )
343  {
344  case ARCH_SRC:
345  case ARCH_NOSRC:
346  return Arch_noarch; //ArchId( ARCH_NOARCH );
347  break;
348  }
349  return Arch( IdString(_solvable->arch).asString() );
350  //return ArchId( _solvable->arch );
351  }
352 
354  {
355  return myPool().isMultiversion( ident() );
356  }
357 
359  {
361  return IdString( _solvable->vendor );
362  }
363 
365  {
366  switch( which_r.inSwitch() )
367  {
368  case Dep::PROVIDES_e: return provides(); break;
369  case Dep::REQUIRES_e: return requires(); break;
370  case Dep::CONFLICTS_e: return conflicts(); break;
371  case Dep::OBSOLETES_e: return obsoletes(); break;
372  case Dep::RECOMMENDS_e: return recommends(); break;
373  case Dep::SUGGESTS_e: return suggests(); break;
374  case Dep::ENHANCES_e: return enhances(); break;
375  case Dep::SUPPLEMENTS_e: return supplements(); break;
376  case Dep::PREREQUIRES_e: return prerequires(); break;
377  }
378  return Capabilities();
379  }
380 
381  inline Capabilities _getCapabilities( detail::IdType * idarraydata_r, ::Offset offs_r )
382  {
383  return offs_r ? Capabilities( idarraydata_r + offs_r ) : Capabilities();
384  }
386  {
388  return _getCapabilities( _solvable->repo->idarraydata, _solvable->provides );
389  }
391  {
393  return _getCapabilities( _solvable->repo->idarraydata, _solvable->requires );
394  }
396  {
398  return _getCapabilities( _solvable->repo->idarraydata, _solvable->conflicts );
399  }
401  {
403  return _getCapabilities( _solvable->repo->idarraydata, _solvable->obsoletes );
404  }
406  {
408  return _getCapabilities( _solvable->repo->idarraydata, _solvable->recommends );
409  }
411  {
413  return _getCapabilities( _solvable->repo->idarraydata, _solvable->suggests );
414  }
416  {
418  return _getCapabilities( _solvable->repo->idarraydata, _solvable->enhances );
419  }
421  {
423  return _getCapabilities( _solvable->repo->idarraydata, _solvable->supplements );
424  }
426  {
428  // prerequires are a subset of requires
429  ::Offset offs = _solvable->requires;
430  return offs ? Capabilities( _solvable->repo->idarraydata + offs, detail::solvablePrereqMarker )
431  : Capabilities();
432  }
433 
434  CapabilitySet Solvable::providesNamespace( const std::string & namespace_r ) const
435  {
437  CapabilitySet ret;
438  Capabilities caps( provides() );
439  for_( it, caps.begin(), caps.end() )
440  {
441  CapDetail caprep( it->detail() );
442  if ( str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) == '(' )
443  ret.insert( *it );
444  }
445  return ret;
446  }
447 
448  CapabilitySet Solvable::valuesOfNamespace( const std::string & namespace_r ) const
449  {
451  CapabilitySet ret;
452  Capabilities caps( provides() );
453  for_( it, caps.begin(), caps.end() )
454  {
455  CapDetail caprep( it->detail() );
456  if ( str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) == '(' )
457  {
458  std::string value( caprep.name().c_str()+namespace_r.size()+1 );
459  value[value.size()-1] = '\0'; // erase the trailing ')'
460  ret.insert( Capability( value, caprep.op(), caprep.ed() ) );
461  }
462  }
463  return ret;
464  }
465 
466 
467  std::string Solvable::asString() const
468  {
469  NO_SOLVABLE_RETURN( (_id == detail::systemSolvableId ? "systemSolvable" : "noSolvable") );
470  return str::form( "%s-%s.%s",
471  IdString( _solvable->name ).c_str(),
472  IdString( _solvable->evr ).c_str(),
473  IdString( _solvable->arch ).c_str() );
474  }
475 
476  std::string Solvable::asUserString() const\
477  {
478  NO_SOLVABLE_RETURN( (_id == detail::systemSolvableId ? "systemSolvable" : "noSolvable") );
479  return str::form( "%s-%s.%s(%s)",
480  IdString( _solvable->name ).c_str(),
481  IdString( _solvable->evr ).c_str(),
482  IdString( _solvable->arch ).c_str(),
483  repository().asUserString().c_str() );
484  }
485 
486  bool Solvable::identical( Solvable rhs ) const
487  {
488  NO_SOLVABLE_RETURN( ! rhs.get() );
489  ::_Solvable * rhssolvable( rhs.get() );
490  return rhssolvable && ( _solvable == rhssolvable || ::solvable_identical( _solvable, rhssolvable ) );
491  }
492 
494  namespace
495  {
496 
500  int invokeOnEachSupportedLocale( Capability cap_r, function<bool (const Locale &)> fnc_r )
501  {
502  CapDetail detail( cap_r );
503  if ( detail.kind() == CapDetail::EXPRESSION )
504  {
505  switch ( detail.capRel() )
506  {
507  case CapDetail::CAP_AND:
508  case CapDetail::CAP_OR:
509  // expand
510  {
511  int res = invokeOnEachSupportedLocale( detail.lhs(), fnc_r );
512  if ( res < 0 )
513  return res; // negative on abort.
514  int res2 = invokeOnEachSupportedLocale( detail.rhs(), fnc_r );
515  if ( res2 < 0 )
516  return -res + res2; // negative on abort.
517  return res + res2;
518  }
519  break;
520 
522  if ( detail.lhs().id() == NAMESPACE_LANGUAGE )
523  {
524  return ( !fnc_r || fnc_r( Locale( IdString(detail.rhs().id()) ) ) ) ? 1 : -1; // negative on abort.
525  }
526  break;
527 
528  case CapDetail::REL_NONE:
529  case CapDetail::CAP_WITH:
530  case CapDetail::CAP_ARCH:
531  break; // unwanted
532  }
533  }
534  return 0;
535  }
536 
541  inline int invokeOnEachSupportedLocale( Capabilities cap_r, function<bool (const Locale &)> fnc_r )
542  {
543  int cnt = 0;
544  for_( cit, cap_r.begin(), cap_r.end() )
545  {
546  int res = invokeOnEachSupportedLocale( *cit, fnc_r );
547  if ( res < 0 )
548  return -cnt + res; // negative on abort.
549  cnt += res;
550  }
551  return cnt;
552  }
554 
555  // Functor returning false if a Locale is in the set.
556  struct NoMatchIn
557  {
558  NoMatchIn( const LocaleSet & locales_r ) : _locales( locales_r ) {}
559 
560  bool operator()( const Locale & locale_r ) const
561  {
562  return _locales.find( locale_r ) == _locales.end();
563  }
564 
566  };
567 
568  }
569 
571  {
572  // false_c stops on 1st Locale.
573  return invokeOnEachSupportedLocale( supplements(), functor::false_c() ) < 0;
574  }
575 
576  bool Solvable::supportsLocale( const Locale & locale_r ) const
577  {
578  // not_equal_to stops on == Locale.
579  return invokeOnEachSupportedLocale( supplements(), bind( std::not_equal_to<Locale>(), locale_r, _1 ) ) < 0;
580  }
581 
582  bool Solvable::supportsLocale( const LocaleSet & locales_r ) const
583  {
584  if ( locales_r.empty() )
585  return false;
586  // NoMatchIn stops if Locale is included.
587  return invokeOnEachSupportedLocale( supplements(), NoMatchIn(locales_r) ) < 0;
588  }
589 
591  { return supportsLocale( myPool().getRequestedLocales() ); }
592 
593  void Solvable::getSupportedLocales( LocaleSet & locales_r ) const
594  {
595  invokeOnEachSupportedLocale( supplements(),
596  functor::Collector( std::inserter( locales_r, locales_r.begin() ) ) );
597  }
598 
599  /******************************************************************
600  **
601  ** FUNCTION NAME : operator<<
602  ** FUNCTION TYPE : std::ostream &
603  */
604  std::ostream & operator<<( std::ostream & str, const Solvable & obj )
605  {
606  if ( ! obj )
607  return str << (obj.isSystem() ? "systemSolvable" : "noSolvable" );
608 
609  return str << "(" << obj.id() << ")"
610  << ( obj.isKind( ResKind::srcpackage ) ? "srcpackage:" : "" ) << obj.ident()
611  << '-' << obj.edition() << '.' << obj.arch() << "("
612  << obj.repository().alias() << ")";
613  }
614 
615  /******************************************************************
616  **
617  ** FUNCTION NAME : dumpOn
618  ** FUNCTION TYPE : std::ostream &
619  */
620  std::ostream & dumpOn( std::ostream & str, const Solvable & obj )
621  {
622  str << obj;
623  if ( obj )
624  {
625 #define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X]
626  OUTS(PROVIDES);
627  OUTS(PREREQUIRES);
628  OUTS(REQUIRES);
629  OUTS(CONFLICTS);
630  OUTS(OBSOLETES);
631  OUTS(RECOMMENDS);
632  OUTS(SUGGESTS);
633  OUTS(ENHANCES);
634  OUTS(SUPPLEMENTS);
635 #undef OUTS
636  }
637  return str;
638  }
639 
640  std::ostream & dumpAsXmlOn( std::ostream & str, const Solvable & obj )
641  {
642  xmlout::Node guard( str, "solvable" );
643 
644  dumpAsXmlOn( *guard, obj.kind() );
645  *xmlout::Node( *guard, "name" ) << obj.name();
646  dumpAsXmlOn( *guard, obj.edition() );
647  dumpAsXmlOn( *guard, obj.arch() );
648  dumpAsXmlOn( *guard, obj.repository() );
649  return str;
650  }
651 
653  } // namespace sat
656 } // namespace zypp
Repository repository() const
The Repository this Solvable belongs to.
Definition: Solvable.cc:121
static const Locale noCode
No or empty code.
Definition: Locale.h:71
RepoInfo info() const
Return any associated RepoInfo.
Definition: Repository.cc:273
Interface to gettext.
bool isSystemRepo(::_Repo *repo_r) const
Definition: PoolImpl.h:91
int IdType
Generic Id type.
Definition: PoolMember.h:82
A Solvable object within the sat Pool.
Definition: Solvable.h:55
Arch arch() const
Definition: Solvable.cc:339
Capabilities recommends() const
Definition: Solvable.cc:405
CapabilitySet providesNamespace(const std::string &namespace_r) const
Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
Definition: Solvable.cc:434
Container of Capability (currently read only).
Definition: Capabilities.h:35
static const ResKind package
Definition: ResKind.h:40
std::string alias() const
Short unique string to identify a repo.
Definition: Repository.cc:59
IdString ident() const
The identifier.
Definition: Solvable.cc:138
IdType id() const
Definition: IdStringType.h:108
Describes a path on a certain media amongs as the information required to download it...
const LocaleSet & _locales
Definition: Solvable.cc:565
#define OUTS(X)
Enumeration class of dependency types.
Definition: Dep.h:29
Helper providing more detailed information about a Capability.
Definition: Capability.h:289
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
bool supportsLocale(const Locale &locale_r) const
Whether this Solvable supports a specific Locale.
Definition: Solvable.cc:576
Store and operate with byte count.
Definition: ByteCount.h:30
Lightweight attribute value lookup.
Definition: LookupAttr.h:111
RAII writing a nodes start/end tag.
Definition: Xml.h:82
sat::SolvAttr attr
Definition: PoolQuery.cc:303
#define NO_SOLVABLE_RETURN(VAL)
Definition: Solvable.cc:100
bool supportsLocales() const
Whether this Solvable claims to support locales.
Definition: Solvable.cc:570
Capabilities supplements() const
Definition: Solvable.cc:420
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:144
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
Definition: Solvable.cc:467
bool isSystem() const
Return whether this Solvable belongs to the system repo.
Definition: Solvable.cc:127
std::ostream & operator<<(std::ostream &str, const Solvable &obj)
Definition: Solvable.cc:604
String related utilities and Regular expression matching.
bool isKind() const
Definition: Solvable.h:162
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition: PoolMember.h:98
Capabilities suggests() const
Definition: Solvable.cc:410
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:246
::_Solvable * get() const
Expert backdoor.
Definition: Solvable.cc:97
static const ResKind srcpackage
Definition: ResKind.h:44
Access to the sat-pools string space.
Definition: IdString.h:39
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:27
Edition represents [epoch:]version[-release]
Definition: Edition.h:60
CapabilitySet valuesOfNamespace(const std::string &namespace_r) const
Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
Definition: Solvable.cc:448
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition: String.cc:34
std::string asUserString() const
String representation "ident-edition.arch(repo)" or "noSolvable".
Definition: Solvable.cc:476
std::tr1::unordered_set< Capability > CapabilitySet
Definition: Capability.h:33
static CheckSum md5(const std::string &checksum)
Definition: CheckSum.h:72
Capabilities _getCapabilities(detail::IdType *idarraydata_r,::Offset offs_r)
Definition: Solvable.cc:381
Capabilities provides() const
Definition: Solvable.cc:385
static const Solvable noSolvable
Represents no Solvable.
Definition: Solvable.h:71
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:182
std::string asString() const
Conversion to std::string
Definition: IdString.h:83
std::string asUserString() const
User string: label (alias or name)
Definition: Repository.h:92
OnMediaLocation & setDownloadSize(const ByteCount &val_r)
Set the files size.
False false_c()
Convenience function for creating a False.
Definition: Functional.h:267
std::string name() const
Definition: Solvable.cc:325
Locale fallback() const
Return a fallback locale for this locale, when giving up, returns empty Locale()
Definition: Locale.cc:223
Solvable attribute keys.
Definition: SolvAttr.h:40
bool isMultiversion(IdString ident_r) const
Definition: PoolImpl.h:241
OnMediaLocation lookupLocation() const
returns OnMediaLocation data: This is everything we need to download e.g.
Definition: Solvable.cc:227
Lightweight repository attribute value lookup.
Definition: LookupAttr.h:260
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:188
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string...
Definition: String.h:111
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
bool supportsRequestedLocales() const
Whether this Solvable supports at least one requested locale.
Definition: Solvable.cc:590
bool lookupBoolAttribute(const SolvAttr &attr) const
returns the boolean attribute value for attr or false if it does not exists.
Definition: Solvable.cc:176
bool isOnSystemByUser(IdString ident_r) const
Definition: PoolImpl.h:259
bool onSystemByUser() const
Whether this is known to be installed on behalf of a user request.
Definition: Solvable.cc:133
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:170
LocaleSet getSupportedLocales() const
Definition: Solvable.h:249
std::tr1::unordered_set< Locale > LocaleSet
Definition: Locale.h:28
std::ostream & dumpOn(std::ostream &str, const Solvable &obj)
Definition: Solvable.cc:620
OnMediaLocation & setChecksum(const CheckSum &val_r)
Set the files checksum.
static const SolvAttr checksum
Definition: SolvAttr.h:86
static PoolImpl & myPool()
Definition: PoolImpl.cc:167
static const SolvAttr downloadsize
Definition: SolvAttr.h:79
const char * c_str() const
Conversion to const char *
Definition: IdString.cc:42
Solvable nextInRepo() const
Return next Solvable in Repo (or noSolvable).
Definition: Solvable.cc:107
static CheckSum sha256(const std::string &checksum)
Definition: CheckSum.h:75
Capabilities enhances() const
Definition: Solvable.cc:415
const_iterator end() const
Iterator pointing behind the last Capability.
Definition: Capabilities.h:165
IdString vendor() const
Definition: Solvable.cc:358
ResKind kind() const
Definition: Solvable.cc:271
const char * c_str() const
Definition: IdStringType.h:105
Solvable nextInPool() const
Return next Solvable in Pool (or noSolvable).
Definition: Solvable.cc:104
Solvable()
Default ctor creates noSolvable.
Definition: Solvable.h:62
Capabilities conflicts() const
Definition: Solvable.cc:395
bool multiversionInstall() const
Whether different versions of this package can be installed at the same time.
Definition: Solvable.cc:353
static const Repository noRepository
Represents no Repository.
Definition: Repository.h:61
std::ostream & dumpAsXmlOn(std::ostream &str, const Solvable &obj)
Definition: Solvable.cc:640
Capabilities prerequires() const
Definition: Solvable.cc:425
A sat capability.
Definition: Capability.h:59
static const IdType noId(0)
::_Solvable * getSolvable(SolvableIdType id_r) const
Return pointer to the sat-solvable or NULL if it is not valid.
Definition: PoolImpl.h:150
Capabilities operator[](Dep which_r) const
Definition: Solvable.cc:364
Capabilities requires() const
Definition: Solvable.cc:390
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
for_use_in_switch inSwitch() const
Enumarator provided for use in switch statement.
Definition: Dep.h:89
static CheckSum sha1(const std::string &checksum)
Definition: CheckSum.h:74
IdType id() const
Expert backdoor.
Definition: Solvable.h:288
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
Definition: Solvable.cc:298
Resolvable kinds.
Definition: ResKind.h:32
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition: String.h:974
const_iterator begin() const
Iterator pointing to the first Capability.
Definition: Capabilities.h:162
Edition edition() const
Definition: Solvable.cc:333
OnMediaLocation & setLocation(const Pathname &val_r, unsigned mediaNumber_r=1)
Set filename and media number (defaults to 1).
Capabilities obsoletes() const
Definition: Solvable.cc:400
bool identical(Solvable rhs) const
Test whether two Solvables have the same content.
Definition: Solvable.cc:486