Go to the documentation of this file.
62 _name =
IdString( ::strchr( _ident.c_str(),
':' )+1 );
108 #define NO_SOLVABLE_RETURN( VAL ) \
109 detail::CSolvable * _solvable( get() ); \
110 if ( ! _solvable ) return VAL
121 if ( nextS && nextS->repo == _solvable->repo )
132 const char * s = ::solvable_lookup_str( _solvable,
attr.id() );
133 return s ? s : std::string();
142 s = ::solvable_lookup_str_poollang( _solvable,
attr.id() );
148 if ( (s = ::solvable_lookup_str_lang( _solvable,
attr.id(), l.c_str(), 0 )) )
152 s = ::solvable_lookup_str_lang( _solvable,
attr.id(), 0, 0 );
154 return s ? s : std::string();
160 return ::solvable_lookup_num( _solvable,
attr.id(), 0 );
166 return ::solvable_lookup_num( _solvable,
attr.id(), notfound_r );
172 return ::solvable_lookup_bool( _solvable,
attr.id() );
178 return ::solvable_lookup_id( _solvable,
attr.id() );
185 const char * s = ::solvable_lookup_checksum( _solvable,
attr.id(), &chksumtype );
188 switch ( chksumtype )
197 return CheckSum( std::string(), s );
205 static const SolvAttr susetagsDatadir(
"susetags:datadir" );
210 if ( ! datadir.empty() )
211 ret = datadir.begin().asString();
214 LookupAttr datadir( susetagsDatadir, repor_r );
215 if ( ! datadir.empty() )
216 ret = datadir.begin().asString();
228 const char * file = ::solvable_lookup_location( _solvable, &medianr );
237 switch (
repository().info().type().toEnum() )
242 if ( ! path.
empty() )
278 switch ( _solvable->arch )
293 const char * sep = ::strchr(
ident,
':' );
306 switch ( _solvable->arch )
318 return( ::strchr(
ident,
':' ) == 0 );
323 unsigned ksize = ::strlen(
kind );
324 return( ::strncmp(
ident,
kind, ksize ) == 0
325 &&
ident[ksize] ==
':' );
332 const char * sep = ::strchr(
ident,
':' );
333 return( sep ? sep+1 :
ident );
339 return Edition( _solvable->evr );
345 switch ( _solvable->arch )
359 return IdString( _solvable->vendor );
452 return rhssolvable && ( _solvable == rhssolvable || ::solvable_identical( _solvable, rhssolvable ) );
468 return _getCapabilities( _solvable->repo->idarraydata, _solvable->provides );
473 return _getCapabilities( _solvable->repo->idarraydata, _solvable->requires );
478 return _getCapabilities( _solvable->repo->idarraydata, _solvable->conflicts );
483 return _getCapabilities( _solvable->repo->idarraydata, _solvable->obsoletes );
488 return _getCapabilities( _solvable->repo->idarraydata, _solvable->recommends );
493 return _getCapabilities( _solvable->repo->idarraydata, _solvable->suggests );
498 return _getCapabilities( _solvable->repo->idarraydata, _solvable->enhances );
503 return _getCapabilities( _solvable->repo->idarraydata, _solvable->supplements );
509 ::Offset offs = _solvable->requires;
522 if (
str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) ==
'(' )
536 if (
str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) ==
'(' )
538 std::string value( caprep.name().c_str()+namespace_r.size()+1 );
539 value[value.size()-1] =
'\0';
540 ret.insert(
Capability( value, caprep.op(), caprep.ed() ) );
549 int res = solvable_matchessolvable(
get(),
attr.id(), static_cast<Id>( solv.
id() ), capQueue, 0 );
552 if ( capQueue.
size() )
553 std::for_each( capQueue.
begin(), capQueue.
end(), [ &caps ](
auto cap ){ caps.insert(
Capability(cap) );});
555 return std::make_pair( res == 1, std::move(caps) );
565 int invokeOnEachSupportedLocale(
Capability cap_r,
function<
bool (
const Locale &)> fnc_r )
570 switch ( detail.capRel() )
576 int res = invokeOnEachSupportedLocale( detail.lhs(), fnc_r );
579 int res2 = invokeOnEachSupportedLocale( detail.rhs(), fnc_r );
587 if ( detail.lhs().id() == NAMESPACE_LANGUAGE )
589 return ( !fnc_r || fnc_r(
Locale(
IdString(detail.rhs().id()) ) ) ) ? 1 : -1;
606 inline int invokeOnEachSupportedLocale( Capabilities cap_r,
function<
bool (Locale)> fnc_r )
609 for_( cit, cap_r.begin(), cap_r.end() )
611 int res = invokeOnEachSupportedLocale( *cit, fnc_r );
625 bool operator()(
const Locale & locale_r )
const
644 return invokeOnEachSupportedLocale(
supplements(), bind( std::not_equal_to<Locale>(), locale_r, _1 ) ) < 0;
649 if ( locales_r.empty() )
652 return invokeOnEachSupportedLocale(
supplements(), NoMatchIn(locales_r) ) < 0;
661 invokeOnEachSupportedLocale(
supplements(), functor::collector( std::inserter( ret, ret.begin() ) ) );
675 unsigned medianr = 0U;
676 const char * file = ::solvable_lookup_location( _solvable, &medianr );
679 else if ( ! medianr )
730 if ( ret.empty() && isKind<Product>() )
733 std::string riname(
name() );
746 if ( isKind<Product>() )
749 std::string riname(
name() );
762 return str << (obj.
isSystem() ?
"systemSolvable" :
"noSolvable" );
764 return str <<
"(" << obj.
id() <<
")"
766 <<
'-' << obj.
edition() <<
'.' << obj.
arch() <<
"("
775 #define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X]
Date installtime() const
The items install time (false if not installed).
RAII writing a nodes start/end tag.
bool isRetracted() const
Whether this solvable is retracted (provides retractedToken).
bool isOnSystemByUser(IdString ident_r) const
bool lookupBoolAttribute(const SolvAttr &attr) const
returns the boolean attribute value for attr or false if it does not exists.
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
A Solvable object within the sat Pool.
std::string description(const Locale &lang_r=Locale()) const
Long (multiline) text describing the solvable (opt.
OnMediaLocation lookupLocation() const
returns OnMediaLocation data: This is everything we need to download e.g.
IdType id() const
Expert backdoor.
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
std::string alias() const
Short unique string to identify a repo.
static CheckSum sha256(const std::string &checksum)
static const SolvAttr installtime
ResKind kind() const
The Solvables ResKind.
#define NO_SOLVABLE_RETURN(VAL)
Capabilities provides() const
RepoInfo repoInfo() const
The repositories RepoInfo.
const char * c_str() const
Conversion to const char *
What is known about a repository.
static const IdString ptfToken
Indicator provides ptf()
static const IdType noId(0)
std::ostream & operator<<(std::ostream &str, const Solvable &obj)
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
const_iterator begin() const
Iterator pointing to the first Capability.
Capabilities supplements() const
std::string asUserString() const
User string: label (alias or name)
detail::IdType lookupIdAttribute(const SolvAttr &attr) const
returns the id attribute value for attr or detail::noId if it does not exists.
LocaleSet getSupportedLocales() const
Return the supported locales.
Capabilities recommends() const
Edition represents [epoch:]version[-release]
ByteCount downloadSize() const
Download size.
static const ResKind package
static PoolImpl & myPool()
const_iterator begin() const
std::string delnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for uninstall (opt.
static CheckSum sha384(const std::string &checksum)
Repository repository() const
The Repository this Solvable belongs to.
bool identical(const Solvable &rhs) const
Test whether two Solvables have the same content.
static const SolvAttr insnotify
std::string distribution() const
The distribution string.
Capabilities enhances() const
Store and operate with byte count.
std::string asString() const
Conversion to std::string
static const Solvable noSolvable
Represents no Solvable.
static CheckSum sha1(const std::string &checksum)
Access to the sat-pools string space.
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
static CheckSum sha512(const std::string &checksum)
ByteCount installSize() const
Installed (unpacked) size.
Solvable nextInRepo() const
Return next Solvable in Repo (or noSolvable).
std::unordered_set< Capability > CapabilitySet
bool isNeedreboot(const Solvable &solv_r) const
Whether solv_r matches the spec.
unsigned long long lookupNumAttribute(const SolvAttr &attr) const
returns the numeric attribute value for attr or 0 if it does not exists.
CapabilitySet valuesOfNamespace(const std::string &namespace_r) const
Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
bool onSystemByAuto() const
Whether this is known to be automatically installed (as dependency of a user request package).
std::string asUserString() const
String representation "ident-edition.arch(repo)" or "noSolvable".
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
CSolvable * getSolvable(SolvableIdType id_r) const
Return pointer to the sat-solvable or NULL if it is not valid.
bool identIsAutoInstalled() const
Whether an installed solvable with the same ident is flagged as AutoInstalled.
Arch arch() const
The architecture.
bool isKind() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Edition edition() const
The edition (version-release).
CheckSum lookupCheckSumAttribute(const SolvAttr &attr) const
returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist.
std::ostream & dumpOn(std::ostream &str, const Solvable &obj)
CapabilitySet providesNamespace(const std::string &namespace_r) const
Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
const_iterator end() const
Iterator pointing behind the last Capability.
unsigned mediaNr() const
Media number the solvable is located on (0 if no media access required).
bool multiversionInstall() const
Whether different versions of this package can be installed at the same time.
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
int IdType
Generic Id type.
Capabilities requires() const
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
static const SolvAttr downloadsize
Solvable nextInPool() const
Return next Solvable in Pool (or noSolvable).
Easy-to use interface to the ZYPP dependency resolver.
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
static const SolvAttr delnotify
bool hasLicense() const
Whether there is a license associated with the repo.
bool contains(const Capability &lhs) const
Return whether the set contains lhs (the Id)
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
Libsolv Id queue wrapper.
static const SolvAttr installsize
Lightweight repository attribute value lookup.
std::string lookupStrAttribute(const SolvAttr &attr) const
returns the string attribute value for attr or an empty string if it does not exists.
detail::CSolvable * get() const
Expert backdoor.
IdType id() const
Expert backdoor.
CpeId cpeId() const
The solvables CpeId if available.
bool supportsRequestedLocales() const
Whether this Solvable supports at least one requested locale.
static const SolvAttr checksum
bool isNeedreboot() const
Whether this solvable triggers the reboot-needed hint if installed/updated.
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 SolvAttr buildtime
bool isSystem() const
Return whether this Solvable belongs to the system repo.
std::string summary(const Locale &lang_r=Locale()) const
Short (singleline) text describing the solvable (opt.
const LocaleSet & _locales
static const Repository noRepository
Represents no Repository.
std::string insnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for install (opt.
std::ostream & dumpAsXmlOn(std::ostream &str, const Solvable &obj)
::s_Solvable CSolvable
Wrapped libsolv C data type exposed as backdoor.
bool supportsLocale(const Locale &locale_r) const
Whether this Solvable supports a specific Locale.
static const SolvAttr description
static const ResKind srcpackage
bool isSystemRepo(CRepo *repo_r) const
bool isMultiversion(const Solvable &solv_r) const
Store and operate on date (time_t).
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
static const SolvAttr cpeid
Solvable()
Default ctor creates noSolvable.
Capabilities conflicts() const
bool empty() const
Test for an empty path.
False false_c()
Convenience function for creating a False.
std::unordered_set< Locale > LocaleSet
static CheckSum md5(const std::string &checksum)
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
Capabilities obsoletes() const
bool onSystemByUser() const
Whether this is known to be installed on behalf of a user request.
static const SolvAttr distribution
Capabilities prerequires() const
bool needToAcceptLicense() const
True except for well known exceptions (i.e show license but no need to accept it).
bool needToAcceptLicense() const
Whether the repo license has to be accepted, e.g.
Date buildtime() const
The items build time.
std::string licenseToConfirm(const Locale &lang_r=Locale()) const
License or agreement to accept before installing the solvable (opt.
static const SolvAttr eula
bool isPtf() const
Whether this solvable is a PTF (provides ptfToken).
String related utilities and Regular expression matching.
RepoInfo info() const
Return any associated RepoInfo.
const char * c_str() const
bool supportsLocales() const
Whether this Solvable claims to support locales.
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
static const SolvAttr summary
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
std::pair< bool, CapabilitySet > matchesSolvable(const SolvAttr &attr, const sat::Solvable &solv) const
const_iterator end() const
static const IdString retractedToken
Indicator provides retracted-patch-package()
static CheckSum sha224(const std::string &checksum)
'Language[_Country]' codes.
std::string name() const
The name (without any ResKind prefix).
Resolvable kinds. A lowercased string and used as identification. Comparison against string values is...
Container of Capability (currently read only).
Lightweight attribute value lookup.
static ResKind explicitBuiltin(const char *str_r)
Return the builtin kind if str_r explicitly prefixed.
IdString vendor() const
The vendor.
Helper providing more detailed information about a Capability.
std::string getLicense(const Locale &lang_r=Locale()) const
Return the best license for the current (or a specified) locale.
Capabilities suggests() const
bool isOnSystemByAuto(IdString ident_r) const
IdString ident() const
The identifier.