28#include <zypp-core/OnMediaLocation>
44 void _doSplit( IdString & _ident, ResKind & _kind, IdString & _name )
63 _name =
IdString( ::strchr( _ident.c_str(),
':' )+1 );
110#define NO_SOLVABLE_RETURN( VAL ) \
111 detail::CSolvable * _solvable( get() ); \
112 if ( ! _solvable ) return VAL
123 if (
nextS &&
nextS->repo == _solvable->repo )
134 const char *
s = ::solvable_lookup_str( _solvable,
attr.id() );
135 return s ?
s : std::string();
144 s = ::solvable_lookup_str_poollang( _solvable,
attr.id() );
150 if ( (
s = ::solvable_lookup_str_lang( _solvable,
attr.id(),
l.c_str(), 0 )) )
154 s = ::solvable_lookup_str_lang( _solvable,
attr.id(), 0, 0 );
156 return s ?
s : std::string();
162 return ::solvable_lookup_num( _solvable,
attr.id(), 0 );
174 return ::solvable_lookup_bool( _solvable,
attr.id() );
180 return ::solvable_lookup_id( _solvable,
attr.id() );
187 const char *
s = ::solvable_lookup_checksum( _solvable,
attr.id(), &chksumtype );
190 switch ( chksumtype )
212 if ( ! datadir.empty() )
213 ret = datadir.begin().asString();
217 if ( ! datadir.empty() )
218 ret = datadir.begin().asString();
229 unsigned medianr = 0;
230 const char * file = ::solvable_lookup_location( _solvable, &medianr );
239 switch (
repository().info().type().toEnum() )
244 if ( ! path.
empty() )
260 ret.setLocation ( path/file, medianr );
280 switch ( _solvable->arch )
295 const char *
sep = ::strchr(
ident,
':' );
308 switch ( _solvable->arch )
320 return( ::strchr(
ident,
':' ) == 0 );
334 const char *
sep = ::strchr(
ident,
':' );
341 return Edition( _solvable->evr );
347 switch ( _solvable->arch )
361 return IdString( _solvable->vendor );
377 return myPool().isSystemRepo( _solvable->repo );
398 return myPool().isNeedreboot( *
this );
409 return myPool().isRetracted( *
this );
421 return myPool().isPtfMaster( *
this );
427 return myPool().isPtfPackage( *
this );
434 return myPool().isMultiversion( *
this );
488 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_provides );
493 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_requires );
498 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_conflicts );
503 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_obsoletes );
508 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_recommends );
513 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_suggests );
518 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_enhances );
523 return _getCapabilities( _solvable->repo->idarraydata, _solvable->dep_supplements );
529 ::Offset
offs = _solvable->dep_requires;
534#if __cplusplus < 202002L
535#define DECLARE_CAP_FWD(_Fnc_Name) \
536 Capabilities Solvable::_Fnc_Name() const \
537 { return dep_##_Fnc_Name(); }
547#undef DECLARE_CAP_FWD
575 value[value.size()-1] =
'\0';
591 return std::make_pair(
res == 1, std::move(
caps) );
606 switch ( detail.capRel() )
640 inline int invokeOnEachSupportedLocale( Capabilities cap_r,
const function<
bool (Locale)>& fnc_r )
643 for_( cit, cap_r.begin(), cap_r.end() )
645 int res = invokeOnEachSupportedLocale( *cit, fnc_r );
659 bool operator()(
const Locale & locale_r )
const
709 unsigned medianr = 0
U;
710 const char * file = ::solvable_lookup_location( _solvable, &medianr );
713 else if ( ! medianr )
787 return ri.needToAcceptLicense(
riname );
796 return str << (
obj.isSystem() ?
"systemSolvable" :
"noSolvable" );
798 return str <<
"(" <<
obj.id() <<
")"
800 <<
'-' <<
obj.edition() <<
'.' <<
obj.arch() <<
"("
801 <<
obj.repository().alias() <<
")";
809#define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X]
#define DECLARE_CAP_FWD(_Fnc_Name)
const LocaleSet & _locales
#define NO_SOLVABLE_RETURN(VAL)
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Store and operate with byte count.
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
Helper providing more detailed information about a Capability.
Container of Capability (currently read only).
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...
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
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.
What is known about a repository.
void setProbedType(const repo::RepoType &t) const
This allows to adjust the RepoType lazy, from NONE to some probed value, even for const objects.
static const Repository noRepository
Represents no Repository.
RepoInfo info() const
Return any associated RepoInfo.
static const ResKind srcpackage
static ResKind explicitBuiltin(const char *str_r)
Return the builtin kind if str_r explicitly prefixed.
static const ResKind package
bool empty() const
Test for an empty path.
Lightweight attribute value lookup.
Lightweight repository attribute value lookup.
Libsolv Id queue wrapper.
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 checksum
static const SolvAttr updateStatus
static const SolvAttr installtime
static const SolvAttr eula
A Solvable object within the sat Pool.
bool isPtfPackage() const
Subset of isPtf (provides ptfPackageToken).
bool isNeedreboot() const
Whether this solvable triggers the reboot-needed hint if installed/updated.
Capabilities supplements() const ZYPP_DEPRECATED
bool identIsAutoInstalled() const
Whether an installed solvable with the same ident is flagged as AutoInstalled.
OnMediaLocation lookupLocation() const
returns OnMediaLocation data: This is everything we need to download e.g.
Capabilities dep_suggests() const
Capabilities dep_conflicts() const
bool lookupBoolAttribute(const SolvAttr &attr) const
returns the boolean attribute value for attr or false if it does not exists.
std::ostream & operator<<(std::ostream &str, const Solvable &obj) ZYPP_API
Stream output.
IdString vendor() const
The vendor.
Capabilities recommends() const ZYPP_DEPRECATED
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).
std::ostream & dumpOn(std::ostream &str, const Solvable &obj) ZYPP_API
More verbose stream output including dependencies.
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".
Capabilities suggests() const ZYPP_DEPRECATED
std::string distribution() const
The distribution string.
unsigned mediaNr() const
Media number the solvable is located on (0 if no media access required).
bool isBlacklisted() const
Whether this solvable is blacklisted (retracted,ptf,...).
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
Capabilities conflicts() const ZYPP_DEPRECATED
bool multiversionInstall() const
Whether different versions of this package can be installed at the same time.
std::ostream & dumpAsXmlOn(std::ostream &str, const Solvable &obj) ZYPP_API
XML output.
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).
static const IdString ptfMasterToken
Indicator provides ptf()
Capabilities prerequires() const
bool isPtfMaster() const
Subset of isPtf (provides ptfMasterToken).
Solvable()
Default ctor creates noSolvable.
Capabilities dep_obsoletes() const
LocaleSet getSupportedLocales() const
Return the supported locales.
bool supportsRequestedLocales() const
Whether this Solvable supports at least one requested locale.
detail::CSolvable * get() const
Expert backdoor.
Arch arch() const
The architecture.
static const IdString ptfPackageToken
Indicator provides ptf-package()
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".
static const IdString retractedToken
Indicator provides retracted-patch-package()
Capabilities obsoletes() const ZYPP_DEPRECATED
std::string summary(const Locale &lang_r=Locale()) const
Short (singleline) text describing the solvable (opt.
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.
bool onSystemByAuto() const
Whether this is known to be automatically installed (as dependency of a user request package).
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.
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.
bool onSystemByUser() const
Whether this is known to be installed on behalf of a user request.
Capabilities provides() const ZYPP_DEPRECATED
RepoInfo repoInfo() const
The repositories RepoInfo.
Capabilities enhances() const ZYPP_DEPRECATED
Repository repository() const
The Repository this Solvable belongs to.
bool isPtf() const
Whether this solvable belongs to a PTF (provides ptfMasterToken or ptfPackageToken).
bool isRetracted() const
Whether this solvable is retracted (provides retractedToken).
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.
String related utilities and Regular expression matching.
False false_c()
Convenience function for creating a False.
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
static const IdType noId(0)
int IdType
Generic Id type.
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Locale > LocaleSet
std::unordered_set< Capability > CapabilitySet
static PoolImpl & myPool()
RAII writing a nodes start/end tag.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.