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