45 const auto id = s.
id();
48 ZYPP_PRECONDITION( cp->solvables[
id].repo,
"Solvable has no repo — already freed?" );
50 return *
static_cast<Pool *
>( cp->appdata );
54 const auto id = s.
id();
57 ZYPP_PRECONDITION( cp->solvables[
id].repo,
"Solvable has no repo — already freed?" );
59 return *
static_cast<const Pool *
>( cp->appdata );
84#define NO_SOLVABLE_RETURN( VAL ) \
85 detail::CSolvable * _solvable( get() ); \
86 if ( ! _solvable ) return VAL
100 if ( nextS && nextS->repo == _solvable->repo )
111 const char * s = ::solvable_lookup_str( _solvable, attr.
id() );
112 return s ? s : std::string();
121 s = ::solvable_lookup_str_poollang( _solvable, attr.
id() );
127 if ( (s = ::solvable_lookup_str_lang( _solvable, attr.
id(), l.c_str(), 0 )) )
131 s = ::solvable_lookup_str_lang( _solvable, attr.
id(), 0, 0 );
133 return s ? s : std::string();
139 return ::solvable_lookup_num( _solvable, attr.
id(), 0 );
145 return ::solvable_lookup_num( _solvable, attr.
id(), notfound_r );
151 return ::solvable_lookup_bool( _solvable, attr.
id() );
157 return ::solvable_lookup_id( _solvable, attr.
id() );
164 const char * s = ::solvable_lookup_checksum( _solvable, attr.
id(), &chksumtype );
167 switch ( chksumtype )
189 switch ( _solvable->arch )
204 const char * sep = ::strchr(
ident,
':' );
217 switch ( _solvable->arch )
229 return( ::strchr(
ident,
':' ) == 0 );
234 unsigned ksize = ::strlen(
kind );
235 return( ::strncmp(
ident,
kind, ksize ) == 0
236 &&
ident[ksize] ==
':' );
243 const char * sep = ::strchr(
ident,
':' );
244 return( sep ? sep+1 :
ident );
250 return Edition( _solvable->evr );
256 switch ( _solvable->arch )
270 return IdString( _solvable->vendor );
276 return _solvable->repo;
301 return str::form(
"%s-%s.%s",
310 return str::form(
"%s-%s.%s (%s)",
322 return rhssolvable && ( _solvable == rhssolvable || ::solvable_identical( _solvable, rhssolvable ) );
338 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_provides );
343 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_requires );
348 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_conflicts );
353 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_obsoletes );
358 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_recommends );
363 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_suggests );
368 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_enhances );
373 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_supplements );
379 ::Offset offs = _solvable->dep_requires;
388 const auto &providesPredicate = []( std::string_view namespace_r ) {
396 | ranges::views::filter( providesPredicate(namespace_r) )
410 std::string value( caprep.
name().
c_str()+namespace_r.size()+1 );
411 value[value.size()-1] =
'\0';
421 int res = solvable_matchessolvable(
get(), attr.
id(),
static_cast<Id
>( solv.
id() ), capQueue, 0 );
424 if ( capQueue.
size() )
425 std::for_each( capQueue.
begin(), capQueue.
end(), [ &caps ](
auto cap ){ caps.insert( Capability(cap) );});
427 return std::make_pair( res == 1, std::move(caps) );
437 int invokeOnEachSupportedLocale(
Capability cap_r,
const std::function<
bool (
const Locale &)>& fnc_r )
442 switch (
detail.capRel() )
448 int res = invokeOnEachSupportedLocale(
detail.lhs(), fnc_r );
451 int res2 = invokeOnEachSupportedLocale(
detail.rhs(), fnc_r );
459 if (
detail.lhs().id() == NAMESPACE_LANGUAGE )
476 inline int invokeOnEachSupportedLocale(
Capabilities cap_r,
const std::function<
bool (
const Locale &)>& fnc_r )
479 for_( cit, cap_r.begin(), cap_r.end() )
481 int res = invokeOnEachSupportedLocale( *cit, fnc_r );
493 NoMatchIn(
const LocaleSet & locales_r ) : _locales( locales_r ) {}
495 bool operator()(
const Locale & locale_r )
const
497 return _locales.find( locale_r ) == _locales.end();
514 return invokeOnEachSupportedLocale(
dep_supplements(), [&](
const Locale & locale ){
return std::not_equal_to<Locale>()( locale, locale_r ); } ) < 0;
519 if ( locales_r.empty() )
522 return invokeOnEachSupportedLocale(
dep_supplements(), NoMatchIn(locales_r) ) < 0;
545 unsigned medianr = 0U;
546 const char * file = ::solvable_lookup_location( _solvable, &medianr );
549 else if ( ! medianr )
605 std::string riname(
name() );
606 if ( ! ri.hasLicense( riname ) )
609 if ( ri.needToAcceptLicense( riname ) || !
ui::Selectable::get( *this )->hasInstalledObj() )
610 ret = ri.getLicense( riname, lang_r );
621 std::string riname(
name() );
622 if ( ! ri.hasLicense( riname ) )
625 return ri.needToAcceptLicense( riname );
634#define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X]
651 xmlout::Node guard( str,
"solvable" );
654 *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.
Namespace routing for C++20 ranges and C++23 ranges::to<T>() backport.