libzypp: zypp/ng/sat/capability.cc Source File

libzypp 17.38.10

capability.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12
13#include "capability.h"
14
15#include <iostream>
16#include <zypp-core/base/Logger.h>
17
18#include <zypp-core/base/String.h>
19#include <zypp-core/base/Regex.h>
20#include <zypp-core/base/Gettext.h>
21#include <zypp-core/base/Exception.h>
22
23#include <zypp/ng/arch.h>
24#include <zypp/ng/rel.h>
25#include <zypp/ng/edition.h>
26#include <zypp/ng/sat/stringpool.h>
27#include <zypp/ng/sat/solvable.h>
28#include <zypp/ng/sat/solvableident.h>
29#include <zypp/ng/sat/cap2str.h>
30
31using std::endl;
32
33namespace zyppng::sat
34{
35
36 using zyppng::sat::StringPool;
37
38 namespace
39 {
41 template <unsigned TLen = 5>
42 struct TempStrings
43 {
45 std::string & getNext()
46 { unsigned c = _next; _next = (_next+1) % TLen; _buf[c].clear(); return _buf[c]; }
47
48 private:
49 unsigned _next = 0;
50 std::string _buf[TLen];
51 };
52
54 inline std::string::size_type backskipWs( const std::string & str_r, std::string::size_type pos_r )
55 {
56 for ( ; pos_r != std::string::npos; --pos_r )
57 {
58 char ch = str_r[pos_r];
59 if ( ch != ' ' && ch != '\t' )
60 break;
61 }
62 return pos_r;
63 }
64
66 inline std::string::size_type backskipNWs( const std::string & str_r, std::string::size_type pos_r )
67 {
68 for ( ; pos_r != std::string::npos; --pos_r )
69 {
70 char ch = str_r[pos_r];
71 if ( ch == ' ' || ch == '\t' )
72 break;
73 }
74 return pos_r;
75 }
76
78 void splitOpEdition( std::string & str_r, Rel & op_r, Edition & ed_r )
79 {
80 if ( str_r.empty() )
81 return;
82 std::string::size_type ch( str_r.size()-1 );
83
84 // check whether the one but last word is a valid Rel:
85 if ( (ch = backskipWs( str_r, ch )) != std::string::npos )
86 {
87 std::string::size_type ee( ch );
88 if ( (ch = backskipNWs( str_r, ch )) != std::string::npos )
89 {
90 std::string::size_type eb( ch );
91 if ( (ch = backskipWs( str_r, ch )) != std::string::npos )
92 {
93 std::string::size_type oe( ch );
94 ch = backskipNWs( str_r, ch ); // now before 'op'? begin
95 if ( op_r.parseFrom( str_r.substr( ch+1, oe-ch ) ) )
96 {
97 // found a legal 'op'
98 ed_r = Edition( str_r.substr( eb+1, ee-eb ) );
99 if ( ch != std::string::npos ) // 'op' is not at str_r begin, so skip WS
100 ch = backskipWs( str_r, ch );
101 str_r.erase( ch+1 );
102 return;
103 }
104 }
105 }
106 }
107 // HERE: Didn't find 'name op edition'
108 // As a convenience we check for an embeded 'op' (not surounded by WS).
109 // But just '[<=>]=?|!=' and not inside '()'.
110 ch = str_r.find_last_of( "<=>)" );
111 if ( ch != std::string::npos && str_r[ch] != ')' )
112 {
113 std::string::size_type oe( ch );
114
115 // do edition first:
116 ch = str_r.find_first_not_of( " \t", oe+1 );
117 if ( ch != std::string::npos )
118 ed_r = Edition( str_r.substr( ch ) );
119
120 // now finish op:
121 ch = oe-1;
122 if ( str_r[oe] != '=' ) // '[<>]'
123 {
124 op_r = ( str_r[oe] == '<' ) ? Rel::LT : Rel::GT;
125 }
126 else
127 { // '?='
128 if ( ch != std::string::npos )
129 {
130 switch ( str_r[ch] )
131 {
132 case '<': --ch; op_r = Rel::LE; break;
133 case '>': --ch; op_r = Rel::GE; break;
134 case '!': --ch; op_r = Rel::NE; break;
135 case '=': --ch; // fall through
136 default: op_r = Rel::EQ; break;
137 }
138 }
139 }
140
141 // finally name:
142 if ( ch != std::string::npos ) // 'op' is not at str_r begin, so skip WS
143 ch = backskipWs( str_r, ch );
144 str_r.erase( ch+1 );
145 return;
146 }
147 // HERE: It's a plain 'name'
148 }
149
152 sat::detail::IdType relFromStr( sat::detail::CPool * pool_r,
153 const Arch & arch_r,
154 const std::string & name_r,
155 Rel op_r,
156 const Edition & ed_r,
157 const ResKind & kind_r )
158 {
159 // First build the name, non-packages prefixed by kind
160 SplitIdent split( kind_r, name_r );
161 sat::detail::IdType nid( split.ident().id() );
162
163 if ( split.kind() == ResKind::srcpackage )
164 {
165 // map 'kind srcpackage' to 'arch src', the pseudo architecture
166 // libsolv uses.
167 nid = ::pool_rel2id( pool_r, nid, IdString(ARCH_SRC).id(), REL_ARCH, /*create*/true );
168 }
169
170 // Extend name by architecture, if provided and not a srcpackage
171 if ( ! arch_r.empty() && kind_r != ResKind::srcpackage )
172 {
173 nid = ::pool_rel2id( pool_r, nid, arch_r.id(), REL_ARCH, /*create*/true );
174 }
175
176 // Extend 'op edition', if provided
177 if ( op_r != Rel::ANY && ed_r != Edition::noedition )
178 {
179 nid = ::pool_rel2id( pool_r, nid, ed_r.id(), op_r.bits(), /*create*/true );
180 }
181
182 return nid;
183 }
184
188 sat::detail::IdType relFromStr( sat::detail::CPool * pool_r,
189 const std::string & name_r, Rel op_r, const Edition & ed_r,
190 const ResKind & kind_r )
191 {
192 static const Arch srcArch( IdString(ARCH_SRC).asString() );
193 static const Arch nosrcArch( IdString(ARCH_NOSRC).asString() );
194 static const std::string srcKindPrefix( ResKind::srcpackage.asString() + ':' );
195
196 // check for an embedded 'srcpackage:foo' to be mapped to 'foo' and 'ResKind::srcpackage'.
197 if ( kind_r.empty() && zypp::str::hasPrefix( name_r, srcKindPrefix ) )
198 {
199 return relFromStr( pool_r, Arch_empty, name_r.substr( srcKindPrefix.size() ), op_r, ed_r, ResKind::srcpackage );
200 }
201
202 Arch arch( Arch_empty );
203 std::string name( name_r );
204
205 std::string::size_type asep( name_r.rfind( '.' ) );
206 if ( asep != std::string::npos )
207 {
208 Arch ext( name_r.substr( asep+1 ) );
209 if ( ext.isBuiltIn() || ext == srcArch || ext == nosrcArch )
210 {
211 arch = ext;
212 name.erase( asep );
213 }
214 }
215
216 return relFromStr( pool_r, arch, name, op_r, ed_r, kind_r );
217 }
218
221 sat::detail::IdType relFromStr( sat::detail::CPool * pool_r,
222 const Arch & arch_r, // parse from name if empty
223 const std::string & str_r, const ResKind & kind_r,
224 Capability::CtorFlag flag_r )
225 {
226 std::string name( str_r );
227 Rel op;
228 Edition ed;
229 if ( flag_r == Capability::UNPARSED )
230 {
231 splitOpEdition( name, op, ed );
232 }
233
234 if ( arch_r.empty() )
235 return relFromStr( pool_r, name, op, ed, kind_r ); // parses for name[.arch]
236 // else
237 return relFromStr( pool_r, arch_r, name, op, ed, kind_r );
238 }
239
241 sat::detail::IdType richOrRelFromStr( sat::detail::CPool * pool_r, const std::string & str_r, const ResKind & prefix_r, Capability::CtorFlag flag_r )
242 {
243 if ( str_r[0] == '(' ) {
244 sat::detail::IdType res { StringPool::instance().parserpmrichdep( str_r.c_str() ) };
245 if ( res ) return res;
246 // else: no richdep, so fall back to the ordinary parser which in
247 // case of doubt turns the string into a NAMED cap.
248 }
249 return relFromStr( pool_r, Arch_empty, str_r, prefix_r, flag_r );
250 }
251
253 } // namespace
255
256 const Capability Capability::Null( STRID_NULL );
257 const Capability Capability::Empty( STRID_EMPTY );
258
260
261 Capability::Capability( const char * str_r, const ResKind & prefix_r, CtorFlag flag_r )
262 : _id( richOrRelFromStr( StringPool::instance().getPool(), str_r, prefix_r, flag_r ) )
263 {}
264
265 Capability::Capability( const std::string & str_r, const ResKind & prefix_r, CtorFlag flag_r )
266 : _id( richOrRelFromStr( StringPool::instance().getPool(), str_r, prefix_r, flag_r ) )
267 {}
268
269 Capability::Capability( const Arch & arch_r, const char * str_r, const ResKind & prefix_r, CtorFlag flag_r )
270 : _id( relFromStr( StringPool::instance().getPool(), arch_r, str_r, prefix_r, flag_r ) )
271 {}
272
273 Capability::Capability( const Arch & arch_r, const std::string & str_r, const ResKind & prefix_r, CtorFlag flag_r )
274 : _id( relFromStr( StringPool::instance().getPool(), arch_r, str_r, prefix_r, flag_r ) )
275 {}
276
277 Capability::Capability( const char * str_r, CtorFlag flag_r, const ResKind & prefix_r )
278 : _id( relFromStr( StringPool::instance().getPool(), Arch_empty, str_r, prefix_r, flag_r ) )
279 {}
280
281 Capability::Capability( const std::string & str_r, CtorFlag flag_r, const ResKind & prefix_r )
282 : _id( relFromStr( StringPool::instance().getPool(), Arch_empty, str_r, prefix_r, flag_r ) )
283 {}
284
285 Capability::Capability( const Arch & arch_r, const char * str_r, CtorFlag flag_r, const ResKind & prefix_r )
286 : _id( relFromStr( StringPool::instance().getPool(), arch_r, str_r, prefix_r, flag_r ) )
287 {}
288
289 Capability::Capability( const Arch & arch_r, const std::string & str_r, CtorFlag flag_r, const ResKind & prefix_r )
290 : _id( relFromStr( StringPool::instance().getPool(), arch_r, str_r, prefix_r, flag_r ) )
291 {}
292
294 // Ctor from <name[.arch] op edition>.
296
297 Capability::Capability( const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r )
298 : _id( relFromStr( StringPool::instance().getPool(), name_r, Rel(op_r), Edition(ed_r), prefix_r ) )
299 {}
300 Capability::Capability( const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r )
301 : _id( relFromStr( StringPool::instance().getPool(), name_r, op_r, Edition(ed_r), prefix_r ) )
302 {}
303 Capability::Capability( const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r )
304 : _id( relFromStr( StringPool::instance().getPool(), name_r, op_r, ed_r, prefix_r ) )
305 {}
306
308 // Ctor from <arch name op edition>.
310
311 Capability::Capability( const std::string & arch_r, const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r )
312 : _id( relFromStr( StringPool::instance().getPool(), Arch(arch_r), name_r, Rel(op_r), Edition(ed_r), prefix_r ) )
313 {}
314 Capability::Capability( const std::string & arch_r, const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r )
315 : _id( relFromStr( StringPool::instance().getPool(), Arch(arch_r), name_r, op_r, Edition(ed_r), prefix_r ) )
316 {}
317 Capability::Capability( const std::string & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r )
318 : _id( relFromStr( StringPool::instance().getPool(), Arch(arch_r), name_r, op_r, ed_r, prefix_r ) )
319 {}
320 Capability::Capability( const Arch & arch_r, const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r )
321 : _id( relFromStr( StringPool::instance().getPool(), arch_r, name_r, Rel(op_r), Edition(ed_r), prefix_r ) )
322 {}
323 Capability::Capability( const Arch & arch_r, const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r )
324 : _id( relFromStr( StringPool::instance().getPool(), arch_r, name_r, op_r, Edition(ed_r), prefix_r ) )
325 {}
326 Capability::Capability( const Arch & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r )
327 : _id( relFromStr( StringPool::instance().getPool(), arch_r, name_r, op_r, ed_r, prefix_r ) )
328 {}
329
330 Capability::Capability( Capability::CapRel rel_r, const Capability & lhs_r, const Capability & rhs_r )
331 : _id( ::pool_rel2id( StringPool::instance().getPool(), lhs_r.id(), rhs_r.id(), rel_r, /*create*/true ) )
332 {}
333
335 // Ctor creating a namespace: capability.
337
338 Capability::Capability( ResolverNamespace namespace_r, IdString value_r )
339 : _id( ::pool_rel2id( StringPool::instance().getPool(), asIdString(namespace_r).id(), (value_r.empty() ? STRID_NULL : value_r.id() ), REL_NAMESPACE, /*create*/true ) )
340 {}
341
342 const char * Capability::c_str() const
343 {
344 return detail::cap2str( StringPool::instance().getPool(), id(), 0 );
345 }
346
347 CapMatch Capability::_doMatch( sat::detail::IdType lhs, sat::detail::IdType rhs )
348 {
349 if ( lhs == rhs )
350 return CapMatch::yes;
351
352 CapDetail l( lhs );
353 CapDetail r( rhs );
354
355 switch ( l.kind() )
356 {
357 case CapDetail::NOCAP:
358 return( r.kind() == CapDetail::NOCAP ); // NOCAP matches NOCAP only
359 break;
360 case CapDetail::EXPRESSION:
361 return CapMatch::irrelevant;
362 break;
363 case CapDetail::NAMED:
364 case CapDetail::VERSIONED:
365 break;
366 }
367
368 switch ( r.kind() )
369 {
370 case CapDetail::NOCAP:
371 return CapMatch::no; // match case handled above
372 break;
373 case CapDetail::EXPRESSION:
374 return CapMatch::irrelevant;
375 break;
376 case CapDetail::NAMED:
377 case CapDetail::VERSIONED:
378 break;
379 }
380 // comparing two simple caps:
381 if ( l.name() != r.name() )
382 return CapMatch::no;
383
384 // if both are arch restricted they must match
385 if ( l.arch() != r.arch()
386 && ! ( l.arch().empty() || r.arch().empty() ) )
387 return CapMatch::no;
388
389 // isNamed matches ANY edition:
390 if ( l.isNamed() || r.isNamed() )
391 return CapMatch::yes;
392
393 // both are versioned:
394 return overlaps( Edition::MatchRange( l.op(), l.ed() ),
395 Edition::MatchRange( r.op(), r.ed() ) );
396 }
397
398 bool Capability::isInterestingFileSpec( const char * name_r )
399 {
400 static zypp::str::smatch what;
401 static const zypp::str::regex filenameRegex(
402 "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
403 zypp::str::regex::nosubs );
404
405 return zypp::str::regex_match( name_r, what, filenameRegex );
406 }
407
408#if MOVE_CODE_FROM_LEGACY
409 Capability Capability::guessPackageSpec( const std::string & str_r, bool & rewrote_r )
410 {
411 Capability cap( str_r );
412 CapDetail detail( cap.detail() );
413
414 // str_r might be the form "libzypp-1.2.3-4.5(.arch)'
415 // correctly parsed as name capability by the ctor.
416 // TODO: Think about allowing glob char in name - for now don't process
417 if ( detail.isNamed() && !::strpbrk( detail.name().c_str(), "*?[{" )
418 && ::strrchr( detail.name().c_str(), '-' ) && sat::WhatProvides( cap ).empty() )
419 {
420 Arch origArch( detail.arch() ); // to support a trailing .arch
421
422 std::string guess( detail.name().asString() );
423 std::string::size_type pos( guess.rfind( '-' ) );
424 guess[pos] = '=';
425
426 Capability guesscap( origArch, guess );
427 detail = guesscap.detail();
428
429 ResPool pool( ResPool::instance() );
430 // require name part matching a pool items name (not just provides!)
431 if ( pool.byIdentBegin( detail.name() ) != pool.byIdentEnd( detail.name() ) )
432 {
433 rewrote_r = true;
434 return guesscap;
435 }
436
437 // try the one but last '-'
438 if ( pos )
439 {
440 guess[pos] = '-';
441 if ( (pos = guess.rfind( '-', pos-1 )) != std::string::npos )
442 {
443 guess[pos] = '=';
444
445 guesscap = Capability( origArch, guess );
446 detail = guesscap.detail();
447
448 // require name part matching a pool items name (not just provides!)
449 if ( pool.byIdentBegin( detail.name() ) != pool.byIdentEnd( detail.name() ) )
450 {
451 rewrote_r = true;
452 return guesscap;
453 }
454 }
455 }
456 }
457
458 rewrote_r = false;
459 return cap;
460 }
461
462 Capability Capability::guessPackageSpec( const std::string & str_r )
463 {
464 bool dummy = false;
465 return guessPackageSpec( str_r, dummy );
466 }
467#endif
468
470 //
471 // CLASS NAME : CapDetail
472 //
474
475 void CapDetail::_init()
476 {
477 // : _kind( NOCAP ), _lhs( id_r ), _rhs( 0 ), _flag( 0 ), _archIfSimple( 0 )
478
479 if ( _lhs == sat::detail::emptyId || _lhs == sat::detail::noId )
480 return; // NOCAP
481
482 if ( ! ISRELDEP(_lhs) )
483 {
484 // this is name without arch!
485 _kind = NAMED;
486 return;
487 }
488
489 ::Reldep * rd = GETRELDEP( StringPool::instance().getPool(), _lhs );
490 _lhs = rd->name;
491 _rhs = rd->evr;
492 _flag = rd->flags;
493
494 if ( Rel::isRel( _flag ) )
495 {
496 _kind = VERSIONED;
497 // Check for name.arch...
498 if ( ! ISRELDEP(_lhs) )
499 return; // this is name without arch!
500 rd = GETRELDEP( StringPool::instance().getPool(), _lhs );
501 if ( rd->flags != CAP_ARCH )
502 return; // this is not name.arch
503 // This is name.arch:
504 _lhs = rd->name;
505 _archIfSimple = rd->evr;
506 }
507 else if ( rd->flags == CAP_ARCH )
508 {
509 _kind = NAMED;
510 // This is name.arch:
511 _lhs = rd->name;
512 _archIfSimple = rd->evr;
513 }
514 else
515 {
516 _kind = EXPRESSION;
517 return;
518 }
519 // map back libsolvs pseudo arch 'src' to kind srcpackage
520 if ( _archIfSimple == ARCH_SRC || _archIfSimple == ARCH_NOSRC )
521 {
522 _lhs = IdString( (ResKind::srcpackage.asString() + ":" + IdString(_lhs).c_str()).c_str() ).id();
523 _archIfSimple = 0;
524 }
525 }
526} // namespace zyppng::sat
Exception.h
Gettext.h
Logger.h
Regex.h
String.h
arch.h
cap2str.h
zypp::Arch
Architecture.
Definition Arch.h:37
zypp::CapDetail::_init
void _init()
Definition Capability.cc:641
zypp::CapMatch
Tri state Capability match result.
Definition CapMatch.h:39
zypp::Capability::Null
static const Capability Null
No or Null Capability ( Id 0 ).
Definition Capability.h:172
zypp::Capability::Capability
Capability()
Default ctor, Empty capability.
Definition Capability.h:69
zypp::Capability::c_str
const char * c_str() const
Conversion to const char *.
Definition Capability.cc:447
zypp::Capability::_doMatch
static CapMatch _doMatch(sat::detail::IdType lhs, sat::detail::IdType rhs)
Match two Capabilities.
Definition Capability.cc:459
zypp::Capability::isInterestingFileSpec
static bool isInterestingFileSpec(const IdString &name_r)
Test for a filename that is likely being REQUIRED.
Definition Capability.h:251
zypp::Capability::Empty
static const Capability Empty
Empty Capability.
Definition Capability.h:175
zypp::Capability::guessPackageSpec
static Capability guessPackageSpec(const std::string &str_r)
Capability parser also guessing "libzypp-1.2.3-4.5.x86_64" formats.
Definition Capability.cc:573
zypp::Edition
Edition represents [epoch:]version[-release].
Definition Edition.h:60
zypp::Edition::noedition
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.
Definition Edition.h:72
zypp::IdString
Access to the sat-pools string space.
Definition IdString.h:55
zypp::IdString::empty
constexpr bool empty() const
Whether the string is empty.
Definition IdString.h:99
zypp::IdString::id
IdType id() const
Expert backdoor.
Definition IdString.h:144
zypp::ResKind
Resolvable kinds.
Definition ResKind.h:33
zypp::ResKind::srcpackage
static const ResKind srcpackage
Definition ResKind.h:44
zypp::ResPool
Global ResObject pool.
Definition ResPool.h:62
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition ResPool.cc:38
zypp::StringPool::instance
static StringPool & instance()
Access the global StringPool instance.
Definition stringpool.cc:18
zypp::str::regex
Regular expression.
Definition Regex.h:95
zypp::str::regex::nosubs
@ nosubs
Support for substring addressing of matches is not required.
Definition Regex.h:100
zypp::str::smatch
Regular expression match result.
Definition Regex.h:168
zyppng::CapMatch::no
static const CapMatch no
Definition CapMatch.h:53
zyppng::CapMatch::irrelevant
static const CapMatch irrelevant
Definition CapMatch.h:54
zyppng::CapMatch::yes
static const CapMatch yes
Definition CapMatch.h:52
zyppng::Edition::MatchRange
Range< Edition, Match > MatchRange
Edition Range based on Match.
Definition Edition.h:168
zyppng::ResKind::srcpackage
static const ResKind srcpackage
Definition ResKind.h:44
zyppng::sat::CapDetail
Helper providing more detailed information about a Capability.
Definition capability.h:339
zyppng::sat::CapDetail::NOCAP
@ NOCAP
Definition capability.h:343
zyppng::sat::CapDetail::NAMED
@ NAMED
Definition capability.h:344
zyppng::sat::CapDetail::EXPRESSION
@ EXPRESSION
Definition capability.h:346
zyppng::sat::CapDetail::VERSIONED
@ VERSIONED
Definition capability.h:345
zyppng::sat::CapDetail::_lhs
sat::detail::IdType _lhs
Definition capability.h:408
zyppng::sat::CapDetail::ed
Edition ed() const
Definition capability.h:394
zyppng::sat::CapDetail::_flag
unsigned _flag
Definition capability.h:410
zyppng::sat::CapDetail::name
IdString name() const
Definition capability.h:392
zyppng::sat::CapDetail::isNamed
bool isNamed() const
Definition capability.h:383
zyppng::sat::CapDetail::CAP_ARCH
@ CAP_ARCH
Used internally.
Definition capability.h:366
zyppng::sat::CapDetail::_rhs
sat::detail::IdType _rhs
Definition capability.h:409
zyppng::sat::CapDetail::_kind
Kind _kind
Definition capability.h:407
zyppng::sat::CapDetail::op
Rel op() const
Definition capability.h:393
zyppng::sat::CapDetail::_archIfSimple
sat::detail::IdType _archIfSimple
Definition capability.h:411
zyppng::sat::CapDetail::arch
IdString arch() const
Definition capability.h:391
zyppng::sat::CapDetail::kind
Kind kind() const
Definition capability.h:381
zyppng::sat::Capability
A sat capability.
Definition capability.h:74
zyppng::sat::Capability::CapRel
CapRel
Enum values correspond with libsolv defines.
Definition capability.h:162
zyppng::sat::Capability::CtorFlag
CtorFlag
Definition capability.h:76
zyppng::sat::Capability::UNPARSED
@ UNPARSED
Definition capability.h:76
zyppng::sat::Capability::_id
sat::detail::IdType _id
Definition capability.h:307
zyppng::sat::Capability::detail
CapDetail detail() const
Helper providing more detailed information about a Capability.
Definition capability.h:414
zyppng::sat::Capability::id
sat::detail::IdType id() const
Expert backdoor.
Definition capability.h:301
zyppng::sat::Capability::Capability
Capability()
Default ctor, Empty capability.
Definition capability.h:80
zyppng::sat::Capability::empty
bool empty() const
Whether the Capability is empty.
Definition capability.h:195
zyppng::sat::SplitIdent
Helper that splits an identifier into kind and name or vice versa.
Definition solvableident.h:31
zyppng::sat::StringPool
Singleton manager for the underlying libsolv string pool.
Definition stringpool.h:35
zyppng::sat::StringPool::instance
static StringPool & instance()
Access the global StringPool instance.
Definition stringpool.cc:18
zyppng::sat::StringPool::parserpmrichdep
detail::IdType parserpmrichdep(const char *capstr_r)
libsolv capability parser
Definition stringpool.h:64
edition.h
zypp::str::regex_match
bool regex_match(const char *s, smatch &matches, const regex &regex) ZYPP_API
Regular expression matching.
Definition Regex.cc:80
ztui::table::CStyle::Edition
@ Edition
Editions with v-r setparator highlighted.
Definition Table.h:160
zypp::pool
Definition ByIdent.h:24
zypp::sat::detail::IdType
int IdType
Generic Id type.
Definition PoolDefines.h:42
zypp::sat::detail::CPool
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Definition PoolDefines.h:34
zypp::str::hasPrefix
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition String.h:1097
zypp::url::split
void split(ParamVec &pvec, const std::string &pstr, const std::string &psep)
Split into a parameter vector.
Definition UrlUtils.cc:164
zypp::ResolverNamespace
ResolverNamespace
The resolver's dependency namespaces.
Definition ResolverNamespace.h:25
zypp::overlaps
bool overlaps(const Range< Tp, TCompare > &lhs, const Range< Tp, TCompare > &rhs)
Definition Range.h:65
zypp::Arch_empty
const Arch Arch_empty(IdString::Empty)
zypp::asIdString
constexpr IdString asIdString(ResolverNamespace obj)
relates: ResolverNamespace The underlying libsolv ID
Definition ResolverNamespace.h:41
zypp::asString
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition Patch.cc:122
zyppng::detail
Definition reporthelper.h:31
zyppng::sat::detail
CLASS NAME : detail::DIWrap.
Definition cap2str.cc:14
zyppng::sat::detail::emptyId
static const IdType emptyId(1)
zyppng::sat::detail::noId
static const IdType noId(0)
zyppng::sat::detail::IdType
zypp::sat::detail::IdType IdType
Definition poolconstants.h:43
zyppng::sat::detail::cap2str
void cap2str(std::string &outs_r, CPool *pool_r, IdType id_r, int parop_r)
Shared logic to convert a sat ID into a human readable string.
Definition cap2str.cc:56
zyppng::sat
This file contains private API, this might break at any time between releases.
Definition capabilities.h:22
zyppng::IdString
zypp::IdString IdString
Definition idstring.h:16
rel.h
capability.h
solvable.h
solvableident.h
stringpool.h
zypp::Rel
Relational operators.
Definition Rel.h:46
zypp::Rel::LT
static const Rel LT
Definition Rel.h:54
zypp::Rel::LE
static const Rel LE
Definition Rel.h:55
zypp::Rel::GE
static const Rel GE
Definition Rel.h:57
zypp::Rel::NE
static const Rel NE
Definition Rel.h:53
zypp::Rel::ANY
static const Rel ANY
Definition Rel.h:58
zypp::Rel::EQ
static const Rel EQ
Definition Rel.h:52
zyppng::Rel::isRel
static bool isRel(unsigned bits_r)
Test whether bits_r is a valid Rel (no extra bits set).
Definition Rel.h:113