44 const auto id = s.
id();
47 ZYPP_PRECONDITION( cp->solvables[
id].repo,
"Solvable has no repo — already freed?" );
49 return *
static_cast<Pool *
>( cp->appdata );
53 const auto id = s.
id();
56 ZYPP_PRECONDITION( cp->solvables[
id].repo,
"Solvable has no repo — already freed?" );
58 return *
static_cast<const Pool *
>( cp->appdata );
83#define NO_SOLVABLE_RETURN( VAL ) \
84 detail::CSolvable * _solvable( get() ); \
85 if ( ! _solvable ) return VAL
99 if ( nextS && nextS->repo == _solvable->repo )
110 const char * s = ::solvable_lookup_str( _solvable, attr.
id() );
111 return s ? s : std::string();
120 s = ::solvable_lookup_str_poollang( _solvable, attr.
id() );
126 if ( (s = ::solvable_lookup_str_lang( _solvable, attr.
id(), l.c_str(), 0 )) )
130 s = ::solvable_lookup_str_lang( _solvable, attr.
id(), 0, 0 );
132 return s ? s : std::string();
138 return ::solvable_lookup_num( _solvable, attr.
id(), 0 );
144 return ::solvable_lookup_num( _solvable, attr.
id(), notfound_r );
150 return ::solvable_lookup_bool( _solvable, attr.
id() );
156 return ::solvable_lookup_id( _solvable, attr.
id() );
163 const char * s = ::solvable_lookup_checksum( _solvable, attr.
id(), &chksumtype );
166 switch ( chksumtype )
188 switch ( _solvable->arch )
203 const char * sep = ::strchr(
ident,
':' );
216 switch ( _solvable->arch )
228 return( ::strchr(
ident,
':' ) == 0 );
233 unsigned ksize = ::strlen(
kind );
234 return( ::strncmp(
ident,
kind, ksize ) == 0
235 &&
ident[ksize] ==
':' );
242 const char * sep = ::strchr(
ident,
':' );
243 return( sep ? sep+1 :
ident );
249 return Edition( _solvable->evr );
255 switch ( _solvable->arch )
269 return IdString( _solvable->vendor );
275 return _solvable->repo;
300 return str::form(
"%s-%s.%s",
309 return str::form(
"%s-%s.%s (%s)",
321 return rhssolvable && ( _solvable == rhssolvable || ::solvable_identical( _solvable, rhssolvable ) );
337 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_provides );
342 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_requires );
347 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_conflicts );
352 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_obsoletes );
357 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_recommends );
362 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_suggests );
367 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_enhances );
372 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_supplements );
378 ::Offset offs = _solvable->dep_requires;
407 std::string value( caprep.
name().
c_str()+namespace_r.size()+1 );
408 value[value.size()-1] =
'\0';
418 int res = solvable_matchessolvable(
get(), attr.
id(),
static_cast<Id
>( solv.
id() ), capQueue, 0 );
421 if ( capQueue.
size() )
422 std::for_each( capQueue.
begin(), capQueue.
end(), [ &caps ](
auto cap ){ caps.insert( Capability(cap) );});
424 return std::make_pair( res == 1, std::move(caps) );
434 int invokeOnEachSupportedLocale(
Capability cap_r,
const std::function<
bool (
const Locale &)>& fnc_r )
439 switch (
detail.capRel() )
445 int res = invokeOnEachSupportedLocale(
detail.lhs(), fnc_r );
448 int res2 = invokeOnEachSupportedLocale(
detail.rhs(), fnc_r );
456 if (
detail.lhs().id() == NAMESPACE_LANGUAGE )
473 inline int invokeOnEachSupportedLocale(
Capabilities cap_r,
const std::function<
bool (
const Locale &)>& fnc_r )
476 for_( cit, cap_r.begin(), cap_r.end() )
478 int res = invokeOnEachSupportedLocale( *cit, fnc_r );
490 NoMatchIn(
const LocaleSet & locales_r ) : _locales( locales_r ) {}
492 bool operator()(
const Locale & locale_r )
const
494 return _locales.find( locale_r ) == _locales.end();
511 return invokeOnEachSupportedLocale(
dep_supplements(), [&](
const Locale & locale ){
return std::not_equal_to<Locale>()( locale, locale_r ); } ) < 0;
516 if ( locales_r.empty() )
519 return invokeOnEachSupportedLocale(
dep_supplements(), NoMatchIn(locales_r) ) < 0;
542 unsigned medianr = 0U;
543 const char * file = ::solvable_lookup_location( _solvable, &medianr );
546 else if ( ! medianr )
602 std::string riname(
name() );
603 if ( ! ri.hasLicense( riname ) )
606 if ( ri.needToAcceptLicense( riname ) || !
ui::Selectable::get( *this )->hasInstalledObj() )
607 ret = ri.getLicense( riname, lang_r );
618 std::string riname(
name() );
619 if ( ! ri.hasLicense( riname ) )
622 return ri.needToAcceptLicense( riname );
631#define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X]
648 xmlout::Node guard( str,
"solvable" );
651 *xmlout::Node( *guard,
"name" ) << obj.name();
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
#define NO_SOLVABLE_RETURN(VAL)
Store and operate with byte count.
static CheckSum md5(const std::string &checksum)
static CheckSum sha384(const std::string &checksum)
static CheckSum sha1(const std::string &checksum)
static CheckSum sha512(const std::string &checksum)
static CheckSum sha256(const std::string &checksum)
static CheckSum sha224(const std::string &checksum)
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
Store and operate on date (time_t).
Edition represents [epoch:]version[-release].
Access to the sat-pools string space.
const char * c_str() const
Conversion to const char *.
std::string asString() const
Conversion to std::string.
'Language[_Country]' codes.
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
What is known about a repository.
Capabilities dep_suggests() const
static const IdString patternToken
Indicator provides pattern().
Capabilities dep_conflicts() const
bool lookupBoolAttribute(const SolvAttr &attr) const
returns the boolean attribute value for attr or false if it does not exists.
IdString vendor() const
The vendor.
ByteCount installSize() const
Installed (unpacked) size.
Date buildtime() const
The items build time.
bool needToAcceptLicense() const
True except for well known exceptions (i.e show license but no need to accept it).
ResKind kind() const
The Solvables ResKind.
CapabilitySet providesNamespace(const std::string &namespace_r) const
Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
static const Solvable noSolvable
Represents no Solvable.
Capabilities dep_supplements() const
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
std::string distribution() const
The distribution string.
unsigned mediaNr() const
Media number the solvable is located on (0 if no media access required).
unsigned long long lookupNumAttribute(const SolvAttr &attr) const
returns the numeric attribute value for attr or 0 if it does not exists.
Capabilities dep_enhances() const
std::string lookupStrAttribute(const SolvAttr &attr) const
returns the string attribute value for attr or an empty string if it does not exists.
Capabilities dep_recommends() const
CpeId cpeId() const
The solvables CpeId if available.
Solvable nextInRepo() const
Return next Solvable in Repo (or noSolvable).
Date installtime() const
The items install time (false if not installed).
Edition edition() const
The edition (version-release).
Capabilities dep_obsoletes() const
LocaleSet getSupportedLocales() const
Return the supported locales.
detail::CSolvable * get() const
Expert backdoor.
Arch arch() const
The architecture.
bool isSystem() const
Return whether this Solvable belongs to the system repo.
Solvable nextInPool() const
Return next Solvable in Pool (or noSolvable).
std::string licenseToConfirm(const Locale &lang_r=Locale()) const
License or agreement to accept before installing the solvable (opt.
bool supportsLocales() const
Whether this Solvable claims to support locales.
std::string asUserString() const
String representation "ident-edition.arch(repo)" or "noSolvable".
std::string summary(const Locale &lang_r=Locale()) const
Short (singleline) text describing the solvable (opt.
Capabilities dep_prerequires() const
Capabilities dep_provides() const
detail::IdType lookupIdAttribute(const SolvAttr &attr) const
returns the id attribute value for attr or detail::noId if it does not exists.
std::pair< bool, CapabilitySet > matchesSolvable(const SolvAttr &attr, const sat::Solvable &solv) const
std::string name() const
The name (without any ResKind prefix).
bool supportsLocale(const Locale &locale_r) const
Whether this Solvable supports a specific Locale.
Capabilities dep_requires() const
ByteCount downloadSize() const
Download size.
std::string delnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for uninstall (opt.
CapabilitySet valuesOfNamespace(const std::string &namespace_r) const
Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
IdString ident() const
The identifier.
static const IdString productToken
Indicator provides product().
CheckSum lookupCheckSumAttribute(const SolvAttr &attr) const
returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist.
std::string description(const Locale &lang_r=Locale()) const
Long (multiline) text describing the solvable (opt.
Repository repository() const
The Repository this Solvable belongs to.
bool isKind() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::string insnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for install (opt.
bool identical(const Solvable &rhs) const
Test whether two Solvables have the same content.
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
const char * c_str() const
static const ResKind srcpackage
static ResKind explicitBuiltin(const char *str_r)
Return the builtin kind if str_r explicitly prefixed.
static const ResKind package
Helper providing more detailed information about a Capability.
Container of Capability (currently read only).
const_iterator begin() const
Iterator pointing to the first Capability.
const_iterator end() const
Iterator pointing behind the last Capability.
Orchestrator for a libsolv pool instance.
detail::CSolvable * getSolvable(detail::SolvableIdType id_r) const
Return pointer to the sat-solvable or NULL if it is not valid.
bool isSystemRepo(detail::CRepo *repo_r) const
Libsolv Id queue wrapper.
const_iterator end() const
const_iterator begin() const
static const SolvAttr cpeid
static const SolvAttr buildtime
static const SolvAttr distribution
static const SolvAttr description
static const SolvAttr delnotify
static const SolvAttr installsize
static const SolvAttr downloadsize
static const SolvAttr insnotify
static const SolvAttr summary
static const SolvAttr installtime
static const SolvAttr eula
A Solvable object within the sat Pool.
std::string lookupStrAttribute(const SolvAttr &attr) const
returns the string attribute value for attr or an empty string if it does not exists.
static const IdString ptfPackageToken
Indicator provides ptf-package().
detail::CSolvable * get() const
Expert backdoor.
Solvable()
Default ctor creates noSolvable.
std::string name() const
The name (without any ResKind prefix).
ResKind kind() const
The Solvables ResKind.
bool isKind() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static const IdString retractedToken
Indicator provides retracted-patch-package().
Capabilities dep_supplements() const
IdString ident() const
The identifier.
unsigned long long lookupNumAttribute(const SolvAttr &attr) const
returns the numeric attribute value for attr or 0 if it does not exists.
IdType id() const
Expert backdoor.
Capabilities dep_provides() const
static const Solvable noSolvable
Represents no Solvable.
detail::RepoIdType repository() const
The repo id this Solvable belongs to.
static const IdString ptfMasterToken
Indicator provides ptf().
detail::CPool * getPool() const
Explicit accessor for the raw sat-pool.
static StringPool & instance()
Access the global StringPool instance.
False false_c()
Convenience function for creating a False.
std::ostream & dumpAsXmlOn(std::ostream &str, const FileConflicts &obj)
relates: FileConflicts XML output
std::ostream & dumpOn(std::ostream &str, const LocaleSupport &obj)
relates: LocaleSupport More verbose stream output including dependencies
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
std::unordered_set< Locale > LocaleSet
std::string asUserString(VendorSupportOption opt)
converts the support option to a name intended to be printed to the user.
CLASS NAME : detail::DIWrap.
zypp::sat::detail::CSolvable CSolvable
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
zypp::sat::detail::RepoIdType RepoIdType
zypp::sat::detail::CPool CPool
zypp::sat::detail::SolvableIdType SolvableIdType
static const IdType noId(0)
static const SolvableIdType noSolvableId(0)
Id to denote Solvable::noSolvable.
static const RepoIdType noRepoId(0)
Id to denote Repo::noRepository.
zypp::sat::detail::IdType IdType
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
This file contains private API, this might break at any time between releases.
bool isKind(const Solvable &solvable_r)
relates: Solvable Test whether a Solvable is of a certain Kind.
std::unordered_set< Capability > CapabilitySet
Always-on precondition checking for NG code.
#define ZYPP_PRECONDITION(EXPR,...)
Always-on precondition check — fires in debug AND release builds.