1LIBSOLV-POOL(3) LIBSOLV LIBSOLV-POOL(3)
2
3
4
6 libsolv-pool - Libsolv's pool object
7
9 void *appdata
10 A no-purpose pointer free to use for the library user. Freeing the
11 pool simply discards the pointer.
12
13 Stringpool ss
14 The pool of unified strings.
15
16 Reldep *rels
17 The pool of unified relation dependencies.
18
19 int nrels
20 Number of allocated relation dependencies.
21
22 Repo **repos
23 The array of repository pointers, indexed by repository Id.
24
25 int nrepos
26 Number of allocated repository array elements, i.e. the size of the
27 repos array.
28
29 int urepos
30 Number of used (i.e. non-zero) repository array elements.
31
32 Repo *installed
33 Pointer to the repo holding the installed packages. You are free to
34 read this attribute, but you should use pool_set_installed() if you
35 want to change it.
36
37 Solvable *solvables
38 The array of Solvable objects.
39
40 int nsolvables
41 Number of Solvable objects, i.e. the size of the solvables array.
42 Note that the array may contain freed solvables, in that case the
43 repo pointer of the solvable will be zero.
44
45 int disttype
46 The distribution type of your system, e.g. DISTTYPE_DEB. You are
47 free to read this attribute, but you should use pool_setdisttype()
48 if you want to change it.
49
50 Id *whatprovidesdata
51 Multi-purpose Id storage holding zero terminated arrays of Ids.
52 pool_whatprovides() returns an offset into this data.
53
54 Map *considered
55 Optional bitmap that can make the library ignore solvables. If a
56 bitmap is set, only solvables that have a set bit in the bitmap at
57 their Id are considered usable.
58
59 int debugmask
60 A mask that defines which debug events should be reported.
61 pool_setdebuglevel() sets this mask.
62
63 Datapos pos
64 An object storing some position in the repository data. Functions
65 like dataiterator_set_pos() set this object, accessing data with a
66 pseudo solvable Id of SOLVID_POS uses it.
67
68 Queue pooljobs
69 A queue where fixed solver jobs can be stored. This jobs are
70 automatically added when solver_solve() is called, they are useful
71 to store configuration data like which packages should be
72 multiversion installed.
73
75 Pool *pool_create();
76
77 Create a new instance of a pool.
78
79 void pool_free(Pool *pool);
80
81 Free a pool and all of the data it contains, e.g. the solvables,
82 repositories, strings.
83
85 Constants
86 SOLV_FATAL
87 Report the error and call “exit(1)” afterwards. You cannot mask
88 this level. Reports to stderr instead of stdout.
89
90 SOLV_ERROR
91 Used to report errors. Reports to stderr instead of stdout.
92
93 SOLV_WARN
94 Used to report warnings.
95
96 SOLV_DEBUG_STATS
97 Used to report statistical data.
98
99 SOLV_DEBUG_RULE_CREATION
100 Used to report information about the solver’s creation of rules.
101
102 SOLV_DEBUG_PROPAGATE
103 Used to report information about the solver’s unit rule propagation
104 process.
105
106 SOLV_DEBUG_ANALYZE
107 Used to report information about the solver’s learnt rule
108 generation mechanism.
109
110 SOLV_DEBUG_UNSOLVABLE
111 Used to report information about the solver dealing with
112 conflicting rules.
113
114 SOLV_DEBUG_SOLUTIONS
115 Used to report information about the solver creating solutions to
116 solve problems.
117
118 SOLV_DEBUG_POLICY
119 Used to report information about the solver searching for an
120 optimal solution.
121
122 SOLV_DEBUG_RESULT
123 Used by the debug functions to output results.
124
125 SOLV_DEBUG_JOB
126 Used to report information about the job rule generation process.
127
128 SOLV_DEBUG_SOLVER
129 Used to report information about what the solver is currently
130 doing.
131
132 SOLV_DEBUG_TRANSACTION
133 Used to report information about the transaction generation and
134 ordering process.
135
136 SOLV_DEBUG_TO_STDERR
137 Write debug messages to stderr instead of stdout.
138
139 Functions
140 void pool_debug(Pool *pool, int type, const char *format, ...);
141
142 Report a message of the type type. You can filter debug messages by
143 setting a debug mask.
144
145 void pool_setdebuglevel(Pool *pool, int level);
146
147 Set a predefined debug mask. A higher level generally means more bits
148 in the mask are set, thus more messages are printed.
149
150 void pool_setdebugmask(Pool *pool, int mask);
151
152 Set the debug mask to filter debug messages.
153
154 int pool_error(Pool *pool, int ret, const char *format, ...);
155
156 Set the pool’s error string. The ret value is simply used as a return
157 value of the function so that you can write code like return
158 pool_error(...);. If the debug mask contains the SOLV_ERROR bit,
159 pool_debug() is also called with the message and type SOLV_ERROR.
160
161 extern char *pool_errstr(Pool *pool);
162
163 Return the current error string stored in the pool. Like with the
164 libc’s errno value, the string is only meaningful after a function
165 returned an error.
166
167 void pool_setdebugcallback(Pool *pool, void (*debugcallback)(Pool *, void *data, int type, const char *str), void *debugcallbackdata);
168
169 Set a custom debug callback function. Instead of writing to stdout or
170 stderr, the callback function will be called.
171
173 Constants
174 DISTTYPE_RPM
175 Used for systems which use rpm as low level package manager.
176
177 DISTTYPE_DEB
178 Used for systems which use dpkg as low level package manager.
179
180 DISTTYPE_ARCH
181 Used for systems which use the arch linux package manager.
182
183 DISTTYPE_HAIKU
184 Used for systems which use haiku packages.
185
186 POOL_FLAG_PROMOTEEPOCH
187 Promote the epoch of the providing dependency to the requesting
188 dependency if it does not contain an epoch. Used at some time in
189 old rpm versions, modern systems should never need this.
190
191 POOL_FLAG_FORBIDSELFCONFLICTS
192 Disallow the installation of packages that conflict with
193 themselves. Debian always allows self-conflicting packages, rpm
194 used to forbid them but switched to also allowing them recently.
195
196 POOL_FLAG_OBSOLETEUSESPROVIDES
197 Make obsolete type dependency match against provides instead of
198 just the name and version of packages. Very old versions of rpm
199 used the name/version, then it got switched to provides and later
200 switched back again to just name/version.
201
202 POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES
203 An implicit obsoletes is the internal mechanism to remove the old
204 package on an update. The default is to remove all packages with
205 the same name, rpm-5 switched to also removing packages providing
206 the same name.
207
208 POOL_FLAG_OBSOLETEUSESCOLORS
209 Rpm’s multilib implementation (used in RedHat and Fedora)
210 distinguishes between 32bit and 64bit packages (the terminology is
211 that they have a different color). If obsoleteusescolors is set,
212 packages with different colors will not obsolete each other.
213
214 POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS
215 Same as POOL_FLAG_OBSOLETEUSESCOLORS, but used to find out if
216 packages of the same name can be installed in parallel. For current
217 Fedora systems, POOL_FLAG_OBSOLETEUSESCOLORS should be false and
218 POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS should be true (this is the
219 default if FEDORA is defined when libsolv is compiled).
220
221 POOL_FLAG_NOINSTALLEDOBSOLETES
222 New versions of rpm consider the obsoletes of installed packages
223 when checking for dependency, thus you may not install a package
224 that is obsoleted by some other installed package, unless you also
225 erase the other package.
226
227 POOL_FLAG_HAVEDISTEPOCH
228 Mandriva added a new field called distepoch that gets checked in
229 version comparison if the epoch/version/release of two packages are
230 the same.
231
232 POOL_FLAG_NOOBSOLETESMULTIVERSION
233 If a package is installed in multiversionmode, rpm used to ignore
234 both the implicit obsoletes and the obsolete dependency of a
235 package. This was changed to ignoring just the implicit obsoletes,
236 thus you may install multiple versions of the same name, but
237 obsoleted packages still get removed.
238
239 POOL_FLAG_ADDFILEPROVIDESFILTERED
240 Make the addfileprovides method only add files from the standard
241 locations (i.e. the “bin” and “etc” directories). This is useful if
242 you have only few packages that use non-standard file dependencies,
243 but you still want the fast speed that addfileprovides() generates.
244
245 Functions
246 int pool_setdisttype(Pool *pool, int disttype);
247
248 Set the package type of your system. The disttype is used for example
249 to define package comparison semantics. Libsolv’s default disttype
250 should match the package manager of your system, so you only need to
251 use this function if you want to use the library to solve packaging
252 problems for different systems. The Function returns the old disttype
253 on success, and -1 if the new disttype is not supported. Note that any
254 pool_setarch and pool_setarchpolicy calls need to come after the
255 pool_setdisttype call, as they make use of the noarch/any/all
256 architecture id.
257
258 int pool_set_flag(Pool *pool, int flag, int value);
259
260 Set a flag to a new value. Returns the old value of the flag.
261
262 int pool_get_flag(Pool *pool, int flag);
263
264 Get the value of a pool flag. See the constants section about the
265 meaning of the flags.
266
267 void pool_set_rootdir(Pool *pool, const char *rootdir);
268
269 Set a specific root directory. Some library functions support a flag
270 that tells the function to prepend the rootdir to file and directory
271 names.
272
273 const char *pool_get_rootdir(Pool *pool);
274
275 Return the current value of the root directory.
276
277 char *pool_prepend_rootdir(Pool *pool, const char *dir);
278
279 Prepend the root directory to the dir argument string. The returned
280 string has been newly allocated and needs to be freed after use.
281
282 char *pool_prepend_rootdir_tmp(Pool *pool, const char *dir);
283
284 Same as pool_prepend_rootdir, but uses the pool’s temporary space for
285 allocation.
286
287 void pool_set_installed(Pool *pool, Repo *repo);
288
289 Set which repository should be treated as the “installed” repository,
290 i.e. the one that holds information about the installed packages.
291
292 void pool_set_languages(Pool *pool, const char **languages, int nlanguages);
293
294 Set the language of your system. The library provides lookup functions
295 that return localized strings, for example for package descriptions.
296 You can set an array of languages to provide a fallback mechanism if
297 one language is not available.
298
299 void pool_setarch(Pool *pool, const char *arch);
300
301 Set the architecture of your system. The architecture is used to
302 determine which packages are installable and which packages cannot be
303 installed. The arch argument is normally the “machine” value of the
304 “uname” system call.
305
306 void pool_setarchpolicy(Pool *, const char *);
307
308 Set the architecture policy for your system. This is the general
309 version of pool_setarch (in fact pool_setarch calls pool_setarchpolicy
310 internally). See the section about architecture policies for more
311 information.
312
313 void pool_addvendorclass(Pool *pool, const char **vendorclass);
314
315 Add a new vendor equivalence class to the system. A vendor equivalence
316 class defines if an installed package of one vendor can be replaced by
317 a package coming from a different vendor. The vendorclass argument must
318 be a NULL terminated array of strings. See the section about vendor
319 policies for more information.
320
321 void pool_setvendorclasses(Pool *pool, const char **vendorclasses);
322
323 Set all allowed vendor equivalences. The vendorclasses argument must be
324 an NULL terminated array consisting of all allowed classes
325 concatenated. Each class itself must be NULL terminated, thus the last
326 class ends with two NULL elements, one to finish the class and one to
327 finish the list of classes.
328
329 void pool_set_custom_vendorcheck(Pool *pool, int (*vendorcheck)(Pool *, Solvable *, Solvable *));
330
331 Define a custom vendor check mechanism. You can use this if libsolv’s
332 internal vendor equivalence class mechanism does not match your needs.
333
334 void pool_setloadcallback(Pool *pool, int (*cb)(Pool *, Repodata *, void *), void *loadcbdata);
335
336 Define a callback function that gets called when repository metadata
337 needs to be loaded on demand. See the section about on demand loading
338 in the libsolv-repodata manual.
339
340 void pool_setnamespacecallback(Pool *pool, Id (*cb)(Pool *, void *, Id, Id), void *nscbdata);
341
342 Define a callback function to implement custom namespace support. See
343 the section about namespace dependencies.
344
346 Constants
347 ID_EMPTY
348 The Id of the empty string, it is always Id 1.
349
350 REL_LT
351 Represents a “<” relation.
352
353 REL_EQ
354 Represents a “=” relation.
355
356 REL_GT
357 Represents a “>” relation. You can use combinations of REL_GT,
358 REL_EQ, and REL_LT or-ed together to create any relation you like.
359
360 REL_AND
361 A boolean AND operation, the “name” and “evr” parts of the relation
362 can be two sub-dependencies. Packages must match both parts of the
363 dependency.
364
365 REL_OR
366 A boolean OR operation, the “name” and “evr” parts of the relation
367 can be two sub-dependencies. Packages can match any part of the
368 dependency.
369
370 REL_WITH
371 Like REL_AND, but packages must match both dependencies
372 simultaneously. See the section about boolean dependencies about
373 more information.
374
375 REL_NAMESPACE
376 A special namespace relation. See the section about namespace
377 dependencies for more information.
378
379 REL_ARCH
380 An architecture filter dependency. The “name” part of the relation
381 is a sub-dependency, the “evr” part is the Id of an architecture
382 that the matching packages must have (note that this is an exact
383 match ignoring architecture policies).
384
385 REL_FILECONFLICT
386 An internal file conflict dependency used to represent file
387 conflicts. See the pool_add_fileconflicts_deps() function.
388
389 REL_COND
390 A conditional dependency, the “name” sub-dependency is only
391 considered if the “evr” sub-dependency is fulfilled. See the
392 section about boolean dependencies about more information.
393
394 REL_UNLESS
395 A conditional dependency, the “name” sub-dependency is only
396 considered if the “evr” sub-dependency is not fulfilled. See the
397 section about boolean dependencies about more information.
398
399 REL_COMPAT
400 A compat dependency used in Haiku to represent version ranges. The
401 “name” part is the actual version, the “evr” part is the backwards
402 compatibility version.
403
404 REL_KIND
405 A pseudo dependency that limits the solvables to a specific kind.
406 The kind is expected to be a prefix of the solvable name, e.g.
407 “patch:foo” would be of kind “patch”. “REL_KIND” is only supported
408 in the selection functions.
409
410 REL_MULTIARCH
411 A debian multiarch annotation. The most common value for the “evr”
412 part is “any”.
413
414 REL_ELSE
415 The else part of a “REL_COND” or “REL_UNLESS” dependency. See the
416 section about boolean dependencies.
417
418 REL_ERROR
419 An illegal dependency. This is useful to encode dependency parse
420 errors.
421
422 Functions
423 Id pool_str2id(Pool *pool, const char *str, int create);
424
425 Add a string to the pool of unified strings, returning the Id of the
426 string. If create is zero, new strings will not be added to the pool,
427 instead Id 0 is returned.
428
429 Id pool_strn2id(Pool *pool, const char *str, unsigned int len, int create);
430
431 Same as pool_str2id, but only len characters of the string are used.
432 This can be used to add substrings to the pool.
433
434 Id pool_rel2id(Pool *pool, Id name, Id evr, int flags, int create);
435
436 Create a relational dependency from to other dependencies, name and
437 evr, and a flag. See the REL_ constants for the supported flags. As
438 with pool_str2id, create defines if new dependencies will get added or
439 Id zero will be returned instead.
440
441 Id pool_id2langid(Pool *pool, Id id, const char *lang, int create);
442
443 Attach a language suffix to a string Id. This function can be used to
444 create language keyname Ids from keynames, it is functional equivalent
445 to converting the id argument to a string, adding a “:” character and
446 the lang argument to the string and then converting the result back
447 into an Id.
448
449 const char *pool_id2str(const Pool *pool, Id id);
450
451 Convert an Id back into a string. If the Id is a relational Id, the
452 “name” part will be converted instead.
453
454 const char *pool_id2rel(const Pool *pool, Id id);
455
456 Return the relation string of a relational Id. Returns an empty string
457 if the passed Id is not a relation.
458
459 const char *pool_id2evr(const Pool *pool, Id id);
460
461 Return the “evr” part of a relational Id as string. Returns an empty
462 string if the passed Id is not a relation.
463
464 const char *pool_dep2str(Pool *pool, Id id);
465
466 Convert an Id back into a string. If the passed Id belongs to a
467 relation, a string representing the relation is returned. Note that in
468 that case the string is allocated on the pool’s temporary space.
469
470 void pool_freeidhashes(Pool *pool);
471
472 Free the hashes used to unify strings and relations. You can use this
473 function to save memory if you know that you will no longer create new
474 strings and relations.
475
477 Solvable *pool_id2solvable(const Pool *pool, Id p);
478
479 Convert a solvable Id into a pointer to the solvable data. Note that
480 the pointer may become invalid if new solvables are created or old
481 solvables deleted, because the array storing all solvables may get
482 reallocated.
483
484 Id pool_solvable2id(const Pool *pool, Solvable *s);
485
486 Convert a pointer to the solvable data into a solvable Id.
487
488 const char *pool_solvid2str(Pool *pool, Id p);
489
490 Return a string representing the solvable with the Id p. The string
491 will be some canonical representation of the solvable, usually a
492 combination of the name, the version, and the architecture.
493
494 const char *pool_solvable2str(Pool *pool, Solvable *s);
495
496 Same as pool_solvid2str, but instead of the Id, a pointer to the
497 solvable is passed.
498
500 Constants
501 EVRCMP_COMPARE
502 Compare all parts of the version, treat missing parts as empty
503 strings.
504
505 EVRCMP_MATCH_RELEASE
506 A special mode for rpm version string matching. If a version misses
507 a release part, it matches all releases. In that case the special
508 values “-2” and “2” are returned, depending on which of the two
509 versions did not have a release part.
510
511 EVRCMP_MATCH
512 A generic match, missing parts always match.
513
514 EVRCMP_COMPARE_EVONLY
515 Only compare the epoch and the version parts, ignore the release
516 part.
517
518 Functions
519 int pool_evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode);
520
521 Compare two version Ids, return -1 if the first version is less than
522 the second version, 0 if they are identical, and 1 if the first version
523 is bigger than the second one.
524
525 int pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode);
526
527 Same as pool_evrcmp(), but uses strings instead of Ids.
528
529 int pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version, const char *release);
530
531 Match a version Id against an epoch, a version and a release string.
532 Passing NULL means that the part should match everything.
533
534 int pool_match_dep(Pool *pool, Id d1, Id d2);
535
536 Returns “1” if the dependency d1 (the provider) is matched by the
537 dependency d2, otherwise “0” is returned. For two dependencies to
538 match, both the “name” parts must match and the version range described
539 by the “evr” parts must overlap.
540
541 int pool_match_nevr(Pool *pool, Solvable *s, Id d);
542
543 Like pool_match_dep, but the provider is the "self-provides" dependency
544 of the Solvable s, i.e. the dependency “s→name = s→evr”.
545
547 void pool_createwhatprovides(Pool *pool);
548
549 Create an index that maps dependency Ids to sets of packages that
550 provide the dependency.
551
552 void pool_freewhatprovides(Pool *pool);
553
554 Free the whatprovides index to save memory.
555
556 Id pool_whatprovides(Pool *pool, Id d);
557
558 Return an offset into the Pool’s whatprovidesdata array. The solvables
559 with the Ids stored starting at that offset provide the dependency d.
560 The solvable list is zero terminated.
561
562 Id *pool_whatprovides_ptr(Pool *pool, Id d);
563
564 Instead of returning the offset, return the pointer to the Ids stored
565 at that offset. Note that this pointer has a very limit validity time,
566 as any call that adds new values to the whatprovidesdata area may
567 reallocate the array.
568
569 Id pool_queuetowhatprovides(Pool *pool, Queue *q);
570
571 Add the contents of the Queue q to the end of the whatprovidesdata
572 array, returning the offset into the array.
573
574 void pool_addfileprovides(Pool *pool);
575
576 Some package managers like rpm allow dependencies on files contained in
577 other packages. To allow libsolv to deal with those dependencies in an
578 efficient way, you need to call the addfileprovides method after
579 creating and reading all repositories. This method will scan all
580 dependency for file names and then scan all packages for matching
581 files. If a filename has been matched, it will be added to the provides
582 list of the corresponding package.
583
584 void pool_addfileprovides_queue(Pool *pool, Queue *idq, Queue *idqinst);
585
586 Same as pool_addfileprovides, but the added Ids are returned in two
587 Queues, idq for all repositories except the one containing the
588 “installed” packages, idqinst for the latter one. This information can
589 be stored in the meta section of the repositories to speed up the next
590 time the repository is loaded and addfileprovides is called
591
592 void pool_set_whatprovides(pool, Id id, Id offset);
593
594 Manually set an entry in the whatprovides index. You’ll never do this
595 for package dependencies, as those entries are created by calling the
596 pool_createwhatprovides() function. But this function is useful for
597 namespace provides if you do not want to use a namespace callback to
598 lazily set the provides. The offset argument is a offset in the
599 whatprovides array, thus you can use “1” as a false value and “2” as
600 true value.
601
602 void pool_flush_namespaceproviders(Pool *pool, Id ns, Id evr);
603
604 Clear the cache of the providers for namespace dependencies matching
605 namespace ns. If the evr argument is non-zero, the namespace dependency
606 for exactly that dependency is cleared, otherwise all matching
607 namespace dependencies are cleared. See the section about Namespace
608 dependencies for further information.
609
610 void pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts);
611
612 Some package managers like rpm report conflicts when a package
613 installation overwrites a file of another installed package with
614 different content. As file content information is not stored in the
615 repository metadata, those conflicts can only be detected after the
616 packages are downloaded. Libsolv provides a function to check for such
617 conflicts, pool_findfileconflicts(). If conflicts are found, they can
618 be added as special REL_FILECONFLICT provides dependencies, so that the
619 solver will know about the conflict when it is re-run.
620
622 char *pool_alloctmpspace(Pool *pool, int len);
623
624 Allocate space on the pool’s temporary space area. This space has a
625 limited lifetime, it will be automatically freed after a fixed amount
626 (currently 16) of other pool_alloctmpspace() calls are done.
627
628 void pool_freetmpspace(Pool *pool, const char *space);
629
630 Give the space allocated with pool_alloctmpspace back to the system.
631 You do not have to use this function, as the space is automatically
632 reclaimed, but it can be useful to extend the lifetime of other
633 pointers to the pool’s temporary space area.
634
635 const char *pool_bin2hex(Pool *pool, const unsigned char *buf, int len);
636
637 Convert some binary data to hexadecimal, returning a string allocated
638 in the pool’s temporary space area.
639
640 char *pool_tmpjoin(Pool *pool, const char *str1, const char *str2, const char *str3);
641
642 Join three strings and return the result in the pool’s temporary space
643 area. You can use NULL arguments if you just want to join less strings.
644
645 char *pool_tmpappend(Pool *pool, const char *str1, const char *str2, const char *str3);
646
647 Like pool_tmpjoin(), but if the first argument is the last allocated
648 space in the pool’s temporary space area, it will be replaced with the
649 result of the join and no new temporary space slot will be used. Thus
650 you can join more than three strings by a combination of one
651 pool_tmpjoin() and multiple pool_tmpappend() calls. Note that the str1
652 pointer is no longer usable after the call.
653
655 Constants
656 SOLVID_POS
657 Use the data position stored in the pool for the lookup instead of
658 looking up the data of a solvable.
659
660 SOLVID_META
661 Use the data stored in the meta section of a repository (or
662 repodata area) instead of looking up the data of a solvable. This
663 constant does not work for the pool’s lookup functions, use it for
664 the repo’s or repodata’s lookup functions instead. It’s just listed
665 for completeness.
666
667 Functions
668 const char *pool_lookup_str(Pool *pool, Id solvid, Id keyname);
669
670 Return the string value stored under the attribute keyname in solvable
671 solvid.
672
673 unsigned long long pool_lookup_num(Pool *pool, Id solvid, Id keyname, unsigned long long notfound);
674
675 Return the 64bit unsigned number stored under the attribute keyname in
676 solvable solvid. If no such number is found, the value of the notfound
677 argument is returned instead.
678
679 Id pool_lookup_id(Pool *pool, Id solvid, Id keyname);
680
681 Return the Id stored under the attribute keyname in solvable solvid.
682
683 int pool_lookup_idarray(Pool *pool, Id solvid, Id keyname, Queue *q);
684
685 Fill the queue q with the content of the Id array stored under the
686 attribute keyname in solvable solvid. Returns “1” if an array was
687 found, otherwise the queue will be empty and “0” will be returned.
688
689 int pool_lookup_void(Pool *pool, Id solvid, Id keyname);
690
691 Returns “1” if a void value is stored under the attribute keyname in
692 solvable solvid, otherwise “0”.
693
694 const char *pool_lookup_checksum(Pool *pool, Id solvid, Id keyname, Id *typep);
695
696 Return the checksum that is stored under the attribute keyname in
697 solvable solvid. The type of the checksum will be returned over the
698 typep pointer. If no such checksum is found, NULL will be returned and
699 the type will be set to zero. Note that the result is stored in the
700 Pool’s temporary space area.
701
702 const unsigned char *pool_lookup_bin_checksum(Pool *pool, Id solvid, Id keyname, Id *typep);
703
704 Return the checksum that is stored under the attribute keyname in
705 solvable solvid. Returns the checksum as binary data, you can use the
706 returned type to calculate the length of the checksum. No temporary
707 space area is needed.
708
709 const char *pool_lookup_deltalocation(Pool *pool, Id solvid, unsigned int *medianrp);
710
711 This is a utility lookup function to return the delta location for a
712 delta rpm. As solvables cannot store deltas, you have to use SOLVID_POS
713 as argument and set the Pool’s datapos pointer to point to valid delta
714 rpm data.
715
716 void pool_search(Pool *pool, Id solvid, Id keyname, const char *match, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *kv), void *cbdata);
717
718 Perform a search on all data stored in the pool. You can limit the
719 search area by using the solvid and keyname arguments. The values can
720 be optionally matched against the match argument, use NULL if you do
721 not want this matching. See the Dataiterator manpage about the possible
722 matches modes and the flags argument. For all (matching) values, the
723 callback function is called with the cbdata callback argument and the
724 data describing the value.
725
727 A Job consists of two Ids, how and what. The how part describes the
728 action, the job flags, and the selection method while the what part is
729 in input for the selection. A Selection is a queue consisting of
730 multiple jobs (thus the number of elements in the queue must be a
731 multiple of two). See the Solver manpage for more information about
732 jobs.
733
734 const char *pool_job2str(Pool *pool, Id how, Id what, Id flagmask);
735
736 Convert a job into a string. Useful for debugging purposes. The
737 flagmask can be used to mask the flags of the job, use “0” if you do
738 not want to see such flags, “-1” to see all flags, or a combination of
739 the flags you want to see.
740
741 void pool_job2solvables(Pool *pool, Queue *pkgs, Id how, Id what);
742
743 Return a list of solvables that the specified job selects.
744
745 int pool_isemptyupdatejob(Pool *pool, Id how, Id what);
746
747 Return “1” if the job is an update job that does not work with any
748 installed package, i.e. the job is basically a no-op. You can use this
749 to turn no-op update jobs into install jobs (as done by package
750 managers like “zypper”).
751
752 const char *pool_selection2str(Pool *pool, Queue *selection, Id flagmask);
753
754 Convert a selection into a string. Useful for debugging purposes. See
755 the pool_job2str() function for the flagmask argument.
756
758 void pool_freeallrepos(Pool *pool, int reuseids);
759
760 Free all repos from the pool (including all solvables). If reuseids is
761 true, all Ids of the solvables are free to be reused the next time
762 solvables are created.
763
764 void pool_clear_pos(Pool *pool);
765
766 Clear the data position stored in the pool.
767
769 An architecture policy defines a list of architectures that can be
770 installed on the system, and also the relationship between them (i.e.
771 the ordering). Architectures can be delimited with three different
772 characters:
773
774 ':'
775 No relationship between the architectures. A package of one
776 architecture can not be replaced with one of the other
777 architecture.
778
779 '>'
780 The first architecture is better than the second one. An installed
781 package of the second architecture may be replaced with one from
782 the first architecture and vice versa. The solver will select the
783 better architecture if the versions are the same.
784
785 '='
786 The two architectures are freely exchangeable. Used to define
787 aliases for architectures.
788
789 An example would be 'x86_64:i686=athlon>i586'. This means that x86_64
790 packages can only be replaced by other x86_64 packages, i686 packages
791 can be replaced by i686 and i586 packages (but i686 packages will be
792 preferred) and athlon is another name for the i686 architecture.
793
794 You can turn off the architecture replacement checks with the Solver’s
795 SOLVER_FLAG_ALLOW_ARCHCHANGE flag.
796
798 Different vendors often compile packages with different features, so
799 Libsolv only replace installed packages of one vendor with packages
800 coming from the same vendor. Also, while the version of a package is
801 normally defined by the upstream project, the release part of the
802 version is set by the vendor’s package maintainer, so it’s not
803 meaningful to do version comparisons for packages coming from different
804 vendors.
805
806 Vendor in this case means the SOLVABLE_VENDOR string stored in each
807 solvable. Sometimes a vendor changes names, or multiple vendors form a
808 group that coordinate their package building, so libsolv offers a way
809 to define that a group of vendors are compatible. You do that be
810 defining vendor equivalence classes, packages from a vendor from one
811 class may be replaced with packages from all the other vendors in the
812 class.
813
814 There can be multiple equivalence classes, the set of allowed vendor
815 changes for an installed package is calculated by building the union of
816 all of the equivalence classes the vendor of the installed package is
817 part of.
818
819 You can turn off the vendor replacement checks with the Solver’s
820 SOLVER_FLAG_ALLOW_VENDORCHANGE flag.
821
823 Boolean Dependencies allow to build complex expressions from simple
824 dependencies. Note that depending on the package manager only a subset
825 of those may be useful. For example, debian currently only allows an
826 "OR" expression.
827
828 REL_OR
829 The expression is true if either the first dependency or the second
830 one is true. This is useful for package dependencies like
831 “Requires”, where you can specify that either one of the packages
832 need to be installed.
833
834 REL_AND
835 The expression is true if both dependencies are true. The packages
836 fulfilling the dependencies may be different, i.e. “Supplements:
837 perl REL_AND python” is true if both a package providing perl and a
838 package providing python are installed.
839
840 REL_WITH
841 The expression is true if both dependencies are true and are
842 fulfilled by the same package. Thus “Supplements: perl REL_WITH
843 python” would only be true if a package is installed that provides
844 both dependencies (some kind of multi-language interpreter).
845
846 REL_COND
847 The expression is true if the first dependency is true or the
848 second dependency is false. “A REL_COND B” is equivalent to “A
849 REL_OR (NOT B)” (except that libsolv does not expose “NOT”).
850
851 REL_UNLESS
852 The expression is true if the first dependency is true and the
853 second dependency is false. “A REL_UNLESS B” is equivalent to “A
854 REL_AND (NOT B)” (except that libsolv does not expose “NOT”).
855
856 REL_ELSE
857 The “else” part of a “REL_COND” or “REL_UNLESS” dependency. It has
858 to be directly in the evr part of the condition, e.g. “foo REL_COND
859 (bar REL_ELSE baz)”. For “REL_COND” this is equivalent to writing
860 “(foo REL_COND bar) REL_AND (bar REL_OR baz)”. For “REL_UNLESS”
861 this is equivalent to writing “(foo REL_UNLESS bar) REL_OR (bar
862 REL_AND baz)”.
863
864 Each sub-dependency of a boolean dependency can in turn be a boolean
865 dependency, so you can chain them to create complex dependencies.
866
868 Namespace dependencies can be used to implement dependencies on
869 attributes external to libsolv. An example would be a dependency on the
870 language set by the user. This types of dependencies are usually only
871 used for “Conflicts” or “Supplements” dependencies, as the underlying
872 package manager does not know how to deal with them.
873
874 If the library needs to evaluate a namespace dependency, it calls the
875 namespace callback function set in the pool. The callback function can
876 return a set of packages that “provide” the dependency. If the
877 dependency is provided by the system, the returned set should consist
878 of just the system solvable (Solvable Id 1).
879
880 The returned set of packages must be returned as offset into the
881 whatprovidesdata array. You can use the pool_queuetowhatprovides
882 function to convert a queue into such an offset. To ease programming
883 the callback function, the return values “0” and “1” are not
884 interpreted as an offset. “0” means that no package is in the return
885 set, “1” means that just the system solvable is in the set.
886
887 The returned set is cached, so that for each namespace dependency the
888 callback is just called once. If you need to flush the cache (maybe
889 because the user has selected a different language), use the
890 pool_flush_namespaceproviders() function.
891
893 Michael Schroeder <mls@suse.de>
894
895
896
897libsolv 01/21/2020 LIBSOLV-POOL(3)