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;
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 ) {
391 return (
zypp::str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) ==
'(' );
396 | ranges::views::filter( providesPredicate(namespace_r) )
397 | ranges::to<CapabilitySet>();
408 if (
zypp::str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) ==
'(' )
410 std::string value( caprep.name().c_str()+namespace_r.size()+1 );
411 value[value.size()-1] =
'\0';
412 ret.insert(
Capability( value, caprep.op(), caprep.ed() ) );
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 )
461 return ( !fnc_r || fnc_r(
Locale(
IdString(detail.rhs().id()) ) ) ) ? 1 : -1;
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 );
495 bool operator()(
const Locale & locale_r )
const 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 )
602 if ( ret.empty() && isKind<Product>() )
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 );
618 if ( isKind<Product>() )
621 std::string riname(
name() );
622 if ( ! ri.hasLicense( riname ) )
625 return ri.needToAcceptLicense( riname );
629 std::ostream &
dumpOn( std::ostream &
str,
const Solvable & obj )
634 #define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X] 649 std::ostream &
dumpAsXmlOn( std::ostream &
str,
const Solvable & obj )
651 xmlout::Node guard(
str,
"solvable" );
654 *xmlout::Node( *guard,
"name" ) << obj.name();
static const SolvableIdType noSolvableId(0)
Id to denote Solvable::noSolvable.
IdString vendor() const
The vendor.
detail::CSolvable * getSolvable(detail::SolvableIdType id_r) const
Return pointer to the sat-solvable or NULL if it is not valid.
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.
bool supportsLocales() const
Whether this Solvable claims to support locales.
static const ResKind package
Capabilities dep_supplements() const
Capabilities dep_conflicts() const
Arch arch() const
The architecture.
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
zypp::sat::detail::CSolvable CSolvable
static const IdString ptfPackageToken
Indicator provides ptf-package()
static ResKind explicitBuiltin(const char *str_r)
Return the builtin kind if str_r explicitly prefixed.
zypp::CheckSum lookupCheckSumAttribute(const SolvAttr &attr) const
returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist...
Store and operate with byte count.
CpeId cpeId() const
The solvables CpeId if available.
std::unordered_set< Locale > LocaleSet
Capabilities dep_enhances() const
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
static const RepoIdType noRepoId(0)
Id to denote Repo::noRepository.
detail::CPool * getPool() const
Explicit accessor for the raw sat-pool.
bool isSystemRepo(detail::CRepo *repo_r) const
Solvable nextInRepo() const
Return next Solvable in Repo (or noSolvable).
String related utilities and Regular expression matching.
bool lookupBoolAttribute(const SolvAttr &attr) const
returns the boolean attribute value for attr or false if it does not exists.
What is known about a repository.
std::ostream & dumpOn(std::ostream &str, const Queue &obj)
relates: Queue Stream output assuming a Solvable queue.
static const ResKind srcpackage
Capabilities dep_obsoletes() const
Access to the sat-pools string space.
std::string name() const
The name (without any ResKind prefix).
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
Orchestrator for a libsolv pool instance.
bool needToAcceptLicense() const
True except for well known exceptions (i.e show license but no need to accept it).
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Edition represents [epoch:]version[-release]
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
zypp::sat::detail::CPool CPool
static const IdString patternToken
Indicator provides pattern()
CapabilitySet providesNamespace(const std::string &namespace_r) const
Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
unsigned long long lookupNumAttribute(const SolvAttr &attr) const
returns the numeric attribute value for attr or 0 if it does not exists.
detail::IdType lookupIdAttribute(const SolvAttr &attr) const
returns the id attribute value for attr or detail::noId if it does not exists.
std::string asUserString(VendorSupportOption opt)
converts the support option to a name intended to be printed to the user.
ResKind kind() const
The Solvables ResKind.
static CheckSum md5(const std::string &checksum)
zypp::sat::detail::SolvableIdType SolvableIdType
Solvable nextInPool() const
Return next Solvable in Pool (or noSolvable).
static StringPool & instance()
Access the global StringPool instance.
const_iterator begin() const
Iterator pointing to the first Capability.
std::string distribution() const
The distribution string.
bool identical(const Solvable &rhs) const
Test whether two Solvables have the same content.
std::unordered_set< Locale > LocaleSet
False false_c()
Convenience function for creating a False.
Store and operate on date (time_t).
zypp::Date buildtime() const
The items build time.
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
bool isSystem() const
Return whether this Solvable belongs to the system repo.
Capabilities dep_prerequires() const
Container of Capability (currently read only).
static CheckSum sha224(const std::string &checksum)
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
unsigned mediaNr() const
Media number the solvable is located on (0 if no media access required).
Helper providing more detailed information about a Capability.
detail::CSolvable * get() const
Expert backdoor.
Edition edition() const
The edition (version-release).
Solvable()
Default ctor creates noSolvable.
std::pair< bool, CapabilitySet > matchesSolvable(const SolvAttr &attr, const Solvable &solv) const
Capabilities dep_provides() const
zypp::ByteCount downloadSize() const
Download size.
const_iterator begin() const
const char * c_str() const
Conversion to const char *
std::unordered_set< Capability > CapabilitySet
zypp::sat::detail::IdType IdType
IdType id() const
Expert backdoor.
static CheckSum sha256(const std::string &checksum)
Namespace routing for C++20 ranges and C++23 ranges::to<T>() backport.
'Language[_Country]' codes.
std::ostream & dumpAsXmlOn(std::ostream &str, const Repository &obj)
relates: Repository XML output
static const IdString retractedToken
Indicator provides retracted-patch-package()
std::string description(const Locale &lang_r=Locale()) const
Long (multiline) text describing the solvable (opt.
CapabilitySet valuesOfNamespace(const std::string &namespace_r) const
Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
Libsolv Id queue wrapper.
std::string licenseToConfirm(const Locale &lang_r=Locale()) const
License or agreement to accept before installing the solvable (opt.
zypp::ByteCount installSize() const
Installed (unpacked) size.
Capabilities dep_recommends() const
detail::RepoIdType repository() const
The repo id this Solvable belongs to.
LocaleSet getSupportedLocales() const
Return the supported locales.
const_iterator end() const
std::string summary(const Locale &lang_r=Locale()) const
Short (singleline) text describing the solvable (opt.
static const Solvable noSolvable
Represents no Solvable.
zypp::Date installtime() const
The items install time (false if not installed).
Capabilities dep_requires() const
const_iterator end() const
Iterator pointing behind the last Capability.
static const IdType noId(0)
const LocaleSet & _locales
#define ZYPP_PRECONDITION(EXPR,...)
Always-on precondition check — fires in debug AND release builds.
IdString ident() const
The identifier.
static CheckSum sha384(const std::string &checksum)
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
static const IdString ptfMasterToken
Indicator provides ptf()
static CheckSum sha1(const std::string &checksum)
Capabilities dep_suggests() const
static const IdString productToken
Indicator provides product()
std::string asString() const
Conversion to std::string
static CheckSum sha512(const std::string &checksum)
std::string delnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for uninstall (opt.
std::string insnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for install (opt.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
bool supportsLocale(const Locale &locale_r) const
Whether this Solvable supports a specific Locale.
const char * c_str() const
Always-on precondition checking for NG code.
zypp::sat::detail::RepoIdType RepoIdType
#define NO_SOLVABLE_RETURN(VAL)