43 void _doSplit( IdString & _ident, ResKind & _kind, IdString & _name )
57 _ident = IdString(
str::form(
"%s:%s", _kind.c_str(), _ident.c_str() ) );
62 _name = IdString( ::strchr( _ident.c_str(),
':' )+1 );
74 { _doSplit( _ident, _kind, _name ); }
78 { _doSplit( _ident, _kind, _name ); }
82 { _doSplit( _ident, _kind, _name ); }
87 { _doSplit( _ident, _kind, _name ); }
92 { _doSplit( _ident, _kind, _name ); }
105 #define NO_SOLVABLE_RETURN( VAL ) \ 106 detail::CSolvable * _solvable( get() ); \ 107 if ( ! _solvable ) return VAL 118 if ( nextS && nextS->repo == _solvable->repo )
129 const char * s = ::solvable_lookup_str( _solvable, attr.
id() );
130 return s ? s : std::string();
139 s = ::solvable_lookup_str_poollang( _solvable, attr.
id() );
144 if ( (s = ::solvable_lookup_str_lang( _solvable, attr.
id(), l.c_str(), 0 )) )
147 s = ::solvable_lookup_str_lang( _solvable, attr.
id(), 0, 0 );
149 return s ? s : std::string();
155 return ::solvable_lookup_num( _solvable, attr.
id(), 0 );
161 return ::solvable_lookup_num( _solvable, attr.
id(), notfound_r );
167 return ::solvable_lookup_bool( _solvable, attr.
id() );
173 return ::solvable_lookup_id( _solvable, attr.
id() );
180 const char * s = ::solvable_lookup_checksum( _solvable, attr.
id(), &chksumtype );
183 switch ( chksumtype )
192 return CheckSum( std::string(), s );
200 static const SolvAttr susetagsDatadir(
"susetags:datadir" );
205 if ( ! datadir.
empty() )
209 LookupAttr datadir( susetagsDatadir, repor_r );
210 if ( ! datadir.
empty() )
223 const char * file = ::solvable_lookup_location( _solvable, &medianr );
232 switch (
repository().info().type().toEnum() )
237 if ( ! path.
empty() )
273 switch ( _solvable->arch )
288 const char * sep = ::strchr( ident,
':' );
293 return ResKind( std::string( ident, sep-ident ) );
301 switch ( _solvable->arch )
313 return( ::strchr( ident,
':' ) == 0 );
318 unsigned ksize = ::strlen( kind );
319 return( ::strncmp( ident, kind, ksize ) == 0
320 && ident[ksize] ==
':' );
327 const char * sep = ::strchr( ident,
':' );
328 return( sep ? sep+1 : ident );
334 return Edition( _solvable->evr );
340 switch ( _solvable->arch )
354 return IdString( _solvable->vendor );
419 return rhssolvable && ( _solvable == rhssolvable || ::solvable_identical( _solvable, rhssolvable ) );
427 return offs_r ?
Capabilities( idarraydata_r + offs_r ) : Capabilities();
435 return _getCapabilities( _solvable->repo->idarraydata, _solvable->provides );
440 return _getCapabilities( _solvable->repo->idarraydata, _solvable->requires );
445 return _getCapabilities( _solvable->repo->idarraydata, _solvable->conflicts );
450 return _getCapabilities( _solvable->repo->idarraydata, _solvable->obsoletes );
455 return _getCapabilities( _solvable->repo->idarraydata, _solvable->recommends );
460 return _getCapabilities( _solvable->repo->idarraydata, _solvable->suggests );
465 return _getCapabilities( _solvable->repo->idarraydata, _solvable->enhances );
470 return _getCapabilities( _solvable->repo->idarraydata, _solvable->supplements );
476 ::Offset offs = _solvable->requires;
489 if (
str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) ==
'(' )
503 if (
str::hasPrefix( caprep.name().c_str(), namespace_r ) && *(caprep.name().c_str()+namespace_r.size()) ==
'(' )
505 std::string value( caprep.name().c_str()+namespace_r.size()+1 );
506 value[value.size()-1] =
'\0';
507 ret.insert(
Capability( value, caprep.op(), caprep.ed() ) );
520 int invokeOnEachSupportedLocale(
Capability cap_r,
function<
bool (
const Locale &)> fnc_r )
525 switch ( detail.
capRel() )
531 int res = invokeOnEachSupportedLocale( detail.
lhs(), fnc_r );
534 int res2 = invokeOnEachSupportedLocale( detail.
rhs(), fnc_r );
542 if ( detail.
lhs().
id() == NAMESPACE_LANGUAGE )
561 inline int invokeOnEachSupportedLocale(
Capabilities cap_r,
function<
bool (
Locale)> fnc_r )
566 int res = invokeOnEachSupportedLocale( *cit, fnc_r );
580 bool operator()(
const Locale & locale_r )
const 599 return invokeOnEachSupportedLocale(
supplements(), bind( std::not_equal_to<Locale>(), locale_r, _1 ) ) < 0;
604 if ( locales_r.empty() )
607 return invokeOnEachSupportedLocale(
supplements(), NoMatchIn(locales_r) ) < 0;
616 invokeOnEachSupportedLocale(
supplements(), functor::collector( std::inserter( ret, ret.begin() ) ) );
678 if ( ret.empty() && isKind<Product>() )
697 return str << (obj.
isSystem() ?
"systemSolvable" :
"noSolvable" );
699 return str <<
"(" << obj.
id() <<
")" 701 <<
'-' << obj.
edition() <<
'.' << obj.
arch() <<
"(" 710 #define OUTS(X) if ( ! obj[Dep::X].empty() ) str << endl << " " #X " " << obj[Dep::X] std::string description(const Locale &lang_r=Locale()) const
Long (multiline) text describing the solvable (opt.
std::string name() const
The name (without any ResKind prefix).
int IdType
Generic Id type.
A Solvable object within the sat Pool.
IdString vendor() const
The vendor.
IdType id() const
Expert backdoor.
Capabilities provides() const
RepoInfo repoInfo() const
The repositories RepoInfo.
ResKind kind() const
The Solvables ResKind.
Container of Capability (currently read only).
static const ResKind package
const LocaleSet & _locales
void setProbedType(const repo::RepoType &t) const
This allows to adjust the RepoType lazy, from NONE to some probed value, even for const objects...
Helper providing more detailed information about a Capability.
OnMediaLocation lookupLocation() const
returns OnMediaLocation data: This is everything we need to download e.g.
LocaleSet getSupportedLocales() const
Return the supported locales.
Capabilities recommends() const
const_iterator end() const
Iterator pointing behind the last Capability.
static ResKind explicitBuiltin(const char *str_r)
Return the builtin kind if str_r explicitly prefixed.
Store and operate with byte count.
detail::IdType lookupIdAttribute(const SolvAttr &attr) const
returns the id attribute value for attr or detail::noId if it does not exists.
Lightweight attribute value lookup.
static const SolvAttr installtime
RAII writing a nodes start/end tag.
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
#define NO_SOLVABLE_RETURN(VAL)
std::ostream & operator<<(std::ostream &str, const Solvable &obj)
String related utilities and Regular expression matching.
Capabilities supplements() const
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
What is known about a repository.
static const ResKind srcpackage
std::string delnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for uninstall (opt.
Access to the sat-pools string space.
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Edition represents [epoch:]version[-release]
::_Solvable CSolvable
Wrapped libsolv C data type exposed as backdoor.
ByteCount downloadSize() const
Download size.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
bool identical(const Solvable &rhs) const
Test whether two Solvables have the same content.
static const SolvAttr insnotify
static CheckSum md5(const std::string &checksum)
static const Solvable noSolvable
Represents no Solvable.
sat::detail::IdType id() const
Expert backdoor.
bool isSystemRepo(CRepo *repo_r) const
CapabilitySet valuesOfNamespace(const std::string &namespace_r) const
Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
Solvable nextInRepo() const
Return next Solvable in Repo (or noSolvable).
std::string asUserString() const
String representation "ident-edition.arch(repo)" or "noSolvable".
False false_c()
Convenience function for creating a False.
bool empty() const
Test for an empty path.
std::string distribution() const
The distribution string.
Repository repository() const
The Repository this Solvable belongs to.
const_iterator begin() const
Iterator pointing to the first Capability.
Store and operate on date (time_t).
Capabilities enhances() const
Edition edition() const
The edition (version-release).
Lightweight repository attribute value lookup.
CapabilitySet providesNamespace(const std::string &namespace_r) const
Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string...
ByteCount installSize() const
Installed (unpacked) size.
static CheckSum sha224(const std::string &checksum)
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
unsigned long long lookupNumAttribute(const SolvAttr &attr) const
returns the numeric attribute value for attr or 0 if it does not exists.
RepoInfo info() const
Return any associated RepoInfo.
CheckSum lookupCheckSumAttribute(const SolvAttr &attr) const
returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist...
Arch arch() const
The architecture.
std::string getLicense(const Locale &lang_r=Locale()) const
Return the best license for the current (or a specified) locale.
unsigned mediaNr() const
Media number the solvable is located on (0 if no media access required).
std::ostream & dumpOn(std::ostream &str, const Solvable &obj)
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
CpeId cpeId() const
The solvables CpeId if available.
static const SolvAttr checksum
static PoolImpl & myPool()
bool multiversionInstall() const
Whether different versions of this package can be installed at the same time.
static const SolvAttr downloadsize
Capabilities requires() const
const char * c_str() const
Conversion to const char *
std::string asUserString() const
User string: label (alias or name)
bool isSystem() const
Return whether this Solvable belongs to the system repo.
Solvable nextInPool() const
Return next Solvable in Pool (or noSolvable).
static CheckSum sha256(const std::string &checksum)
static const SolvAttr delnotify
bool isMultiversion(const Solvable &solv_r) const
'Language[_Country]' codes.
static const SolvAttr installsize
bool supportsLocale(const Locale &locale_r) const
Whether this Solvable supports a specific Locale.
detail::CSolvable * get() const
Expert backdoor.
std::string lookupStrAttribute(const SolvAttr &attr) const
returns the string attribute value for attr or an empty string if it does not exists.
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
std::unordered_set< Capability > CapabilitySet
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
static const SolvAttr buildtime
std::string alias() const
Short unique string to identify a repo.
bool isOnSystemByUser(IdString ident_r) const
Solvable()
Default ctor creates noSolvable.
bool supportsRequestedLocales() const
Whether this Solvable supports at least one requested locale.
bool needToAcceptLicense() const
Whether the repo license has to be accepted, e.g.
static const SolvAttr cpeid
std::string insnotify(const Locale &lang_r=Locale()) const
UI hint text when selecting the solvable for install (opt.
std::string summary(const Locale &lang_r=Locale()) const
Short (singleline) text describing the solvable (opt.
static const Repository noRepository
Represents no Repository.
Capabilities conflicts() const
std::ostream & dumpAsXmlOn(std::ostream &str, const Solvable &obj)
bool onSystemByUser() const
Whether this is known to be installed on behalf of a user request.
static const SolvAttr description
Capabilities prerequires() const
static const IdType noId(0)
bool needToAcceptLicense() const
True except for well known exceptions (i.e show license but no need to accept it).
static CheckSum sha384(const std::string &checksum)
CSolvable * getSolvable(SolvableIdType id_r) const
Return pointer to the sat-solvable or NULL if it is not valid.
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
static const SolvAttr eula
static CheckSum sha1(const std::string &checksum)
static const SolvAttr summary
Capabilities obsoletes() const
std::string asString() const
Conversion to std::string
static const SolvAttr distribution
std::string asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static CheckSum sha512(const std::string &checksum)
Easy-to use interface to the ZYPP dependency resolver.
bool supportsLocales() const
Whether this Solvable claims to support locales.
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.
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
const char * c_str() const
Capabilities suggests() const
IdString ident() const
The identifier.
Date installtime() const
The items install time (false if not installed).
bool empty() const
Whether the query is empty.
iterator begin() const
Iterator to the begin of query results.
static const SolvAttr medianr
bool lookupBoolAttribute(const SolvAttr &attr) const
returns the boolean attribute value for attr or false if it does not exists.