Imported Upstream version 0.6.29
[platform/upstream/libsolv.git] / doc / gen / libsolv-pool.3
1 '\" t
2 .\"     Title: Libsolv-Pool
3 .\"    Author: [see the "Author" section]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 09/04/2017
6 .\"    Manual: LIBSOLV
7 .\"    Source: libsolv
8 .\"  Language: English
9 .\"
10 .TH "LIBSOLV\-POOL" "3" "09/04/2017" "libsolv" "LIBSOLV"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 libsolv-pool \- Libsolv\*(Aqs pool object
32 .SH "PUBLIC ATTRIBUTES"
33 .PP
34 \fBvoid *appdata\fR
35 .RS 4
36 A no\-purpose pointer free to use for the library user\&. Freeing the pool simply discards the pointer\&.
37 .RE
38 .PP
39 \fBStringpool ss\fR
40 .RS 4
41 The pool of unified strings\&.
42 .RE
43 .PP
44 \fBReldep *rels\fR
45 .RS 4
46 The pool of unified relation dependencies\&.
47 .RE
48 .PP
49 \fBint nrels\fR
50 .RS 4
51 Number of allocated relation dependencies\&.
52 .RE
53 .PP
54 \fBRepo **repos\fR
55 .RS 4
56 The array of repository pointers, indexed by repository Id\&.
57 .RE
58 .PP
59 \fBint nrepos\fR
60 .RS 4
61 Number of allocated repository array elements, i\&.e\&. the size of the repos array\&.
62 .RE
63 .PP
64 \fBint urepos\fR
65 .RS 4
66 Number of used (i\&.e\&. non\-zero) repository array elements\&.
67 .RE
68 .PP
69 \fBRepo *installed\fR
70 .RS 4
71 Pointer to the repo holding the installed packages\&. You are free to read this attribute, but you should use pool_set_installed() if you want to change it\&.
72 .RE
73 .PP
74 \fBSolvable *solvables\fR
75 .RS 4
76 The array of Solvable objects\&.
77 .RE
78 .PP
79 \fBint nsolvables\fR
80 .RS 4
81 Number of Solvable objects, i\&.e\&. the size of the solvables array\&. Note that the array may contain freed solvables, in that case the repo pointer of the solvable will be zero\&.
82 .RE
83 .PP
84 \fBint disttype\fR
85 .RS 4
86 The distribution type of your system, e\&.g\&. DISTTYPE_DEB\&. You are free to read this attribute, but you should use pool_setdisttype() if you want to change it\&.
87 .RE
88 .PP
89 \fBId *whatprovidesdata\fR
90 .RS 4
91 Multi\-purpose Id storage holding zero terminated arrays of Ids\&. pool_whatprovides() returns an offset into this data\&.
92 .RE
93 .PP
94 \fBMap *considered\fR
95 .RS 4
96 Optional bitmap that can make the library ignore solvables\&. If a bitmap is set, only solvables that have a set bit in the bitmap at their Id are considered usable\&.
97 .RE
98 .PP
99 \fBint debugmask\fR
100 .RS 4
101 A mask that defines which debug events should be reported\&. pool_setdebuglevel() sets this mask\&.
102 .RE
103 .PP
104 \fBDatapos pos\fR
105 .RS 4
106 An object storing some position in the repository data\&. Functions like dataiterator_set_pos() set this object, accessing data with a pseudo solvable Id of SOLVID_POS uses it\&.
107 .RE
108 .PP
109 \fBQueue pooljobs\fR
110 .RS 4
111 A queue where fixed solver jobs can be stored\&. This jobs are automatically added when solver_solve() is called, they are useful to store configuration data like which packages should be multiversion installed\&.
112 .RE
113 .SH "CREATION AND DESTRUCTION"
114 .sp
115 .if n \{\
116 .RS 4
117 .\}
118 .nf
119 \fBPool *pool_create()\fR;
120 .fi
121 .if n \{\
122 .RE
123 .\}
124 .sp
125 Create a new instance of a pool\&.
126 .sp
127 .if n \{\
128 .RS 4
129 .\}
130 .nf
131 \fBvoid pool_free(Pool *\fR\fIpool\fR\fB)\fR;
132 .fi
133 .if n \{\
134 .RE
135 .\}
136 .sp
137 Free a pool and all of the data it contains, e\&.g\&. the solvables, repositories, strings\&.
138 .SH "DEBUGGING AND ERROR REPORTING"
139 .SS "Constants"
140 .PP
141 \fBSOLV_FATAL\fR
142 .RS 4
143 Report the error and call \(lqexit(1)\(rq afterwards\&. You cannot mask this level\&. Reports to stderr instead of stdout\&.
144 .RE
145 .PP
146 \fBSOLV_ERROR\fR
147 .RS 4
148 Used to report errors\&. Reports to stderr instead of stdout\&.
149 .RE
150 .PP
151 \fBSOLV_WARN\fR
152 .RS 4
153 Used to report warnings\&.
154 .RE
155 .PP
156 \fBSOLV_DEBUG_STATS\fR
157 .RS 4
158 Used to report statistical data\&.
159 .RE
160 .PP
161 \fBSOLV_DEBUG_RULE_CREATION\fR
162 .RS 4
163 Used to report information about the solver\(cqs creation of rules\&.
164 .RE
165 .PP
166 \fBSOLV_DEBUG_PROPAGATE\fR
167 .RS 4
168 Used to report information about the solver\(cqs unit rule propagation process\&.
169 .RE
170 .PP
171 \fBSOLV_DEBUG_ANALYZE\fR
172 .RS 4
173 Used to report information about the solver\(cqs learnt rule generation mechanism\&.
174 .RE
175 .PP
176 \fBSOLV_DEBUG_UNSOLVABLE\fR
177 .RS 4
178 Used to report information about the solver dealing with conflicting rules\&.
179 .RE
180 .PP
181 \fBSOLV_DEBUG_SOLUTIONS\fR
182 .RS 4
183 Used to report information about the solver creating solutions to solve problems\&.
184 .RE
185 .PP
186 \fBSOLV_DEBUG_POLICY\fR
187 .RS 4
188 Used to report information about the solver searching for an optimal solution\&.
189 .RE
190 .PP
191 \fBSOLV_DEBUG_RESULT\fR
192 .RS 4
193 Used by the debug functions to output results\&.
194 .RE
195 .PP
196 \fBSOLV_DEBUG_JOB\fR
197 .RS 4
198 Used to report information about the job rule generation process\&.
199 .RE
200 .PP
201 \fBSOLV_DEBUG_SOLVER\fR
202 .RS 4
203 Used to report information about what the solver is currently doing\&.
204 .RE
205 .PP
206 \fBSOLV_DEBUG_TRANSACTION\fR
207 .RS 4
208 Used to report information about the transaction generation and ordering process\&.
209 .RE
210 .PP
211 \fBSOLV_DEBUG_TO_STDERR\fR
212 .RS 4
213 Write debug messages to stderr instead of stdout\&.
214 .RE
215 .SS "Functions"
216 .sp
217 .if n \{\
218 .RS 4
219 .\}
220 .nf
221 \fBvoid pool_debug(Pool *\fR\fIpool\fR\fB, int\fR \fItype\fR\fB, const char *\fR\fIformat\fR\fB, \&.\&.\&.)\fR;
222 .fi
223 .if n \{\
224 .RE
225 .\}
226 .sp
227 Report a message of the type \fItype\fR\&. You can filter debug messages by setting a debug mask\&.
228 .sp
229 .if n \{\
230 .RS 4
231 .\}
232 .nf
233 \fBvoid pool_setdebuglevel(Pool *\fR\fIpool\fR\fB, int\fR \fIlevel\fR\fB)\fR;
234 .fi
235 .if n \{\
236 .RE
237 .\}
238 .sp
239 Set a predefined debug mask\&. A higher level generally means more bits in the mask are set, thus more messages are printed\&.
240 .sp
241 .if n \{\
242 .RS 4
243 .\}
244 .nf
245 \fBvoid pool_setdebugmask(Pool *\fR\fIpool\fR\fB, int\fR \fImask\fR\fB)\fR;
246 .fi
247 .if n \{\
248 .RE
249 .\}
250 .sp
251 Set the debug mask to filter debug messages\&.
252 .sp
253 .if n \{\
254 .RS 4
255 .\}
256 .nf
257 \fBint pool_error(Pool *\fR\fIpool\fR\fB, int\fR \fIret\fR\fB, const char *\fR\fIformat\fR\fB, \&.\&.\&.)\fR;
258 .fi
259 .if n \{\
260 .RE
261 .\}
262 .sp
263 Set the pool\(cqs error string\&. The \fIret\fR value is simply used as a return value of the function so that you can write code like return pool_error(\&...);\&. If the debug mask contains the \fBSOLV_ERROR\fR bit, pool_debug() is also called with the message and type \fBSOLV_ERROR\fR\&.
264 .sp
265 .if n \{\
266 .RS 4
267 .\}
268 .nf
269 \fBextern char *pool_errstr(Pool *\fR\fIpool\fR\fB)\fR;
270 .fi
271 .if n \{\
272 .RE
273 .\}
274 .sp
275 Return the current error string stored in the pool\&. Like with the libc\(cqs errno value, the string is only meaningful after a function returned an error\&.
276 .sp
277 .if n \{\
278 .RS 4
279 .\}
280 .nf
281 \fBvoid pool_setdebugcallback(Pool *\fR\fIpool\fR\fB, void (*\fR\fIdebugcallback\fR\fB)(Pool *, void *\fR\fIdata\fR\fB, int\fR \fItype\fR\fB, const char *\fR\fIstr\fR\fB), void *\fR\fIdebugcallbackdata\fR\fB)\fR;
282 .fi
283 .if n \{\
284 .RE
285 .\}
286 .sp
287 Set a custom debug callback function\&. Instead of writing to stdout or stderr, the callback function will be called\&.
288 .SH "POOL CONFIGURATION"
289 .SS "Constants"
290 .PP
291 \fBDISTTYPE_RPM\fR
292 .RS 4
293 Used for systems which use rpm as low level package manager\&.
294 .RE
295 .PP
296 \fBDISTTYPE_DEB\fR
297 .RS 4
298 Used for systems which use dpkg as low level package manager\&.
299 .RE
300 .PP
301 \fBDISTTYPE_ARCH\fR
302 .RS 4
303 Used for systems which use the arch linux package manager\&.
304 .RE
305 .PP
306 \fBDISTTYPE_HAIKU\fR
307 .RS 4
308 Used for systems which use haiku packages\&.
309 .RE
310 .PP
311 \fBPOOL_FLAG_PROMOTEEPOCH\fR
312 .RS 4
313 Promote the epoch of the providing dependency to the requesting dependency if it does not contain an epoch\&. Used at some time in old rpm versions, modern systems should never need this\&.
314 .RE
315 .PP
316 \fBPOOL_FLAG_FORBIDSELFCONFLICTS\fR
317 .RS 4
318 Disallow the installation of packages that conflict with themselves\&. Debian always allows self\-conflicting packages, rpm used to forbid them but switched to also allowing them recently\&.
319 .RE
320 .PP
321 \fBPOOL_FLAG_OBSOLETEUSESPROVIDES\fR
322 .RS 4
323 Make obsolete type dependency match against provides instead of just the name and version of packages\&. Very old versions of rpm used the name/version, then it got switched to provides and later switched back again to just name/version\&.
324 .RE
325 .PP
326 \fBPOOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES\fR
327 .RS 4
328 An implicit obsoletes is the internal mechanism to remove the old package on an update\&. The default is to remove all packages with the same name, rpm\-5 switched to also removing packages providing the same name\&.
329 .RE
330 .PP
331 \fBPOOL_FLAG_OBSOLETEUSESCOLORS\fR
332 .RS 4
333 Rpm\(cqs multilib implementation (used in RedHat and Fedora) distinguishes between 32bit and 64bit packages (the terminology is that they have a different color)\&. If obsoleteusescolors is set, packages with different colors will not obsolete each other\&.
334 .RE
335 .PP
336 \fBPOOL_FLAG_IMPLICITOBSOLETEUSESCOLORS\fR
337 .RS 4
338 Same as POOL_FLAG_OBSOLETEUSESCOLORS, but used to find out if packages of the same name can be installed in parallel\&. For current Fedora systems, POOL_FLAG_OBSOLETEUSESCOLORS should be false and POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS should be true (this is the default if FEDORA is defined when libsolv is compiled)\&.
339 .RE
340 .PP
341 \fBPOOL_FLAG_NOINSTALLEDOBSOLETES\fR
342 .RS 4
343 New versions of rpm consider the obsoletes of installed packages when checking for dependency, thus you may not install a package that is obsoleted by some other installed package, unless you also erase the other package\&.
344 .RE
345 .PP
346 \fBPOOL_FLAG_HAVEDISTEPOCH\fR
347 .RS 4
348 Mandriva added a new field called distepoch that gets checked in version comparison if the epoch/version/release of two packages are the same\&.
349 .RE
350 .PP
351 \fBPOOL_FLAG_NOOBSOLETESMULTIVERSION\fR
352 .RS 4
353 If a package is installed in multiversionmode, rpm used to ignore both the implicit obsoletes and the obsolete dependency of a package\&. This was changed to ignoring just the implicit obsoletes, thus you may install multiple versions of the same name, but obsoleted packages still get removed\&.
354 .RE
355 .PP
356 \fBPOOL_FLAG_ADDFILEPROVIDESFILTERED\fR
357 .RS 4
358 Make the addfileprovides method only add files from the standard locations (i\&.e\&. the \(lqbin\(rq and \(lqetc\(rq directories)\&. This is useful if you have only few packages that use non\-standard file dependencies, but you still want the fast speed that addfileprovides() generates\&.
359 .RE
360 .SS "Functions"
361 .sp
362 .if n \{\
363 .RS 4
364 .\}
365 .nf
366 \fBint pool_setdisttype(Pool *\fR\fIpool\fR\fB, int\fR \fIdisttype\fR\fB)\fR;
367 .fi
368 .if n \{\
369 .RE
370 .\}
371 .sp
372 Set the package type of your system\&. The disttype is used for example to define package comparison semantics\&. Libsolv\(cqs default disttype should match the package manager of your system, so you only need to use this function if you want to use the library to solve packaging problems for different systems\&. The Function returns the old disttype on success, and \-1 if the new disttype is not supported\&. Note that any pool_setarch and pool_setarchpolicy calls need to come after the pool_setdisttype call, as they make use of the noarch/any/all architecture id\&.
373 .sp
374 .if n \{\
375 .RS 4
376 .\}
377 .nf
378 \fBint pool_set_flag(Pool *\fR\fIpool\fR\fB, int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR;
379 .fi
380 .if n \{\
381 .RE
382 .\}
383 .sp
384 Set a flag to a new value\&. Returns the old value of the flag\&.
385 .sp
386 .if n \{\
387 .RS 4
388 .\}
389 .nf
390 \fBint pool_get_flag(Pool *\fR\fIpool\fR\fB, int\fR \fIflag\fR\fB)\fR;
391 .fi
392 .if n \{\
393 .RE
394 .\}
395 .sp
396 Get the value of a pool flag\&. See the constants section about the meaning of the flags\&.
397 .sp
398 .if n \{\
399 .RS 4
400 .\}
401 .nf
402 \fBvoid pool_set_rootdir(Pool *\fR\fIpool\fR\fB, const char *\fR\fIrootdir\fR\fB)\fR;
403 .fi
404 .if n \{\
405 .RE
406 .\}
407 .sp
408 Set a specific root directory\&. Some library functions support a flag that tells the function to prepend the rootdir to file and directory names\&.
409 .sp
410 .if n \{\
411 .RS 4
412 .\}
413 .nf
414 \fBconst char *pool_get_rootdir(Pool *\fR\fIpool\fR\fB)\fR;
415 .fi
416 .if n \{\
417 .RE
418 .\}
419 .sp
420 Return the current value of the root directory\&.
421 .sp
422 .if n \{\
423 .RS 4
424 .\}
425 .nf
426 \fBchar *pool_prepend_rootdir(Pool *\fR\fIpool\fR\fB, const char *\fR\fIdir\fR\fB)\fR;
427 .fi
428 .if n \{\
429 .RE
430 .\}
431 .sp
432 Prepend the root directory to the \fIdir\fR argument string\&. The returned string has been newly allocated and needs to be freed after use\&.
433 .sp
434 .if n \{\
435 .RS 4
436 .\}
437 .nf
438 \fBchar *pool_prepend_rootdir_tmp(Pool *\fR\fIpool\fR\fB, const char *\fR\fIdir\fR\fB)\fR;
439 .fi
440 .if n \{\
441 .RE
442 .\}
443 .sp
444 Same as pool_prepend_rootdir, but uses the pool\(cqs temporary space for allocation\&.
445 .sp
446 .if n \{\
447 .RS 4
448 .\}
449 .nf
450 \fBvoid pool_set_installed(Pool *\fR\fIpool\fR\fB, Repo *\fR\fIrepo\fR\fB)\fR;
451 .fi
452 .if n \{\
453 .RE
454 .\}
455 .sp
456 Set which repository should be treated as the \(lqinstalled\(rq repository, i\&.e\&. the one that holds information about the installed packages\&.
457 .sp
458 .if n \{\
459 .RS 4
460 .\}
461 .nf
462 \fBvoid pool_set_languages(Pool *\fR\fIpool\fR\fB, const char **\fR\fIlanguages\fR\fB, int\fR \fInlanguages\fR\fB)\fR;
463 .fi
464 .if n \{\
465 .RE
466 .\}
467 .sp
468 Set the language of your system\&. The library provides lookup functions that return localized strings, for example for package descriptions\&. You can set an array of languages to provide a fallback mechanism if one language is not available\&.
469 .sp
470 .if n \{\
471 .RS 4
472 .\}
473 .nf
474 \fBvoid pool_setarch(Pool *\fR\fIpool\fR\fB, const char *\fR\fIarch\fR\fB)\fR;
475 .fi
476 .if n \{\
477 .RE
478 .\}
479 .sp
480 Set the architecture of your system\&. The architecture is used to determine which packages are installable and which packages cannot be installed\&. The \fIarch\fR argument is normally the \(lqmachine\(rq value of the \(lquname\(rq system call\&.
481 .sp
482 .if n \{\
483 .RS 4
484 .\}
485 .nf
486 \fBvoid pool_setarchpolicy(Pool *, const char *)\fR;
487 .fi
488 .if n \{\
489 .RE
490 .\}
491 .sp
492 Set the architecture policy for your system\&. This is the general version of pool_setarch (in fact pool_setarch calls pool_setarchpolicy internally)\&. See the section about architecture policies for more information\&.
493 .sp
494 .if n \{\
495 .RS 4
496 .\}
497 .nf
498 \fBvoid pool_addvendorclass(Pool *\fR\fIpool\fR\fB, const char **\fR\fIvendorclass\fR\fB)\fR;
499 .fi
500 .if n \{\
501 .RE
502 .\}
503 .sp
504 Add a new vendor equivalence class to the system\&. A vendor equivalence class defines if an installed package of one vendor can be replaced by a package coming from a different vendor\&. The \fIvendorclass\fR argument must be a NULL terminated array of strings\&. See the section about vendor policies for more information\&.
505 .sp
506 .if n \{\
507 .RS 4
508 .\}
509 .nf
510 \fBvoid pool_setvendorclasses(Pool *\fR\fIpool\fR\fB, const char **\fR\fIvendorclasses\fR\fB)\fR;
511 .fi
512 .if n \{\
513 .RE
514 .\}
515 .sp
516 Set all allowed vendor equivalences\&. The vendorclasses argument must be an NULL terminated array consisting of all allowed classes concatenated\&. Each class itself must be NULL terminated, thus the last class ends with two NULL elements, one to finish the class and one to finish the list of classes\&.
517 .sp
518 .if n \{\
519 .RS 4
520 .\}
521 .nf
522 \fBvoid pool_set_custom_vendorcheck(Pool *\fR\fIpool\fR\fB, int (*\fR\fIvendorcheck\fR\fB)(Pool *, Solvable *, Solvable *))\fR;
523 .fi
524 .if n \{\
525 .RE
526 .\}
527 .sp
528 Define a custom vendor check mechanism\&. You can use this if libsolv\(cqs internal vendor equivalence class mechanism does not match your needs\&.
529 .sp
530 .if n \{\
531 .RS 4
532 .\}
533 .nf
534 \fBvoid pool_setloadcallback(Pool *\fR\fIpool\fR\fB, int (*\fR\fIcb\fR\fB)(Pool *, Repodata *, void *), void *\fR\fIloadcbdata\fR\fB)\fR;
535 .fi
536 .if n \{\
537 .RE
538 .\}
539 .sp
540 Define a callback function that gets called when repository metadata needs to be loaded on demand\&. See the section about on demand loading in the libsolv\-repodata manual\&.
541 .sp
542 .if n \{\
543 .RS 4
544 .\}
545 .nf
546 \fBvoid pool_setnamespacecallback(Pool *\fR\fIpool\fR\fB, Id (*\fR\fIcb\fR\fB)(Pool *, void *,\fR \fIId\fR\fB,\fR \fIId\fR\fB), void *\fR\fInscbdata\fR\fB)\fR;
547 .fi
548 .if n \{\
549 .RE
550 .\}
551 .sp
552 Define a callback function to implement custom namespace support\&. See the section about namespace dependencies\&.
553 .SH "ID POOL MANAGEMENT"
554 .SS "Constants"
555 .PP
556 \fBID_EMPTY\fR
557 .RS 4
558 The Id of the empty string, it is always Id 1\&.
559 .RE
560 .PP
561 \fBREL_LT\fR
562 .RS 4
563 Represents a \(lq<\(rq relation\&.
564 .RE
565 .PP
566 \fBREL_EQ\fR
567 .RS 4
568 Represents a \(lq=\(rq relation\&.
569 .RE
570 .PP
571 \fBREL_GT\fR
572 .RS 4
573 Represents a \(lq>\(rq relation\&. You can use combinations of REL_GT, REL_EQ, and REL_LT or\-ed together to create any relation you like\&.
574 .RE
575 .PP
576 \fBREL_AND\fR
577 .RS 4
578 A boolean AND operation, the \(lqname\(rq and \(lqevr\(rq parts of the relation can be two sub\-dependencies\&. Packages must match both parts of the dependency\&.
579 .RE
580 .PP
581 \fBREL_OR\fR
582 .RS 4
583 A boolean OR operation, the \(lqname\(rq and \(lqevr\(rq parts of the relation can be two sub\-dependencies\&. Packages can match any part of the dependency\&.
584 .RE
585 .PP
586 \fBREL_WITH\fR
587 .RS 4
588 Like REL_AND, but packages must match both dependencies simultaneously\&. See the section about boolean dependencies about more information\&.
589 .RE
590 .PP
591 \fBREL_NAMESPACE\fR
592 .RS 4
593 A special namespace relation\&. See the section about namespace dependencies for more information\&.
594 .RE
595 .PP
596 \fBREL_ARCH\fR
597 .RS 4
598 An architecture filter dependency\&. The \(lqname\(rq part of the relation is a sub\-dependency, the \(lqevr\(rq part is the Id of an architecture that the matching packages must have (note that this is an exact match ignoring architecture policies)\&.
599 .RE
600 .PP
601 \fBREL_FILECONFLICT\fR
602 .RS 4
603 An internal file conflict dependency used to represent file conflicts\&. See the pool_add_fileconflicts_deps() function\&.
604 .RE
605 .PP
606 \fBREL_COND\fR
607 .RS 4
608 A conditional dependency, the \(lqname\(rq sub\-dependency is only considered if the \(lqevr\(rq sub\-dependency is fulfilled\&. See the section about boolean dependencies about more information\&.
609 .RE
610 .PP
611 \fBREL_UNLESS\fR
612 .RS 4
613 A conditional dependency, the \(lqname\(rq sub\-dependency is only considered if the \(lqevr\(rq sub\-dependency is not fulfilled\&. See the section about boolean dependencies about more information\&.
614 .RE
615 .PP
616 \fBREL_COMPAT\fR
617 .RS 4
618 A compat dependency used in Haiku to represent version ranges\&. The \(lqname\(rq part is the actual version, the \(lqevr\(rq part is the backwards compatibility version\&.
619 .RE
620 .PP
621 \fBREL_KIND\fR
622 .RS 4
623 A pseudo dependency that limits the solvables to a specific kind\&. The kind is expected to be a prefix of the solvable name, e\&.g\&. \(lqpatch:foo\(rq would be of kind \(lqpatch\(rq\&. \(lqREL_KIND\(rq is only supported in the selection functions\&.
624 .RE
625 .PP
626 \fBREL_MULTIARCH\fR
627 .RS 4
628 A debian multiarch annotation\&. The most common value for the \(lqevr\(rq part is \(lqany\(rq\&.
629 .RE
630 .PP
631 \fBREL_ELSE\fR
632 .RS 4
633 The else part of a \(lqREL_COND\(rq or \(lqREL_UNLESS\(rq dependency\&. See the section about boolean dependencies\&.
634 .RE
635 .PP
636 \fBREL_ERROR\fR
637 .RS 4
638 An illegal dependency\&. This is useful to encode dependency parse errors\&.
639 .RE
640 .SS "Functions"
641 .sp
642 .if n \{\
643 .RS 4
644 .\}
645 .nf
646 \fBId pool_str2id(Pool *\fR\fIpool\fR\fB, const char *\fR\fIstr\fR\fB, int\fR \fIcreate\fR\fB)\fR;
647 .fi
648 .if n \{\
649 .RE
650 .\}
651 .sp
652 Add a string to the pool of unified strings, returning the Id of the string\&. If \fIcreate\fR is zero, new strings will not be added to the pool, instead Id 0 is returned\&.
653 .sp
654 .if n \{\
655 .RS 4
656 .\}
657 .nf
658 \fBId pool_strn2id(Pool *\fR\fIpool\fR\fB, const char *\fR\fIstr\fR\fB, unsigned int\fR \fIlen\fR\fB, int\fR \fIcreate\fR\fB)\fR;
659 .fi
660 .if n \{\
661 .RE
662 .\}
663 .sp
664 Same as pool_str2id, but only \fIlen\fR characters of the string are used\&. This can be used to add substrings to the pool\&.
665 .sp
666 .if n \{\
667 .RS 4
668 .\}
669 .nf
670 \fBId pool_rel2id(Pool *\fR\fIpool\fR\fB, Id\fR \fIname\fR\fB, Id\fR \fIevr\fR\fB, int\fR \fIflags\fR\fB, int\fR \fIcreate\fR\fB)\fR;
671 .fi
672 .if n \{\
673 .RE
674 .\}
675 .sp
676 Create a relational dependency from to other dependencies, \fIname\fR and \fIevr\fR, and a \fIflag\fR\&. See the \fBREL_\fR constants for the supported flags\&. As with pool_str2id, \fIcreate\fR defines if new dependencies will get added or Id zero will be returned instead\&.
677 .sp
678 .if n \{\
679 .RS 4
680 .\}
681 .nf
682 \fBId pool_id2langid(Pool *\fR\fIpool\fR\fB, Id\fR \fIid\fR\fB, const char *\fR\fIlang\fR\fB, int\fR \fIcreate\fR\fB)\fR;
683 .fi
684 .if n \{\
685 .RE
686 .\}
687 .sp
688 Attach a language suffix to a string Id\&. This function can be used to create language keyname Ids from keynames, it is functional equivalent to converting the \fIid\fR argument to a string, adding a \(lq:\(rq character and the \fIlang\fR argument to the string and then converting the result back into an Id\&.
689 .sp
690 .if n \{\
691 .RS 4
692 .\}
693 .nf
694 \fBconst char *pool_id2str(const Pool *\fR\fIpool\fR\fB, Id\fR \fIid\fR\fB)\fR;
695 .fi
696 .if n \{\
697 .RE
698 .\}
699 .sp
700 Convert an Id back into a string\&. If the Id is a relational Id, the \(lqname\(rq part will be converted instead\&.
701 .sp
702 .if n \{\
703 .RS 4
704 .\}
705 .nf
706 \fBconst char *pool_id2rel(const Pool *\fR\fIpool\fR\fB, Id\fR \fIid\fR\fB)\fR;
707 .fi
708 .if n \{\
709 .RE
710 .\}
711 .sp
712 Return the relation string of a relational Id\&. Returns an empty string if the passed Id is not a relation\&.
713 .sp
714 .if n \{\
715 .RS 4
716 .\}
717 .nf
718 \fBconst char *pool_id2evr(const Pool *\fR\fIpool\fR\fB, Id\fR \fIid\fR\fB)\fR;
719 .fi
720 .if n \{\
721 .RE
722 .\}
723 .sp
724 Return the \(lqevr\(rq part of a relational Id as string\&. Returns an empty string if the passed Id is not a relation\&.
725 .sp
726 .if n \{\
727 .RS 4
728 .\}
729 .nf
730 \fBconst char *pool_dep2str(Pool *\fR\fIpool\fR\fB, Id\fR \fIid\fR\fB)\fR;
731 .fi
732 .if n \{\
733 .RE
734 .\}
735 .sp
736 Convert an Id back into a string\&. If the passed Id belongs to a relation, a string representing the relation is returned\&. Note that in that case the string is allocated on the pool\(cqs temporary space\&.
737 .sp
738 .if n \{\
739 .RS 4
740 .\}
741 .nf
742 \fBvoid pool_freeidhashes(Pool *\fR\fIpool\fR\fB)\fR;
743 .fi
744 .if n \{\
745 .RE
746 .\}
747 .sp
748 Free the hashes used to unify strings and relations\&. You can use this function to save memory if you know that you will no longer create new strings and relations\&.
749 .SH "SOLVABLE FUNCTIONS"
750 .sp
751 .if n \{\
752 .RS 4
753 .\}
754 .nf
755 \fBSolvable *pool_id2solvable(const Pool *\fR\fIpool\fR\fB, Id\fR \fIp\fR\fB)\fR;
756 .fi
757 .if n \{\
758 .RE
759 .\}
760 .sp
761 Convert a solvable Id into a pointer to the solvable data\&. Note that the pointer may become invalid if new solvables are created or old solvables deleted, because the array storing all solvables may get reallocated\&.
762 .sp
763 .if n \{\
764 .RS 4
765 .\}
766 .nf
767 \fBconst char *pool_solvid2str(Pool *\fR\fIpool\fR\fB, Id\fR \fIp\fR\fB)\fR;
768 .fi
769 .if n \{\
770 .RE
771 .\}
772 .sp
773 Return a string representing the solvable with the Id \fIp\fR\&. The string will be some canonical representation of the solvable, usually a combination of the name, the version, and the architecture\&.
774 .sp
775 .if n \{\
776 .RS 4
777 .\}
778 .nf
779 \fBconst char *pool_solvable2str(Pool *\fR\fIpool\fR\fB, Solvable *\fR\fIs\fR\fB)\fR;
780 .fi
781 .if n \{\
782 .RE
783 .\}
784 .sp
785 Same as pool_solvid2str, but instead of the Id, a pointer to the solvable is passed\&.
786 .SH "DEPENDENCY MATCHING"
787 .SS "Constants"
788 .PP
789 \fBEVRCMP_COMPARE\fR
790 .RS 4
791 Compare all parts of the version, treat missing parts as empty strings\&.
792 .RE
793 .PP
794 \fBEVRCMP_MATCH_RELEASE\fR
795 .RS 4
796 A special mode for rpm version string matching\&. If a version misses a release part, it matches all releases\&. In that case the special values \(lq\-2\(rq and \(lq2\(rq are returned, depending on which of the two versions did not have a release part\&.
797 .RE
798 .PP
799 \fBEVRCMP_MATCH\fR
800 .RS 4
801 A generic match, missing parts always match\&.
802 .RE
803 .PP
804 \fBEVRCMP_COMPARE_EVONLY\fR
805 .RS 4
806 Only compare the epoch and the version parts, ignore the release part\&.
807 .RE
808 .SS "Functions"
809 .sp
810 .if n \{\
811 .RS 4
812 .\}
813 .nf
814 \fBint pool_evrcmp(const Pool *\fR\fIpool\fR\fB, Id\fR \fIevr1id\fR\fB, Id\fR \fIevr2id\fR\fB, int\fR \fImode\fR\fB)\fR;
815 .fi
816 .if n \{\
817 .RE
818 .\}
819 .sp
820 Compare two version Ids, return \-1 if the first version is less than the second version, 0 if they are identical, and 1 if the first version is bigger than the second one\&.
821 .sp
822 .if n \{\
823 .RS 4
824 .\}
825 .nf
826 \fBint pool_evrcmp_str(const Pool *\fR\fIpool\fR\fB, const char *\fR\fIevr1\fR\fB, const char *\fR\fIevr2\fR\fB, int\fR \fImode\fR\fB)\fR;
827 .fi
828 .if n \{\
829 .RE
830 .\}
831 .sp
832 Same as pool_evrcmp(), but uses strings instead of Ids\&.
833 .sp
834 .if n \{\
835 .RS 4
836 .\}
837 .nf
838 \fBint pool_evrmatch(const Pool *\fR\fIpool\fR\fB, Id\fR \fIevrid\fR\fB, const char *\fR\fIepoch\fR\fB, const char *\fR\fIversion\fR\fB, const char *\fR\fIrelease\fR\fB)\fR;
839 .fi
840 .if n \{\
841 .RE
842 .\}
843 .sp
844 Match a version Id against an epoch, a version and a release string\&. Passing NULL means that the part should match everything\&.
845 .sp
846 .if n \{\
847 .RS 4
848 .\}
849 .nf
850 \fBint pool_match_dep(Pool *\fR\fIpool\fR\fB, Id\fR \fId1\fR\fB, Id\fR \fId2\fR\fB)\fR;
851 .fi
852 .if n \{\
853 .RE
854 .\}
855 .sp
856 Returns \(lq1\(rq if the dependency \fId1\fR (the provider) is matched by the dependency \fId2\fR, otherwise \(lq0\(rq is returned\&. For two dependencies to match, both the \(lqname\(rq parts must match and the version range described by the \(lqevr\(rq parts must overlap\&.
857 .sp
858 .if n \{\
859 .RS 4
860 .\}
861 .nf
862 \fBint pool_match_nevr(Pool *\fR\fIpool\fR\fB, Solvable *\fR\fIs\fR\fB, Id\fR \fId\fR\fB)\fR;
863 .fi
864 .if n \{\
865 .RE
866 .\}
867 .sp
868 Like pool_match_dep, but the provider is the "self\-provides" dependency of the Solvable \fIs\fR, i\&.e\&. the dependency \(lqs→name = s→evr\(rq\&.
869 .SH "WHATPROVIDES INDEX"
870 .sp
871 .if n \{\
872 .RS 4
873 .\}
874 .nf
875 \fBvoid pool_createwhatprovides(Pool *\fR\fIpool\fR\fB)\fR;
876 .fi
877 .if n \{\
878 .RE
879 .\}
880 .sp
881 Create an index that maps dependency Ids to sets of packages that provide the dependency\&.
882 .sp
883 .if n \{\
884 .RS 4
885 .\}
886 .nf
887 \fBvoid pool_freewhatprovides(Pool *\fR\fIpool\fR\fB)\fR;
888 .fi
889 .if n \{\
890 .RE
891 .\}
892 .sp
893 Free the whatprovides index to save memory\&.
894 .sp
895 .if n \{\
896 .RS 4
897 .\}
898 .nf
899 \fBId pool_whatprovides(Pool *\fR\fIpool\fR\fB, Id\fR \fId\fR\fB)\fR;
900 .fi
901 .if n \{\
902 .RE
903 .\}
904 .sp
905 Return an offset into the Pool\(cqs whatprovidesdata array\&. The solvables with the Ids stored starting at that offset provide the dependency \fId\fR\&. The solvable list is zero terminated\&.
906 .sp
907 .if n \{\
908 .RS 4
909 .\}
910 .nf
911 \fBId *pool_whatprovides_ptr(Pool *\fR\fIpool\fR\fB, Id\fR \fId\fR\fB)\fR;
912 .fi
913 .if n \{\
914 .RE
915 .\}
916 .sp
917 Instead of returning the offset, return the pointer to the Ids stored at that offset\&. Note that this pointer has a very limit validity time, as any call that adds new values to the whatprovidesdata area may reallocate the array\&.
918 .sp
919 .if n \{\
920 .RS 4
921 .\}
922 .nf
923 \fBId pool_queuetowhatprovides(Pool *\fR\fIpool\fR\fB, Queue *\fR\fIq\fR\fB)\fR;
924 .fi
925 .if n \{\
926 .RE
927 .\}
928 .sp
929 Add the contents of the Queue \fIq\fR to the end of the whatprovidesdata array, returning the offset into the array\&.
930 .sp
931 .if n \{\
932 .RS 4
933 .\}
934 .nf
935 \fBvoid pool_addfileprovides(Pool *\fR\fIpool\fR\fB)\fR;
936 .fi
937 .if n \{\
938 .RE
939 .\}
940 .sp
941 Some package managers like rpm allow dependencies on files contained in other packages\&. To allow libsolv to deal with those dependencies in an efficient way, you need to call the addfileprovides method after creating and reading all repositories\&. This method will scan all dependency for file names and then scan all packages for matching files\&. If a filename has been matched, it will be added to the provides list of the corresponding package\&.
942 .sp
943 .if n \{\
944 .RS 4
945 .\}
946 .nf
947 \fBvoid pool_addfileprovides_queue(Pool *\fR\fIpool\fR\fB, Queue *\fR\fIidq\fR\fB, Queue *\fR\fIidqinst\fR\fB)\fR;
948 .fi
949 .if n \{\
950 .RE
951 .\}
952 .sp
953 Same as pool_addfileprovides, but the added Ids are returned in two Queues, \fIidq\fR for all repositories except the one containing the \(lqinstalled\(rq packages, \fIidqinst\fR for the latter one\&. This information can be stored in the meta section of the repositories to speed up the next time the repository is loaded and addfileprovides is called
954 .sp
955 .if n \{\
956 .RS 4
957 .\}
958 .nf
959 \fBvoid pool_flush_namespaceproviders(Pool *\fR\fIpool\fR\fB, Id\fR \fIns\fR\fB, Id\fR \fIevr\fR\fB)\fR;
960 .fi
961 .if n \{\
962 .RE
963 .\}
964 .sp
965 Clear the cache of the providers for namespace dependencies matching namespace \fIns\fR\&. If the \fIevr\fR argument is non\-zero, the namespace dependency for exactly that dependency is cleared, otherwise all matching namespace dependencies are cleared\&. See the section about Namespace dependencies for further information\&.
966 .sp
967 .if n \{\
968 .RS 4
969 .\}
970 .nf
971 \fBvoid pool_add_fileconflicts_deps(Pool *\fR\fIpool\fR\fB, Queue *\fR\fIconflicts\fR\fB)\fR;
972 .fi
973 .if n \{\
974 .RE
975 .\}
976 .sp
977 Some package managers like rpm report conflicts when a package installation overwrites a file of another installed package with different content\&. As file content information is not stored in the repository metadata, those conflicts can only be detected after the packages are downloaded\&. Libsolv provides a function to check for such conflicts, pool_findfileconflicts()\&. If conflicts are found, they can be added as special \fBREL_FILECONFLICT\fR provides dependencies, so that the solver will know about the conflict when it is re\-run\&.
978 .SH "UTILITY FUNCTIONS"
979 .sp
980 .if n \{\
981 .RS 4
982 .\}
983 .nf
984 \fBchar *pool_alloctmpspace(Pool *\fR\fIpool\fR\fB, int\fR \fIlen\fR\fB)\fR;
985 .fi
986 .if n \{\
987 .RE
988 .\}
989 .sp
990 Allocate space on the pool\(cqs temporary space area\&. This space has a limited lifetime, it will be automatically freed after a fixed amount (currently 16) of other pool_alloctmpspace() calls are done\&.
991 .sp
992 .if n \{\
993 .RS 4
994 .\}
995 .nf
996 \fBvoid pool_freetmpspace(Pool *\fR\fIpool\fR\fB, const char *\fR\fIspace\fR\fB)\fR;
997 .fi
998 .if n \{\
999 .RE
1000 .\}
1001 .sp
1002 Give the space allocated with pool_alloctmpspace back to the system\&. You do not have to use this function, as the space is automatically reclaimed, but it can be useful to extend the lifetime of other pointers to the pool\(cqs temporary space area\&.
1003 .sp
1004 .if n \{\
1005 .RS 4
1006 .\}
1007 .nf
1008 \fBconst char *pool_bin2hex(Pool *\fR\fIpool\fR\fB, const unsigned char *\fR\fIbuf\fR\fB, int\fR \fIlen\fR\fB)\fR;
1009 .fi
1010 .if n \{\
1011 .RE
1012 .\}
1013 .sp
1014 Convert some binary data to hexadecimal, returning a string allocated in the pool\(cqs temporary space area\&.
1015 .sp
1016 .if n \{\
1017 .RS 4
1018 .\}
1019 .nf
1020 \fBchar *pool_tmpjoin(Pool *\fR\fIpool\fR\fB, const char *\fR\fIstr1\fR\fB, const char *\fR\fIstr2\fR\fB, const char *\fR\fIstr3\fR\fB)\fR;
1021 .fi
1022 .if n \{\
1023 .RE
1024 .\}
1025 .sp
1026 Join three strings and return the result in the pool\(cqs temporary space area\&. You can use NULL arguments if you just want to join less strings\&.
1027 .sp
1028 .if n \{\
1029 .RS 4
1030 .\}
1031 .nf
1032 \fBchar *pool_tmpappend(Pool *\fR\fIpool\fR\fB, const char *\fR\fIstr1\fR\fB, const char *\fR\fIstr2\fR\fB, const char *\fR\fIstr3\fR\fB)\fR;
1033 .fi
1034 .if n \{\
1035 .RE
1036 .\}
1037 .sp
1038 Like pool_tmpjoin(), but if the first argument is the last allocated space in the pool\(cqs temporary space area, it will be replaced with the result of the join and no new temporary space slot will be used\&. Thus you can join more than three strings by a combination of one pool_tmpjoin() and multiple pool_tmpappend() calls\&. Note that the \fIstr1\fR pointer is no longer usable after the call\&.
1039 .SH "DATA LOOKUP"
1040 .SS "Constants"
1041 .PP
1042 \fBSOLVID_POS\fR
1043 .RS 4
1044 Use the data position stored in the pool for the lookup instead of looking up the data of a solvable\&.
1045 .RE
1046 .PP
1047 \fBSOLVID_META\fR
1048 .RS 4
1049 Use the data stored in the meta section of a repository (or repodata area) instead of looking up the data of a solvable\&. This constant does not work for the pool\(cqs lookup functions, use it for the repo\(cqs or repodata\(cqs lookup functions instead\&. It\(cqs just listed for completeness\&.
1050 .RE
1051 .SS "Functions"
1052 .sp
1053 .if n \{\
1054 .RS 4
1055 .\}
1056 .nf
1057 \fBconst char *pool_lookup_str(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR;
1058 .fi
1059 .if n \{\
1060 .RE
1061 .\}
1062 .sp
1063 Return the string value stored under the attribute \fIkeyname\fR in solvable \fIsolvid\fR\&.
1064 .sp
1065 .if n \{\
1066 .RS 4
1067 .\}
1068 .nf
1069 \fBunsigned long long pool_lookup_num(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR\fB)\fR;
1070 .fi
1071 .if n \{\
1072 .RE
1073 .\}
1074 .sp
1075 Return the 64bit unsigned number stored under the attribute \fIkeyname\fR in solvable \fIsolvid\fR\&. If no such number is found, the value of the \fInotfound\fR argument is returned instead\&.
1076 .sp
1077 .if n \{\
1078 .RS 4
1079 .\}
1080 .nf
1081 \fBId pool_lookup_id(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR;
1082 .fi
1083 .if n \{\
1084 .RE
1085 .\}
1086 .sp
1087 Return the Id stored under the attribute \fIkeyname\fR in solvable \fIsolvid\fR\&.
1088 .sp
1089 .if n \{\
1090 .RS 4
1091 .\}
1092 .nf
1093 \fBint pool_lookup_idarray(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Queue *\fR\fIq\fR\fB)\fR;
1094 .fi
1095 .if n \{\
1096 .RE
1097 .\}
1098 .sp
1099 Fill the queue \fIq\fR with the content of the Id array stored under the attribute \fIkeyname\fR in solvable \fIsolvid\fR\&. Returns \(lq1\(rq if an array was found, otherwise the queue will be empty and \(lq0\(rq will be returned\&.
1100 .sp
1101 .if n \{\
1102 .RS 4
1103 .\}
1104 .nf
1105 \fBint pool_lookup_void(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR;
1106 .fi
1107 .if n \{\
1108 .RE
1109 .\}
1110 .sp
1111 Returns \(lq1\(rq if a void value is stored under the attribute \fIkeyname\fR in solvable \fIsolvid\fR, otherwise \(lq0\(rq\&.
1112 .sp
1113 .if n \{\
1114 .RS 4
1115 .\}
1116 .nf
1117 \fBconst char *pool_lookup_checksum(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Id *\fR\fItypep\fR\fB)\fR;
1118 .fi
1119 .if n \{\
1120 .RE
1121 .\}
1122 .sp
1123 Return the checksum that is stored under the attribute \fIkeyname\fR in solvable \fIsolvid\fR\&. The type of the checksum will be returned over the \fItypep\fR pointer\&. If no such checksum is found, NULL will be returned and the type will be set to zero\&. Note that the result is stored in the Pool\(cqs temporary space area\&.
1124 .sp
1125 .if n \{\
1126 .RS 4
1127 .\}
1128 .nf
1129 \fBconst unsigned char *pool_lookup_bin_checksum(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Id *\fR\fItypep\fR\fB)\fR;
1130 .fi
1131 .if n \{\
1132 .RE
1133 .\}
1134 .sp
1135 Return the checksum that is stored under the attribute \fIkeyname\fR in solvable \fIsolvid\fR\&. Returns the checksum as binary data, you can use the returned type to calculate the length of the checksum\&. No temporary space area is needed\&.
1136 .sp
1137 .if n \{\
1138 .RS 4
1139 .\}
1140 .nf
1141 \fBconst char *pool_lookup_deltalocation(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, unsigned int *\fR\fImedianrp\fR\fB)\fR;
1142 .fi
1143 .if n \{\
1144 .RE
1145 .\}
1146 .sp
1147 This is a utility lookup function to return the delta location for a delta rpm\&. As solvables cannot store deltas, you have to use SOLVID_POS as argument and set the Pool\(cqs datapos pointer to point to valid delta rpm data\&.
1148 .sp
1149 .if n \{\
1150 .RS 4
1151 .\}
1152 .nf
1153 \fBvoid pool_search(Pool *\fR\fIpool\fR\fB, Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB, int (*\fR\fIcallback\fR\fB)(void *\fR\fIcbdata\fR\fB, Solvable *\fR\fIs\fR\fB, Repodata *\fR\fIdata\fR\fB, Repokey *\fR\fIkey\fR\fB, KeyValue *\fR\fIkv\fR\fB), void *\fR\fIcbdata\fR\fB)\fR;
1154 .fi
1155 .if n \{\
1156 .RE
1157 .\}
1158 .sp
1159 Perform a search on all data stored in the pool\&. You can limit the search area by using the \fIsolvid\fR and \fIkeyname\fR arguments\&. The values can be optionally matched against the \fImatch\fR argument, use NULL if you do not want this matching\&. See the Dataiterator manpage about the possible matches modes and the \fIflags\fR argument\&. For all (matching) values, the callback function is called with the \fIcbdata\fR callback argument and the data describing the value\&.
1160 .SH "JOB AND SELECTION FUNCTIONS"
1161 .sp
1162 A Job consists of two Ids, \fIhow\fR and \fIwhat\fR\&. The \fIhow\fR part describes the action, the job flags, and the selection method while the \fIwhat\fR part is in input for the selection\&. A Selection is a queue consisting of multiple jobs (thus the number of elements in the queue must be a multiple of two)\&. See the Solver manpage for more information about jobs\&.
1163 .sp
1164 .if n \{\
1165 .RS 4
1166 .\}
1167 .nf
1168 \fBconst char *pool_job2str(Pool *\fR\fIpool\fR\fB, Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB, Id\fR \fIflagmask\fR\fB)\fR;
1169 .fi
1170 .if n \{\
1171 .RE
1172 .\}
1173 .sp
1174 Convert a job into a string\&. Useful for debugging purposes\&. The \fIflagmask\fR can be used to mask the flags of the job, use \(lq0\(rq if you do not want to see such flags, \(lq\-1\(rq to see all flags, or a combination of the flags you want to see\&.
1175 .sp
1176 .if n \{\
1177 .RS 4
1178 .\}
1179 .nf
1180 \fBvoid pool_job2solvables(Pool *\fR\fIpool\fR\fB, Queue *\fR\fIpkgs\fR\fB, Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR;
1181 .fi
1182 .if n \{\
1183 .RE
1184 .\}
1185 .sp
1186 Return a list of solvables that the specified job selects\&.
1187 .sp
1188 .if n \{\
1189 .RS 4
1190 .\}
1191 .nf
1192 \fBint pool_isemptyupdatejob(Pool *\fR\fIpool\fR\fB, Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR;
1193 .fi
1194 .if n \{\
1195 .RE
1196 .\}
1197 .sp
1198 Return \(lq1\(rq if the job is an update job that does not work with any installed package, i\&.e\&. the job is basically a no\-op\&. You can use this to turn no\-op update jobs into install jobs (as done by package managers like \(lqzypper\(rq)\&.
1199 .sp
1200 .if n \{\
1201 .RS 4
1202 .\}
1203 .nf
1204 \fBconst char *pool_selection2str(Pool *\fR\fIpool\fR\fB, Queue *\fR\fIselection\fR\fB, Id\fR \fIflagmask\fR\fB)\fR;
1205 .fi
1206 .if n \{\
1207 .RE
1208 .\}
1209 .sp
1210 Convert a selection into a string\&. Useful for debugging purposes\&. See the pool_job2str() function for the \fIflagmask\fR argument\&.
1211 .SH "ODDS AND ENDS"
1212 .sp
1213 .if n \{\
1214 .RS 4
1215 .\}
1216 .nf
1217 \fBvoid pool_freeallrepos(Pool *\fR\fIpool\fR\fB, int\fR \fIreuseids\fR\fB)\fR;
1218 .fi
1219 .if n \{\
1220 .RE
1221 .\}
1222 .sp
1223 Free all repos from the pool (including all solvables)\&. If \fIreuseids\fR is true, all Ids of the solvables are free to be reused the next time solvables are created\&.
1224 .sp
1225 .if n \{\
1226 .RS 4
1227 .\}
1228 .nf
1229 \fBvoid pool_clear_pos(Pool *\fR\fIpool\fR\fB)\fR;
1230 .fi
1231 .if n \{\
1232 .RE
1233 .\}
1234 .sp
1235 Clear the data position stored in the pool\&.
1236 .SH "ARCHITECTURE POLICIES"
1237 .sp
1238 An architecture policy defines a list of architectures that can be installed on the system, and also the relationship between them (i\&.e\&. the ordering)\&. Architectures can be delimited with three different characters:
1239 .PP
1240 \fB\*(Aq:\*(Aq\fR
1241 .RS 4
1242 No relationship between the architectures\&. A package of one architecture can not be replaced with one of the other architecture\&.
1243 .RE
1244 .PP
1245 \fB\*(Aq>\*(Aq\fR
1246 .RS 4
1247 The first architecture is better than the second one\&. An installed package of the second architecture may be replaced with one from the first architecture and vice versa\&. The solver will select the better architecture if the versions are the same\&.
1248 .RE
1249 .PP
1250 \fB\*(Aq=\*(Aq\fR
1251 .RS 4
1252 The two architectures are freely exchangeable\&. Used to define aliases for architectures\&.
1253 .RE
1254 .sp
1255 An example would be \*(Aqx86_64:i686=athlon>i586\*(Aq\&. This means that x86_64 packages can only be replaced by other x86_64 packages, i686 packages can be replaced by i686 and i586 packages (but i686 packages will be preferred) and athlon is another name for the i686 architecture\&.
1256 .sp
1257 You can turn off the architecture replacement checks with the Solver\(cqs SOLVER_FLAG_ALLOW_ARCHCHANGE flag\&.
1258 .SH "VENDOR POLICIES"
1259 .sp
1260 Different vendors often compile packages with different features, so Libsolv only replace installed packages of one vendor with packages coming from the same vendor\&. Also, while the version of a package is normally defined by the upstream project, the release part of the version is set by the vendor\(cqs package maintainer, so it\(cqs not meaningful to do version comparisons for packages coming from different vendors\&.
1261 .sp
1262 Vendor in this case means the SOLVABLE_VENDOR string stored in each solvable\&. Sometimes a vendor changes names, or multiple vendors form a group that coordinate their package building, so libsolv offers a way to define that a group of vendors are compatible\&. You do that be defining vendor equivalence classes, packages from a vendor from one class may be replaced with packages from all the other vendors in the class\&.
1263 .sp
1264 There can be multiple equivalence classes, the set of allowed vendor changes for an installed package is calculated by building the union of all of the equivalence classes the vendor of the installed package is part of\&.
1265 .sp
1266 You can turn off the architecture replacement checks with the Solver\(cqs SOLVER_FLAG_ALLOW_VENDORCHANGE flag\&.
1267 .SH "BOOLEAN DEPENDENCIES"
1268 .sp
1269 Boolean Dependencies allow to build complex expressions from simple dependencies\&. Note that depending on the package manager only a subset of those may be useful\&. For example, debian currently only allows an "OR" expression\&.
1270 .PP
1271 \fBREL_OR\fR
1272 .RS 4
1273 The expression is true if either the first dependency or the second one is true\&. This is useful for package dependencies like \(lqRequires\(rq, where you can specify that either one of the packages need to be installed\&.
1274 .RE
1275 .PP
1276 \fBREL_AND\fR
1277 .RS 4
1278 The expression is true if both dependencies are true\&. The packages fulfilling the dependencies may be different, i\&.e\&. \(lqSupplements: perl REL_AND python\(rq is true if both a package providing perl and a package providing python are installed\&.
1279 .RE
1280 .PP
1281 \fBREL_WITH\fR
1282 .RS 4
1283 The expression is true if both dependencies are true and are fulfilled by the same package\&. Thus \(lqSupplements: perl REL_WITH python\(rq would only be true if a package is installed that provides both dependencies (some kind of multi\-language interpreter)\&.
1284 .RE
1285 .PP
1286 \fBREL_COND\fR
1287 .RS 4
1288 The expression is true if the first dependency is true or the second dependency is false\&. \(lqA REL_COND B\(rq is equivalent to \(lqA REL_OR (NOT B)\(rq (except that libsolv does not expose \(lqNOT\(rq)\&.
1289 .RE
1290 .PP
1291 \fBREL_UNLESS\fR
1292 .RS 4
1293 The expression is true if the first dependency is true and the second dependency is false\&. \(lqA REL_UNLESS B\(rq is equivalent to \(lqA REL_AND (NOT B)\(rq (except that libsolv does not expose \(lqNOT\(rq)\&.
1294 .RE
1295 .PP
1296 \fBREL_ELSE\fR
1297 .RS 4
1298 The \(lqelse\(rq part of a \(lqREL_COND\(rq or \(lqREL_UNLESS\(rq dependency\&. It has to be directly in the evr part of the condition, e\&.g\&. \(lqfoo REL_COND (bar REL_ELSE baz)\(rq\&. For \(lqREL_COND\(rq this is equivalent to writing \(lq(foo REL_COND bar) REL_AND (bar REL_OR baz)\(rq\&. For \(lqREL_UNLESS\(rq this is equivalent to writing \(lq(foo REL_UNLESS bar) REL_OR (bar REL_AND baz)\(rq\&.
1299 .RE
1300 .sp
1301 Each sub\-dependency of a boolean dependency can in turn be a boolean dependency, so you can chain them to create complex dependencies\&.
1302 .SH "NAMESPACE DEPENDENCIES"
1303 .sp
1304 Namespace dependencies can be used to implement dependencies on attributes external to libsolv\&. An example would be a dependency on the language set by the user\&. This types of dependencies are usually only used for \(lqConflicts\(rq or \(lqSupplements\(rq dependencies, as the underlying package manager does not know how to deal with them\&.
1305 .sp
1306 If the library needs to evaluate a namespace dependency, it calls the namespace callback function set in the pool\&. The callback function can return a set of packages that \(lqprovide\(rq the dependency\&. If the dependency is provided by the system, the returned set should consist of just the system solvable (Solvable Id 1)\&.
1307 .sp
1308 The returned set of packages must be returned as offset into the whatprovidesdata array\&. You can use the pool_queuetowhatprovides function to convert a queue into such an offset\&. To ease programming the callback function, the return values \(lq0\(rq and \(lq1\(rq are not interpreted as an offset\&. \(lq0\(rq means that no package is in the return set, \(lq1\(rq means that just the system solvable is in the set\&.
1309 .sp
1310 The returned set is cached, so that for each namespace dependency the callback is just called once\&. If you need to flush the cache (maybe because the user has selected a different language), use the pool_flush_namespaceproviders() function\&.
1311 .SH "AUTHOR"
1312 .sp
1313 Michael Schroeder <mls@suse\&.de>