Add ENABLE_COMPLEX_DEPS flag
[platform/upstream/libsolv.git] / doc / gen / libsolv-bindings.3
1 '\" t
2 .\"     Title: Libsolv-Bindings
3 .\"    Author: [see the "Author" section]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 01/31/2023
6 .\"    Manual: LIBSOLV
7 .\"    Source: libsolv
8 .\"  Language: English
9 .\"
10 .TH "LIBSOLV\-BINDINGS" "3" "01/31/2023" "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-bindings \- access libsolv from perl/python/ruby
32 .SH "DESCRIPTION"
33 .sp
34 Libsolv\(cqs language bindings offer an abstract, object orientated interface to the library\&. The supported languages are currently perl, python, ruby and tcl\&. All example code (except in the specifics sections, of course) lists first the \(lqC\-ish\(rq interface, then the syntax for perl, python, and ruby (in that order)\&.
35 .SH "PERL SPECIFICS"
36 .sp
37 Libsolv\(cqs perl bindings can be loaded with the following statement:
38 .sp
39 .if n \{\
40 .RS 4
41 .\}
42 .nf
43 \fBuse solv\fR;
44 .fi
45 .if n \{\
46 .RE
47 .\}
48 .sp
49 Objects are either created by calling the new() method on a class or they are returned by calling methods on other objects\&.
50 .sp
51 .if n \{\
52 .RS 4
53 .\}
54 .nf
55 my \fI$pool\fR \fB= solv::Pool\->new()\fR;
56 my \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->add_repo("my_first_repo")\fR;
57 .fi
58 .if n \{\
59 .RE
60 .\}
61 .sp
62 Swig encapsulates all objects as tied hashes, thus the attributes can be accessed by treating the object as standard hash reference:
63 .sp
64 .if n \{\
65 .RS 4
66 .\}
67 .nf
68 \fI$pool\fR\fB\->{appdata} = 42\fR;
69 \fBprintf "appdata is %d\en",\fR \fI$pool\fR\fB\->{appdata}\fR;
70 .fi
71 .if n \{\
72 .RE
73 .\}
74 .sp
75 A special exception to this are iterator objects, they are encapsulated as tied arrays so that it is possible to iterate with a for() statement:
76 .sp
77 .if n \{\
78 .RS 4
79 .\}
80 .nf
81 my \fI$iter\fR \fB=\fR \fI$pool\fR\fB\->solvables_iter()\fR;
82 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@$iter\fR\fB) { \&.\&.\&. }\fR;
83 .fi
84 .if n \{\
85 .RE
86 .\}
87 .sp
88 As a downside of this approach, iterator objects cannot have attributes\&.
89 .sp
90 If an array needs to be passed to a method it is usually done by reference, if a method returns an array it returns it on the perl stack:
91 .sp
92 .if n \{\
93 .RS 4
94 .\}
95 .nf
96 my \fI@problems\fR \fB=\fR \fI$solver\fR\fB\->solve(\e\fR\fI@jobs\fR\fB)\fR;
97 .fi
98 .if n \{\
99 .RE
100 .\}
101 .sp
102 Due to a bug in swig, stringification does not work for libsolv\(cqs objects\&. Instead, you have to call the object\(cqs str() method\&.
103 .sp
104 .if n \{\
105 .RS 4
106 .\}
107 .nf
108 \fBprint\fR \fI$dep\fR\fB\->str() \&. "\e\fR\fIn\fR\fB"\fR;
109 .fi
110 .if n \{\
111 .RE
112 .\}
113 .sp
114 Swig implements all constants as numeric variables (instead of the more natural constant subs), so don\(cqt forget the leading \(lq$\(rq when accessing a constant\&. Also do not forget to prepend the namespace of the constant:
115 .sp
116 .if n \{\
117 .RS 4
118 .\}
119 .nf
120 \fI$pool\fR\fB\->set_flag($solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1)\fR;
121 .fi
122 .if n \{\
123 .RE
124 .\}
125 .SH "PYTHON SPECIFICS"
126 .sp
127 The python bindings can be loaded with:
128 .sp
129 .if n \{\
130 .RS 4
131 .\}
132 .nf
133 \fBimport solv\fR
134 .fi
135 .if n \{\
136 .RE
137 .\}
138 .sp
139 Objects are either created by calling the constructor method for a class or they are returned by calling methods on other objects\&.
140 .sp
141 .if n \{\
142 .RS 4
143 .\}
144 .nf
145 \fIpool\fR \fB= solv\&.Pool()\fR
146 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo("my_first_repo")\fR
147 .fi
148 .if n \{\
149 .RE
150 .\}
151 .sp
152 Attributes can be accessed as usual:
153 .sp
154 .if n \{\
155 .RS 4
156 .\}
157 .nf
158 \fIpool\fR\fB\&.appdata = 42\fR
159 \fBprint "appdata is %d" % (\fR\fIpool\fR\fB\&.appdata)\fR
160 .fi
161 .if n \{\
162 .RE
163 .\}
164 .sp
165 Iterators also work as expected:
166 .sp
167 .if n \{\
168 .RS 4
169 .\}
170 .nf
171 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter():\fR
172 .fi
173 .if n \{\
174 .RE
175 .\}
176 .sp
177 Arrays are passed and returned as list objects:
178 .sp
179 .if n \{\
180 .RS 4
181 .\}
182 .nf
183 \fIjobs\fR \fB= []\fR
184 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
185 .fi
186 .if n \{\
187 .RE
188 .\}
189 .sp
190 The bindings define stringification for many classes, some also have a \fIrepr\fR method to ease debugging\&.
191 .sp
192 .if n \{\
193 .RS 4
194 .\}
195 .nf
196 \fBprint\fR \fIdep\fR
197 \fBprint repr(\fR\fIrepo\fR\fB)\fR
198 .fi
199 .if n \{\
200 .RE
201 .\}
202 .sp
203 Constants are attributes of the corresponding classes:
204 .sp
205 .if n \{\
206 .RS 4
207 .\}
208 .nf
209 \fIpool\fR\fB\&.set_flag(solv\&.Pool\&.POOL_FLAG_OBSOLETEUSESCOLORS, 1)\fR;
210 .fi
211 .if n \{\
212 .RE
213 .\}
214 .SH "RUBY SPECIFICS"
215 .sp
216 The ruby bindings can be loaded with:
217 .sp
218 .if n \{\
219 .RS 4
220 .\}
221 .nf
222 \fBrequire \*(Aqsolv\*(Aq\fR
223 .fi
224 .if n \{\
225 .RE
226 .\}
227 .sp
228 Objects are either created by calling the new method on a class or they are returned by calling methods on other objects\&. Note that all classes start with an uppercase letter in ruby, so the class is called \(lqSolv\(rq\&.
229 .sp
230 .if n \{\
231 .RS 4
232 .\}
233 .nf
234 \fIpool\fR \fB= Solv::Pool\&.new\fR
235 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo("my_first_repo")\fR
236 .fi
237 .if n \{\
238 .RE
239 .\}
240 .sp
241 Attributes can be accessed as usual:
242 .sp
243 .if n \{\
244 .RS 4
245 .\}
246 .nf
247 \fIpool\fR\fB\&.appdata = 42\fR
248 \fBputs "appdata is #{\fR\fIpool\fR\fB\&.appdata}"\fR
249 .fi
250 .if n \{\
251 .RE
252 .\}
253 .sp
254 Iterators also work as expected:
255 .sp
256 .if n \{\
257 .RS 4
258 .\}
259 .nf
260 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter() do \&.\&.\&.\fR
261 .fi
262 .if n \{\
263 .RE
264 .\}
265 .sp
266 Arrays are passed and returned as array objects:
267 .sp
268 .if n \{\
269 .RS 4
270 .\}
271 .nf
272 \fIjobs\fR \fB= []\fR
273 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
274 .fi
275 .if n \{\
276 .RE
277 .\}
278 .sp
279 Most classes define a to_s method, so objects can be easily stringified\&. Many also define an inspect() method\&.
280 .sp
281 .if n \{\
282 .RS 4
283 .\}
284 .nf
285 \fBputs\fR \fIdep\fR
286 \fBputs\fR \fIrepo\fR\fB\&.inspect\fR
287 .fi
288 .if n \{\
289 .RE
290 .\}
291 .sp
292 Constants live in the namespace of the class they belong to:
293 .sp
294 .if n \{\
295 .RS 4
296 .\}
297 .nf
298 \fIpool\fR\fB\&.set_flag(Solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1)\fR;
299 .fi
300 .if n \{\
301 .RE
302 .\}
303 .sp
304 Note that boolean methods have an added trailing \(lq?\(rq, to be consistent with other ruby modules:
305 .sp
306 .if n \{\
307 .RS 4
308 .\}
309 .nf
310 \fBputs "empty" if\fR \fIrepo\fR\fB\&.isempty?\fR
311 .fi
312 .if n \{\
313 .RE
314 .\}
315 .SH "TCL SPECIFICS"
316 .sp
317 Libsolv\(cqs tcl bindings can be loaded with the following statement:
318 .sp
319 .if n \{\
320 .RS 4
321 .\}
322 .nf
323 \fBpackage require solv\fR
324 .fi
325 .if n \{\
326 .RE
327 .\}
328 .sp
329 Objects are either created by calling class name prefixed with \(lqnew_\(rq, or they are returned by calling methods on other objects\&.
330 .sp
331 .if n \{\
332 .RS 4
333 .\}
334 .nf
335 \fBset pool [solv::new_Pool]\fR
336 \fBset repo [\fR\fI$pool\fR \fBadd_repo "my_first_repo"]\fR
337 .fi
338 .if n \{\
339 .RE
340 .\}
341 .sp
342 Swig provides a \(lqcget\(rq method to read object attributes, and a \(lqconfigure\(rq method to write them:
343 .sp
344 .if n \{\
345 .RS 4
346 .\}
347 .nf
348 \fI$pool\fR \fBconfigure \-appdata 42\fR
349 \fBputs "appdata is [\fR\fI$pool\fR \fBcget \-appdata]"\fR
350 .fi
351 .if n \{\
352 .RE
353 .\}
354 .sp
355 The tcl bindings provide a little helper to work with iterators in a foreach style:
356 .sp
357 .if n \{\
358 .RS 4
359 .\}
360 .nf
361 \fBset iter [\fR\fI$pool\fR \fBsolvables_iter]\fR
362 \fBsolv::iter s\fR \fI$iter\fR \fB{ \&.\&.\&. }\fR
363 .fi
364 .if n \{\
365 .RE
366 .\}
367 .sp
368 libsolv\(cqs arrays are mapped to tcl\(cqs lists:
369 .sp
370 .if n \{\
371 .RS 4
372 .\}
373 .nf
374 \fBset jobs [list\fR \fI$job1 $job2\fR\fB]\fR
375 \fBset problems [\fR\fI$solver\fR \fBsolve\fR \fI$jobs\fR\fB]\fR
376 \fBputs "We have [llength\fR \fI$problems\fR\fB] problems\&.\&.\&."\fR
377 .fi
378 .if n \{\
379 .RE
380 .\}
381 .sp
382 Stringification is done by calling the object\(cqs \(lqstr\(rq method\&.
383 .sp
384 .if n \{\
385 .RS 4
386 .\}
387 .nf
388 \fBputs [\fR\fI$dep\fR \fBstr]\fR
389 .fi
390 .if n \{\
391 .RE
392 .\}
393 .sp
394 There is one exception: you have to use \(lqstringify\(rq for Datamatch objects, as swig reports a clash with the \(lqstr\(rq attribute\&. Some objects also support a \(lq==\(rq method for equality tests, and a \(lq!=\(rq method\&.
395 .sp
396 Swig implements all constants as numeric variables, constants belonging to a libsolv class are prefixed with the class name:
397 .sp
398 .if n \{\
399 .RS 4
400 .\}
401 .nf
402 \fI$pool\fR \fBset_flag\fR \fI$solv::Pool_POOL_FLAG_OBSOLETEUSESCOLORS\fR \fB1\fR
403 \fBputs [\fR\fI$solvable\fR \fBlookup_str\fR \fI$solv::SOLVABLE_SUMMARY\fR\fB]\fR
404 .fi
405 .if n \{\
406 .RE
407 .\}
408 .SH "THE SOLV CLASS"
409 .sp
410 This is the main namespace of the library, you cannot create objects of this type but it contains some useful constants\&.
411 .SS "CONSTANTS"
412 .sp
413 Relational flag constants, the first three can be or\-ed together
414 .PP
415 \fBREL_LT\fR
416 .RS 4
417 the \(lqless than\(rq bit
418 .RE
419 .PP
420 \fBREL_EQ\fR
421 .RS 4
422 the \(lqequals to\(rq bit
423 .RE
424 .PP
425 \fBREL_GT\fR
426 .RS 4
427 the \(lqgreater than\(rq bit
428 .RE
429 .PP
430 \fBREL_ARCH\fR
431 .RS 4
432 used for relations that describe an extra architecture filter, the version part of the relation is interpreted as architecture\&.
433 .RE
434 .sp
435 Special Solvable Ids
436 .PP
437 \fBSOLVID_META\fR
438 .RS 4
439 Access the meta section of a repository or repodata area\&. This is like an extra Solvable that has the Id SOLVID_META\&.
440 .RE
441 .PP
442 \fBSOLVID_POS\fR
443 .RS 4
444 Use the data position stored inside of the pool instead of accessing some solvable by Id\&. The bindings have the Datapos objects as an abstraction mechanism, so you most likely do not need this constant\&.
445 .RE
446 .sp
447 Constant string Ids
448 .PP
449 \fBID_NULL\fR
450 .RS 4
451 Always zero
452 .RE
453 .PP
454 \fBID_EMPTY\fR
455 .RS 4
456 Always one, describes the empty string
457 .RE
458 .PP
459 \fBSOLVABLE_NAME\fR
460 .RS 4
461 The keyname Id of the name of the solvable\&.
462 .RE
463 .PP
464 \fB\&...\fR
465 .RS 4
466 see the libsolv\-constantids manpage for a list of fixed Ids\&.
467 .RE
468 .SH "THE POOL CLASS"
469 .sp
470 The pool is libsolv\(cqs central resource manager\&. A pool consists of Solvables, Repositories, Dependencies, each indexed by Ids\&.
471 .SS "CLASS METHODS"
472 .sp
473 .if n \{\
474 .RS 4
475 .\}
476 .nf
477 \fBPool *Pool()\fR
478 my \fI$pool\fR \fB= solv::Pool\->new()\fR;
479 \fIpool\fR \fB= solv\&.Pool()\fR
480 \fIpool\fR \fB= Solv::Pool\&.new()\fR
481 .fi
482 .if n \{\
483 .RE
484 .\}
485 .sp
486 Create a new pool instance\&. In most cases you just need one pool\&. Note that the returned object "owns" the pool, i\&.e\&. if the object is freed, the pool is also freed\&. You can use the disown method to break this ownership relation\&.
487 .SS "ATTRIBUTES"
488 .sp
489 .if n \{\
490 .RS 4
491 .\}
492 .nf
493 \fBvoid *appdata;\fR                  /* read/write */
494 \fI$pool\fR\fB\->{appdata}\fR
495 \fIpool\fR\fB\&.appdata\fR
496 \fIpool\fR\fB\&.appdata\fR
497 .fi
498 .if n \{\
499 .RE
500 .\}
501 .sp
502 Application specific data that may be used in any way by the code using the pool\&.
503 .sp
504 .if n \{\
505 .RS 4
506 .\}
507 .nf
508 \fBSolvable solvables[];\fR           /* read only */
509 my \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->{solvables}\->[\fR\fI$solvid\fR\fB]\fR;
510 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.solvables[\fR\fIsolvid\fR\fB]\fR
511 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.solvables[\fR\fIsolvid\fR\fB]\fR
512 .fi
513 .if n \{\
514 .RE
515 .\}
516 .sp
517 Look up a Solvable by its id\&.
518 .sp
519 .if n \{\
520 .RS 4
521 .\}
522 .nf
523 \fBRepo repos[];\fR                   /* read only */
524 my \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->{repos}\->[\fR\fI$repoid\fR\fB]\fR;
525 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.repos[\fR\fIrepoid\fR\fB]\fR
526 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.repos[\fR\fIrepoid\fR\fB]\fR
527 .fi
528 .if n \{\
529 .RE
530 .\}
531 .sp
532 Look up a Repository by its id\&.
533 .sp
534 .if n \{\
535 .RS 4
536 .\}
537 .nf
538 \fBRepo *installed;\fR                /* read/write */
539 \fI$pool\fR\fB\->{installed} =\fR \fI$repo\fR;
540 \fIpool\fR\fB\&.installed =\fR \fIrepo\fR
541 \fIpool\fR\fB\&.installed =\fR \fIrepo\fR
542 .fi
543 .if n \{\
544 .RE
545 .\}
546 .sp
547 Define which repository contains all the installed packages\&.
548 .sp
549 .if n \{\
550 .RS 4
551 .\}
552 .nf
553 \fBconst char *errstr;\fR             /* read only */
554 my \fI$err\fR \fB=\fR \fI$pool\fR\fB\->{errstr}\fR;
555 \fIerr\fR \fB=\fR \fIpool\fR\fB\&.errstr\fR
556 \fIerr\fR \fB=\fR \fIpool\fR\fB\&.errstr\fR
557 .fi
558 .if n \{\
559 .RE
560 .\}
561 .sp
562 Return the last error string that was stored in the pool\&.
563 .SS "CONSTANTS"
564 .PP
565 \fBPOOL_FLAG_PROMOTEEPOCH\fR
566 .RS 4
567 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\&.
568 .RE
569 .PP
570 \fBPOOL_FLAG_FORBIDSELFCONFLICTS\fR
571 .RS 4
572 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 since rpm\-4\&.9\&.0\&.
573 .RE
574 .PP
575 \fBPOOL_FLAG_OBSOLETEUSESPROVIDES\fR
576 .RS 4
577 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\&.
578 .RE
579 .PP
580 \fBPOOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES\fR
581 .RS 4
582 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\&.
583 .RE
584 .PP
585 \fBPOOL_FLAG_OBSOLETEUSESCOLORS\fR
586 .RS 4
587 Rpm\(cqs multilib implementation 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\&.
588 .RE
589 .PP
590 \fBPOOL_FLAG_IMPLICITOBSOLETEUSESCOLORS\fR
591 .RS 4
592 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)\&.
593 .RE
594 .PP
595 \fBPOOL_FLAG_NOINSTALLEDOBSOLETES\fR
596 .RS 4
597 Since version 4\&.9\&.0 rpm considers the obsoletes of installed packages when checking for dependency conflicts, thus you may not install a package that is obsoleted by some other installed package unless you also erase the other package\&.
598 .RE
599 .PP
600 \fBPOOL_FLAG_HAVEDISTEPOCH\fR
601 .RS 4
602 Mandriva added a new field called distepoch that gets checked in version comparison if the epoch/version/release of two packages are the same\&.
603 .RE
604 .PP
605 \fBPOOL_FLAG_NOOBSOLETESMULTIVERSION\fR
606 .RS 4
607 If a package is installed in multiversion mode, 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\&.
608 .RE
609 .PP
610 \fBPOOL_FLAG_ADDFILEPROVIDESFILTERED\fR
611 .RS 4
612 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\&.
613 .RE
614 .PP
615 \fBPOOL_FLAG_NOWHATPROVIDESAUX\fR
616 .RS 4
617 Disable the creation of the auxillary whatprovides index\&. This saves a bit of memory but also makes the whatprovides lookups a bit slower\&.
618 .RE
619 .PP
620 \fBPOOL_FLAG_WHATPROVIDESWITHDISABLED\fR
621 .RS 4
622 Make the whatprovides index also contain disabled packages\&. This means that you do not need to recreate the index if a package is enabled/disabled, i\&.e\&. the pool→considered bitmap is changed\&.
623 .RE
624 .SS "METHODS"
625 .sp
626 .if n \{\
627 .RS 4
628 .\}
629 .nf
630 \fBvoid free()\fR
631 \fI$pool\fR\fB\->free()\fR;
632 \fIpool\fR\fB\&.free()\fR
633 \fIpool\fR\fB\&.free()\fR
634 .fi
635 .if n \{\
636 .RE
637 .\}
638 .sp
639 Force a free of the pool\&. After this call, you must not access any object that still references the pool\&.
640 .sp
641 .if n \{\
642 .RS 4
643 .\}
644 .nf
645 \fBvoid disown()\fR
646 \fI$pool\fR\fB\->disown()\fR;
647 \fIpool\fR\fB\&.disown()\fR
648 \fIpool\fR\fB\&.disown()\fR
649 .fi
650 .if n \{\
651 .RE
652 .\}
653 .sp
654 Break the ownership relation between the binding object and the pool\&. After this call, the pool will not get freed even if the object goes out of scope\&. This also means that you must manually call the free method to free the pool data\&.
655 .sp
656 .if n \{\
657 .RS 4
658 .\}
659 .nf
660 \fBvoid setdebuglevel(int\fR \fIlevel\fR\fB)\fR
661 \fI$pool\fR\fB\->setdebuglevel(\fR\fI$level\fR\fB)\fR;
662 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
663 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
664 .fi
665 .if n \{\
666 .RE
667 .\}
668 .sp
669 Set the debug level\&. A value of zero means no debug output, the higher the value, the more output is generated\&.
670 .sp
671 .if n \{\
672 .RS 4
673 .\}
674 .nf
675 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
676 my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
677 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
678 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
679 .fi
680 .if n \{\
681 .RE
682 .\}
683 .sp
684 .if n \{\
685 .RS 4
686 .\}
687 .nf
688 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
689 my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
690 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
691 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
692 .fi
693 .if n \{\
694 .RE
695 .\}
696 .sp
697 Set/get a pool specific flag\&. The flags define how the system works, e\&.g\&. how the package manager treats obsoletes\&. The default flags should be sane for most applications, but in some cases you may want to tweak a flag, for example if you want to solve package dependencies for some other system\&.
698 .sp
699 .if n \{\
700 .RS 4
701 .\}
702 .nf
703 \fBvoid set_rootdir(const char *\fR\fIrootdir\fR\fB)\fR
704 \fI$pool\fR\fB\->set_rootdir(\fR\fIrootdir\fR\fB)\fR;
705 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
706 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
707 .fi
708 .if n \{\
709 .RE
710 .\}
711 .sp
712 .if n \{\
713 .RS 4
714 .\}
715 .nf
716 \fBconst char *get_rootdir()\fR
717 my \fI$rootdir\fR \fB=\fR \fI$pool\fR\fB\->get_rootdir()\fR;
718 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
719 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
720 .fi
721 .if n \{\
722 .RE
723 .\}
724 .sp
725 Set/get the rootdir to use\&. This is useful if you want package management to work only in some directory, for example if you want to setup a chroot jail\&. Note that the rootdir will only be prepended to file paths if the \fBREPO_USE_ROOTDIR\fR flag is used\&.
726 .sp
727 .if n \{\
728 .RS 4
729 .\}
730 .nf
731 \fBvoid setarch(const char *\fR\fIarch\fR \fB= 0)\fR
732 \fI$pool\fR\fB\->setarch()\fR;
733 \fIpool\fR\fB\&.setarch()\fR
734 \fIpool\fR\fB\&.setarch()\fR
735 .fi
736 .if n \{\
737 .RE
738 .\}
739 .sp
740 Set the architecture for your system\&. The architecture is used to determine which packages are installable\&. It defaults to the result of \(lquname \-m\(rq\&.
741 .sp
742 .if n \{\
743 .RS 4
744 .\}
745 .nf
746 \fBRepo add_repo(const char *\fR\fIname\fR\fB)\fR
747 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->add_repo(\fR\fI$name\fR\fB)\fR;
748 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
749 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
750 .fi
751 .if n \{\
752 .RE
753 .\}
754 .sp
755 Add a Repository with the specified name to the pool\&. The repository is empty on creation, use the repository methods to populate it with packages\&.
756 .sp
757 .if n \{\
758 .RS 4
759 .\}
760 .nf
761 \fBRepoiterator repos_iter()\fR
762 \fBfor my\fR \fI$repo\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->repos_iter()})\fR
763 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter():\fR
764 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter()\fR
765 .fi
766 .if n \{\
767 .RE
768 .\}
769 .sp
770 Iterate over the existing repositories\&.
771 .sp
772 .if n \{\
773 .RS 4
774 .\}
775 .nf
776 \fBSolvableiterator solvables_iter()\fR
777 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->solvables_iter()})\fR
778 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter():\fR
779 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter()\fR
780 .fi
781 .if n \{\
782 .RE
783 .\}
784 .sp
785 Iterate over the existing solvables\&.
786 .sp
787 .if n \{\
788 .RS 4
789 .\}
790 .nf
791 \fBDep Dep(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
792 my \fI$dep\fR \fB=\fR \fI$pool\fR\fB\->Dep(\fR\fI$string\fR\fB)\fR;
793 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
794 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
795 .fi
796 .if n \{\
797 .RE
798 .\}
799 .sp
800 Create an object describing a string or dependency\&. If the string is currently not in the pool and \fIcreate\fR is false, \fBundef\fR/\fBNone\fR/\fBnil\fR is returned\&.
801 .sp
802 .if n \{\
803 .RS 4
804 .\}
805 .nf
806 \fBvoid addfileprovides()\fR
807 \fI$pool\fR\fB\->addfileprovides()\fR;
808 \fIpool\fR\fB\&.addfileprovides()\fR
809 \fIpool\fR\fB\&.addfileprovides()\fR
810 .fi
811 .if n \{\
812 .RE
813 .\}
814 .sp
815 .if n \{\
816 .RS 4
817 .\}
818 .nf
819 \fBId *addfileprovides_queue()\fR
820 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->addfileprovides_queue()\fR;
821 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
822 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
823 .fi
824 .if n \{\
825 .RE
826 .\}
827 .sp
828 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\&. The addfileprovides_queue variant works the same way but returns an array containing all file dependencies\&. 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\&.
829 .sp
830 .if n \{\
831 .RS 4
832 .\}
833 .nf
834 \fBvoid createwhatprovides()\fR
835 \fI$pool\fR\fB\->createwhatprovides()\fR;
836 \fIpool\fR\fB\&.createwhatprovides()\fR
837 \fIpool\fR\fB\&.createwhatprovides()\fR
838 .fi
839 .if n \{\
840 .RE
841 .\}
842 .sp
843 Create the internal \(lqwhatprovides\(rq hash over all of the provides of all installable packages\&. This method must be called before doing any lookups on provides\&. It\(cqs encouraged to do it right after all repos are set up, usually right after the call to addfileprovides()\&.
844 .sp
845 .if n \{\
846 .RS 4
847 .\}
848 .nf
849 \fBSolvable *whatprovides(DepId\fR \fIdep\fR\fB)\fR
850 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatprovides(\fR\fI$dep\fR\fB)\fR;
851 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
852 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
853 .fi
854 .if n \{\
855 .RE
856 .\}
857 .sp
858 Return all solvables that provide the specified dependency\&. You can use either a Dep object or a simple Id as argument\&.
859 .sp
860 .if n \{\
861 .RS 4
862 .\}
863 .nf
864 \fBSolvable *best_solvables(Solvable *\fR\fIsolvables\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
865 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->best_solvables(\fR\fI$solvables\fR\fB)\fR;
866 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.best_solvables(\fR\fIsolvables\fR\fB)\fR
867 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.best_solvables(\fR\fIsolvables\fR\fB)\fR
868 .fi
869 .if n \{\
870 .RE
871 .\}
872 .sp
873 Filter list of solvables by repo priority, architecture and version\&.
874 .sp
875 .if n \{\
876 .RS 4
877 .\}
878 .nf
879 \fBSolvable *whatcontainsdep(Id\fR \fIkeyname\fR\fB, DepId\fR \fIdep\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
880 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatcontainsdep(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR;
881 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatcontainsdep(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
882 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatcontainsdep(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
883 .fi
884 .if n \{\
885 .RE
886 .\}
887 .sp
888 Return all solvables for which keyname contains the dependency\&.
889 .sp
890 .if n \{\
891 .RS 4
892 .\}
893 .nf
894 \fBSolvable *whatmatchesdep(Id\fR \fIkeyname\fR\fB, DepId\fR \fIdep\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
895 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatmatchesdep(\fR\fI$keyname\fR\fB,\fR \fI$sdep\fR\fB)\fR;
896 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatmatchesdep(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
897 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatmatchesdep(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
898 .fi
899 .if n \{\
900 .RE
901 .\}
902 .sp
903 Return all solvables that have dependencies in keyname that match the dependency\&.
904 .sp
905 .if n \{\
906 .RS 4
907 .\}
908 .nf
909 \fBSolvable *whatmatchessolvable(Id\fR \fIkeyname\fR\fB, Solvable\fR \fIsolvable\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
910 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatmatchessolvable(\fR\fI$keyname\fR\fB,\fR \fI$solvable\fR\fB)\fR;
911 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatmatchessolvable(\fR\fIkeyname\fR\fB,\fR \fIsolvable\fR\fB)\fR
912 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatmatchessolvable(\fR\fIkeyname\fR\fB,\fR \fIsolvable\fR\fB)\fR
913 .fi
914 .if n \{\
915 .RE
916 .\}
917 .sp
918 Return all solvables that match package dependencies against solvable\(cqs provides\&.
919 .sp
920 .if n \{\
921 .RS 4
922 .\}
923 .nf
924 \fBId *matchprovidingids(const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
925 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->matchprovidingids(\fR\fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
926 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
927 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
928 .fi
929 .if n \{\
930 .RE
931 .\}
932 .sp
933 Search the names of all provides and return the ones matching the specified string\&. See the Dataiterator class for the allowed flags\&.
934 .sp
935 .if n \{\
936 .RS 4
937 .\}
938 .nf
939 \fBId towhatprovides(Id *\fR\fIids\fR\fB)\fR
940 my \fI$offset\fR \fB=\fR \fI$pool\fR\fB\->towhatprovides(\e\fR\fI@ids\fR\fB)\fR;
941 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
942 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
943 .fi
944 .if n \{\
945 .RE
946 .\}
947 .sp
948 \(lqInternalize\(rq an array containing Ids\&. The returned value can be used to create solver jobs working on a specific set of packages\&. See the Solver class for more information\&.
949 .sp
950 .if n \{\
951 .RS 4
952 .\}
953 .nf
954 \fBvoid set_namespaceproviders(DepId\fR \fIns\fR\fB, DepId\fR \fIevr\fR\fB, bool\fR \fIvalue\fR \fB= 1)\fR
955 \fI$pool\fR\fB\->set_namespaceproviders(\fR\fI$ns\fR\fB,\fR \fI$evr\fR\fB, 1)\fR;
956 \fIpool\fR\fB\&.set_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB,\fR \fITrue\fR\fB)\fR
957 \fIpool\fR\fB\&.set_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB,\fR \fItrue\fR\fB)\fR
958 .fi
959 .if n \{\
960 .RE
961 .\}
962 .sp
963 Manually set a namespace provides entry in the whatprovides index\&.
964 .sp
965 .if n \{\
966 .RS 4
967 .\}
968 .nf
969 \fBvoid flush_namespaceproviders(DepId\fR \fIns\fR\fB, DepId\fR \fIevr\fR\fB)\fR
970 \fI$pool\fR\fB\->flush_namespaceproviders(\fR\fI$ns\fR\fB,\fR \fI$evr\fR\fB)\fR;
971 \fI$pool\fR\fB\&.flush_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB)\fR
972 \fI$pool\fR\fB\&.flush_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB)\fR
973 .fi
974 .if n \{\
975 .RE
976 .\}
977 .sp
978 Flush the cache of all namespaceprovides matching the specified namespace dependency\&. You can use zero as a wildcard argument\&.
979 .sp
980 .if n \{\
981 .RS 4
982 .\}
983 .nf
984 \fBbool isknownarch(DepId\fR \fIid\fR\fB)\fR
985 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->isknownarch(\fR\fI$id\fR\fB)\fR;
986 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch(\fR\fIid\fR\fB)\fR
987 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch?(\fR\fIid\fR\fB)\fR
988 .fi
989 .if n \{\
990 .RE
991 .\}
992 .sp
993 Return true if the specified Id describes a known architecture\&.
994 .sp
995 .if n \{\
996 .RS 4
997 .\}
998 .nf
999 \fBSolver Solver()\fR
1000 my \fI$solver\fR \fB=\fR \fI$pool\fR\fB\->Solver()\fR;
1001 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
1002 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
1003 .fi
1004 .if n \{\
1005 .RE
1006 .\}
1007 .sp
1008 Create a new solver object\&.
1009 .sp
1010 .if n \{\
1011 .RS 4
1012 .\}
1013 .nf
1014 \fBJob Job(int\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
1015 my \fI$job\fR \fB=\fR \fI$pool\fR\fB\->Job(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
1016 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
1017 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
1018 .fi
1019 .if n \{\
1020 .RE
1021 .\}
1022 .sp
1023 Create a new Job object\&. Kind of low level, in most cases you would instead use a Selection or Dep job constructor\&.
1024 .sp
1025 .if n \{\
1026 .RS 4
1027 .\}
1028 .nf
1029 \fBSelection Selection()\fR
1030 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection()\fR;
1031 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
1032 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
1033 .fi
1034 .if n \{\
1035 .RE
1036 .\}
1037 .sp
1038 Create an empty selection\&. Useful as a starting point for merging other selections\&.
1039 .sp
1040 .if n \{\
1041 .RS 4
1042 .\}
1043 .nf
1044 \fBSelection Selection_all()\fR
1045 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection_all()\fR;
1046 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
1047 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
1048 .fi
1049 .if n \{\
1050 .RE
1051 .\}
1052 .sp
1053 Create a selection containing all packages\&. Useful as starting point for intersecting other selections or for update/distupgrade jobs\&.
1054 .sp
1055 .if n \{\
1056 .RS 4
1057 .\}
1058 .nf
1059 \fBSelection select(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB)\fR
1060 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->select(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1061 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1062 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1063 .fi
1064 .if n \{\
1065 .RE
1066 .\}
1067 .sp
1068 Create a selection by matching packages against the specified string\&. See the Selection class for a list of flags and how to create solver jobs from a selection\&.
1069 .sp
1070 .if n \{\
1071 .RS 4
1072 .\}
1073 .nf
1074 \fBSelection matchdeps(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1075 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->matchdeps(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1076 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchdeps(\fR\fIname\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1077 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchdeps(\fR\fIname\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1078 .fi
1079 .if n \{\
1080 .RE
1081 .\}
1082 .sp
1083 Create a selection by matching package dependencies against the specified string\&. This can be used if you want to match other dependency types than \(lqprovides\(rq\&.
1084 .sp
1085 .if n \{\
1086 .RS 4
1087 .\}
1088 .nf
1089 \fBSelection matchdepid(DepId\fR \fIdep\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1090 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->matchdepid(\fR\fI$dep\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1091 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchdepid(\fR\fIdep\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1092 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchdepid(\fR\fIdep\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1093 .fi
1094 .if n \{\
1095 .RE
1096 .\}
1097 .sp
1098 Create a selection by matching package dependencies against the specified dependency\&. This may be faster than matchdeps and also works with complex dependencies\&. The downside is that you cannot use globs or case insensitive matching\&.
1099 .sp
1100 .if n \{\
1101 .RS 4
1102 .\}
1103 .nf
1104 \fBSelection matchsolvable(Solvable\fR \fIsolvable\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1105 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->matchsolvable(\fR\fI$solvable\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1106 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchsolvable(\fR\fIsolvable\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1107 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchsolvable(\fR\fIsolvable\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1108 .fi
1109 .if n \{\
1110 .RE
1111 .\}
1112 .sp
1113 Create a selection by matching package dependencies against the specified solvable\(cqs provides\&.
1114 .sp
1115 .if n \{\
1116 .RS 4
1117 .\}
1118 .nf
1119 \fBvoid setpooljobs(Jobs *\fR\fIjobs\fR\fB)\fR
1120 \fI$pool\fR\fB\->setpooljobs(\e\fR\fI@jobs\fR\fB)\fR;
1121 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
1122 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
1123 .fi
1124 .if n \{\
1125 .RE
1126 .\}
1127 .sp
1128 .if n \{\
1129 .RS 4
1130 .\}
1131 .nf
1132 \fBJob *getpooljobs()\fR
1133 \fI@jobs\fR \fB=\fR \fI$pool\fR\fB\->getpooljobs()\fR;
1134 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
1135 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
1136 .fi
1137 .if n \{\
1138 .RE
1139 .\}
1140 .sp
1141 Get/Set fixed jobs stored in the pool\&. Those jobs are automatically appended to all solver jobs, they are meant for fixed configurations like which packages can be multiversion installed, which packages were userinstalled, or which packages must not be erased\&.
1142 .sp
1143 .if n \{\
1144 .RS 4
1145 .\}
1146 .nf
1147 \fBvoid set_loadcallback(Callable *\fR\fIcallback\fR\fB)\fR
1148 \fI$pool\fR\fB\->setloadcallback(\e\fR\fI&callbackfunction\fR\fB)\fR;
1149 \fIpool\fR\fB\&.setloadcallback(\fR\fIcallbackfunction\fR\fB)\fR
1150 \fIpool\fR\fB\&.setloadcallback { |\fR\fIrepodata\fR\fB| \&.\&.\&. }\fR
1151 .fi
1152 .if n \{\
1153 .RE
1154 .\}
1155 .sp
1156 Set the callback function called when repository metadata needs to be loaded on demand\&. To make use of this feature, you need to create repodata stubs that tell the library which data is available but not loaded\&. If later on the data needs to be accessed, the callback function is called with a repodata argument\&. You can then load the data (maybe fetching it first from a remote server)\&. The callback should return true if the data has been made available\&.
1157 .sp
1158 .if n \{\
1159 .RS 4
1160 .\}
1161 .nf
1162 /* bindings only */
1163 \fI$pool\fR\fB\->appdata_disown()\fR
1164 \fIpool\fR\fB\&.appdata_disown()\fR
1165 \fIpool\fR\fB\&.appdata_disown()\fR
1166 .fi
1167 .if n \{\
1168 .RE
1169 .\}
1170 .sp
1171 Decrement the reference count of the appdata object\&. This can be used to break circular references (e\&.g\&. if the pool\(cqs appdata value points to some meta data structure that contains a pool handle)\&. If used incorrectly, this method can lead to application crashes, so beware\&. (This method is a no\-op for ruby and tcl\&.)
1172 .sp
1173 .if n \{\
1174 .RS 4
1175 .\}
1176 .nf
1177 \fBId *get_considered_list()\fR
1178 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->get_considered_list()\fR;
1179 \fIids\fR \fB=\fR \fIpool\fR\fB\&.get_considered_list()\fR
1180 \fIids\fR \fB=\fR \fIpool\fR\fB\&.get_considered_list()\fR
1181 .fi
1182 .if n \{\
1183 .RE
1184 .\}
1185 .sp
1186 .if n \{\
1187 .RS 4
1188 .\}
1189 .nf
1190 \fBvoid set_considered_list(Id *\fR\fIids\fR\fB)\fR
1191 \fI$pool\fR\fB\->set_considered_list(\e\fR\fI@ids\fR\fB)\fR;
1192 \fIpool\fR\fB\&.set_considered_list(\fR\fIids\fR\fB)\fR
1193 \fIpool\fR\fB\&.set_considered_list(\fR\fIids\fR\fB)\fR
1194 .fi
1195 .if n \{\
1196 .RE
1197 .\}
1198 .sp
1199 Get/set the list of solvables that are eligible for installation\&. Note that you need to recreate the whatprovides hash after changing the list\&.
1200 .sp
1201 .if n \{\
1202 .RS 4
1203 .\}
1204 .nf
1205 \fBId *get_disabled_list()\fR
1206 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->get_disabled_list()\fR;
1207 \fIids\fR \fB=\fR \fIpool\fR\fB\&.get_disabled_list()\fR
1208 \fIids\fR \fB=\fR \fIpool\fR\fB\&.get_disabled_list()\fR
1209 .fi
1210 .if n \{\
1211 .RE
1212 .\}
1213 .sp
1214 .if n \{\
1215 .RS 4
1216 .\}
1217 .nf
1218 \fBvoid set_disabled_list(Id *\fR\fIids\fR\fB)\fR
1219 \fI$pool\fR\fB\->set_disabled_list(\e\fR\fI@ids\fR\fB)\fR;
1220 \fIpool\fR\fB\&.set_disabled_list(\fR\fIids\fR\fB)\fR
1221 \fIpool\fR\fB\&.set_disabled_list(\fR\fIids\fR\fB)\fR
1222 .fi
1223 .if n \{\
1224 .RE
1225 .\}
1226 .sp
1227 Get/set the list of solvables that are not eligible for installation\&. This is basically the inverse of the \(lqconsidered\(rq methods above, i\&.e\&. calling \(lqset_disabled_list()\(rq with an empty list will make all solvables eligible for installation\&. Note you need to recreate the whatprovides hash after changing the list\&.
1228 .sp
1229 .if n \{\
1230 .RS 4
1231 .\}
1232 .nf
1233 \fBconst char *solvableset2str(Solvable *\fR\fIsolvables\fR\fB)\fR
1234 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvableset2str(\fR\fI$solvables\fR\fB)\fR;
1235 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvableset2str(\fR\fIsolvables\fR\fB)\fR
1236 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvableset2str(\fR\fIsolvables\fR\fB)\fR
1237 .fi
1238 .if n \{\
1239 .RE
1240 .\}
1241 .sp
1242 Return a string describing a list of solvables\&. The method tries to reduce the output by using version ranges if possible\&.
1243 .SS "DATA RETRIEVAL METHODS"
1244 .sp
1245 In the following functions, the \fIkeyname\fR argument describes what to retrieve\&. For the standard cases you can use the available Id constants\&. For example,
1246 .sp
1247 .if n \{\
1248 .RS 4
1249 .\}
1250 .nf
1251 \fB$solv::SOLVABLE_SUMMARY\fR
1252 \fBsolv\&.SOLVABLE_SUMMARY\fR
1253 \fBSolv::SOLVABLE_SUMMARY\fR
1254 .fi
1255 .if n \{\
1256 .RE
1257 .\}
1258 .sp
1259 selects the \(lqSummary\(rq entry of a solvable\&. The \fIsolvid\fR argument selects the desired solvable by Id\&.
1260 .sp
1261 .if n \{\
1262 .RS 4
1263 .\}
1264 .nf
1265 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1266 my \fI$string\fR \fB=\fR \fI$pool\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1267 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1268 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1269 .fi
1270 .if n \{\
1271 .RE
1272 .\}
1273 .sp
1274 .if n \{\
1275 .RS 4
1276 .\}
1277 .nf
1278 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1279 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->lookup_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1280 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1281 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1282 .fi
1283 .if n \{\
1284 .RE
1285 .\}
1286 .sp
1287 .if n \{\
1288 .RS 4
1289 .\}
1290 .nf
1291 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
1292 my \fI$num\fR \fB=\fR \fI$pool\fR\fB\->lookup_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1293 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1294 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1295 .fi
1296 .if n \{\
1297 .RE
1298 .\}
1299 .sp
1300 .if n \{\
1301 .RS 4
1302 .\}
1303 .nf
1304 \fBbool lookup_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1305 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->lookup_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1306 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1307 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1308 .fi
1309 .if n \{\
1310 .RE
1311 .\}
1312 .sp
1313 .if n \{\
1314 .RS 4
1315 .\}
1316 .nf
1317 \fBId *lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1318 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1319 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1320 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1321 .fi
1322 .if n \{\
1323 .RE
1324 .\}
1325 .sp
1326 .if n \{\
1327 .RS 4
1328 .\}
1329 .nf
1330 \fBChksum lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1331 my \fI$chksum\fR \fB=\fR \fI$pool\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1332 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1333 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1334 .fi
1335 .if n \{\
1336 .RE
1337 .\}
1338 .sp
1339 Lookup functions\&. Return the data element stored in the specified solvable\&. You should probably use the methods of the Solvable class instead\&.
1340 .sp
1341 .if n \{\
1342 .RS 4
1343 .\}
1344 .nf
1345 \fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
1346 my \fI$di\fR \fB=\fR \fI$pool\fR\fB\->Dataiterator(\fR\fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
1347 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1348 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1349 .fi
1350 .if n \{\
1351 .RE
1352 .\}
1353 .sp
1354 .if n \{\
1355 .RS 4
1356 .\}
1357 .nf
1358 \fBDataiterator Dataiterator_solvid(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
1359 my \fI$di\fR \fB=\fR \fI$pool\fR\fB\->Dataiterator(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
1360 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1361 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1362 .fi
1363 .if n \{\
1364 .RE
1365 .\}
1366 .sp
1367 .if n \{\
1368 .RS 4
1369 .\}
1370 .nf
1371 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1372 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1373 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1374 .fi
1375 .if n \{\
1376 .RE
1377 .\}
1378 .sp
1379 Iterate over the matching data elements\&. See the Dataiterator class for more information\&. The Dataiterator method iterates over all solvables in the pool, whereas the Dataiterator_solvid only iterates over the specified solvable\&.
1380 .SS "ID METHODS"
1381 .sp
1382 The following methods deal with Ids, i\&.e\&. integers representing objects in the pool\&. They are considered \(lqlow level\(rq, in most cases you would not use them but instead the object orientated methods\&.
1383 .sp
1384 .if n \{\
1385 .RS 4
1386 .\}
1387 .nf
1388 \fBRepo id2repo(Id\fR \fIid\fR\fB)\fR
1389 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->id2repo(\fR\fI$id\fR\fB)\fR;
1390 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
1391 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
1392 .fi
1393 .if n \{\
1394 .RE
1395 .\}
1396 .sp
1397 Lookup an existing Repository by id\&. You can also do this by using the \fBrepos\fR attribute\&.
1398 .sp
1399 .if n \{\
1400 .RS 4
1401 .\}
1402 .nf
1403 \fBSolvable id2solvable(Id\fR \fIid\fR\fB)\fR
1404 \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->id2solvable(\fR\fI$id\fR\fB)\fR;
1405 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
1406 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
1407 .fi
1408 .if n \{\
1409 .RE
1410 .\}
1411 .sp
1412 Lookup an existing Repository by id\&. You can also do this by using the \fBsolvables\fR attribute\&.
1413 .sp
1414 .if n \{\
1415 .RS 4
1416 .\}
1417 .nf
1418 \fBconst char *solvid2str(Id\fR \fIid\fR\fB)\fR
1419 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvid2str(\fR\fI$id\fR\fB)\fR;
1420 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
1421 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
1422 .fi
1423 .if n \{\
1424 .RE
1425 .\}
1426 .sp
1427 Return a string describing the Solvable with the specified id\&. The string consists of the name, version, and architecture of the Solvable\&.
1428 .sp
1429 .if n \{\
1430 .RS 4
1431 .\}
1432 .nf
1433 \fBconst char *solvidset2str(Id *\fR\fIsolvids\fR\fB)\fR
1434 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvidset2str(\e\fR\fI@solvids\fR\fB)\fR;
1435 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvidset2str(\fR\fIsolvids\fR\fB)\fR
1436 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvidset2str(\fR\fIsolvids\fR\fB)\fR
1437 .fi
1438 .if n \{\
1439 .RE
1440 .\}
1441 .sp
1442 Return a string describing a list of solvables\&. The method tries to reduce the output by using version ranges if possible\&.
1443 .sp
1444 .if n \{\
1445 .RS 4
1446 .\}
1447 .nf
1448 \fBId str2id(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1449 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->str2id(\fR\fI$string\fR\fB)\fR;
1450 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
1451 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
1452 .fi
1453 .if n \{\
1454 .RE
1455 .\}
1456 .sp
1457 .if n \{\
1458 .RS 4
1459 .\}
1460 .nf
1461 \fBconst char *id2str(Id\fR \fIid\fR\fB)\fR
1462 \fI$string\fR \fB=\fR \fIpool\fR\fB\->id2str(\fR\fI$id\fR\fB)\fR;
1463 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
1464 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
1465 .fi
1466 .if n \{\
1467 .RE
1468 .\}
1469 .sp
1470 Convert a string into an Id and back\&. If the string is currently not in the pool and \fIcreate\fR is false, zero is returned\&.
1471 .sp
1472 .if n \{\
1473 .RS 4
1474 .\}
1475 .nf
1476 \fBId rel2id(Id\fR \fIname\fR\fB, Id\fR \fIevr\fR\fB, int\fR \fIflags\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1477 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->rel2id(\fR\fI$nameid\fR\fB,\fR \fI$evrid\fR\fB,\fR \fI$flags\fR\fB)\fR;
1478 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
1479 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
1480 .fi
1481 .if n \{\
1482 .RE
1483 .\}
1484 .sp
1485 Create a \(lqrelational\(rq dependency\&. Such dependencies consist of a name part, \fIflags\fR describing the relation, and a version part\&. The flags are:
1486 .sp
1487 .if n \{\
1488 .RS 4
1489 .\}
1490 .nf
1491 \fB$solv::REL_EQ | $solv::REL_GT | $solv::REL_LT\fR
1492 \fBsolv\&.REL_EQ | solv\&.REL_GT | solv\&.REL_LT\fR
1493 \fBSolv::REL_EQ | Solv::REL_GT | Solv::REL_LT\fR
1494 .fi
1495 .if n \{\
1496 .RE
1497 .\}
1498 .sp
1499 Thus, if you want a \(lq<=\(rq relation, you would use \fBREL_LT | REL_EQ\fR\&.
1500 .sp
1501 .if n \{\
1502 .RS 4
1503 .\}
1504 .nf
1505 \fBId id2langid(Id\fR \fIid\fR\fB, const char *\fR\fIlang\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1506 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->id2langid(\fR\fI$id\fR\fB,\fR \fI$language\fR\fB)\fR;
1507 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
1508 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
1509 .fi
1510 .if n \{\
1511 .RE
1512 .\}
1513 .sp
1514 Create a language specific Id from some other id\&. This function simply converts the id into a string, appends a dot and the specified language to the string and converts the result back into an Id\&.
1515 .sp
1516 .if n \{\
1517 .RS 4
1518 .\}
1519 .nf
1520 \fBconst char *dep2str(Id\fR \fIid\fR\fB)\fR
1521 \fI$string\fR \fB=\fR \fIpool\fR\fB\->dep2str(\fR\fI$id\fR\fB)\fR;
1522 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
1523 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
1524 .fi
1525 .if n \{\
1526 .RE
1527 .\}
1528 .sp
1529 Convert a dependency id into a string\&. If the id is just a string, this function has the same effect as id2str()\&. For relational dependencies, the result is the correct \(lqname relation evr\(rq string\&.
1530 .SH "THE DEPENDENCY CLASS"
1531 .sp
1532 The dependency class is an object orientated way to work with strings and dependencies\&. Internally, dependencies are represented as Ids, i\&.e\&. simple numbers\&. Dependency objects can be constructed by using the Pool\(cqs Dep() method\&.
1533 .SS "ATTRIBUTES"
1534 .sp
1535 .if n \{\
1536 .RS 4
1537 .\}
1538 .nf
1539 \fBPool *pool;\fR             /* read only */
1540 \fI$dep\fR\fB\->{pool}\fR
1541 \fIdep\fR\fB\&.pool\fR
1542 \fIdep\fR\fB\&.pool\fR
1543 .fi
1544 .if n \{\
1545 .RE
1546 .\}
1547 .sp
1548 Back reference to the pool this dependency belongs to\&.
1549 .sp
1550 .if n \{\
1551 .RS 4
1552 .\}
1553 .nf
1554 \fBId id;\fR          /* read only */
1555 \fI$dep\fR\fB\->{id}\fR
1556 \fIdep\fR\fB\&.id\fR
1557 \fIdep\fR\fB\&.id\fR
1558 .fi
1559 .if n \{\
1560 .RE
1561 .\}
1562 .sp
1563 The id of this dependency\&.
1564 .SS "METHODS"
1565 .sp
1566 .if n \{\
1567 .RS 4
1568 .\}
1569 .nf
1570 \fBDep Rel(int\fR \fIflags\fR\fB, DepId\fR \fIevrid\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1571 my \fI$reldep\fR \fB=\fR \fI$dep\fR\fB\->Rel(\fR\fI$flags\fR\fB,\fR \fI$evrdep\fR\fB)\fR;
1572 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
1573 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
1574 .fi
1575 .if n \{\
1576 .RE
1577 .\}
1578 .sp
1579 Create a relational dependency from the caller dependency, the flags, and a dependency describing the \(lqversion\(rq part\&. See the pool\(cqs rel2id method for a description of the flags\&.
1580 .sp
1581 .if n \{\
1582 .RS 4
1583 .\}
1584 .nf
1585 \fBSelection Selection_name(int\fR \fIsetflags\fR \fB= 0)\fR
1586 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_name()\fR;
1587 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
1588 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
1589 .fi
1590 .if n \{\
1591 .RE
1592 .\}
1593 .sp
1594 Create a Selection from a dependency\&. The selection consists of all packages that have a name equal to the dependency\&. If the dependency is of a relational type, the packages version must also fulfill the dependency\&.
1595 .sp
1596 .if n \{\
1597 .RS 4
1598 .\}
1599 .nf
1600 \fBSelection Selection_provides(int\fR \fIsetflags\fR \fB= 0)\fR
1601 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_provides()\fR;
1602 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
1603 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
1604 .fi
1605 .if n \{\
1606 .RE
1607 .\}
1608 .sp
1609 Create a Selection from a dependency\&. The selection consists of all packages that have at least one provides matching the dependency\&.
1610 .sp
1611 .if n \{\
1612 .RS 4
1613 .\}
1614 .nf
1615 \fBconst char *str()\fR
1616 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str()\fR;
1617 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
1618 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
1619 .fi
1620 .if n \{\
1621 .RE
1622 .\}
1623 .sp
1624 Return a string describing the dependency\&.
1625 .sp
1626 .if n \{\
1627 .RS 4
1628 .\}
1629 .nf
1630 \fB<stringification>\fR
1631 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str\fR;
1632 \fIstr\fR \fB= str(\fR\fIdep\fR\fB)\fR
1633 \fIstr\fR \fB=\fR \fIdep\fR\fB\&.to_s\fR
1634 .fi
1635 .if n \{\
1636 .RE
1637 .\}
1638 .sp
1639 Same as calling the str() method\&.
1640 .sp
1641 .if n \{\
1642 .RS 4
1643 .\}
1644 .nf
1645 \fB<equality>\fR
1646 \fBif (\fR\fI$dep1\fR \fB==\fR \fI$dep2\fR\fB)\fR
1647 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR\fB:\fR
1648 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR
1649 .fi
1650 .if n \{\
1651 .RE
1652 .\}
1653 .sp
1654 Two dependencies are equal if they are part of the same pool and have the same ids\&.
1655 .SH "THE REPOSITORY CLASS"
1656 .sp
1657 A Repository describes a group of packages, normally coming from the same source\&. Repositories are created by the Pool\(cqs add_repo() method\&.
1658 .SS "ATTRIBUTES"
1659 .sp
1660 .if n \{\
1661 .RS 4
1662 .\}
1663 .nf
1664 \fBPool *pool;\fR                     /* read only */
1665 \fI$repo\fR\fB\->{pool}\fR
1666 \fIrepo\fR\fB\&.pool\fR
1667 \fIrepo\fR\fB\&.pool\fR
1668 .fi
1669 .if n \{\
1670 .RE
1671 .\}
1672 .sp
1673 Back reference to the pool this dependency belongs to\&.
1674 .sp
1675 .if n \{\
1676 .RS 4
1677 .\}
1678 .nf
1679 \fBId id;\fR                          /* read only */
1680 \fI$repo\fR\fB\->{id}\fR
1681 \fIrepo\fR\fB\&.id\fR
1682 \fIrepo\fR\fB\&.id\fR
1683 .fi
1684 .if n \{\
1685 .RE
1686 .\}
1687 .sp
1688 The id of the repository\&.
1689 .sp
1690 .if n \{\
1691 .RS 4
1692 .\}
1693 .nf
1694 \fBconst char *name;\fR               /* read/write */
1695 \fI$repo\fR\fB\->{name}\fR
1696 \fIrepo\fR\fB\&.name\fR
1697 \fIrepo\fR\fB\&.name\fR
1698 .fi
1699 .if n \{\
1700 .RE
1701 .\}
1702 .sp
1703 The repositories name\&. To libsolv, the name is just a string with no specific meaning\&.
1704 .sp
1705 .if n \{\
1706 .RS 4
1707 .\}
1708 .nf
1709 \fBint priority;\fR                   /* read/write */
1710 \fI$repo\fR\fB\->{priority}\fR
1711 \fIrepo\fR\fB\&.priority\fR
1712 \fIrepo\fR\fB\&.priority\fR
1713 .fi
1714 .if n \{\
1715 .RE
1716 .\}
1717 .sp
1718 The priority of the repository\&. A higher number means that packages of this repository will be chosen over other repositories, even if they have a greater package version\&.
1719 .sp
1720 .if n \{\
1721 .RS 4
1722 .\}
1723 .nf
1724 \fBint subpriority;\fR                /* read/write */
1725 \fI$repo\fR\fB\->{subpriority}\fR
1726 \fIrepo\fR\fB\&.subpriority\fR
1727 \fIrepo\fR\fB\&.subpriority\fR
1728 .fi
1729 .if n \{\
1730 .RE
1731 .\}
1732 .sp
1733 The sub\-priority of the repository\&. This value is compared when the priorities of two repositories are the same\&. It is useful to make the library prefer on\-disk repositories to remote ones\&.
1734 .sp
1735 .if n \{\
1736 .RS 4
1737 .\}
1738 .nf
1739 \fBint nsolvables;\fR                 /* read only */
1740 \fI$repo\fR\fB\->{nsolvables}\fR
1741 \fIrepo\fR\fB\&.nsolvables\fR
1742 \fIrepo\fR\fB\&.nsolvables\fR
1743 .fi
1744 .if n \{\
1745 .RE
1746 .\}
1747 .sp
1748 The number of solvables in this repository\&.
1749 .sp
1750 .if n \{\
1751 .RS 4
1752 .\}
1753 .nf
1754 \fBvoid *appdata;\fR                  /* read/write */
1755 \fI$repo\fR\fB\->{appdata}\fR
1756 \fIrepo\fR\fB\&.appdata\fR
1757 \fIrepo\fR\fB\&.appdata\fR
1758 .fi
1759 .if n \{\
1760 .RE
1761 .\}
1762 .sp
1763 Application specific data that may be used in any way by the code using the repository\&.
1764 .sp
1765 .if n \{\
1766 .RS 4
1767 .\}
1768 .nf
1769 \fBDatapos *meta;\fR                  /* read only */
1770 \fI$repo\fR\fB\->{meta}\fR
1771 \fIrepo\fR\fB\&.meta\fR
1772 \fIrepo\fR\fB\&.meta\fR
1773 .fi
1774 .if n \{\
1775 .RE
1776 .\}
1777 .sp
1778 Return a Datapos object of the repodata\(cqs metadata\&. You can use the lookup methods of the Datapos class to lookup metadata attributes, like the repository timestamp\&.
1779 .SS "CONSTANTS"
1780 .PP
1781 \fBREPO_REUSE_REPODATA\fR
1782 .RS 4
1783 Reuse the last repository data area (\(lqrepodata\(rq) instead of creating a new area\&.
1784 .RE
1785 .PP
1786 \fBREPO_NO_INTERNALIZE\fR
1787 .RS 4
1788 Do not internalize the added repository data\&. This is useful if you plan to add more data because internalization is a costly operation\&.
1789 .RE
1790 .PP
1791 \fBREPO_LOCALPOOL\fR
1792 .RS 4
1793 Use the repodata\(cqs pool for Id storage instead of the global pool\&. Useful if you don\(cqt want to pollute the global pool with many unneeded ids, like when storing the filelist\&.
1794 .RE
1795 .PP
1796 \fBREPO_USE_LOADING\fR
1797 .RS 4
1798 Use the repodata that is currently being loaded instead of creating a new one\&. This only makes sense if used in a load callback\&.
1799 .RE
1800 .PP
1801 \fBREPO_EXTEND_SOLVABLES\fR
1802 .RS 4
1803 Do not create new solvables for the new data, but match existing solvables and add the data to them\&. Repository metadata is often split into multiple parts, with one primary file describing all packages and other parts holding information that is normally not needed, like the changelog\&.
1804 .RE
1805 .PP
1806 \fBREPO_USE_ROOTDIR\fR
1807 .RS 4
1808 Prepend the pool\(cqs rootdir to the path when doing file operations\&.
1809 .RE
1810 .PP
1811 \fBREPO_NO_LOCATION\fR
1812 .RS 4
1813 Do not add a location element to the solvables\&. Useful if the solvables are not in the final position, so you can add the correct location later in your code\&.
1814 .RE
1815 .PP
1816 \fBSOLV_ADD_NO_STUBS\fR
1817 .RS 4
1818 Do not create stubs for repository parts that can be downloaded on demand\&.
1819 .RE
1820 .PP
1821 \fBSUSETAGS_RECORD_SHARES\fR
1822 .RS 4
1823 This is specific to the add_susetags() method\&. Susetags allows one to refer to already read packages to save disk space\&. If this data sharing needs to work over multiple calls to add_susetags, you need to specify this flag so that the share information is made available to subsequent calls\&.
1824 .RE
1825 .SS "METHODS"
1826 .sp
1827 .if n \{\
1828 .RS 4
1829 .\}
1830 .nf
1831 \fBvoid free(bool\fR \fIreuseids\fR \fB= 0)\fR
1832 \fI$repo\fR\fB\->free()\fR;
1833 \fIrepo\fR\fB\&.free()\fR
1834 \fIrepo\fR\fB\&.free()\fR
1835 .fi
1836 .if n \{\
1837 .RE
1838 .\}
1839 .sp
1840 Free the repository and all solvables it contains\&. If \fIreuseids\fR is set to true, the solvable ids and the repository id may be reused by the library when added new solvables\&. Thus you should leave it false if you are not sure that somebody holds a reference\&.
1841 .sp
1842 .if n \{\
1843 .RS 4
1844 .\}
1845 .nf
1846 \fBvoid empty(bool\fR \fIreuseids\fR \fB= 0)\fR
1847 \fI$repo\fR\fB\->empty()\fR;
1848 \fIrepo\fR\fB\&.empty()\fR
1849 \fIrepo\fR\fB\&.empty()\fR
1850 .fi
1851 .if n \{\
1852 .RE
1853 .\}
1854 .sp
1855 Free all the solvables in a repository\&. The repository will be empty after this call\&. See the free() method for the meaning of \fIreuseids\fR\&.
1856 .sp
1857 .if n \{\
1858 .RS 4
1859 .\}
1860 .nf
1861 \fBbool isempty()\fR
1862 \fI$repo\fR\fB\->isempty()\fR
1863 \fIrepo\fR\fB\&.empty()\fR
1864 \fIrepo\fR\fB\&.empty?\fR
1865 .fi
1866 .if n \{\
1867 .RE
1868 .\}
1869 .sp
1870 Return true if there are no solvables in this repository\&.
1871 .sp
1872 .if n \{\
1873 .RS 4
1874 .\}
1875 .nf
1876 \fBvoid internalize()\fR
1877 \fI$repo\fR\fB\->internalize()\fR;
1878 \fIrepo\fR\fB\&.internalize()\fR
1879 \fIrepo\fR\fB\&.internalize()\fR
1880 .fi
1881 .if n \{\
1882 .RE
1883 .\}
1884 .sp
1885 Internalize added data\&. Data must be internalized before it is available to the lookup and data iterator functions\&.
1886 .sp
1887 .if n \{\
1888 .RS 4
1889 .\}
1890 .nf
1891 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR
1892 \fI$repo\fR\fB\->write(\fR\fI$fp\fR\fB)\fR
1893 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1894 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1895 .fi
1896 .if n \{\
1897 .RE
1898 .\}
1899 .sp
1900 Write a repo as a \(lqsolv\(rq file\&. These files can be read very fast and thus are a good way to cache repository data\&. Returns false if there was some error writing the file\&.
1901 .sp
1902 .if n \{\
1903 .RS 4
1904 .\}
1905 .nf
1906 \fBSolvableiterator solvables_iter()\fR
1907 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$repo\fR\fB\->solvables_iter()})\fR
1908 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter():\fR
1909 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter()\fR
1910 .fi
1911 .if n \{\
1912 .RE
1913 .\}
1914 .sp
1915 Iterate over all solvables in a repository\&.
1916 .sp
1917 .if n \{\
1918 .RS 4
1919 .\}
1920 .nf
1921 \fBRepodata add_repodata(int\fR \fIflags\fR \fB= 0)\fR
1922 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->add_repodata()\fR;
1923 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1924 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1925 .fi
1926 .if n \{\
1927 .RE
1928 .\}
1929 .sp
1930 Add a new repodata area to the repository\&. This is normally automatically done by the repo_add methods, so you need this method only in very rare circumstances\&.
1931 .sp
1932 .if n \{\
1933 .RS 4
1934 .\}
1935 .nf
1936 \fBvoid create_stubs()\fR
1937 \fI$repo\fR\fB\->create_stubs()\fR;
1938 \fIrepo\fR\fB\&.create_stubs()\fR
1939 \fIrepo\fR\fB\&.create_stubs()\fR
1940 .fi
1941 .if n \{\
1942 .RE
1943 .\}
1944 .sp
1945 Calls the create_stubs() repodata method for the last repodata of the repository\&.
1946 .sp
1947 .if n \{\
1948 .RS 4
1949 .\}
1950 .nf
1951 \fBbool iscontiguous()\fR
1952 \fI$repo\fR\fB\->iscontiguous()\fR
1953 \fIrepo\fR\fB\&.iscontiguous()\fR
1954 \fIrepo\fR\fB\&.iscontiguous?\fR
1955 .fi
1956 .if n \{\
1957 .RE
1958 .\}
1959 .sp
1960 Return true if the solvables of this repository are all in a single block with no holes, i\&.e\&. they have consecutive ids\&.
1961 .sp
1962 .if n \{\
1963 .RS 4
1964 .\}
1965 .nf
1966 \fBRepodata first_repodata()\fR
1967 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->first_repodata()\fR;
1968 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1969 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1970 .fi
1971 .if n \{\
1972 .RE
1973 .\}
1974 .sp
1975 Checks if all repodatas but the first repodata are extensions, and return the first repodata if this is the case\&. Useful if you want to do a store/retrieve sequence on the repository to reduce the memory using and enable paging, as this does not work if the repository contains multiple non\-extension repodata areas\&.
1976 .sp
1977 .if n \{\
1978 .RS 4
1979 .\}
1980 .nf
1981 \fBSelection Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1982 my \fI$sel\fR \fB=\fR \fI$repo\fR\fB\->Selection()\fR;
1983 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1984 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1985 .fi
1986 .if n \{\
1987 .RE
1988 .\}
1989 .sp
1990 Create a Selection consisting of all packages in the repository\&.
1991 .sp
1992 .if n \{\
1993 .RS 4
1994 .\}
1995 .nf
1996 \fBDataiterator Dataiterator(Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
1997 my \fI$di\fR \fB=\fR \fI$repo\fR\fB\->Dataiterator(\fR\fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
1998 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1999 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2000 .fi
2001 .if n \{\
2002 .RE
2003 .\}
2004 .sp
2005 .if n \{\
2006 .RS 4
2007 .\}
2008 .nf
2009 \fBDataiterator Dataiterator_meta(Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
2010 my \fI$di\fR \fB=\fR \fI$repo\fR\fB\->Dataiterator_meta(\fR\fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
2011 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator_meta(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2012 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator_meta(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2013 .fi
2014 .if n \{\
2015 .RE
2016 .\}
2017 .sp
2018 .if n \{\
2019 .RS 4
2020 .\}
2021 .nf
2022 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2023 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2024 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2025 .fi
2026 .if n \{\
2027 .RE
2028 .\}
2029 .sp
2030 Iterate over the matching data elements in this repository\&. See the Dataiterator class for more information\&. The Dataiterator() method iterates over all solvables in a repository, whereas the Dataiterator_meta method only iterates over the repository\(cqs meta data\&.
2031 .sp
2032 .if n \{\
2033 .RS 4
2034 .\}
2035 .nf
2036 \fB<stringification>\fR
2037 my \fI$str\fR \fB=\fR \fI$repo\fR\fB\->str\fR;
2038 \fIstr\fR \fB= str(\fR\fIrepo\fR\fB)\fR
2039 \fIstr\fR \fB=\fR \fIrepo\fR\fB\&.to_s\fR
2040 .fi
2041 .if n \{\
2042 .RE
2043 .\}
2044 .sp
2045 Return the name of the repository, or "Repo#<id>" if no name is set\&.
2046 .sp
2047 .if n \{\
2048 .RS 4
2049 .\}
2050 .nf
2051 \fB<equality>\fR
2052 \fBif (\fR\fI$repo1\fR \fB==\fR \fI$repo2\fR\fB)\fR
2053 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR\fB:\fR
2054 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR
2055 .fi
2056 .if n \{\
2057 .RE
2058 .\}
2059 .sp
2060 Two repositories are equal if they belong to the same pool and have the same id\&.
2061 .SS "DATA ADD METHODS"
2062 .sp
2063 .if n \{\
2064 .RS 4
2065 .\}
2066 .nf
2067 \fBSolvable add_solvable()\fR
2068 \fI$repo\fR\fB\->add_solvable()\fR;
2069 \fIrepo\fR\fB\&.add_solvable()\fR
2070 \fIrepo\fR\fB\&.add_solvable()\fR
2071 .fi
2072 .if n \{\
2073 .RE
2074 .\}
2075 .sp
2076 Add a single empty solvable to the repository\&. Returns a Solvable object, see the Solvable class for more information\&.
2077 .sp
2078 .if n \{\
2079 .RS 4
2080 .\}
2081 .nf
2082 \fBbool add_solv(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2083 \fI$repo\fR\fB\->add_solv(\fR\fI$name\fR\fB)\fR;
2084 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB)\fR
2085 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB)\fR
2086 .fi
2087 .if n \{\
2088 .RE
2089 .\}
2090 .sp
2091 .if n \{\
2092 .RS 4
2093 .\}
2094 .nf
2095 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2096 \fI$repo\fR\fB\->add_solv(\fR\fI$fp\fR\fB)\fR;
2097 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
2098 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
2099 .fi
2100 .if n \{\
2101 .RE
2102 .\}
2103 .sp
2104 Read a \(lqsolv\(rq file and add its contents to the repository\&. These files can be written with the write() method and are normally used as fast cache for repository metadata\&.
2105 .sp
2106 .if n \{\
2107 .RS 4
2108 .\}
2109 .nf
2110 \fBbool add_rpmdb(int\fR \fIflags\fR \fB= 0)\fR
2111 \fI$repo\fR\fB\->add_rpmdb()\fR;
2112 \fIrepo\fR\fB\&.add_rpmdb()\fR
2113 \fIrepo\fR\fB\&.add_rpmdb()\fR
2114 .fi
2115 .if n \{\
2116 .RE
2117 .\}
2118 .sp
2119 .if n \{\
2120 .RS 4
2121 .\}
2122 .nf
2123 \fBbool add_rpmdb_reffp(FILE *\fR\fIreffp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2124 \fI$repo\fR\fB\->add_rpmdb_reffp(\fR\fI$reffp\fR\fB)\fR;
2125 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fIreffp\fR\fB)\fR
2126 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fIreffp\fR\fB)\fR
2127 .fi
2128 .if n \{\
2129 .RE
2130 .\}
2131 .sp
2132 Add the contents of the rpm database to the repository\&. If a solv file containing an old version of the database is available, it can be passed as reffp to speed up reading\&.
2133 .sp
2134 .if n \{\
2135 .RS 4
2136 .\}
2137 .nf
2138 \fBSolvable add_rpm(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2139 my \fI$solvable\fR \fB=\fR \fI$repo\fR\fB\->add_rpm(\fR\fI$filename\fR\fB)\fR;
2140 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_rpm(\fR\fIfilename\fR\fB)\fR
2141 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_rpm(\fR\fIfilename\fR\fB)\fR
2142 .fi
2143 .if n \{\
2144 .RE
2145 .\}
2146 .sp
2147 Add the metadata of a single rpm package to the repository\&.
2148 .sp
2149 .if n \{\
2150 .RS 4
2151 .\}
2152 .nf
2153 \fBbool add_rpmdb_pubkeys(int\fR \fIflags\fR \fB= 0)\fR
2154 \fI$repo\fR\fB\->add_rpmdb_pubkeys()\fR;
2155 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
2156 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
2157 .fi
2158 .if n \{\
2159 .RE
2160 .\}
2161 .sp
2162 Add all pubkeys contained in the rpm database to the repository\&. Note that newer rpm versions also allow to store the pubkeys in some directory instead of the rpm database\&.
2163 .sp
2164 .if n \{\
2165 .RS 4
2166 .\}
2167 .nf
2168 \fBSolvable add_pubkey(const char *\fR\fIkeyfile\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2169 my \fI$solvable\fR \fB=\fR \fI$repo\fR\fB\->add_pubkey(\fR\fI$keyfile\fR\fB)\fR;
2170 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_pubkey(\fR\fIkeyfile\fR\fB)\fR
2171 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_pubkey(\fR\fIkeyfile\fR\fB)\fR
2172 .fi
2173 .if n \{\
2174 .RE
2175 .\}
2176 .sp
2177 Add a pubkey from a file to the repository\&.
2178 .sp
2179 .if n \{\
2180 .RS 4
2181 .\}
2182 .nf
2183 \fBbool add_rpmmd(FILE *\fR\fIfp\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2184 \fI$repo\fR\fB\->add_rpmmd(\fR\fI$fp\fR\fB,\fR \fIundef\fR\fB)\fR;
2185 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fINone\fR\fB)\fR
2186 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fInil\fR\fB)\fR
2187 .fi
2188 .if n \{\
2189 .RE
2190 .\}
2191 .sp
2192 Add metadata stored in the "rpm\-md" format (i\&.e\&. from files in the \(lqrepodata\(rq directory) to a repository\&. Supported files are "primary", "filelists", "other", "suseinfo"\&. Do not forget to specify the \fBREPO_EXTEND_SOLVABLES\fR for extension files like "filelists" and "other"\&. Use the \fIlanguage\fR parameter if you have language extension files, otherwise simply use a \fBundef\fR/\fBNone\fR/\fBnil\fR parameter\&.
2193 .sp
2194 .if n \{\
2195 .RS 4
2196 .\}
2197 .nf
2198 \fBbool add_repomdxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2199 \fI$repo\fR\fB\->add_repomdxml(\fR\fI$fp\fR\fB)\fR;
2200 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
2201 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
2202 .fi
2203 .if n \{\
2204 .RE
2205 .\}
2206 .sp
2207 Add the repomd\&.xml meta description from the "rpm\-md" format to the repository\&. This file contains information about the repository like keywords, and also a list of all database files with checksums\&. The data is added to the "meta" section of the repository, i\&.e\&. no package gets created\&.
2208 .sp
2209 .if n \{\
2210 .RS 4
2211 .\}
2212 .nf
2213 \fBbool add_updateinfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2214 \fI$repo\fR\fB\->add_updateinfoxml(\fR\fI$fp\fR\fB)\fR;
2215 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
2216 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
2217 .fi
2218 .if n \{\
2219 .RE
2220 .\}
2221 .sp
2222 Add the updateinfo\&.xml file containing available maintenance updates to the repository\&. All updates are created as special packages that have a "patch:" prefix in their name\&.
2223 .sp
2224 .if n \{\
2225 .RS 4
2226 .\}
2227 .nf
2228 \fBbool add_deltainfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2229 \fI$repo\fR\fB\->add_deltainfoxml(\fR\fI$fp\fR\fB)\fR;
2230 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
2231 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
2232 .fi
2233 .if n \{\
2234 .RE
2235 .\}
2236 .sp
2237 Add the deltainfo\&.xml file (also called prestodelta\&.xml) containing available delta\-rpms to the repository\&. The data is added to the "meta" section, i\&.e\&. no package gets created\&.
2238 .sp
2239 .if n \{\
2240 .RS 4
2241 .\}
2242 .nf
2243 \fBbool add_debdb(int\fR \fIflags\fR \fB= 0)\fR
2244 \fI$repo\fR\fB\->add_debdb()\fR;
2245 \fIrepo\fR\fB\&.add_debdb()\fR
2246 \fIrepo\fR\fB\&.add_debdb()\fR
2247 .fi
2248 .if n \{\
2249 .RE
2250 .\}
2251 .sp
2252 Add the contents of the debian installed package database to the repository\&.
2253 .sp
2254 .if n \{\
2255 .RS 4
2256 .\}
2257 .nf
2258 \fBbool add_debpackages(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2259 \fI$repo\fR\fB\->add_debpackages(\fR\fI$fp\fR\fB)\fR;
2260 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
2261 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
2262 .fi
2263 .if n \{\
2264 .RE
2265 .\}
2266 .sp
2267 Add the contents of the debian repository metadata (the "packages" file) to the repository\&.
2268 .sp
2269 .if n \{\
2270 .RS 4
2271 .\}
2272 .nf
2273 \fBSolvable add_deb(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2274 my \fI$solvable\fR \fB=\fR \fI$repo\fR\fB\->add_deb(\fR\fI$filename\fR\fB)\fR;
2275 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
2276 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
2277 .fi
2278 .if n \{\
2279 .RE
2280 .\}
2281 .sp
2282 Add the metadata of a single deb package to the repository\&.
2283 .sp
2284 .if n \{\
2285 .RS 4
2286 .\}
2287 .nf
2288 \fBbool add_mdk(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2289 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
2290 \fIrepo\fR\fB\&.add_mdk(\fR\fIfp\fR\fB)\fR
2291 \fIrepo\fR\fB\&.add_mdk(\fR\fIfp\fR\fB)\fR
2292 .fi
2293 .if n \{\
2294 .RE
2295 .\}
2296 .sp
2297 Add the contents of the mageia/mandriva repository metadata (the "synthesis\&.hdlist" file) to the repository\&.
2298 .sp
2299 .if n \{\
2300 .RS 4
2301 .\}
2302 .nf
2303 \fBbool add_mdk_info(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2304 \fI$repo\fR\fB\->add_mdk_info(\fR\fI$fp\fR\fB)\fR;
2305 \fIrepo\fR\fB\&.add_mdk_info(\fR\fIfp\fR\fB)\fR
2306 \fIrepo\fR\fB\&.add_mdk_info(\fR\fIfp\fR\fB)\fR
2307 .fi
2308 .if n \{\
2309 .RE
2310 .\}
2311 .sp
2312 Extend the packages from the synthesis file with the info\&.xml and files\&.xml data\&. Do not forget to specify \fBREPO_EXTEND_SOLVABLES\fR\&.
2313 .sp
2314 .if n \{\
2315 .RS 4
2316 .\}
2317 .nf
2318 \fBbool add_arch_repo(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2319 \fI$repo\fR\fB\->add_arch_repo(\fR\fI$fp\fR\fB)\fR;
2320 \fIrepo\fR\fB\&.add_arch_repo(\fR\fIfp\fR\fB)\fR
2321 \fIrepo\fR\fB\&.add_arch_repo(\fR\fIfp\fR\fB)\fR
2322 .fi
2323 .if n \{\
2324 .RE
2325 .\}
2326 .sp
2327 Add the contents of the archlinux repository metadata (the "\&.db\&.tar" file) to the repository\&.
2328 .sp
2329 .if n \{\
2330 .RS 4
2331 .\}
2332 .nf
2333 \fBbool add_arch_local(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2334 \fI$repo\fR\fB\->add_arch_local(\fR\fI$dir\fR\fB)\fR;
2335 \fIrepo\fR\fB\&.add_arch_local(\fR\fIdir\fR\fB)\fR
2336 \fIrepo\fR\fB\&.add_arch_local(\fR\fIdir\fR\fB)\fR
2337 .fi
2338 .if n \{\
2339 .RE
2340 .\}
2341 .sp
2342 Add the contents of the archlinux installed package database to the repository\&. The \fIdir\fR parameter is usually set to "/var/lib/pacman/local"\&.
2343 .sp
2344 .if n \{\
2345 .RS 4
2346 .\}
2347 .nf
2348 \fBbool add_content(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2349 \fI$repo\fR\fB\->add_content(\fR\fI$fp\fR\fB)\fR;
2350 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
2351 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
2352 .fi
2353 .if n \{\
2354 .RE
2355 .\}
2356 .sp
2357 Add the \(lqcontent\(rq meta description from the susetags format to the repository\&. This file contains information about the repository like keywords, and also a list of all database files with checksums\&. The data is added to the "meta" section of the repository, i\&.e\&. no package gets created\&.
2358 .sp
2359 .if n \{\
2360 .RS 4
2361 .\}
2362 .nf
2363 \fBbool add_susetags(FILE *\fR\fIfp\fR\fB, Id\fR \fIdefvendor\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2364 \fI$repo\fR\fB\->add_susetags(\fR\fI$fp\fR\fB,\fR \fI$defvendor\fR\fB,\fR \fI$language\fR\fB)\fR;
2365 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
2366 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
2367 .fi
2368 .if n \{\
2369 .RE
2370 .\}
2371 .sp
2372 Add repository metadata in the susetags format to the repository\&. Like with add_rpmmd, you can specify a language if you have language extension files\&. The \fIdefvendor\fR parameter provides a default vendor for packages with missing vendors, it is usually provided in the content file\&.
2373 .sp
2374 .if n \{\
2375 .RS 4
2376 .\}
2377 .nf
2378 \fBbool add_products(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2379 \fI$repo\fR\fB\->add_products(\fR\fI$dir\fR\fB)\fR;
2380 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
2381 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
2382 .fi
2383 .if n \{\
2384 .RE
2385 .\}
2386 .sp
2387 Add the installed SUSE products database to the repository\&. The \fIdir\fR parameter is usually "/etc/products\&.d"\&.
2388 .SH "THE SOLVABLE CLASS"
2389 .sp
2390 A solvable describes all the information of one package\&. Each solvable belongs to one repository, it can be added and filled manually but in most cases solvables will get created by the repo_add methods\&.
2391 .SS "ATTRIBUTES"
2392 .sp
2393 .if n \{\
2394 .RS 4
2395 .\}
2396 .nf
2397 \fBRepo *repo;\fR                     /* read only */
2398 \fI$solvable\fR\fB\->{repo}\fR
2399 \fIsolvable\fR\fB\&.repo\fR
2400 \fIsolvable\fR\fB\&.repo\fR
2401 .fi
2402 .if n \{\
2403 .RE
2404 .\}
2405 .sp
2406 The repository this solvable belongs to\&.
2407 .sp
2408 .if n \{\
2409 .RS 4
2410 .\}
2411 .nf
2412 \fBPool *pool;\fR                     /* read only */
2413 \fI$solvable\fR\fB\->{pool}\fR
2414 \fIsolvable\fR\fB\&.pool\fR
2415 \fIsolvable\fR\fB\&.pool\fR
2416 .fi
2417 .if n \{\
2418 .RE
2419 .\}
2420 .sp
2421 The pool this solvable belongs to, same as the pool of the repo\&.
2422 .sp
2423 .if n \{\
2424 .RS 4
2425 .\}
2426 .nf
2427 \fBId id;\fR                          /* read only */
2428 \fI$solvable\fR\fB\->{id}\fR
2429 \fIsolvable\fR\fB\&.id\fR
2430 \fIsolvable\fR\fB\&.id\fR
2431 .fi
2432 .if n \{\
2433 .RE
2434 .\}
2435 .sp
2436 The specific id of the solvable\&.
2437 .sp
2438 .if n \{\
2439 .RS 4
2440 .\}
2441 .nf
2442 \fBchar *name;\fR                     /* read/write */
2443 \fI$solvable\fR\fB\->{name}\fR
2444 \fIsolvable\fR\fB\&.name\fR
2445 \fIsolvable\fR\fB\&.name\fR
2446 .fi
2447 .if n \{\
2448 .RE
2449 .\}
2450 .sp
2451 .if n \{\
2452 .RS 4
2453 .\}
2454 .nf
2455 \fBchar *evr;\fR                      /* read/write */
2456 \fI$solvable\fR\fB\->{evr}\fR
2457 \fIsolvable\fR\fB\&.evr\fR
2458 \fIsolvable\fR\fB\&.evr\fR
2459 .fi
2460 .if n \{\
2461 .RE
2462 .\}
2463 .sp
2464 .if n \{\
2465 .RS 4
2466 .\}
2467 .nf
2468 \fBchar *arch;\fR                     /* read/write */
2469 \fI$solvable\fR\fB\->{arch}\fR
2470 \fIsolvable\fR\fB\&.arch\fR
2471 \fIsolvable\fR\fB\&.arch\fR
2472 .fi
2473 .if n \{\
2474 .RE
2475 .\}
2476 .sp
2477 .if n \{\
2478 .RS 4
2479 .\}
2480 .nf
2481 \fBchar *vendor;\fR                   /* read/write */
2482 \fI$solvable\fR\fB\->{vendor}\fR
2483 \fIsolvable\fR\fB\&.vendor\fR
2484 \fIsolvable\fR\fB\&.vendor\fR
2485 .fi
2486 .if n \{\
2487 .RE
2488 .\}
2489 .sp
2490 Easy access to often used attributes of solvables\&. They are internally stored as Ids\&.
2491 .sp
2492 .if n \{\
2493 .RS 4
2494 .\}
2495 .nf
2496 \fBId nameid;\fR                      /* read/write */
2497 \fI$solvable\fR\fB\->{nameid}\fR
2498 \fIsolvable\fR\fB\&.nameid\fR
2499 \fIsolvable\fR\fB\&.nameid\fR
2500 .fi
2501 .if n \{\
2502 .RE
2503 .\}
2504 .sp
2505 .if n \{\
2506 .RS 4
2507 .\}
2508 .nf
2509 \fBId evrid;\fR                       /* read/write */
2510 \fI$solvable\fR\fB\->{evrid}\fR
2511 \fIsolvable\fR\fB\&.evrid\fR
2512 \fIsolvable\fR\fB\&.evrid\fR
2513 .fi
2514 .if n \{\
2515 .RE
2516 .\}
2517 .sp
2518 .if n \{\
2519 .RS 4
2520 .\}
2521 .nf
2522 \fBId archid;\fR                      /* read/write */
2523 \fI$solvable\fR\fB\->{archid}\fR
2524 \fIsolvable\fR\fB\&.archid\fR
2525 \fIsolvable\fR\fB\&.archid\fR
2526 .fi
2527 .if n \{\
2528 .RE
2529 .\}
2530 .sp
2531 .if n \{\
2532 .RS 4
2533 .\}
2534 .nf
2535 \fBId vendorid;\fR                    /* read/write */
2536 \fI$solvable\fR\fB\->{vendorid}\fR
2537 \fIsolvable\fR\fB\&.vendorid\fR
2538 \fIsolvable\fR\fB\&.vendorid\fR
2539 .fi
2540 .if n \{\
2541 .RE
2542 .\}
2543 .sp
2544 Raw interface to the ids\&. Useful if you want to search for a specific id and want to avoid the string compare overhead\&.
2545 .SS "METHODS"
2546 .sp
2547 .if n \{\
2548 .RS 4
2549 .\}
2550 .nf
2551 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
2552 my \fI$string\fR \fB=\fR \fI$solvable\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
2553 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
2554 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
2555 .fi
2556 .if n \{\
2557 .RE
2558 .\}
2559 .sp
2560 .if n \{\
2561 .RS 4
2562 .\}
2563 .nf
2564 \fBId lookup_id(Id\fR \fIkeyname\fR\fB)\fR
2565 my \fI$id\fR \fB=\fR \fI$solvable\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
2566 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
2567 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
2568 .fi
2569 .if n \{\
2570 .RE
2571 .\}
2572 .sp
2573 .if n \{\
2574 .RS 4
2575 .\}
2576 .nf
2577 \fBunsigned long long lookup_num(Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
2578 my \fI$num\fR \fB=\fR \fI$solvable\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
2579 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
2580 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
2581 .fi
2582 .if n \{\
2583 .RE
2584 .\}
2585 .sp
2586 .if n \{\
2587 .RS 4
2588 .\}
2589 .nf
2590 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
2591 my \fI$bool\fR \fB=\fR \fI$solvable\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
2592 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
2593 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
2594 .fi
2595 .if n \{\
2596 .RE
2597 .\}
2598 .sp
2599 .if n \{\
2600 .RS 4
2601 .\}
2602 .nf
2603 \fBChksum lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
2604 my \fI$chksum\fR \fB=\fR \fI$solvable\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
2605 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
2606 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
2607 .fi
2608 .if n \{\
2609 .RE
2610 .\}
2611 .sp
2612 .if n \{\
2613 .RS 4
2614 .\}
2615 .nf
2616 \fBId *lookup_idarray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2617 my \fI@ids\fR \fB=\fR \fI$solvable\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
2618 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
2619 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
2620 .fi
2621 .if n \{\
2622 .RE
2623 .\}
2624 .sp
2625 .if n \{\
2626 .RS 4
2627 .\}
2628 .nf
2629 \fBDep *lookup_deparray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2630 my \fI@deps\fR \fB=\fR \fI$solvable\fR\fB\->lookup_deparray(\fR\fI$keyname\fR\fB)\fR;
2631 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
2632 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
2633 .fi
2634 .if n \{\
2635 .RE
2636 .\}
2637 .sp
2638 Generic lookup methods\&. Retrieve data stored for the specific keyname\&. The lookup_idarray() method will return an array of Ids, use lookup_deparray if you want an array of Dependency objects instead\&. Some Id arrays contain two parts of data divided by a specific marker, for example the provides array uses the SOLVABLE_FILEMARKER id to store both the ids provided by the package and the ids added by the addfileprovides method\&. The default, \-1, translates to the correct marker for the keyname and returns the first part of the array, use 1 to select the second part or 0 to retrieve all ids including the marker\&.
2639 .sp
2640 .if n \{\
2641 .RS 4
2642 .\}
2643 .nf
2644 \fBconst char *lookup_location(unsigned int *\fR\fIOUTPUT\fR\fB)\fR
2645 my \fB(\fR\fI$location\fR\fB,\fR \fI$mediano\fR\fB) =\fR \fI$solvable\fR\fB\->lookup_location()\fR;
2646 \fIlocation\fR\fB,\fR \fImediano\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
2647 \fIlocation\fR\fB,\fR \fImediano\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
2648 .fi
2649 .if n \{\
2650 .RE
2651 .\}
2652 .sp
2653 Return a tuple containing the on\-media location and an optional media number for multi\-part repositories (e\&.g\&. repositories spawning multiple DVDs)\&.
2654 .sp
2655 .if n \{\
2656 .RS 4
2657 .\}
2658 .nf
2659 \fBconst char *lookup_sourcepkg()\fR
2660 my \fI$sourcepkg\fR \fB=\fR \fI$solvable\fR\fB\->lookup_sourcepkg()\fR;
2661 \fIsourcepkg\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_sourcepkg()\fR
2662 \fIsourcepkg\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_sourcepkg()\fR
2663 .fi
2664 .if n \{\
2665 .RE
2666 .\}
2667 .sp
2668 Return a sourcepkg name associated with solvable\&.
2669 .sp
2670 .if n \{\
2671 .RS 4
2672 .\}
2673 .nf
2674 \fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
2675 my \fI$di\fR \fB=\fR \fI$solvable\fR\fB\->Dataiterator(\fR\fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
2676 \fIdi\fR \fB=\fR \fIsolvable\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2677 \fIdi\fR \fB=\fR \fIsolvable\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2678 .fi
2679 .if n \{\
2680 .RE
2681 .\}
2682 .sp
2683 .if n \{\
2684 .RS 4
2685 .\}
2686 .nf
2687 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2688 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2689 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2690 .fi
2691 .if n \{\
2692 .RE
2693 .\}
2694 .sp
2695 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
2696 .sp
2697 .if n \{\
2698 .RS 4
2699 .\}
2700 .nf
2701 \fBvoid add_deparray(Id\fR \fIkeyname\fR\fB, DepId\fR \fIdep\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2702 \fI$solvable\fR\fB\->add_deparray(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR;
2703 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2704 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2705 .fi
2706 .if n \{\
2707 .RE
2708 .\}
2709 .sp
2710 Add a new dependency to the attributes stored in keyname\&.
2711 .sp
2712 .if n \{\
2713 .RS 4
2714 .\}
2715 .nf
2716 \fBvoid unset(Id\fR \fIkeyname\fR\fB)\fR
2717 \fI$solvable\fR\fB\->unset(\fR\fI$keyname\fR\fB)\fR;
2718 \fIsolvable\fR\fB\&.unset(\fR\fIkeyname\fR\fB)\fR
2719 \fIsolvable\fR\fB\&.unset(\fR\fIkeyname\fR\fB)\fR
2720 .fi
2721 .if n \{\
2722 .RE
2723 .\}
2724 .sp
2725 Delete data stored for the specific keyname\&.
2726 .sp
2727 .if n \{\
2728 .RS 4
2729 .\}
2730 .nf
2731 \fBbool installable()\fR
2732 \fI$solvable\fR\fB\->installable()\fR
2733 \fIsolvable\fR\fB\&.installable()\fR
2734 \fIsolvable\fR\fB\&.installable?\fR
2735 .fi
2736 .if n \{\
2737 .RE
2738 .\}
2739 .sp
2740 Return true if the solvable is installable on the system\&. Solvables are not installable if the system does not support their architecture\&.
2741 .sp
2742 .if n \{\
2743 .RS 4
2744 .\}
2745 .nf
2746 \fBbool isinstalled()\fR
2747 \fI$solvable\fR\fB\->isinstalled()\fR
2748 \fIsolvable\fR\fB\&.isinstalled()\fR
2749 \fIsolvable\fR\fB\&.isinstalled?\fR
2750 .fi
2751 .if n \{\
2752 .RE
2753 .\}
2754 .sp
2755 Return true if the solvable is installed on the system\&.
2756 .sp
2757 .if n \{\
2758 .RS 4
2759 .\}
2760 .nf
2761 \fBbool identical(Solvable *\fR\fIother\fR\fB)\fR
2762 \fI$solvable\fR\fB\->identical(\fR\fI$other\fR\fB)\fR
2763 \fIsolvable\fR\fB\&.identical(\fR\fIother\fR\fB)\fR
2764 \fIsolvable\fR\fB\&.identical?(\fR\fIother\fR\fB)\fR
2765 .fi
2766 .if n \{\
2767 .RE
2768 .\}
2769 .sp
2770 Return true if the two solvables are identical\&.
2771 .sp
2772 .if n \{\
2773 .RS 4
2774 .\}
2775 .nf
2776 \fBint evrcmp(Solvable *\fR\fIother\fR\fB)\fR
2777 \fI$solvable\fR\fB\->evrcmp(\fR\fI$other\fR\fB)\fR
2778 \fIsolvable\fR\fB\&.evrcmp(\fR\fIother\fR\fB)\fR
2779 \fIsolvable\fR\fB\&.evrcmp(\fR\fIother\fR\fB)\fR
2780 .fi
2781 .if n \{\
2782 .RE
2783 .\}
2784 .sp
2785 Returns \-1 if the epoch/version/release of the solvable is less than the one from the other solvable, 1 if it is greater, and 0 if they are equal\&. Note that "equal" does not mean that the evr is identical\&.
2786 .sp
2787 .if n \{\
2788 .RS 4
2789 .\}
2790 .nf
2791 \fBint matchesdep(Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2792 \fI$solvable\fR\fB\->matchesdep(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR
2793 \fIsolvable\fR\fB\&.matchesdep(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2794 \fIsolvable\fR\fB\&.matchesdep?(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2795 .fi
2796 .if n \{\
2797 .RE
2798 .\}
2799 .sp
2800 Return true if the dependencies stored in keyname match the specified dependency\&.
2801 .sp
2802 .if n \{\
2803 .RS 4
2804 .\}
2805 .nf
2806 \fBSelection Selection(int\fR \fIsetflags\fR \fB= 0)\fR
2807 my \fI$sel\fR \fB=\fR \fI$solvable\fR\fB\->Selection()\fR;
2808 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
2809 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
2810 .fi
2811 .if n \{\
2812 .RE
2813 .\}
2814 .sp
2815 Create a Selection containing just the single solvable\&.
2816 .sp
2817 .if n \{\
2818 .RS 4
2819 .\}
2820 .nf
2821 \fBconst char *str()\fR
2822 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str()\fR;
2823 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
2824 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
2825 .fi
2826 .if n \{\
2827 .RE
2828 .\}
2829 .sp
2830 Return a string describing the solvable\&. The string consists of the name, version, and architecture of the Solvable\&.
2831 .sp
2832 .if n \{\
2833 .RS 4
2834 .\}
2835 .nf
2836 \fB<stringification>\fR
2837 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str\fR;
2838 \fIstr\fR \fB= str(\fR\fIsolvable\fR\fB)\fR
2839 \fIstr\fR \fB=\fR \fIsolvable\fR\fB\&.to_s\fR
2840 .fi
2841 .if n \{\
2842 .RE
2843 .\}
2844 .sp
2845 Same as calling the str() method\&.
2846 .sp
2847 .if n \{\
2848 .RS 4
2849 .\}
2850 .nf
2851 \fB<equality>\fR
2852 \fBif (\fR\fI$solvable1\fR \fB==\fR \fI$solvable2\fR\fB)\fR
2853 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR\fB:\fR
2854 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR
2855 .fi
2856 .if n \{\
2857 .RE
2858 .\}
2859 .sp
2860 Two solvables are equal if they are part of the same pool and have the same ids\&.
2861 .SH "THE DATAITERATOR CLASS"
2862 .sp
2863 Dataiterators can be used to do complex string searches or to iterate over arrays\&. They can be created via the constructors in the Pool, Repo, and Solvable classes\&. The Repo and Solvable constructors will limit the search to the repository or the specific package\&.
2864 .SS "CONSTANTS"
2865 .PP
2866 \fBSEARCH_STRING\fR
2867 .RS 4
2868 Return a match if the search string matches the value\&.
2869 .RE
2870 .PP
2871 \fBSEARCH_STRINGSTART\fR
2872 .RS 4
2873 Return a match if the value starts with the search string\&.
2874 .RE
2875 .PP
2876 \fBSEARCH_STRINGEND\fR
2877 .RS 4
2878 Return a match if the value ends with the search string\&.
2879 .RE
2880 .PP
2881 \fBSEARCH_SUBSTRING\fR
2882 .RS 4
2883 Return a match if the search string can be matched somewhere in the value\&.
2884 .RE
2885 .PP
2886 \fBSEARCH_GLOB\fR
2887 .RS 4
2888 Do a glob match of the search string against the value\&.
2889 .RE
2890 .PP
2891 \fBSEARCH_REGEX\fR
2892 .RS 4
2893 Do a regular expression match of the search string against the value\&.
2894 .RE
2895 .PP
2896 \fBSEARCH_NOCASE\fR
2897 .RS 4
2898 Ignore case when matching strings\&. Works for all the above match types\&.
2899 .RE
2900 .PP
2901 \fBSEARCH_FILES\fR
2902 .RS 4
2903 Match the complete filenames of the file list, not just the base name\&.
2904 .RE
2905 .PP
2906 \fBSEARCH_COMPLETE_FILELIST\fR
2907 .RS 4
2908 When matching the file list, check every file of the package not just the subset from the primary metadata\&.
2909 .RE
2910 .PP
2911 \fBSEARCH_CHECKSUMS\fR
2912 .RS 4
2913 Allow the matching of checksum entries\&.
2914 .RE
2915 .SS "METHODS"
2916 .sp
2917 .if n \{\
2918 .RS 4
2919 .\}
2920 .nf
2921 \fBvoid prepend_keyname(Id\fR \fIkeyname\fR\fB)\fR;
2922 \fI$di\fR\fB\->prepend_keyname(\fR\fI$keyname\fR\fB)\fR;
2923 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2924 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2925 .fi
2926 .if n \{\
2927 .RE
2928 .\}
2929 .sp
2930 Do a sub\-search in the array stored in keyname\&.
2931 .sp
2932 .if n \{\
2933 .RS 4
2934 .\}
2935 .nf
2936 \fBvoid skip_solvable()\fR;
2937 \fI$di\fR\fB\->skip_solvable()\fR;
2938 \fIdi\fR\fB\&.skip_solvable()\fR
2939 \fIdi\fR\fB\&.skip_solvable()\fR
2940 .fi
2941 .if n \{\
2942 .RE
2943 .\}
2944 .sp
2945 Stop matching the current solvable and advance to the next one\&.
2946 .sp
2947 .if n \{\
2948 .RS 4
2949 .\}
2950 .nf
2951 \fB<iteration>\fR
2952 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2953 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2954 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2955 .fi
2956 .if n \{\
2957 .RE
2958 .\}
2959 .sp
2960 Iterate through the matches\&. If there is a match, the object in d will be of type Datamatch\&.
2961 .SH "THE DATAMATCH CLASS"
2962 .sp
2963 Objects of this type will be created for every value matched by a dataiterator\&.
2964 .SS "ATTRIBUTES"
2965 .sp
2966 .if n \{\
2967 .RS 4
2968 .\}
2969 .nf
2970 \fBPool *pool;\fR                             /* read only */
2971 \fI$d\fR\fB\->{pool}\fR
2972 \fId\fR\fB\&.pool\fR
2973 \fId\fR\fB\&.pool\fR
2974 .fi
2975 .if n \{\
2976 .RE
2977 .\}
2978 .sp
2979 Back pointer to pool\&.
2980 .sp
2981 .if n \{\
2982 .RS 4
2983 .\}
2984 .nf
2985 \fBRepo *repo;\fR                             /* read only */
2986 \fI$d\fR\fB\->{repo}\fR
2987 \fId\fR\fB\&.repo\fR
2988 \fId\fR\fB\&.repo\fR
2989 .fi
2990 .if n \{\
2991 .RE
2992 .\}
2993 .sp
2994 The repository containing the matched object\&.
2995 .sp
2996 .if n \{\
2997 .RS 4
2998 .\}
2999 .nf
3000 \fBSolvable *solvable;\fR                     /* read only */
3001 \fI$d\fR\fB\->{solvable}\fR
3002 \fId\fR\fB\&.solvable\fR
3003 \fId\fR\fB\&.solvable\fR
3004 .fi
3005 .if n \{\
3006 .RE
3007 .\}
3008 .sp
3009 The solvable containing the value that was matched\&.
3010 .sp
3011 .if n \{\
3012 .RS 4
3013 .\}
3014 .nf
3015 \fBId solvid;\fR                              /* read only */
3016 \fI$d\fR\fB\->{solvid}\fR
3017 \fId\fR\fB\&.solvid\fR
3018 \fId\fR\fB\&.solvid\fR
3019 .fi
3020 .if n \{\
3021 .RE
3022 .\}
3023 .sp
3024 The id of the solvable that matched\&.
3025 .sp
3026 .if n \{\
3027 .RS 4
3028 .\}
3029 .nf
3030 \fBId\fR \fIkey_id\fR;
3031 \fI$d\fR\fB\->{\fR\fIkey_id\fR\fB}\fR
3032 \fId\fR\fB\&.key_id\fR
3033 \fId\fR\fB\&.key_id\fR
3034 .fi
3035 .if n \{\
3036 .RE
3037 .\}
3038 .sp
3039 .if n \{\
3040 .RS 4
3041 .\}
3042 .nf
3043 \fBconst char *\fR\fIkey_idstr\fR;
3044 \fI$d\fR\fB\->{\fR\fIkey_idstr\fR\fB}\fR
3045 \fId\fR\fB\&.key_idstr\fR
3046 \fId\fR\fB\&.key_idstr\fR
3047 .fi
3048 .if n \{\
3049 .RE
3050 .\}
3051 .sp
3052 The keyname that matched, either as id or string\&.
3053 .sp
3054 .if n \{\
3055 .RS 4
3056 .\}
3057 .nf
3058 \fBId\fR \fItype_id\fR;
3059 \fI$d\fR\fB\->{\fR\fItype_id\fR\fB}\fR
3060 \fId\fR\fB\&.type_id\fR
3061 \fId\fR\fB\&.type_id\fR
3062 .fi
3063 .if n \{\
3064 .RE
3065 .\}
3066 .sp
3067 .if n \{\
3068 .RS 4
3069 .\}
3070 .nf
3071 \fBconst char *\fR\fItype_idstr\fR;
3072 \fI$d\fR\fB\->{\fR\fItype_idstr\fR\fB}\fR;
3073 \fId\fR\fB\&.type_idstr\fR
3074 \fId\fR\fB\&.type_idstr\fR
3075 .fi
3076 .if n \{\
3077 .RE
3078 .\}
3079 .sp
3080 The key type of the value that was matched, either as id or string\&.
3081 .sp
3082 .if n \{\
3083 .RS 4
3084 .\}
3085 .nf
3086 \fBId\fR \fIid\fR;
3087 \fI$d\fR\fB\->{id}\fR
3088 \fId\fR\fB\&.id\fR
3089 \fId\fR\fB\&.id\fR
3090 .fi
3091 .if n \{\
3092 .RE
3093 .\}
3094 .sp
3095 .if n \{\
3096 .RS 4
3097 .\}
3098 .nf
3099 \fBId\fR \fIidstr\fR;
3100 \fI$d\fR\fB\->{idstr}\fR
3101 \fId\fR\fB\&.idstr\fR
3102 \fId\fR\fB\&.idstr\fR
3103 .fi
3104 .if n \{\
3105 .RE
3106 .\}
3107 .sp
3108 The Id of the value that was matched (only valid for id types), either as id or string\&.
3109 .sp
3110 .if n \{\
3111 .RS 4
3112 .\}
3113 .nf
3114 \fBconst char *\fR\fIstr\fR;
3115 \fI$d\fR\fB\->{str}\fR
3116 \fId\fR\fB\&.str\fR
3117 \fId\fR\fB\&.str\fR
3118 .fi
3119 .if n \{\
3120 .RE
3121 .\}
3122 .sp
3123 The string value that was matched (only valid for string types)\&.
3124 .sp
3125 .if n \{\
3126 .RS 4
3127 .\}
3128 .nf
3129 \fBunsigned long long\fR \fInum\fR;
3130 \fI$d\fR\fB\->{num}\fR
3131 \fId\fR\fB\&.num\fR
3132 \fId\fR\fB\&.num\fR
3133 .fi
3134 .if n \{\
3135 .RE
3136 .\}
3137 .sp
3138 The numeric value that was matched (only valid for numeric types)\&.
3139 .sp
3140 .if n \{\
3141 .RS 4
3142 .\}
3143 .nf
3144 \fBunsigned int\fR \fInum2\fR;
3145 \fI$d\fR\fB\->{num2}\fR
3146 \fId\fR\fB\&.num2\fR
3147 \fId\fR\fB\&.num2\fR
3148 .fi
3149 .if n \{\
3150 .RE
3151 .\}
3152 .sp
3153 The secondary numeric value that was matched (only valid for types containing two values)\&.
3154 .sp
3155 .if n \{\
3156 .RS 4
3157 .\}
3158 .nf
3159 \fBunsigned int\fR \fIbinary\fR;
3160 \fI$d\fR\fB\->{binary}\fR
3161 \fId\fR\fB\&.binary\fR
3162 \fId\fR\fB\&.binary\fR
3163 .fi
3164 .if n \{\
3165 .RE
3166 .\}
3167 .sp
3168 The value in binary form, useful for checksums and other data that cannot be represented as a string\&.
3169 .SS "METHODS"
3170 .sp
3171 .if n \{\
3172 .RS 4
3173 .\}
3174 .nf
3175 \fBDatapos pos()\fR
3176 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->pos()\fR;
3177 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
3178 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
3179 .fi
3180 .if n \{\
3181 .RE
3182 .\}
3183 .sp
3184 The position object of the current match\&. It can be used to do sub\-searches starting at the match (if it is of an array type)\&. See the Datapos class for more information\&.
3185 .sp
3186 .if n \{\
3187 .RS 4
3188 .\}
3189 .nf
3190 \fBDatapos parentpos()\fR
3191 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->parentpos()\fR;
3192 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
3193 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
3194 .fi
3195 .if n \{\
3196 .RE
3197 .\}
3198 .sp
3199 The position object of the array containing the current match\&. It can be used to do sub\-searches, see the Datapos class for more information\&.
3200 .sp
3201 .if n \{\
3202 .RS 4
3203 .\}
3204 .nf
3205 \fB<stringification>\fR
3206 my \fI$str\fR \fB=\fR \fI$d\fR\fB\->str\fR;
3207 \fIstr\fR \fB= str(\fR\fId\fR\fB)\fR
3208 \fIstr\fR \fB=\fR \fId\fR\fB\&.to_s\fR
3209 .fi
3210 .if n \{\
3211 .RE
3212 .\}
3213 .sp
3214 Return the stringification of the matched value\&. Stringification depends on the search flags, for file list entries it will return just the base name unless SEARCH_FILES is used, for checksums it will return an empty string unless SEARCH_CHECKSUMS is used\&. Numeric values are currently stringified to an empty string\&.
3215 .SH "THE SELECTION CLASS"
3216 .sp
3217 Selections are a way to easily deal with sets of packages\&. There are multiple constructors to create them, the most useful is probably the select() method in the Pool class\&.
3218 .SS "CONSTANTS"
3219 .PP
3220 \fBSELECTION_NAME\fR
3221 .RS 4
3222 Create the selection by matching package names\&.
3223 .RE
3224 .PP
3225 \fBSELECTION_PROVIDES\fR
3226 .RS 4
3227 Create the selection by matching package provides\&.
3228 .RE
3229 .PP
3230 \fBSELECTION_FILELIST\fR
3231 .RS 4
3232 Create the selection by matching package files\&.
3233 .RE
3234 .PP
3235 \fBSELECTION_CANON\fR
3236 .RS 4
3237 Create the selection by matching the canonical representation of the package\&. This is normally a combination of the name, the version, and the architecture of a package\&.
3238 .RE
3239 .PP
3240 \fBSELECTION_DOTARCH\fR
3241 .RS 4
3242 Allow an "\&.<architecture>" suffix when matching names or provides\&.
3243 .RE
3244 .PP
3245 \fBSELECTION_REL\fR
3246 .RS 4
3247 Allow the specification of a relation when matching names or dependencies, e\&.g\&. "name >= 1\&.2"\&.
3248 .RE
3249 .PP
3250 \fBSELECTION_GLOB\fR
3251 .RS 4
3252 Allow glob matching for package names, package provides, and file names\&.
3253 .RE
3254 .PP
3255 \fBSELECTION_NOCASE\fR
3256 .RS 4
3257 Ignore case when matching package names, package provides, and file names\&.
3258 .RE
3259 .PP
3260 \fBSELECTION_FLAT\fR
3261 .RS 4
3262 Return only one selection element describing the selected packages\&. The default is to create multiple elements for all globbed packages\&. Multiple elements are useful if you want to turn the selection into an install job, in that case you want an install job for every globbed package\&.
3263 .RE
3264 .PP
3265 \fBSELECTION_SKIP_KIND\fR
3266 .RS 4
3267 Remove a "packagekind:" prefix from the package names\&.
3268 .RE
3269 .PP
3270 \fBSELECTION_MATCH_DEPSTR\fR
3271 .RS 4
3272 When matching dependencies, do a string match on the result of dep2str instead of using the normal dependency intersect algorithm\&.
3273 .RE
3274 .PP
3275 \fBSELECTION_INSTALLED_ONLY\fR
3276 .RS 4
3277 Limit the package search to installed packages\&.
3278 .RE
3279 .PP
3280 \fBSELECTION_SOURCE_ONLY\fR
3281 .RS 4
3282 Limit the package search to source packages only\&.
3283 .RE
3284 .PP
3285 \fBSELECTION_WITH_SOURCE\fR
3286 .RS 4
3287 Extend the package search to also match source packages\&. The default is only to match binary packages\&.
3288 .RE
3289 .PP
3290 \fBSELECTION_WITH_DISABLED\fR
3291 .RS 4
3292 Extend the package search to also include disabled packages\&.
3293 .RE
3294 .PP
3295 \fBSELECTION_WITH_BADARCH\fR
3296 .RS 4
3297 Extend the package search to also include packages that are not installable on the configured architecture\&.
3298 .RE
3299 .PP
3300 \fBSELECTION_WITH_ALL\fR
3301 .RS 4
3302 Shortcut for selecting the three modifiers above\&.
3303 .RE
3304 .PP
3305 \fBSELECTION_ADD\fR
3306 .RS 4
3307 Add the result of the match to the current selection instead of replacing it\&.
3308 .RE
3309 .PP
3310 \fBSELECTION_SUBTRACT\fR
3311 .RS 4
3312 Remove the result of the match to the current selection instead of replacing it\&.
3313 .RE
3314 .PP
3315 \fBSELECTION_FILTER\fR
3316 .RS 4
3317 Intersect the result of the match to the current selection instead of replacing it\&.
3318 .RE
3319 .SS "ATTRIBUTES"
3320 .sp
3321 .if n \{\
3322 .RS 4
3323 .\}
3324 .nf
3325 \fBPool *pool;\fR                             /* read only */
3326 \fI$d\fR\fB\->{pool}\fR
3327 \fId\fR\fB\&.pool\fR
3328 \fId\fR\fB\&.pool\fR
3329 .fi
3330 .if n \{\
3331 .RE
3332 .\}
3333 .sp
3334 Back pointer to pool\&.
3335 .sp
3336 .if n \{\
3337 .RS 4
3338 .\}
3339 .nf
3340 \fBint flags;\fR                              /* read only */
3341 \fI$sel\fR\fB\->{flags}\fR
3342 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags\fR
3343 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags\fR
3344 .fi
3345 .if n \{\
3346 .RE
3347 .\}
3348 .sp
3349 The result flags of the selection\&. The flags are a subset of the ones used when creating the selection, they describe which method was used to get the result\&. For example, if you create the selection with \(lqSELECTION_NAME | SELECTION_PROVIDES\(rq, the resulting flags will either be SELECTION_NAME or SELECTION_PROVIDES depending if there was a package that matched the name or not\&. If there was no match at all, the flags will be zero\&.
3350 .SS "METHODS"
3351 .sp
3352 .if n \{\
3353 .RS 4
3354 .\}
3355 .nf
3356 \fBbool isempty()\fR
3357 \fI$sel\fR\fB\->isempty()\fR
3358 \fIsel\fR\fB\&.isempty()\fR
3359 \fIsel\fR\fB\&.isempty?\fR
3360 .fi
3361 .if n \{\
3362 .RE
3363 .\}
3364 .sp
3365 Return true if the selection is empty, i\&.e\&. no package could be matched\&.
3366 .sp
3367 .if n \{\
3368 .RS 4
3369 .\}
3370 .nf
3371 \fBSelection clone(int\fR \fIflags\fR \fB= 0)\fR
3372 my \fI$cloned\fR \fB=\fR \fI$sel\fR\fB\->clone()\fR;
3373 \fIcloned\fR \fB=\fR \fIsel\fR\fB\&.clone()\fR
3374 \fIcloned\fR \fB=\fR \fIsel\fR\fB\&.clone()\fR
3375 .fi
3376 .if n \{\
3377 .RE
3378 .\}
3379 .sp
3380 Return a copy of a selection\&.
3381 .sp
3382 .if n \{\
3383 .RS 4
3384 .\}
3385 .nf
3386 \fBvoid filter(Selection *\fR\fIother\fR\fB)\fR
3387 \fI$sel\fR\fB\->filter(\fR\fI$other\fR\fB)\fR;
3388 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
3389 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
3390 .fi
3391 .if n \{\
3392 .RE
3393 .\}
3394 .sp
3395 Intersect two selections\&. Packages will only stay in the selection if there are also included in the other selecting\&. Does an in\-place modification\&.
3396 .sp
3397 .if n \{\
3398 .RS 4
3399 .\}
3400 .nf
3401 \fBvoid add(Selection *\fR\fIother\fR\fB)\fR
3402 \fI$sel\fR\fB\->add(\fR\fI$other\fR\fB)\fR;
3403 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
3404 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
3405 .fi
3406 .if n \{\
3407 .RE
3408 .\}
3409 .sp
3410 Build the union of two selections\&. All packages of the other selection will be added to the set of packages of the selection object\&. Does an in\-place modification\&. Note that the selection flags are no longer meaningful after the add operation\&.
3411 .sp
3412 .if n \{\
3413 .RS 4
3414 .\}
3415 .nf
3416 \fBvoid subtract(Selection *\fR\fIother\fR\fB)\fR
3417 \fI$sel\fR\fB\->subtract(\fR\fI$other\fR\fB)\fR;
3418 \fIsel\fR\fB\&.subtract(\fR\fIother\fR\fB)\fR
3419 \fIsel\fR\fB\&.subtract(\fR\fIother\fR\fB)\fR
3420 .fi
3421 .if n \{\
3422 .RE
3423 .\}
3424 .sp
3425 Remove the packages of the other selection from the packages of the selection object\&. Does an in\-place modification\&.
3426 .sp
3427 .if n \{\
3428 .RS 4
3429 .\}
3430 .nf
3431 \fBvoid add_raw(Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
3432 \fI$sel\fR\fB\->add_raw(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
3433 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
3434 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
3435 .fi
3436 .if n \{\
3437 .RE
3438 .\}
3439 .sp
3440 Add a raw element to the selection\&. Check the Job class for information about the how and what parameters\&. Note that the selection flags are no longer meaningful after the add_raw operation\&.
3441 .sp
3442 .if n \{\
3443 .RS 4
3444 .\}
3445 .nf
3446 \fBJob *jobs(int\fR \fIaction\fR\fB)\fR
3447 my \fI@jobs\fR \fB=\fR \fI$sel\fR\fB\->jobs(\fR\fI$action\fR\fB)\fR;
3448 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
3449 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
3450 .fi
3451 .if n \{\
3452 .RE
3453 .\}
3454 .sp
3455 Convert a selection into an array of Job objects\&. The action parameter is or\-ed to the \(lqhow\(rq part of the job, it describes the type of job (e\&.g\&. install, erase)\&. See the Job class for the action and action modifier constants\&.
3456 .sp
3457 .if n \{\
3458 .RS 4
3459 .\}
3460 .nf
3461 \fBSolvable *solvables()\fR
3462 my \fI@solvables\fR \fB=\fR \fI$sel\fR\fB\->solvables()\fR;
3463 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
3464 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
3465 .fi
3466 .if n \{\
3467 .RE
3468 .\}
3469 .sp
3470 Convert a selection into an array of Solvable objects\&.
3471 .sp
3472 .if n \{\
3473 .RS 4
3474 .\}
3475 .nf
3476 \fBvoid select(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB)\fR
3477 \fI$sel\fR\fB\->select(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
3478 \fIsel\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
3479 \fIsel\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
3480 .fi
3481 .if n \{\
3482 .RE
3483 .\}
3484 .sp
3485 Do a select operation and combine the result with the current selection\&. You can choose the desired combination method by using either the SELECTION_ADD, SELECTION_SUBTRACT, or SELECTION_FILTER flag\&. If none of the flags are used, SELECTION_FILTER|SELECTION_WITH_ALL is assumed\&.
3486 .sp
3487 .if n \{\
3488 .RS 4
3489 .\}
3490 .nf
3491 \fBvoid matchdeps(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
3492 \fI$sel\fR\fB\->matchdeps(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
3493 \fIsel\fR\fB\&.matchdeps(\fR\fIname\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3494 \fIsel\fR\fB\&.matchdeps(\fR\fIname\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3495 .fi
3496 .if n \{\
3497 .RE
3498 .\}
3499 .sp
3500 Do a matchdeps operation and combine the result with the current selection\&.
3501 .sp
3502 .if n \{\
3503 .RS 4
3504 .\}
3505 .nf
3506 \fBvoid matchdepid(DepId\fR \fIdep\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
3507 \fI$sel\fR\fB\->matchdepid(\fR\fI$dep\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
3508 \fIsel\fR\fB\&.matchdepid(\fR\fIdep\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3509 \fIsel\fR\fB\&.matchdepid(\fR\fIdep\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3510 .fi
3511 .if n \{\
3512 .RE
3513 .\}
3514 .sp
3515 Do a matchdepid operation and combine the result with the current selection\&.
3516 .sp
3517 .if n \{\
3518 .RS 4
3519 .\}
3520 .nf
3521 \fBvoid matchsolvable(Solvable\fR \fIsolvable\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
3522 \fI$sel\fR\fB\->matchsolvable(\fR\fI$solvable\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
3523 \fIsel\fR\fB\&.matchsolvable(\fR\fIsolvable\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3524 \fIsel\fR\fB\&.matchsolvable(\fR\fIsolvable\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3525 .fi
3526 .if n \{\
3527 .RE
3528 .\}
3529 .sp
3530 Do a matchsolvable operation and combine the result with the current selection\&.
3531 .sp
3532 .if n \{\
3533 .RS 4
3534 .\}
3535 .nf
3536 \fB<stringification>\fR
3537 my \fI$str\fR \fB=\fR \fI$sel\fR\fB\->str\fR;
3538 \fIstr\fR \fB= str(\fR\fIsel\fR\fB)\fR
3539 \fIstr\fR \fB=\fR \fIsel\fR\fB\&.to_s\fR
3540 .fi
3541 .if n \{\
3542 .RE
3543 .\}
3544 .sp
3545 Return a string describing the selection\&.
3546 .SH "THE JOB CLASS"
3547 .sp
3548 Jobs are the way to specify to the dependency solver what to do\&. Most of the times jobs will get created by calling the jobs() method on a Selection object, but there is also a Job() constructor in the Pool class\&.
3549 .SS "CONSTANTS"
3550 .sp
3551 Selection constants:
3552 .PP
3553 \fBSOLVER_SOLVABLE\fR
3554 .RS 4
3555 The \(lqwhat\(rq part is the id of a solvable\&.
3556 .RE
3557 .PP
3558 \fBSOLVER_SOLVABLE_NAME\fR
3559 .RS 4
3560 The \(lqwhat\(rq part is the id of a package name\&.
3561 .RE
3562 .PP
3563 \fBSOLVER_SOLVABLE_PROVIDES\fR
3564 .RS 4
3565 The \(lqwhat\(rq part is the id of a package provides\&.
3566 .RE
3567 .PP
3568 \fBSOLVER_SOLVABLE_ONE_OF\fR
3569 .RS 4
3570 The \(lqwhat\(rq part is an offset into the \(lqwhatprovides\(rq data, created by calling the towhatprovides() pool method\&.
3571 .RE
3572 .PP
3573 \fBSOLVER_SOLVABLE_REPO\fR
3574 .RS 4
3575 The \(lqwhat\(rq part is the id of a repository\&.
3576 .RE
3577 .PP
3578 \fBSOLVER_SOLVABLE_ALL\fR
3579 .RS 4
3580 The \(lqwhat\(rq part is ignored, all packages are selected\&.
3581 .RE
3582 .PP
3583 \fBSOLVER_SOLVABLE_SELECTMASK\fR
3584 .RS 4
3585 A mask containing all the above selection bits\&.
3586 .RE
3587 .sp
3588 Action constants:
3589 .PP
3590 \fBSOLVER_NOOP\fR
3591 .RS 4
3592 Do nothing\&.
3593 .RE
3594 .PP
3595 \fBSOLVER_INSTALL\fR
3596 .RS 4
3597 Install a package of the specified set of packages\&. It tries to install the best matching package (i\&.e\&. the highest version of the packages from the repositories with the highest priority)\&.
3598 .RE
3599 .PP
3600 \fBSOLVER_ERASE\fR
3601 .RS 4
3602 Erase all of the packages from the specified set\&. If a package is not installed, erasing it will keep it from getting installed\&.
3603 .RE
3604 .PP
3605 \fBSOLVER_UPDATE\fR
3606 .RS 4
3607 Update the matching installed packages to their best version\&. If none of the specified packages are installed, try to update the installed packages to the specified versions\&. See the section about targeted updates about more information\&.
3608 .RE
3609 .PP
3610 \fBSOLVER_WEAKENDEPS\fR
3611 .RS 4
3612 Allow to break the dependencies of the matching packages\&. Handle with care\&.
3613 .RE
3614 .PP
3615 \fBSOLVER_MULTIVERSION\fR
3616 .RS 4
3617 Mark the matched packages for multiversion install\&. If they get to be installed because of some other job, the installation will keep the old version of the package installed (for rpm this is done by using \(lq\-i\(rq instead of \(lq\-U\(rq)\&.
3618 .RE
3619 .PP
3620 \fBSOLVER_LOCK\fR
3621 .RS 4
3622 Do not change the state of the matched packages, i\&.e\&. when they are installed they stay installed, if not they are not selected for installation\&.
3623 .RE
3624 .PP
3625 \fBSOLVER_DISTUPGRADE\fR
3626 .RS 4
3627 Update the matching installed packages to the best version included in one of the repositories\&. After this operation, all come from one of the available repositories except orphaned packages\&. Orphaned packages are packages that have no relation to the packages in the repositories, i\&.e\&. no package in the repositories have the same name or obsolete the orphaned package\&. This action brings the installed packages in sync with the ones in the repository\&. By default it also turns of arch/vendor/version locking for the affected packages to simulate a fresh installation\&. This means that distupgrade can actually downgrade packages if only lower versions of a package are available in the repositories\&. You can tweak this behavior with the SOLVER_FLAG_DUP_ solver flags\&.
3628 .RE
3629 .PP
3630 \fBSOLVER_DROP_ORPHANED\fR
3631 .RS 4
3632 Erase all the matching installed packages if they are orphaned\&. This only makes sense if there is a \(lqdistupgrade all packages\(rq job\&. The default is to erase orphaned packages only if they block the installation of other packages\&.
3633 .RE
3634 .PP
3635 \fBSOLVER_VERIFY\fR
3636 .RS 4
3637 Fix dependency problems of matching installed packages\&. The default is to ignore dependency problems for installed packages\&.
3638 .RE
3639 .PP
3640 \fBSOLVER_USERINSTALLED\fR
3641 .RS 4
3642 The matching installed packages are considered to be installed by a user, thus not installed to fulfill some dependency\&. This is needed input for the calculation of unneeded packages for jobs that have the SOLVER_CLEANDEPS flag set\&.
3643 .RE
3644 .PP
3645 \fBSOLVER_ALLOWUNINSTALL\fR
3646 .RS 4
3647 Allow the solver to deinstall the matching installed packages if they get into the way of resolving a dependency\&. This is like the SOLVER_FLAG_ALLOW_UNINSTALL flag, but limited to a specific set of packages\&.
3648 .RE
3649 .PP
3650 \fBSOLVER_FAVOR\fR
3651 .RS 4
3652 Prefer the specified packages if the solver encounters an alternative\&. If a job contains multiple matching favor/disfavor elements, the last one takes precedence\&.
3653 .RE
3654 .PP
3655 \fBSOLVER_DISFAVOR\fR
3656 .RS 4
3657 Avoid the specified packages if the solver encounters an alternative\&. This can also be used to block recommended or supplemented packages from being installed\&.
3658 .RE
3659 .PP
3660 \fBSOLVER_EXCLUDEFROMWEAK\fR
3661 .RS 4
3662 Avoid the specified packages to satisfy recommended or supplemented dependencies\&. Unlike SOLVER_DISFAVOR, it does not interfere with other rules\&.
3663 .RE
3664 .PP
3665 \fBSOLVER_JOBMASK\fR
3666 .RS 4
3667 A mask containing all the above action bits\&.
3668 .RE
3669 .sp
3670 Action modifier constants:
3671 .PP
3672 \fBSOLVER_WEAK\fR
3673 .RS 4
3674 Makes the job a weak job\&. The solver tries to fulfill weak jobs, but does not report a problem if it is not possible to do so\&.
3675 .RE
3676 .PP
3677 \fBSOLVER_ESSENTIAL\fR
3678 .RS 4
3679 Makes the job an essential job\&. If there is a problem with the job, the solver will not propose to remove the job as one solution (unless all other solutions are also to remove essential jobs)\&.
3680 .RE
3681 .PP
3682 \fBSOLVER_CLEANDEPS\fR
3683 .RS 4
3684 The solver will try to also erase all packages dragged in through dependencies when erasing the package\&. This needs SOLVER_USERINSTALLED jobs to maximize user satisfaction\&.
3685 .RE
3686 .PP
3687 \fBSOLVER_FORCEBEST\fR
3688 .RS 4
3689 Insist on the best package for install, update, and distupgrade jobs\&. If this flag is not used, the solver will use the second\-best package if the best package cannot be installed for some reason\&. When this flag is used, the solver will generate a problem instead\&.
3690 .RE
3691 .PP
3692 \fBSOLVER_TARGETED\fR
3693 .RS 4
3694 Forces targeted operation update and distupgrade jobs\&. See the section about targeted updates about more information\&.
3695 .RE
3696 .sp
3697 Set constants\&.
3698 .PP
3699 \fBSOLVER_SETEV\fR
3700 .RS 4
3701 The job specified the exact epoch and version of the package set\&.
3702 .RE
3703 .PP
3704 \fBSOLVER_SETEVR\fR
3705 .RS 4
3706 The job specified the exact epoch, version, and release of the package set\&.
3707 .RE
3708 .PP
3709 \fBSOLVER_SETARCH\fR
3710 .RS 4
3711 The job specified the exact architecture of the packages from the set\&.
3712 .RE
3713 .PP
3714 \fBSOLVER_SETVENDOR\fR
3715 .RS 4
3716 The job specified the exact vendor of the packages from the set\&.
3717 .RE
3718 .PP
3719 \fBSOLVER_SETREPO\fR
3720 .RS 4
3721 The job specified the exact repository of the packages from the set\&.
3722 .RE
3723 .PP
3724 \fBSOLVER_SETNAME\fR
3725 .RS 4
3726 The job specified the exact name of the packages from the set\&.
3727 .RE
3728 .PP
3729 \fBSOLVER_NOAUTOSET\fR
3730 .RS 4
3731 Turn of automatic set flag generation for SOLVER_SOLVABLE jobs\&.
3732 .RE
3733 .PP
3734 \fBSOLVER_SETMASK\fR
3735 .RS 4
3736 A mask containing all the above set bits\&.
3737 .RE
3738 .sp
3739 See the section about set bits for more information\&.
3740 .SS "ATTRIBUTES"
3741 .sp
3742 .if n \{\
3743 .RS 4
3744 .\}
3745 .nf
3746 \fBPool *pool;\fR                             /* read only */
3747 \fI$job\fR\fB\->{pool}\fR
3748 \fId\fR\fB\&.pool\fR
3749 \fId\fR\fB\&.pool\fR
3750 .fi
3751 .if n \{\
3752 .RE
3753 .\}
3754 .sp
3755 Back pointer to pool\&.
3756 .sp
3757 .if n \{\
3758 .RS 4
3759 .\}
3760 .nf
3761 \fBId how;\fR                                 /* read/write */
3762 \fI$job\fR\fB\->{how}\fR
3763 \fId\fR\fB\&.how\fR
3764 \fId\fR\fB\&.how\fR
3765 .fi
3766 .if n \{\
3767 .RE
3768 .\}
3769 .sp
3770 Union of the selection, action, action modifier, and set flags\&. The selection part describes the semantics of the \(lqwhat\(rq Id\&.
3771 .sp
3772 .if n \{\
3773 .RS 4
3774 .\}
3775 .nf
3776 \fBId what;\fR                                /* read/write */
3777 \fI$job\fR\fB\->{what}\fR
3778 \fId\fR\fB\&.what\fR
3779 \fId\fR\fB\&.what\fR
3780 .fi
3781 .if n \{\
3782 .RE
3783 .\}
3784 .sp
3785 Id describing the set of packages, the meaning depends on the selection part of the \(lqhow\(rq attribute\&.
3786 .SS "METHODS"
3787 .sp
3788 .if n \{\
3789 .RS 4
3790 .\}
3791 .nf
3792 \fBSolvable *solvables()\fR
3793 my \fI@solvables\fR \fB=\fR \fI$job\fR\fB\->solvables()\fR;
3794 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
3795 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
3796 .fi
3797 .if n \{\
3798 .RE
3799 .\}
3800 .sp
3801 Return the set of solvables of the job as an array of Solvable objects\&.
3802 .sp
3803 .if n \{\
3804 .RS 4
3805 .\}
3806 .nf
3807 \fBbool isemptyupdate()\fR
3808 \fI$job\fR\fB\->isemptyupdate()\fR
3809 \fIjob\fR\fB\&.isemptyupdate()\fR
3810 \fIjob\fR\fB\&.isemptyupdate?\fR
3811 .fi
3812 .if n \{\
3813 .RE
3814 .\}
3815 .sp
3816 Convenience function to find out if the job describes an update job with no matching packages, i\&.e\&. a job that does nothing\&. Some package managers like \(lqzypper\(rq like to turn those jobs into install jobs, i\&.e\&. an update of a not\-installed package will result into the installation of the package\&.
3817 .sp
3818 .if n \{\
3819 .RS 4
3820 .\}
3821 .nf
3822 \fB<stringification>\fR
3823 my \fI$str\fR \fB=\fR \fI$job\fR\fB\->str\fR;
3824 \fIstr\fR \fB= str(\fR\fIjob\fR\fB)\fR
3825 \fIstr\fR \fB=\fR \fIjob\fR\fB\&.to_s\fR
3826 .fi
3827 .if n \{\
3828 .RE
3829 .\}
3830 .sp
3831 Return a string describing the job\&.
3832 .sp
3833 .if n \{\
3834 .RS 4
3835 .\}
3836 .nf
3837 \fB<equality>\fR
3838 \fBif (\fR\fI$job1\fR \fB==\fR \fI$job2\fR\fB)\fR
3839 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR\fB:\fR
3840 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR
3841 .fi
3842 .if n \{\
3843 .RE
3844 .\}
3845 .sp
3846 Two jobs are equal if they belong to the same pool and both the \(lqhow\(rq and the \(lqwhat\(rq attributes are the same\&.
3847 .SS "TARGETED UPDATES"
3848 .sp
3849 Libsolv has two modes for upgrades and distupgrade: targeted and untargeted\&. Untargeted mode means that the installed packages from the specified set will be updated to the best version\&. Targeted means that packages that can be updated to a package in the specified set will be updated to the best package of the set\&.
3850 .sp
3851 Here\(cqs an example to explain the subtle difference\&. Suppose that you have package A installed in version "1\&.1", "A\-1\&.2" is available in one of the repositories and there is also package "B" that obsoletes package A\&.
3852 .sp
3853 An untargeted update of "A" will update the installed "A\-1\&.1" to package "B", because that is the newest version (B obsoletes A and is thus newer)\&.
3854 .sp
3855 A targeted update of "A" will update "A\-1\&.1" to "A\-1\&.2", as the set of packages contains both "A\-1\&.1" and "A\-1\&.2", and "A\-1\&.2" is the newer one\&.
3856 .sp
3857 An untargeted update of "B" will do nothing, as "B" is not installed\&.
3858 .sp
3859 An targeted update of "B" will update "A\-1\&.1" to "B"\&.
3860 .sp
3861 Note that the default is to do "auto\-targeting", thus if the specified set of packages does not include an installed package, the solver will assume targeted operation even if SOLVER_TARGETED is not used\&.
3862 .sp
3863 This mostly matches the intent of the user, with one exception: In the example above, an update of "A\-1\&.2" will update "A\-1\&.1" to "A\-1\&.2" (targeted mode), but a second update of "A\-1\&.2" will suddenly update to "B", as untargeted mode is chosen because "A\-1\&.2" is now installed\&.
3864 .sp
3865 If you want to have full control over when targeting mode is chosen, turn off auto\-targeting with the SOLVER_FLAG_NO_AUTOTARGET solver option\&. In that case, all updates are considered to be untargeted unless they include the SOLVER_TARGETED flag\&.
3866 .SS "SET BITS"
3867 .sp
3868 Set bits specify which parts of the specified packages where specified by the user\&. It is used by the solver when checking if an operation is allowed or not\&. For example, the solver will normally not allow the downgrade of an installed package\&. But it will not report a problem if the SOLVER_SETEVR flag is used, as it then assumes that the user specified the exact version and thus knows what he is doing\&.
3869 .sp
3870 So if a package "screen\-1\-1" is installed for the x86_64 architecture and version "2\-1" is only available for the i586 architecture, installing package "screen\-2\&.1" will ask the user for confirmation because of the different architecture\&. When using the Selection class to create jobs the set bits are automatically added, e\&.g\&. selecting \(lqscreen\&.i586\(rq will automatically add SOLVER_SETARCH, and thus no problem will be reported\&.
3871 .SH "THE SOLVER CLASS"
3872 .sp
3873 Dependency solving is what this library is about\&. A solver object is needed for solving to store the result of the solver run\&. The solver object can be used multiple times for different jobs, reusing it allows the solver to re\-use the dependency rules it already computed\&.
3874 .SS "CONSTANTS"
3875 .sp
3876 Flags to modify some of the solver\(cqs behavior:
3877 .PP
3878 \fBSOLVER_FLAG_ALLOW_DOWNGRADE\fR
3879 .RS 4
3880 Allow the solver to downgrade packages without asking for confirmation (i\&.e\&. reporting a problem)\&.
3881 .RE
3882 .PP
3883 \fBSOLVER_FLAG_ALLOW_ARCHCHANGE\fR
3884 .RS 4
3885 Allow the solver to change the architecture of an installed package without asking for confirmation\&. Note that changes to/from noarch are always considered to be allowed\&.
3886 .RE
3887 .PP
3888 \fBSOLVER_FLAG_ALLOW_VENDORCHANGE\fR
3889 .RS 4
3890 Allow the solver to change the vendor of an installed package without asking for confirmation\&. Each vendor is part of one or more vendor equivalence classes, normally installed packages may only change their vendor if the new vendor shares at least one equivalence class\&.
3891 .RE
3892 .PP
3893 \fBSOLVER_FLAG_ALLOW_NAMECHANGE\fR
3894 .RS 4
3895 Allow the solver to change the name of an installed package, i\&.e\&. install a package with a different name that obsoletes the installed package\&. This option is on by default\&.
3896 .RE
3897 .PP
3898 \fBSOLVER_FLAG_ALLOW_UNINSTALL\fR
3899 .RS 4
3900 Allow the solver to erase installed packages to fulfill the jobs\&. This flag also includes the above flags\&. You may want to set this flag if you only have SOLVER_ERASE jobs, as in that case it\(cqs better for the user to check the transaction overview instead of approving every single package that needs to be erased\&.
3901 .RE
3902 .PP
3903 \fBSOLVER_FLAG_DUP_ALLOW_DOWNGRADE\fR
3904 .RS 4
3905 Like SOLVER_FLAG_ALLOW_DOWNGRADE, but used in distupgrade mode\&.
3906 .RE
3907 .PP
3908 \fBSOLVER_FLAG_DUP_ALLOW_ARCHCHANGE\fR
3909 .RS 4
3910 Like SOLVER_FLAG_ALLOW_ARCHCHANGE, but used in distupgrade mode\&.
3911 .RE
3912 .PP
3913 \fBSOLVER_FLAG_DUP_ALLOW_VENDORCHANGE\fR
3914 .RS 4
3915 Like SOLVER_FLAG_ALLOW_VENDORCHANGE, but used in distupgrade mode\&.
3916 .RE
3917 .PP
3918 \fBSOLVER_FLAG_DUP_ALLOW_NAMECHANGE\fR
3919 .RS 4
3920 Like SOLVER_FLAG_ALLOW_NAMECHANGE, but used in distupgrade mode\&.
3921 .RE
3922 .PP
3923 \fBSOLVER_FLAG_NO_UPDATEPROVIDE\fR
3924 .RS 4
3925 If multiple packages obsolete an installed package, the solver checks the provides of every such package and ignores all packages that do not provide the installed package name\&. Thus, you can have an official update candidate that provides the old name, and other packages that also obsolete the package but are not considered for updating\&. If you cannot use this feature, you can turn it off by setting this flag\&.
3926 .RE
3927 .PP
3928 \fBSOLVER_FLAG_NEED_UPDATEPROVIDE\fR
3929 .RS 4
3930 This is somewhat the opposite of SOLVER_FLAG_NO_UPDATEPROVIDE: Only packages that provide the installed package names are considered for updating\&.
3931 .RE
3932 .PP
3933 \fBSOLVER_FLAG_SPLITPROVIDES\fR
3934 .RS 4
3935 Make the solver aware of special provides of the form \(lq<packagename>:<path>\(rq used in SUSE systems to support package splits\&.
3936 .RE
3937 .PP
3938 \fBSOLVER_FLAG_IGNORE_RECOMMENDED\fR
3939 .RS 4
3940 Do not process optional (aka weak) dependencies\&.
3941 .RE
3942 .PP
3943 \fBSOLVER_FLAG_ADD_ALREADY_RECOMMENDED\fR
3944 .RS 4
3945 Install recommended or supplemented packages even if they have no connection to the current transaction\&. You can use this feature to implement a simple way for the user to install new recommended packages that were not available in the past\&.
3946 .RE
3947 .PP
3948 \fBSOLVER_FLAG_NO_INFARCHCHECK\fR
3949 .RS 4
3950 Turn off the inferior architecture checking that is normally done by the solver\&. Normally, the solver allows only the installation of packages from the "best" architecture if a package is available for multiple architectures\&.
3951 .RE
3952 .PP
3953 \fBSOLVER_FLAG_BEST_OBEY_POLICY\fR
3954 .RS 4
3955 Make the SOLVER_FORCEBEST job option consider only packages that meet the policies for installed packages, i\&.e\&. no downgrades, no architecture change, no vendor change (see the first flags of this section)\&. If the flag is not specified, the solver will enforce the installation of the best package ignoring the installed packages, which may conflict with the set policy\&.
3956 .RE
3957 .PP
3958 \fBSOLVER_FLAG_NO_AUTOTARGET\fR
3959 .RS 4
3960 Do not enable auto\-targeting up update and distupgrade jobs\&. See the section on targeted updates for more information\&.
3961 .RE
3962 .PP
3963 \fBSOLVER_FLAG_KEEP_ORPHANS\fR
3964 .RS 4
3965 Do not allow orphaned packages to be deinstalled if they get in the way of resolving other packages\&.
3966 .RE
3967 .PP
3968 \fBSOLVER_FLAG_BREAK_ORPHANS\fR
3969 .RS 4
3970 Ignore dependencies of orphaned packages that get in the way of resolving non\-orphaned ones\&. Setting the flag might result in no longer working packages in case they are orphaned\&.
3971 .RE
3972 .PP
3973 \fBSOLVER_FLAG_FOCUS_INSTALLED\fR
3974 .RS 4
3975 Resolve installed packages before resolving the given jobs\&. Setting this flag means that the solver will prefer picking a package version that fits the other installed packages over updating installed packages\&.
3976 .RE
3977 .PP
3978 \fBSOLVER_FLAG_FOCUS_BEST\fR
3979 .RS 4
3980 First resolve the given jobs, then the dependencies of the resulting packages, then resolve all already installed packages\&. This will result in more packages being updated as when the flag is not used\&.
3981 .RE
3982 .PP
3983 \fBSOLVER_FLAG_INSTALL_ALSO_UPDATES\fR
3984 .RS 4
3985 Update the package if a job is already fulfilled by an installed package\&.
3986 .RE
3987 .PP
3988 \fBSOLVER_FLAG_YUM_OBSOLETES\fR
3989 .RS 4
3990 Turn on yum\-like package split handling\&. See the yum documentation for more details\&.
3991 .RE
3992 .PP
3993 \fBSOLVER_FLAG_URPM_REORDER\fR
3994 .RS 4
3995 Turn on urpm like package reordering for kernel packages\&. See the urpm documentation for more details\&.
3996 .RE
3997 .sp
3998 Basic rule types:
3999 .PP
4000 \fBSOLVER_RULE_UNKNOWN\fR
4001 .RS 4
4002 A rule of an unknown class\&. You should never encounter those\&.
4003 .RE
4004 .PP
4005 \fBSOLVER_RULE_PKG\fR
4006 .RS 4
4007 A rule generated because of a package dependency\&.
4008 .RE
4009 .PP
4010 \fBSOLVER_RULE_UPDATE\fR
4011 .RS 4
4012 A rule to implement the update policy of installed packages\&. Every installed package has an update rule that consists of the packages that may replace the installed package\&.
4013 .RE
4014 .PP
4015 \fBSOLVER_RULE_FEATURE\fR
4016 .RS 4
4017 Feature rules are fallback rules used when an update rule is disabled\&. They include all packages that may replace the installed package ignoring the update policy, i\&.e\&. they contain downgrades, arch changes and so on\&. Without them, the solver would simply erase installed packages if their update rule gets disabled\&.
4018 .RE
4019 .PP
4020 \fBSOLVER_RULE_JOB\fR
4021 .RS 4
4022 Job rules implement the job given to the solver\&.
4023 .RE
4024 .PP
4025 \fBSOLVER_RULE_DISTUPGRADE\fR
4026 .RS 4
4027 These are simple negative assertions that make sure that only packages are kept that are also available in one of the repositories\&.
4028 .RE
4029 .PP
4030 \fBSOLVER_RULE_INFARCH\fR
4031 .RS 4
4032 Infarch rules are also negative assertions, they disallow the installation of packages when there are packages of the same name but with a better architecture\&.
4033 .RE
4034 .PP
4035 \fBSOLVER_RULE_CHOICE\fR
4036 .RS 4
4037 Choice rules are used to make sure that the solver prefers updating to installing different packages when some dependency is provided by multiple packages with different names\&. The solver may always break choice rules, so you will not see them when a problem is found\&.
4038 .RE
4039 .PP
4040 \fBSOLVER_RULE_LEARNT\fR
4041 .RS 4
4042 These rules are generated by the solver to keep it from running into the same problem multiple times when it has to backtrack\&. They are the main reason why a sat solver is faster than other dependency solver implementations\&.
4043 .RE
4044 .sp
4045 Special dependency rule types:
4046 .PP
4047 \fBSOLVER_RULE_PKG_NOT_INSTALLABLE\fR
4048 .RS 4
4049 This rule was added to prevent the installation of a package of an architecture that does not work on the system\&.
4050 .RE
4051 .PP
4052 \fBSOLVER_RULE_PKG_NOTHING_PROVIDES_DEP\fR
4053 .RS 4
4054 The package contains a required dependency which was not provided by any package\&.
4055 .RE
4056 .PP
4057 \fBSOLVER_RULE_PKG_REQUIRES\fR
4058 .RS 4
4059 The package contains a required dependency which was provided by at least one package\&.
4060 .RE
4061 .PP
4062 \fBSOLVER_RULE_PKG_SELF_CONFLICT\fR
4063 .RS 4
4064 The package conflicts with itself\&. This is not allowed by older rpm versions\&.
4065 .RE
4066 .PP
4067 \fBSOLVER_RULE_PKG_CONFLICTS\fR
4068 .RS 4
4069 The package conflices with some other package\&.
4070 .RE
4071 .PP
4072 \fBSOLVER_RULE_PKG_SAME_NAME\fR
4073 .RS 4
4074 This rules make sure that only one version of a package is installed in the system\&.
4075 .RE
4076 .PP
4077 \fBSOLVER_RULE_PKG_OBSOLETES\fR
4078 .RS 4
4079 To fulfill the dependencies two packages need to be installed, but one of the packages obsoletes the other one\&.
4080 .RE
4081 .PP
4082 \fBSOLVER_RULE_PKG_IMPLICIT_OBSOLETES\fR
4083 .RS 4
4084 To fulfill the dependencies two packages need to be installed, but one of the packages has provides a dependency that is obsoleted by the other one\&. See the POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES flag\&.
4085 .RE
4086 .PP
4087 \fBSOLVER_RULE_PKG_INSTALLED_OBSOLETES\fR
4088 .RS 4
4089 To fulfill the dependencies a package needs to be installed that is obsoleted by an installed package\&. See the POOL_FLAG_NOINSTALLEDOBSOLETES flag\&.
4090 .RE
4091 .PP
4092 \fBSOLVER_RULE_PKG_RECOMMENDS\fR
4093 .RS 4
4094 The package contains a recommended dependency\&.
4095 .RE
4096 .PP
4097 \fBSOLVER_RULE_PKG_SUPPLEMENTS\fR
4098 .RS 4
4099 The package contains a dependency to specify it supplements another package\&.
4100 .RE
4101 .PP
4102 \fBSOLVER_RULE_PKG_CONSTRAINS\fR
4103 .RS 4
4104 The package contains a constraint against some other package (disttype conda)\&.
4105 .RE
4106 .PP
4107 \fBSOLVER_RULE_JOB_NOTHING_PROVIDES_DEP\fR
4108 .RS 4
4109 The user asked for installation of a package providing a specific dependency, but no available package provides it\&.
4110 .RE
4111 .PP
4112 \fBSOLVER_RULE_JOB_UNKNOWN_PACKAGE\fR
4113 .RS 4
4114 The user asked for installation of a package with a specific name, but no available package has that name\&.
4115 .RE
4116 .PP
4117 \fBSOLVER_RULE_JOB_PROVIDED_BY_SYSTEM\fR
4118 .RS 4
4119 The user asked for the erasure of a dependency that is provided by the system (i\&.e\&. for special hardware or language dependencies), this cannot be done with a job\&.
4120 .RE
4121 .PP
4122 \fBSOLVER_RULE_JOB_UNSUPPORTED\fR
4123 .RS 4
4124 The user asked for something that is not yet implemented, e\&.g\&. the installation of all packages at once\&.
4125 .RE
4126 .sp
4127 Policy error constants
4128 .PP
4129 \fBPOLICY_ILLEGAL_DOWNGRADE\fR
4130 .RS 4
4131 The solver ask for permission before downgrading packages\&.
4132 .RE
4133 .PP
4134 \fBPOLICY_ILLEGAL_ARCHCHANGE\fR
4135 .RS 4
4136 The solver ask for permission before changing the architecture of installed packages\&.
4137 .RE
4138 .PP
4139 \fBPOLICY_ILLEGAL_VENDORCHANGE\fR
4140 .RS 4
4141 The solver ask for permission before changing the vendor of installed packages\&.
4142 .RE
4143 .PP
4144 \fBPOLICY_ILLEGAL_NAMECHANGE\fR
4145 .RS 4
4146 The solver ask for permission before replacing an installed packages with a package that has a different name\&.
4147 .RE
4148 .sp
4149 Solution element type constants
4150 .PP
4151 \fBSOLVER_SOLUTION_JOB\fR
4152 .RS 4
4153 The problem can be solved by removing the specified job\&.
4154 .RE
4155 .PP
4156 \fBSOLVER_SOLUTION_POOLJOB\fR
4157 .RS 4
4158 The problem can be solved by removing the specified job that is defined in the pool\&.
4159 .RE
4160 .PP
4161 \fBSOLVER_SOLUTION_INFARCH\fR
4162 .RS 4
4163 The problem can be solved by allowing the installation of the specified package with an inferior architecture\&.
4164 .RE
4165 .PP
4166 \fBSOLVER_SOLUTION_DISTUPGRADE\fR
4167 .RS 4
4168 The problem can be solved by allowing to keep the specified package installed\&.
4169 .RE
4170 .PP
4171 \fBSOLVER_SOLUTION_BEST\fR
4172 .RS 4
4173 The problem can be solved by allowing to install the specified package that is not the best available package\&.
4174 .RE
4175 .PP
4176 \fBSOLVER_SOLUTION_ERASE\fR
4177 .RS 4
4178 The problem can be solved by allowing to erase the specified package\&.
4179 .RE
4180 .PP
4181 \fBSOLVER_SOLUTION_REPLACE\fR
4182 .RS 4
4183 The problem can be solved by allowing to replace the package with some other package\&.
4184 .RE
4185 .PP
4186 \fBSOLVER_SOLUTION_REPLACE_DOWNGRADE\fR
4187 .RS 4
4188 The problem can be solved by allowing to replace the package with some other package that has a lower version\&.
4189 .RE
4190 .PP
4191 \fBSOLVER_SOLUTION_REPLACE_ARCHCHANGE\fR
4192 .RS 4
4193 The problem can be solved by allowing to replace the package with some other package that has a different architecture\&.
4194 .RE
4195 .PP
4196 \fBSOLVER_SOLUTION_REPLACE_VENDORCHANGE\fR
4197 .RS 4
4198 The problem can be solved by allowing to replace the package with some other package that has a different vendor\&.
4199 .RE
4200 .PP
4201 \fBSOLVER_SOLUTION_REPLACE_NAMECHANGE\fR
4202 .RS 4
4203 The problem can be solved by allowing to replace the package with some other package that has a different name\&.
4204 .RE
4205 .sp
4206 Reason constants
4207 .PP
4208 \fBSOLVER_REASON_UNRELATED\fR
4209 .RS 4
4210 The package status did not change as it was not related to any job\&.
4211 .RE
4212 .PP
4213 \fBSOLVER_REASON_UNIT_RULE\fR
4214 .RS 4
4215 The package was installed/erased/kept because of a unit rule, i\&.e\&. a rule where all literals but one were false\&.
4216 .RE
4217 .PP
4218 \fBSOLVER_REASON_KEEP_INSTALLED\fR
4219 .RS 4
4220 The package was chosen when trying to keep as many packages installed as possible\&.
4221 .RE
4222 .PP
4223 \fBSOLVER_REASON_RESOLVE_JOB\fR
4224 .RS 4
4225 The decision happened to fulfill a job rule\&.
4226 .RE
4227 .PP
4228 \fBSOLVER_REASON_UPDATE_INSTALLED\fR
4229 .RS 4
4230 The decision happened to fulfill a package update request\&.
4231 .RE
4232 .PP
4233 \fBSOLVER_REASON_CLEANDEPS_ERASE\fR
4234 .RS 4
4235 The package was erased when cleaning up dependencies from other erased packages\&.
4236 .RE
4237 .PP
4238 \fBSOLVER_REASON_RESOLVE\fR
4239 .RS 4
4240 The package was installed to fulfill package dependencies\&.
4241 .RE
4242 .PP
4243 \fBSOLVER_REASON_WEAKDEP\fR
4244 .RS 4
4245 The package was installed because of a weak dependency (Recommends or Supplements)\&.
4246 .RE
4247 .PP
4248 \fBSOLVER_REASON_RESOLVE_ORPHAN\fR
4249 .RS 4
4250 The decision about the package was made when deciding the fate of orphaned packages\&.
4251 .RE
4252 .PP
4253 \fBSOLVER_REASON_RECOMMENDED\fR
4254 .RS 4
4255 This is a special case of SOLVER_REASON_WEAKDEP\&.
4256 .RE
4257 .PP
4258 \fBSOLVER_REASON_SUPPLEMENTED\fR
4259 .RS 4
4260 This is a special case of SOLVER_REASON_WEAKDEP\&.
4261 .RE
4262 .PP
4263 \fBSOLVER_REASON_UNSOLVABLE\fR
4264 .RS 4
4265 This is a special case where a rule cannot be fulfilled\&.
4266 .RE
4267 .PP
4268 \fBSOLVER_REASON_PREMISE\fR
4269 .RS 4
4270 This is a special case for the premises of learnt rules\&.
4271 .RE
4272 .SS "ATTRIBUTES"
4273 .sp
4274 .if n \{\
4275 .RS 4
4276 .\}
4277 .nf
4278 \fBPool *pool;\fR                             /* read only */
4279 \fI$job\fR\fB\->{pool}\fR
4280 \fId\fR\fB\&.pool\fR
4281 \fId\fR\fB\&.pool\fR
4282 .fi
4283 .if n \{\
4284 .RE
4285 .\}
4286 .sp
4287 Back pointer to pool\&.
4288 .SS "METHODS"
4289 .sp
4290 .if n \{\
4291 .RS 4
4292 .\}
4293 .nf
4294 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
4295 my \fI$oldvalue\fR \fB=\fR \fI$solver\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
4296 \fIoldvalue\fR \fB=\fR \fIsolver\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
4297 \fIoldvalue\fR \fB=\fR \fIsolver\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
4298 .fi
4299 .if n \{\
4300 .RE
4301 .\}
4302 .sp
4303 .if n \{\
4304 .RS 4
4305 .\}
4306 .nf
4307 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
4308 my \fI$value\fR \fB=\fR \fI$solver\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
4309 \fIvalue\fR \fB=\fR \fIsolver\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
4310 \fIvalue\fR \fB=\fR \fIsolver\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
4311 .fi
4312 .if n \{\
4313 .RE
4314 .\}
4315 .sp
4316 Set/get a solver specific flag\&. The flags define the policies the solver has to obey\&. The flags are explained in the CONSTANTS section of this class\&.
4317 .sp
4318 .if n \{\
4319 .RS 4
4320 .\}
4321 .nf
4322 \fBProblem *solve(Job *\fR\fIjobs\fR\fB)\fR
4323 my \fI@problems\fR \fB=\fR \fI$solver\fR\fB\->solve(\e\fR\fI@jobs\fR\fB)\fR;
4324 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
4325 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
4326 .fi
4327 .if n \{\
4328 .RE
4329 .\}
4330 .sp
4331 Solve a problem specified in the job list (plus the jobs defined in the pool)\&. Returns an array of problems that need user interaction, or an empty array if no problems were encountered\&. See the Problem class on how to deal with problems\&.
4332 .sp
4333 .if n \{\
4334 .RS 4
4335 .\}
4336 .nf
4337 \fBTransaction transaction()\fR
4338 my \fI$trans\fR \fB=\fR \fI$solver\fR\fB\->transaction()\fR;
4339 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
4340 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
4341 .fi
4342 .if n \{\
4343 .RE
4344 .\}
4345 .sp
4346 Return the transaction to implement the calculated package changes\&. A transaction is available even if problems were found, this is useful for interactive user interfaces that show both the job result and the problems\&.
4347 .sp
4348 .if n \{\
4349 .RS 4
4350 .\}
4351 .nf
4352 \fBSolvable *get_recommended(bool\fR \fInoselected\fR\fB=0)\fR
4353 my \fI@solvables\fR \fB=\fR \fI$solver\fR\fB\->get_recommended()\fR;
4354 \fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_recommended()\fR
4355 \fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_recommended()\fR
4356 .fi
4357 .if n \{\
4358 .RE
4359 .\}
4360 .sp
4361 Return all solvables that are recommended by the solver run result\&. This includes solvables included in the result; set noselected if you want to filter those\&.
4362 .sp
4363 .if n \{\
4364 .RS 4
4365 .\}
4366 .nf
4367 \fBSolvable *get_suggested(bool\fR \fInoselected\fR\fB=0)\fR
4368 my \fI@solvables\fR \fB=\fR \fI$solver\fR\fB\->get_suggested()\fR;
4369 \fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_suggested()\fR
4370 \fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_suggested()\fR
4371 .fi
4372 .if n \{\
4373 .RE
4374 .\}
4375 .sp
4376 Return all solvables that are suggested by the solver run result\&. This includes solvables included in the result; set noselected if you want to filter those\&.
4377 .sp
4378 .if n \{\
4379 .RS 4
4380 .\}
4381 .nf
4382 \fIDecision\fR \fB= get_decision(Solvable *\fR\fIs\fR\fB)\fR
4383 my \fI$decision\fR \fB=\fR \fI$solver\fR\fB\->get_decision(\fR\fI$solvable\fR\fB)\fR;
4384 \fIdecision\fR \fB=\fR \fIsolver\fR\fB\&.get_decision(\fR\fIsolvable\fR\fB)\fR;
4385 \fIdecision\fR \fB=\fR \fIsolver\fR\fB\&.get_decision(\fR\fIsolvable\fR\fB)\fR;
4386 .fi
4387 .if n \{\
4388 .RE
4389 .\}
4390 .sp
4391 Return a decision object that describes why a specific solvable was installed or erased\&. See the Decision class for more information\&.
4392 .sp
4393 .if n \{\
4394 .RS 4
4395 .\}
4396 .nf
4397 \fBDecision *get_decisionlist(Solvable *\fR\fIs\fR\fB)\fR
4398 my \fI@decisions\fR \fB=\fR \fI$solver\fR\fB\->get_decisionlist(\fR\fI$solvable\fR\fB)\fR;
4399 \fIdecisions\fR \fB=\fR \fIsolver\fR\fB\&.get_decisionlist(\fR\fIsolvable\fR\fB)\fR
4400 \fIdecisions\fR \fB=\fR \fIsolver\fR\fB\&.get_decisionlist(\fR\fIsolvable\fR\fB)\fR
4401 .fi
4402 .if n \{\
4403 .RE
4404 .\}
4405 .sp
4406 Return a list of decisions that caused the specific solvable to be installed or erased\&. This is usually more useful than the get_decision() method, as it returns every involved decision instead of just a single one\&.
4407 .sp
4408 .if n \{\
4409 .RS 4
4410 .\}
4411 .nf
4412 \fBAlternative *alternatives()\fR
4413 my \fI@alternatives\fR \fB=\fR \fI$solver\fR\fB\->alternatives()\fR;
4414 \fIalternatives\fR \fB=\fR \fIsolver\fR\fB\&.alternatives()\fR
4415 \fIalternatives\fR \fB=\fR \fIsolver\fR\fB\&.alternatives()\fR
4416 .fi
4417 .if n \{\
4418 .RE
4419 .\}
4420 .sp
4421 Return all alternatives recorded in the solver run\&. See the Alternative class for more information\&.
4422 .sp
4423 .if n \{\
4424 .RS 4
4425 .\}
4426 .nf
4427 \fBint alternatives_count()\fR
4428 my \fI$cnt\fR \fB=\fR \fI$solver\fR\fB\->alternatives_count()\fR;
4429 \fIcnt\fR \fB=\fR \fIsolver\fR\fB\&.alternatives_count()\fR
4430 \fIcnt\fR \fB=\fR \fIsolver\fR\fB\&.alternatives_count()\fR
4431 .fi
4432 .if n \{\
4433 .RE
4434 .\}
4435 .sp
4436 Return the number of alternatives without creating alternative objects\&.
4437 .SH "THE PROBLEM CLASS"
4438 .sp
4439 Problems are the way of the solver to interact with the user\&. You can simply list all problems and terminate your program, but a better way is to present solutions to the user and let him pick the ones he likes\&.
4440 .SS "ATTRIBUTES"
4441 .sp
4442 .if n \{\
4443 .RS 4
4444 .\}
4445 .nf
4446 \fBSolver *solv;\fR                           /* read only */
4447 \fI$problem\fR\fB\->{solv}\fR
4448 \fIproblem\fR\fB\&.solv\fR
4449 \fIproblem\fR\fB\&.solv\fR
4450 .fi
4451 .if n \{\
4452 .RE
4453 .\}
4454 .sp
4455 Back pointer to solver object\&.
4456 .sp
4457 .if n \{\
4458 .RS 4
4459 .\}
4460 .nf
4461 \fBId id;\fR                                  /* read only */
4462 \fI$problem\fR\fB\->{id}\fR
4463 \fIproblem\fR\fB\&.id\fR
4464 \fIproblem\fR\fB\&.id\fR
4465 .fi
4466 .if n \{\
4467 .RE
4468 .\}
4469 .sp
4470 Id of the problem\&. The first problem has Id 1, they are numbered consecutively\&.
4471 .SS "METHODS"
4472 .sp
4473 .if n \{\
4474 .RS 4
4475 .\}
4476 .nf
4477 \fBRule findproblemrule()\fR
4478 my \fI$probrule\fR \fB=\fR \fI$problem\fR\fB\->findproblemrule()\fR;
4479 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
4480 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
4481 .fi
4482 .if n \{\
4483 .RE
4484 .\}
4485 .sp
4486 Return the rule that caused the problem\&. Of course in most situations there is no single responsible rule, but many rules that interconnect with each created the problem\&. Nevertheless, the solver uses some heuristic approach to find a rule that somewhat describes the problem best to the user\&.
4487 .sp
4488 .if n \{\
4489 .RS 4
4490 .\}
4491 .nf
4492 \fBRule *findallproblemrules(bool\fR \fIunfiltered\fR \fB= 0)\fR
4493 my \fI@probrules\fR \fB=\fR \fI$problem\fR\fB\->findallproblemrules()\fR;
4494 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrules()\fR
4495 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrules()\fR
4496 .fi
4497 .if n \{\
4498 .RE
4499 .\}
4500 .sp
4501 Return all rules responsible for the problem\&. The returned set of rules contains all the needed information why there was a problem, but it\(cqs hard to present them to the user in a sensible way\&. The default is to filter out all update and job rules (unless the returned rules only consist of those types)\&.
4502 .sp
4503 .if n \{\
4504 .RS 4
4505 .\}
4506 .nf
4507 \fBDecision *get_decisionlist()\fR
4508 my \fI@decisions\fR \fB=\fR \fI$problem\fR\fB\->get_decisionlist()\fR;
4509 \fIdecisions\fR \fB=\fR \fIproblem\fR\fB\&.get_decisionlist()\fR
4510 \fIdecisions\fR \fB=\fR \fIproblem\fR\fB\&.get_decisionlist()\fR
4511 .fi
4512 .if n \{\
4513 .RE
4514 .\}
4515 .sp
4516 Return a list of decisions prooving the problem\&. This is somewhat similar to the findallproblemrules(), but the output is in an order that makes it easier to understand why the solver could not find a solution\&.
4517 .sp
4518 .if n \{\
4519 .RS 4
4520 .\}
4521 .nf
4522 \fBDecisionset *get_decisionsetlist()\fR
4523 my \fI@decisionsets\fR \fB=\fR \fI$problem\fR\fB\->get_decisionsetlist()\fR;
4524 \fIdecisionsets\fR \fB=\fR \fIproblem\fR\fB\&.get_decisionsetlist()\fR
4525 \fIdecisionsets\fR \fB=\fR \fIproblem\fR\fB\&.get_decisionsetlist()\fR
4526 .fi
4527 .if n \{\
4528 .RE
4529 .\}
4530 .sp
4531 Like the get_decisionlist() method, but the decisions are merged into individual sets\&.
4532 .sp
4533 .if n \{\
4534 .RS 4
4535 .\}
4536 .nf
4537 \fBRule *get_learnt()\fR
4538 my \fI@learnt\fR \fB=\fR \fI$problem\fR\fB\->get_learnt()\fR;
4539 \fIlearnt\fR \fB=\fR \fIproblem\fR\fB\&.get_learnt()\fR
4540 \fIlearnt\fR \fB=\fR \fIproblem\fR\fB\&.get_lerant()\fR
4541 .fi
4542 .if n \{\
4543 .RE
4544 .\}
4545 .sp
4546 Return a list of learnt rules that are part of the problem proof\&. This is useful for presenting a complete proof to the user\&.
4547 .sp
4548 .if n \{\
4549 .RS 4
4550 .\}
4551 .nf
4552 \fBSolution *solutions()\fR
4553 my \fI@solutions\fR \fB=\fR \fI$problem\fR\fB\->solutions()\fR;
4554 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
4555 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
4556 .fi
4557 .if n \{\
4558 .RE
4559 .\}
4560 .sp
4561 Return an array containing multiple possible solutions to fix the problem\&. See the solution class for more information\&.
4562 .sp
4563 .if n \{\
4564 .RS 4
4565 .\}
4566 .nf
4567 \fBint solution_count()\fR
4568 my \fI$cnt\fR \fB=\fR \fI$problem\fR\fB\->solution_count()\fR;
4569 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
4570 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
4571 .fi
4572 .if n \{\
4573 .RE
4574 .\}
4575 .sp
4576 Return the number of solutions without creating solution objects\&.
4577 .sp
4578 .if n \{\
4579 .RS 4
4580 .\}
4581 .nf
4582 \fB<stringification>\fR
4583 my \fI$str\fR \fB=\fR \fI$problem\fR\fB\->str\fR;
4584 \fIstr\fR \fB= str(\fR\fIproblem\fR\fB)\fR
4585 \fIstr\fR \fB=\fR \fIproblem\fR\fB\&.to_s\fR
4586 .fi
4587 .if n \{\
4588 .RE
4589 .\}
4590 .sp
4591 Return a string describing the problem\&. This is a convenience function, it is a shorthand for calling findproblemrule(), then ruleinfo() on the problem rule and problemstr() on the ruleinfo object\&.
4592 .SH "THE RULE CLASS"
4593 .sp
4594 Rules are the basic block of sat solving\&. Each package dependency gets translated into one or multiple rules\&.
4595 .SS "ATTRIBUTES"
4596 .sp
4597 .if n \{\
4598 .RS 4
4599 .\}
4600 .nf
4601 \fBSolver *solv;\fR                           /* read only */
4602 \fI$rule\fR\fB\->{solv}\fR
4603 \fIrule\fR\fB\&.solv\fR
4604 \fIrule\fR\fB\&.solv\fR
4605 .fi
4606 .if n \{\
4607 .RE
4608 .\}
4609 .sp
4610 Back pointer to solver object\&.
4611 .sp
4612 .if n \{\
4613 .RS 4
4614 .\}
4615 .nf
4616 \fBId id;\fR                                  /* read only */
4617 \fI$rule\fR\fB\->{id}\fR
4618 \fIrule\fR\fB\&.id\fR
4619 \fIrule\fR\fB\&.id\fR
4620 .fi
4621 .if n \{\
4622 .RE
4623 .\}
4624 .sp
4625 The id of the rule\&.
4626 .sp
4627 .if n \{\
4628 .RS 4
4629 .\}
4630 .nf
4631 \fBint type;\fR                               /* read only */
4632 \fI$rule\fR\fB\->{type}\fR
4633 \fIrule\fR\fB\&.type\fR
4634 \fIrule\fR\fB\&.type\fR
4635 .fi
4636 .if n \{\
4637 .RE
4638 .\}
4639 .sp
4640 The basic type of the rule\&. See the constant section of the solver class for the type list\&.
4641 .SS "METHODS"
4642 .sp
4643 .if n \{\
4644 .RS 4
4645 .\}
4646 .nf
4647 \fBRuleinfo info()\fR
4648 my \fI$ruleinfo\fR \fB=\fR \fI$rule\fR\fB\->info()\fR;
4649 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
4650 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
4651 .fi
4652 .if n \{\
4653 .RE
4654 .\}
4655 .sp
4656 Return a Ruleinfo object that contains information about why the rule was created\&. But see the allinfos() method below\&.
4657 .sp
4658 .if n \{\
4659 .RS 4
4660 .\}
4661 .nf
4662 \fBRuleinfo *allinfos()\fR
4663 my \fI@ruleinfos\fR \fB=\fR \fI$rule\fR\fB\->allinfos()\fR;
4664 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
4665 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
4666 .fi
4667 .if n \{\
4668 .RE
4669 .\}
4670 .sp
4671 As the same dependency rule can get created because of multiple dependencies, one Ruleinfo is not enough to describe the reason\&. Thus the allinfos() method returns an array of all infos about a rule\&.
4672 .sp
4673 .if n \{\
4674 .RS 4
4675 .\}
4676 .nf
4677 \fBDecision *get_decisionlist()\fR
4678 my \fI@decisions\fR \fB=\fR \fI$rule\fR\fB\->get_decisionlist()\fR;
4679 \fIdecisions\fR \fB=\fR \fIrule\fR\fB\&.get_decisionlist()\fR
4680 \fIdecisions\fR \fB=\fR \fIrule\fR\fB\&.get_decisionlist()\fR
4681 .fi
4682 .if n \{\
4683 .RE
4684 .\}
4685 .sp
4686 Return a list of decisions prooving a learnt rule\&.
4687 .sp
4688 .if n \{\
4689 .RS 4
4690 .\}
4691 .nf
4692 \fBDecision *get_decisionsetlist()\fR
4693 my \fI@decisionsets\fR \fB=\fR \fI$rule\fR\fB\->get_decisionsetlist()\fR;
4694 \fIdecisionsets\fR \fB=\fR \fIrule\fR\fB\&.get_decisionsetlist()\fR
4695 \fIdecisionsets\fR \fB=\fR \fIrule\fR\fB\&.get_decisionsetlist()\fR
4696 .fi
4697 .if n \{\
4698 .RE
4699 .\}
4700 .sp
4701 Like the get_decisionlist() method, but the decisions are merged into individual sets\&.
4702 .sp
4703 .if n \{\
4704 .RS 4
4705 .\}
4706 .nf
4707 \fBRule *get_learnt()\fR
4708 my \fI@learnt\fR \fB=\fR \fI$rule\fR\fB\->get_learnt()\fR;
4709 \fIlearnt\fR \fB=\fR \fIrule\fR\fB\&.get_learnt()\fR
4710 \fIlearnt\fR \fB=\fR \fIrule\fR\fB\&.get_lerant()\fR
4711 .fi
4712 .if n \{\
4713 .RE
4714 .\}
4715 .sp
4716 Return a list of learnt rules that are part of the learnt rule proof\&.
4717 .sp
4718 .if n \{\
4719 .RS 4
4720 .\}
4721 .nf
4722 \fB<equality>\fR
4723 \fBif (\fR\fI$rule1\fR \fB==\fR \fI$rule2\fR\fB)\fR
4724 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR\fB:\fR
4725 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR
4726 .fi
4727 .if n \{\
4728 .RE
4729 .\}
4730 .sp
4731 Two rules are equal if they belong to the same solver and have the same id\&.
4732 .SH "THE RULEINFO CLASS"
4733 .sp
4734 A Ruleinfo describes one reason why a rule was created\&.
4735 .SS "ATTRIBUTES"
4736 .sp
4737 .if n \{\
4738 .RS 4
4739 .\}
4740 .nf
4741 \fBSolver *solv;\fR                           /* read only */
4742 \fI$ruleinfo\fR\fB\->{solv}\fR
4743 \fIruleinfo\fR\fB\&.solv\fR
4744 \fIruleinfo\fR\fB\&.solv\fR
4745 .fi
4746 .if n \{\
4747 .RE
4748 .\}
4749 .sp
4750 Back pointer to solver object\&.
4751 .sp
4752 .if n \{\
4753 .RS 4
4754 .\}
4755 .nf
4756 \fBint type;\fR                               /* read only */
4757 \fI$ruleinfo\fR\fB\->{type}\fR
4758 \fIruleinfo\fR\fB\&.type\fR
4759 \fIruleinfo\fR\fB\&.type\fR
4760 .fi
4761 .if n \{\
4762 .RE
4763 .\}
4764 .sp
4765 The type of the ruleinfo\&. See the constant section of the solver class for the rule type list and the special type list\&.
4766 .sp
4767 .if n \{\
4768 .RS 4
4769 .\}
4770 .nf
4771 \fBDep *dep;\fR                               /* read only */
4772 \fI$ruleinfo\fR\fB\->{dep}\fR
4773 \fIruleinfo\fR\fB\&.dep\fR
4774 \fIruleinfo\fR\fB\&.dep\fR
4775 .fi
4776 .if n \{\
4777 .RE
4778 .\}
4779 .sp
4780 The dependency leading to the creation of the rule\&.
4781 .sp
4782 .if n \{\
4783 .RS 4
4784 .\}
4785 .nf
4786 \fBDep *dep_id;\fR                            /* read only */
4787 \fI$ruleinfo\fR\fB\->{\fR\fIdep_id\fR\fB}\fR
4788 \fIruleinfo\fR\fB\&.dep_id\fR
4789 \fIruleinfo\fR\fB\&.dep_id\fR
4790 .fi
4791 .if n \{\
4792 .RE
4793 .\}
4794 .sp
4795 The Id of the dependency leading to the creation of the rule, or zero\&.
4796 .sp
4797 .if n \{\
4798 .RS 4
4799 .\}
4800 .nf
4801 \fBSolvable *solvable;\fR                     /* read only */
4802 \fI$ruleinfo\fR\fB\->{solvable}\fR
4803 \fIruleinfo\fR\fB\&.solvable\fR
4804 \fIruleinfo\fR\fB\&.solvable\fR
4805 .fi
4806 .if n \{\
4807 .RE
4808 .\}
4809 .sp
4810 The involved Solvable, e\&.g\&. the one containing the dependency\&.
4811 .sp
4812 .if n \{\
4813 .RS 4
4814 .\}
4815 .nf
4816 \fBSolvable *othersolvable;\fR                /* read only */
4817 \fI$ruleinfo\fR\fB\->{othersolvable}\fR
4818 \fIruleinfo\fR\fB\&.othersolvable\fR
4819 \fIruleinfo\fR\fB\&.othersolvable\fR
4820 .fi
4821 .if n \{\
4822 .RE
4823 .\}
4824 .sp
4825 The other involved Solvable (if any), e\&.g\&. the one providing the dependency\&.
4826 .sp
4827 .if n \{\
4828 .RS 4
4829 .\}
4830 .nf
4831 \fBconst char *problemstr()\fR;
4832 my \fI$str\fR \fB=\fR \fI$ruleinfo\fR\fB\->problemstr()\fR;
4833 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
4834 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
4835 .fi
4836 .if n \{\
4837 .RE
4838 .\}
4839 .sp
4840 A string describing the ruleinfo from a problem perspective\&. This probably only makes sense if the rule is part of a problem\&.
4841 .sp
4842 .if n \{\
4843 .RS 4
4844 .\}
4845 .nf
4846 \fB<stringification>\fR
4847 my \fI$str\fR \fB=\fR \fI$ruleinfo\fR\fB\->str\fR;
4848 \fIstr\fR \fB= str(\fR\fIruleinfo\fR\fB)\fR
4849 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.to_s\fR
4850 .fi
4851 .if n \{\
4852 .RE
4853 .\}
4854 .sp
4855 A string describing the ruleinfo, i\&.e\&. the reason why the corresponding rule has been created\&.
4856 .SH "THE SOLUTION CLASS"
4857 .sp
4858 A solution solves one specific problem\&. It consists of multiple solution elements that all need to be executed\&.
4859 .SS "ATTRIBUTES"
4860 .sp
4861 .if n \{\
4862 .RS 4
4863 .\}
4864 .nf
4865 \fBSolver *solv;\fR                           /* read only */
4866 \fI$solution\fR\fB\->{solv}\fR
4867 \fIsolution\fR\fB\&.solv\fR
4868 \fIsolution\fR\fB\&.solv\fR
4869 .fi
4870 .if n \{\
4871 .RE
4872 .\}
4873 .sp
4874 Back pointer to solver object\&.
4875 .sp
4876 .if n \{\
4877 .RS 4
4878 .\}
4879 .nf
4880 \fBId problemid;\fR                           /* read only */
4881 \fI$solution\fR\fB\->{problemid}\fR
4882 \fIsolution\fR\fB\&.problemid\fR
4883 \fIsolution\fR\fB\&.problemid\fR
4884 .fi
4885 .if n \{\
4886 .RE
4887 .\}
4888 .sp
4889 Id of the problem the solution solves\&.
4890 .sp
4891 .if n \{\
4892 .RS 4
4893 .\}
4894 .nf
4895 \fBId id;\fR                                  /* read only */
4896 \fI$solution\fR\fB\->{id}\fR
4897 \fIsolution\fR\fB\&.id\fR
4898 \fIsolution\fR\fB\&.id\fR
4899 .fi
4900 .if n \{\
4901 .RE
4902 .\}
4903 .sp
4904 Id of the solution\&. The first solution has Id 1, they are numbered consecutively\&.
4905 .SS "METHODS"
4906 .sp
4907 .if n \{\
4908 .RS 4
4909 .\}
4910 .nf
4911 \fBSolutionelement *elements(bool\fR \fIexpandreplaces\fR \fB= 0)\fR
4912 my \fI@solutionelements\fR \fB=\fR \fI$solution\fR\fB\->elements()\fR;
4913 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
4914 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
4915 .fi
4916 .if n \{\
4917 .RE
4918 .\}
4919 .sp
4920 Return an array containing the elements describing what needs to be done to implement the specific solution\&. If expandreplaces is true, elements of type SOLVER_SOLUTION_REPLACE will be replaced by one or more elements replace elements describing the policy mismatches\&.
4921 .sp
4922 .if n \{\
4923 .RS 4
4924 .\}
4925 .nf
4926 \fBint element_count()\fR
4927 my \fI$cnt\fR \fB=\fR \fI$solution\fR\fB\->solution_count()\fR;
4928 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
4929 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
4930 .fi
4931 .if n \{\
4932 .RE
4933 .\}
4934 .sp
4935 Return the number of solution elements without creating objects\&. Note that the count does not match the number of objects returned by the elements() method of expandreplaces is set to true\&.
4936 .SH "THE SOLUTIONELEMENT CLASS"
4937 .sp
4938 A solution element describes a single action of a solution\&. The action is always either to remove one specific job or to add a new job that installs or erases a single specific package\&.
4939 .SS "ATTRIBUTES"
4940 .sp
4941 .if n \{\
4942 .RS 4
4943 .\}
4944 .nf
4945 \fBSolver *solv;\fR                           /* read only */
4946 \fI$solutionelement\fR\fB\->{solv}\fR
4947 \fIsolutionelement\fR\fB\&.solv\fR
4948 \fIsolutionelement\fR\fB\&.solv\fR
4949 .fi
4950 .if n \{\
4951 .RE
4952 .\}
4953 .sp
4954 Back pointer to solver object\&.
4955 .sp
4956 .if n \{\
4957 .RS 4
4958 .\}
4959 .nf
4960 \fBId problemid;\fR                           /* read only */
4961 \fI$solutionelement\fR\fB\->{problemid}\fR
4962 \fIsolutionelement\fR\fB\&.problemid\fR
4963 \fIsolutionelement\fR\fB\&.problemid\fR
4964 .fi
4965 .if n \{\
4966 .RE
4967 .\}
4968 .sp
4969 Id of the problem the element (partly) solves\&.
4970 .sp
4971 .if n \{\
4972 .RS 4
4973 .\}
4974 .nf
4975 \fBId solutionid;\fR                          /* read only */
4976 \fI$solutionelement\fR\fB\->{solutionid}\fR
4977 \fIsolutionelement\fR\fB\&.solutionid\fR
4978 \fIsolutionelement\fR\fB\&.solutionid\fR
4979 .fi
4980 .if n \{\
4981 .RE
4982 .\}
4983 .sp
4984 Id of the solution the element is a part of\&.
4985 .sp
4986 .if n \{\
4987 .RS 4
4988 .\}
4989 .nf
4990 \fBId id;\fR                                  /* read only */
4991 \fI$solutionelement\fR\fB\->{id}\fR
4992 \fIsolutionelement\fR\fB\&.id\fR
4993 \fIsolutionelement\fR\fB\&.id\fR
4994 .fi
4995 .if n \{\
4996 .RE
4997 .\}
4998 .sp
4999 Id of the solution element\&. The first element has Id 1, they are numbered consecutively\&.
5000 .sp
5001 .if n \{\
5002 .RS 4
5003 .\}
5004 .nf
5005 \fBId type;\fR                                /* read only */
5006 \fI$solutionelement\fR\fB\->{type}\fR
5007 \fIsolutionelement\fR\fB\&.type\fR
5008 \fIsolutionelement\fR\fB\&.type\fR
5009 .fi
5010 .if n \{\
5011 .RE
5012 .\}
5013 .sp
5014 Type of the solution element\&. See the constant section of the solver class for the existing types\&.
5015 .sp
5016 .if n \{\
5017 .RS 4
5018 .\}
5019 .nf
5020 \fBSolvable *solvable;\fR                     /* read only */
5021 \fI$solutionelement\fR\fB\->{solvable}\fR
5022 \fIsolutionelement\fR\fB\&.solvable\fR
5023 \fIsolutionelement\fR\fB\&.solvable\fR
5024 .fi
5025 .if n \{\
5026 .RE
5027 .\}
5028 .sp
5029 The installed solvable that needs to be replaced for replacement elements\&.
5030 .sp
5031 .if n \{\
5032 .RS 4
5033 .\}
5034 .nf
5035 \fBSolvable *replacement;\fR                  /* read only */
5036 \fI$solutionelement\fR\fB\->{replacement}\fR
5037 \fIsolutionelement\fR\fB\&.replacement\fR
5038 \fIsolutionelement\fR\fB\&.replacement\fR
5039 .fi
5040 .if n \{\
5041 .RE
5042 .\}
5043 .sp
5044 The solvable that needs to be installed to fix the problem\&.
5045 .sp
5046 .if n \{\
5047 .RS 4
5048 .\}
5049 .nf
5050 \fBint jobidx;\fR                             /* read only */
5051 \fI$solutionelement\fR\fB\->{jobidx}\fR
5052 \fIsolutionelement\fR\fB\&.jobidx\fR
5053 \fIsolutionelement\fR\fB\&.jobidx\fR
5054 .fi
5055 .if n \{\
5056 .RE
5057 .\}
5058 .sp
5059 The index of the job that needs to be removed to fix the problem, or \-1 if the element is of another type\&. Note that it\(cqs better to change the job to SOLVER_NOOP type so that the numbering of other elements does not get disturbed\&. This method works both for types SOLVER_SOLUTION_JOB and SOLVER_SOLUTION_POOLJOB\&.
5060 .SS "METHODS"
5061 .sp
5062 .if n \{\
5063 .RS 4
5064 .\}
5065 .nf
5066 \fBSolutionelement *replaceelements()\fR
5067 my \fI@solutionelements\fR \fB=\fR \fI$solutionelement\fR\fB\->replaceelements()\fR;
5068 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
5069 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
5070 .fi
5071 .if n \{\
5072 .RE
5073 .\}
5074 .sp
5075 If the solution element is of type SOLVER_SOLUTION_REPLACE, return an array of elements describing the policy mismatches, otherwise return a copy of the element\&. See also the \(lqexpandreplaces\(rq option in the solution\(cqs elements() method\&.
5076 .sp
5077 .if n \{\
5078 .RS 4
5079 .\}
5080 .nf
5081 \fBint illegalreplace()\fR
5082 my \fI$illegal\fR \fB=\fR \fI$solutionelement\fR\fB\->illegalreplace()\fR;
5083 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
5084 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
5085 .fi
5086 .if n \{\
5087 .RE
5088 .\}
5089 .sp
5090 Return an integer that contains the policy mismatch bits or\-ed together, or zero if there was no policy mismatch\&. See the policy error constants in the solver class\&.
5091 .sp
5092 .if n \{\
5093 .RS 4
5094 .\}
5095 .nf
5096 \fBJob Job()\fR
5097 my \fI$job\fR \fB=\fR \fI$solutionelement\fR\fB\->Job()\fR;
5098 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
5099 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
5100 .fi
5101 .if n \{\
5102 .RE
5103 .\}
5104 .sp
5105 Create a job that implements the solution element\&. Add this job to the array of jobs for all elements of type different to SOLVER_SOLUTION_JOB and SOLVER_SOLUTION_POOLJOB\&. For the latter two, a SOLVER_NOOB Job is created, you should replace the old job with the new one\&.
5106 .sp
5107 .if n \{\
5108 .RS 4
5109 .\}
5110 .nf
5111 \fBconst char *str()\fR
5112 my \fI$str\fR \fB=\fR \fI$solutionelement\fR\fB\->str()\fR;
5113 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
5114 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
5115 .fi
5116 .if n \{\
5117 .RE
5118 .\}
5119 .sp
5120 A string describing the change the solution element consists of\&.
5121 .SH "THE TRANSACTION CLASS"
5122 .sp
5123 Transactions describe the output of a solver run\&. A transaction contains a number of transaction elements, each either the installation of a new package or the removal of an already installed package\&. The Transaction class supports a classify() method that puts the elements into different groups so that a transaction can be presented to the user in a meaningful way\&.
5124 .SS "CONSTANTS"
5125 .sp
5126 Transaction element types, both active and passive
5127 .PP
5128 \fBSOLVER_TRANSACTION_IGNORE\fR
5129 .RS 4
5130 This element does nothing\&. Used to map element types that do not match the view mode\&.
5131 .RE
5132 .PP
5133 \fBSOLVER_TRANSACTION_INSTALL\fR
5134 .RS 4
5135 This element installs a package\&.
5136 .RE
5137 .PP
5138 \fBSOLVER_TRANSACTION_ERASE\fR
5139 .RS 4
5140 This element erases a package\&.
5141 .RE
5142 .PP
5143 \fBSOLVER_TRANSACTION_MULTIINSTALL\fR
5144 .RS 4
5145 This element installs a package with a different version keeping the other versions installed\&.
5146 .RE
5147 .PP
5148 \fBSOLVER_TRANSACTION_MULTIREINSTALL\fR
5149 .RS 4
5150 This element reinstalls an installed package keeping the other versions installed\&.
5151 .RE
5152 .sp
5153 Transaction element types, active view
5154 .PP
5155 \fBSOLVER_TRANSACTION_REINSTALL\fR
5156 .RS 4
5157 This element re\-installs a package, i\&.e\&. installs the same package again\&.
5158 .RE
5159 .PP
5160 \fBSOLVER_TRANSACTION_CHANGE\fR
5161 .RS 4
5162 This element installs a package with same name, version, architecture but different content\&.
5163 .RE
5164 .PP
5165 \fBSOLVER_TRANSACTION_UPGRADE\fR
5166 .RS 4
5167 This element installs a newer version of an installed package\&.
5168 .RE
5169 .PP
5170 \fBSOLVER_TRANSACTION_DOWNGRADE\fR
5171 .RS 4
5172 This element installs an older version of an installed package\&.
5173 .RE
5174 .PP
5175 \fBSOLVER_TRANSACTION_OBSOLETES\fR
5176 .RS 4
5177 This element installs a package that obsoletes an installed package\&.
5178 .RE
5179 .sp
5180 Transaction element types, passive view
5181 .PP
5182 \fBSOLVER_TRANSACTION_REINSTALLED\fR
5183 .RS 4
5184 This element re\-installs a package, i\&.e\&. installs the same package again\&.
5185 .RE
5186 .PP
5187 \fBSOLVER_TRANSACTION_CHANGED\fR
5188 .RS 4
5189 This element replaces an installed package with one of the same name, version, architecture but different content\&.
5190 .RE
5191 .PP
5192 \fBSOLVER_TRANSACTION_UPGRADED\fR
5193 .RS 4
5194 This element replaces an installed package with a new version\&.
5195 .RE
5196 .PP
5197 \fBSOLVER_TRANSACTION_DOWNGRADED\fR
5198 .RS 4
5199 This element replaces an installed package with an old version\&.
5200 .RE
5201 .PP
5202 \fBSOLVER_TRANSACTION_OBSOLETED\fR
5203 .RS 4
5204 This element replaces an installed package with a package that obsoletes it\&.
5205 .RE
5206 .sp
5207 Pseudo element types for showing extra information used by classify()
5208 .PP
5209 \fBSOLVER_TRANSACTION_ARCHCHANGE\fR
5210 .RS 4
5211 This element replaces an installed package with a package of a different architecture\&.
5212 .RE
5213 .PP
5214 \fBSOLVER_TRANSACTION_VENDORCHANGE\fR
5215 .RS 4
5216 This element replaces an installed package with a package of a different vendor\&.
5217 .RE
5218 .sp
5219 Transaction mode flags
5220 .PP
5221 \fBSOLVER_TRANSACTION_SHOW_ACTIVE\fR
5222 .RS 4
5223 Filter for active view types\&. The default is to return passive view type, i\&.e\&. to show how the installed packages get changed\&.
5224 .RE
5225 .PP
5226 \fBSOLVER_TRANSACTION_SHOW_OBSOLETES\fR
5227 .RS 4
5228 Do not map the obsolete view type into INSTALL/ERASE elements\&.
5229 .RE
5230 .PP
5231 \fBSOLVER_TRANSACTION_SHOW_ALL\fR
5232 .RS 4
5233 If multiple packages replace an installed package, only the best of them is kept as OBSOLETE element, the other ones are mapped to INSTALL/ERASE elements\&. This is because most applications want to show just one package replacing the installed one\&. The SOLVER_TRANSACTION_SHOW_ALL makes the library keep all OBSOLETE elements\&.
5234 .RE
5235 .PP
5236 \fBSOLVER_TRANSACTION_SHOW_MULTIINSTALL\fR
5237 .RS 4
5238 The library maps MULTIINSTALL elements to simple INSTALL elements\&. This flag can be used to disable the mapping\&.
5239 .RE
5240 .PP
5241 \fBSOLVER_TRANSACTION_CHANGE_IS_REINSTALL\fR
5242 .RS 4
5243 Use this flag if you want to map CHANGE elements to the REINSTALL type\&.
5244 .RE
5245 .PP
5246 \fBSOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE\fR
5247 .RS 4
5248 Use this flag if you want to map OBSOLETE elements to the UPGRADE type\&.
5249 .RE
5250 .PP
5251 \fBSOLVER_TRANSACTION_MERGE_ARCHCHANGES\fR
5252 .RS 4
5253 Do not add extra categories for every architecture change, instead cumulate them in one category\&.
5254 .RE
5255 .PP
5256 \fBSOLVER_TRANSACTION_MERGE_VENDORCHANGES\fR
5257 .RS 4
5258 Do not add extra categories for every vendor change, instead cumulate them in one category\&.
5259 .RE
5260 .PP
5261 \fBSOLVER_TRANSACTION_RPM_ONLY\fR
5262 .RS 4
5263 Special view mode that just returns IGNORE, ERASE, INSTALL, MULTIINSTALL elements\&. Useful if you want to find out what to feed to the underlying package manager\&.
5264 .RE
5265 .sp
5266 Transaction order flags
5267 .PP
5268 \fBSOLVER_TRANSACTION_KEEP_ORDERDATA\fR
5269 .RS 4
5270 Do not throw away the dependency graph used for ordering the transaction\&. This flag is needed if you want to do manual ordering\&.
5271 .RE
5272 .SS "ATTRIBUTES"
5273 .sp
5274 .if n \{\
5275 .RS 4
5276 .\}
5277 .nf
5278 \fBPool *pool;\fR                             /* read only */
5279 \fI$trans\fR\fB\->{pool}\fR
5280 \fItrans\fR\fB\&.pool\fR
5281 \fItrans\fR\fB\&.pool\fR
5282 .fi
5283 .if n \{\
5284 .RE
5285 .\}
5286 .sp
5287 Back pointer to pool\&.
5288 .SS "METHODS"
5289 .sp
5290 .if n \{\
5291 .RS 4
5292 .\}
5293 .nf
5294 \fBbool isempty()\fR
5295 \fI$trans\fR\fB\->isempty()\fR
5296 \fItrans\fR\fB\&.isempty()\fR
5297 \fItrans\fR\fB\&.isempty?\fR
5298 .fi
5299 .if n \{\
5300 .RE
5301 .\}
5302 .sp
5303 Returns true if the transaction does not do anything, i\&.e\&. has no elements\&.
5304 .sp
5305 .if n \{\
5306 .RS 4
5307 .\}
5308 .nf
5309 \fBSolvable *newsolvables()\fR
5310 my \fI@newsolvables\fR \fB=\fR \fI$trans\fR\fB\->newsolvables()\fR;
5311 \fInewsolvables\fR \fB=\fR \fItrans\fR\fB\&.newsolvables()\fR
5312 \fInewsolvables\fR \fB=\fR \fItrans\fR\fB\&.newsolvables()\fR
5313 .fi
5314 .if n \{\
5315 .RE
5316 .\}
5317 .sp
5318 Return all packages that are to be installed by the transaction\&. These are the packages that need to be downloaded from the repositories\&.
5319 .sp
5320 .if n \{\
5321 .RS 4
5322 .\}
5323 .nf
5324 \fBSolvable *keptsolvables()\fR
5325 my \fI@keptsolvables\fR \fB=\fR \fI$trans\fR\fB\->keptsolvables()\fR;
5326 \fIkeptsolvables\fR \fB=\fR \fItrans\fR\fB\&.keptsolvables()\fR
5327 \fIkeptsolvables\fR \fB=\fR \fItrans\fR\fB\&.keptsolvables()\fR
5328 .fi
5329 .if n \{\
5330 .RE
5331 .\}
5332 .sp
5333 Return all installed packages that the transaction will keep installed\&.
5334 .sp
5335 .if n \{\
5336 .RS 4
5337 .\}
5338 .nf
5339 \fBSolvable *steps()\fR
5340 my \fI@steps\fR \fB=\fR \fI$trans\fR\fB\->steps()\fR;
5341 \fIsteps\fR \fB=\fR \fItrans\fR\fB\&.steps()\fR
5342 \fIsteps\fR \fB=\fR \fItrans\fR\fB\&.steps()\fR
5343 .fi
5344 .if n \{\
5345 .RE
5346 .\}
5347 .sp
5348 Return all solvables that need to be installed (if the returned solvable is not already installed) or erased (if the returned solvable is installed)\&. A step is also called a transaction element\&.
5349 .sp
5350 .if n \{\
5351 .RS 4
5352 .\}
5353 .nf
5354 \fBint steptype(Solvable *\fR\fIsolvable\fR\fB, int\fR \fImode\fR\fB)\fR
5355 my \fI$type\fR \fB=\fR \fI$trans\fR\fB\->steptype(\fR\fI$solvable\fR\fB,\fR \fI$mode\fR\fB)\fR;
5356 \fItype\fR \fB=\fR \fItrans\fR\fB\&.steptype(\fR\fIsolvable\fR\fB,\fR \fImode\fR\fB)\fR
5357 \fItype\fR \fB=\fR \fItrans\fR\fB\&.steptype(\fR\fIsolvable\fR\fB,\fR \fImode\fR\fB)\fR
5358 .fi
5359 .if n \{\
5360 .RE
5361 .\}
5362 .sp
5363 Return the transaction type of the specified solvable\&. See the CONSTANTS sections for the mode argument flags and the list of returned types\&.
5364 .sp
5365 .if n \{\
5366 .RS 4
5367 .\}
5368 .nf
5369 \fBTransactionClass *classify(int\fR \fImode\fR \fB= 0)\fR
5370 my \fI@classes\fR \fB=\fR \fI$trans\fR\fB\->classify()\fR;
5371 \fIclasses\fR \fB=\fR \fItrans\fR\fB\&.classify()\fR
5372 \fIclasses\fR \fB=\fR \fItrans\fR\fB\&.classify()\fR
5373 .fi
5374 .if n \{\
5375 .RE
5376 .\}
5377 .sp
5378 Group the transaction elements into classes so that they can be displayed in a structured way\&. You can use various mapping mode flags to tweak the result to match your preferences, see the mode argument flag in the CONSTANTS section\&. See the TransactionClass class for how to deal with the returned objects\&.
5379 .sp
5380 .if n \{\
5381 .RS 4
5382 .\}
5383 .nf
5384 \fBSolvable othersolvable(Solvable *\fR\fIsolvable\fR\fB)\fR
5385 my \fI$other\fR \fB=\fR \fI$trans\fR\fB\->othersolvable(\fR\fI$solvable\fR\fB)\fR;
5386 \fIother\fR \fB=\fR \fItrans\fR\fB\&.othersolvable(\fR\fIsolvable\fR\fB)\fR
5387 \fIother\fR \fB=\fR \fItrans\fR\fB\&.othersolvable(\fR\fIsolvable\fR\fB)\fR
5388 .fi
5389 .if n \{\
5390 .RE
5391 .\}
5392 .sp
5393 Return the \(lqother\(rq solvable for a given solvable\&. For installed packages the other solvable is the best package with the same name that replaces the installed package, or the best package of the obsoleting packages if the package does not get replaced by one with the same name\&.
5394 .sp
5395 For to be installed packages, the \(lqother\(rq solvable is the best installed package with the same name that will be replaced, or the best packages of all the packages that are obsoleted if the new package does not replace a package with the same name\&.
5396 .sp
5397 Thus, the \(lqother\(rq solvable is normally the package that is also shown for a given package\&.
5398 .sp
5399 .if n \{\
5400 .RS 4
5401 .\}
5402 .nf
5403 \fBSolvable *allothersolvables(Solvable *\fR\fIsolvable\fR\fB)\fR
5404 my \fI@others\fR \fB=\fR \fI$trans\fR\fB\->allothersolvables(\fR\fI$solvable\fR\fB)\fR;
5405 \fIothers\fR \fB=\fR \fItrans\fR\fB\&.allothersolvables(\fR\fIsolvable\fR\fB)\fR
5406 \fIothers\fR \fB=\fR \fItrans\fR\fB\&.allothersolvables(\fR\fIsolvable\fR\fB)\fR
5407 .fi
5408 .if n \{\
5409 .RE
5410 .\}
5411 .sp
5412 For installed packages, returns all of the packages that replace us\&. For to be installed packages, returns all of the packages that the new package replaces\&. The special \(lqother\(rq solvable is always the first entry of the returned array\&.
5413 .sp
5414 .if n \{\
5415 .RS 4
5416 .\}
5417 .nf
5418 \fBlong long calc_installsizechange()\fR
5419 my \fI$change\fR \fB=\fR \fI$trans\fR\fB\->calc_installsizechange()\fR;
5420 \fIchange\fR \fB=\fR \fItrans\fR\fB\&.calc_installsizechange()\fR
5421 \fIchange\fR \fB=\fR \fItrans\fR\fB\&.calc_installsizechange()\fR
5422 .fi
5423 .if n \{\
5424 .RE
5425 .\}
5426 .sp
5427 Return the size change of the installed system in kilobytes (kibibytes)\&.
5428 .sp
5429 .if n \{\
5430 .RS 4
5431 .\}
5432 .nf
5433 \fBvoid order(int\fR \fIflags\fR \fB= 0)\fR
5434 \fI$trans\fR\fB\->order()\fR;
5435 \fItrans\fR\fB\&.order()\fR
5436 \fItrans\fR\fB\&.order()\fR
5437 .fi
5438 .if n \{\
5439 .RE
5440 .\}
5441 .sp
5442 Order the steps in the transactions so that dependent packages are updated before packages that depend on them\&. For rpm, you can also use rpmlib\(cqs ordering functionality, debian\(cqs dpkg does not provide a way to order a transaction\&.
5443 .SS "ACTIVE/PASSIVE VIEW"
5444 .sp
5445 Active view lists what new packages get installed, while passive view shows what happens to the installed packages\&. Most often there\(cqs not much difference between the two modes, but things get interesting if multiple packages get replaced by one new package\&. Say you have installed packages A\-1\-1 and B\-1\-1, and now install A\-2\-1 which has a new dependency that obsoletes B\&. The transaction elements will be
5446 .sp
5447 .if n \{\
5448 .RS 4
5449 .\}
5450 .nf
5451 updated   A\-1\-1 (other: A\-2\-1)
5452 obsoleted B\-1\-1 (other: A\-2\-1)
5453 .fi
5454 .if n \{\
5455 .RE
5456 .\}
5457 .sp
5458 in passive mode, but
5459 .sp
5460 .if n \{\
5461 .RS 4
5462 .\}
5463 .nf
5464 update A\-2\-1 (other: A\-1\-1)
5465 erase  B
5466 .fi
5467 .if n \{\
5468 .RE
5469 .\}
5470 .sp
5471 in active mode\&. If the mode contains SOLVER_TRANSACTION_SHOW_ALL, the passive mode list will be unchanged but the active mode list will just contain A\-2\-1\&.
5472 .SH "THE TRANSACTIONCLASS CLASS"
5473 .sp
5474 Objects of this type are returned by the classify() Transaction method\&.
5475 .SS "ATTRIBUTES"
5476 .sp
5477 .if n \{\
5478 .RS 4
5479 .\}
5480 .nf
5481 \fBTransaction *transaction;\fR               /* read only */
5482 \fI$class\fR\fB\->{transaction}\fR
5483 \fIclass\fR\fB\&.transaction\fR
5484 \fIclass\fR\fB\&.transaction\fR
5485 .fi
5486 .if n \{\
5487 .RE
5488 .\}
5489 .sp
5490 Back pointer to transaction object\&.
5491 .sp
5492 .if n \{\
5493 .RS 4
5494 .\}
5495 .nf
5496 \fBint type;\fR                               /* read only */
5497 \fI$class\fR\fB\->{type}\fR
5498 \fIclass\fR\fB\&.type\fR
5499 \fIclass\fR\fB\&.type\fR
5500 .fi
5501 .if n \{\
5502 .RE
5503 .\}
5504 .sp
5505 The type of the transaction elements in the class\&.
5506 .sp
5507 .if n \{\
5508 .RS 4
5509 .\}
5510 .nf
5511 \fBint count;\fR                              /* read only */
5512 \fI$class\fR\fB\->{count}\fR
5513 \fIclass\fR\fB\&.count\fR
5514 \fIclass\fR\fB\&.count\fR
5515 .fi
5516 .if n \{\
5517 .RE
5518 .\}
5519 .sp
5520 The number of elements in the class\&.
5521 .sp
5522 .if n \{\
5523 .RS 4
5524 .\}
5525 .nf
5526 \fBconst char *\fR\fIfromstr\fR;
5527 \fI$class\fR\fB\->{fromstr}\fR
5528 \fIclass\fR\fB\&.fromstr\fR
5529 \fIclass\fR\fB\&.fromstr\fR
5530 .fi
5531 .if n \{\
5532 .RE
5533 .\}
5534 .sp
5535 The old vendor or architecture\&.
5536 .sp
5537 .if n \{\
5538 .RS 4
5539 .\}
5540 .nf
5541 \fBconst char *\fR\fItostr\fR;
5542 \fI$class\fR\fB\->{tostr}\fR
5543 \fIclass\fR\fB\&.tostr\fR
5544 \fIclass\fR\fB\&.tostr\fR
5545 .fi
5546 .if n \{\
5547 .RE
5548 .\}
5549 .sp
5550 The new vendor or architecture\&.
5551 .sp
5552 .if n \{\
5553 .RS 4
5554 .\}
5555 .nf
5556 \fBId\fR \fIfromid\fR;
5557 \fI$class\fR\fB\->{fromid}\fR
5558 \fIclass\fR\fB\&.fromid\fR
5559 \fIclass\fR\fB\&.fromid\fR
5560 .fi
5561 .if n \{\
5562 .RE
5563 .\}
5564 .sp
5565 The id of the old vendor or architecture\&.
5566 .sp
5567 .if n \{\
5568 .RS 4
5569 .\}
5570 .nf
5571 \fBId\fR \fItoid\fR;
5572 \fI$class\fR\fB\->{toid}\fR
5573 \fIclass\fR\fB\&.toid\fR
5574 \fIclass\fR\fB\&.toid\fR
5575 .fi
5576 .if n \{\
5577 .RE
5578 .\}
5579 .sp
5580 The id of the new vendor or architecture\&.
5581 .SS "METHODS"
5582 .sp
5583 .if n \{\
5584 .RS 4
5585 .\}
5586 .nf
5587 \fBvoid solvables()\fR;
5588 my \fI@solvables\fR \fB=\fR \fI$class\fR\fB\->solvables()\fR;
5589 \fIsolvables\fR \fB=\fR \fIclass\fR\fB\&.solvables()\fR
5590 \fIsolvables\fR \fB=\fR \fIclass\fR\fB\&.solvables()\fR
5591 .fi
5592 .if n \{\
5593 .RE
5594 .\}
5595 .sp
5596 Return the solvables for all transaction elements in the class\&.
5597 .SH "CHECKSUMS"
5598 .sp
5599 Checksums (also called hashes) are used to make sure that downloaded data is not corrupt and also as a fingerprint mechanism to check if data has changed\&.
5600 .SS "CLASS METHODS"
5601 .sp
5602 .if n \{\
5603 .RS 4
5604 .\}
5605 .nf
5606 \fBChksum Chksum(Id\fR \fItype\fR\fB)\fR
5607 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB)\fR;
5608 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB)\fR
5609 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB)\fR
5610 .fi
5611 .if n \{\
5612 .RE
5613 .\}
5614 .sp
5615 Create a checksum object\&. Currently the following types are supported:
5616 .sp
5617 .if n \{\
5618 .RS 4
5619 .\}
5620 .nf
5621 \fBREPOKEY_TYPE_MD5\fR
5622 \fBREPOKEY_TYPE_SHA1\fR
5623 \fBREPOKEY_TYPE_SHA224\fR
5624 \fBREPOKEY_TYPE_SHA256\fR
5625 \fBREPOKEY_TYPE_SHA384\fR
5626 \fBREPOKEY_TYPE_SHA512\fR
5627 .fi
5628 .if n \{\
5629 .RE
5630 .\}
5631 .sp
5632 These keys are constants in the \fBsolv\fR class\&.
5633 .sp
5634 .if n \{\
5635 .RS 4
5636 .\}
5637 .nf
5638 \fBChksum Chksum(Id\fR \fItype\fR\fB, const char *\fR\fIhex\fR\fB)\fR
5639 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB,\fR \fI$hex\fR\fB)\fR;
5640 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
5641 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
5642 .fi
5643 .if n \{\
5644 .RE
5645 .\}
5646 .sp
5647 Create an already finalized checksum object from a hex string\&.
5648 .sp
5649 .if n \{\
5650 .RS 4
5651 .\}
5652 .nf
5653 \fBChksum Chksum_from_bin(Id\fR \fItype\fR\fB, char *\fR\fIbin\fR\fB)\fR
5654 my \fI$chksum\fR \fB= solv::Chksum\->from_bin(\fR\fI$type\fR\fB,\fR \fI$bin\fR\fB)\fR;
5655 \fIchksum\fR \fB= solv\&.Chksum\&.from_bin(\fR\fItype\fR\fB,\fR \fIbin\fR\fB)\fR
5656 \fIchksum\fR \fB= Solv::Chksum\&.from_bin(\fR\fItype\fR\fB,\fR \fIbin\fR\fB)\fR
5657 .fi
5658 .if n \{\
5659 .RE
5660 .\}
5661 .sp
5662 Create an already finalized checksum object from a binary checksum\&.
5663 .SS "ATTRIBUTES"
5664 .sp
5665 .if n \{\
5666 .RS 4
5667 .\}
5668 .nf
5669 \fBId type;\fR                        /* read only */
5670 \fI$chksum\fR\fB\->{type}\fR
5671 \fIchksum\fR\fB\&.type\fR
5672 \fIchksum\fR\fB\&.type\fR
5673 .fi
5674 .if n \{\
5675 .RE
5676 .\}
5677 .sp
5678 Return the type of the checksum object\&.
5679 .SS "METHODS"
5680 .sp
5681 .if n \{\
5682 .RS 4
5683 .\}
5684 .nf
5685 \fBvoid add(const char *\fR\fIstr\fR\fB)\fR
5686 \fI$chksum\fR\fB\->add(\fR\fI$str\fR\fB)\fR;
5687 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
5688 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
5689 .fi
5690 .if n \{\
5691 .RE
5692 .\}
5693 .sp
5694 Add a (binary) string to the checksum\&.
5695 .sp
5696 .if n \{\
5697 .RS 4
5698 .\}
5699 .nf
5700 \fBvoid add_fp(FILE *\fR\fIfp\fR\fB)\fR
5701 \fI$chksum\fR\fB\->add_fp(\fR\fI$file\fR\fB)\fR;
5702 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
5703 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
5704 .fi
5705 .if n \{\
5706 .RE
5707 .\}
5708 .sp
5709 Add the contents of a file to the checksum\&.
5710 .sp
5711 .if n \{\
5712 .RS 4
5713 .\}
5714 .nf
5715 \fBvoid add_stat(const char *\fR\fIfilename\fR\fB)\fR
5716 \fI$chksum\fR\fB\->add_stat(\fR\fI$filename\fR\fB)\fR;
5717 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
5718 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
5719 .fi
5720 .if n \{\
5721 .RE
5722 .\}
5723 .sp
5724 Stat the file and add the dev/ino/size/mtime member to the checksum\&. If the stat fails, the members are zeroed\&.
5725 .sp
5726 .if n \{\
5727 .RS 4
5728 .\}
5729 .nf
5730 \fBvoid add_fstat(int\fR \fIfd\fR\fB)\fR
5731 \fI$chksum\fR\fB\->add_fstat(\fR\fI$fd\fR\fB)\fR;
5732 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
5733 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
5734 .fi
5735 .if n \{\
5736 .RE
5737 .\}
5738 .sp
5739 Same as add_stat, but instead of the filename a file descriptor is used\&.
5740 .sp
5741 .if n \{\
5742 .RS 4
5743 .\}
5744 .nf
5745 \fBunsigned char *raw()\fR
5746 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->raw()\fR;
5747 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
5748 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
5749 .fi
5750 .if n \{\
5751 .RE
5752 .\}
5753 .sp
5754 Finalize the checksum and return the result as raw bytes\&. This means that the result can contain NUL bytes or unprintable characters\&.
5755 .sp
5756 .if n \{\
5757 .RS 4
5758 .\}
5759 .nf
5760 \fBconst char *hex()\fR
5761 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->hex()\fR;
5762 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
5763 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
5764 .fi
5765 .if n \{\
5766 .RE
5767 .\}
5768 .sp
5769 Finalize the checksum and return the result as hex string\&.
5770 .sp
5771 .if n \{\
5772 .RS 4
5773 .\}
5774 .nf
5775 \fBconst char *typestr()\fR
5776 my \fI$typestr\fR \fB=\fR \fI$chksum\fR\fB\->typestr()\fR;
5777 \fItypestr\fR \fB=\fR \fIchksum\fR\fB\&.typestr\fR
5778 \fItypestr\fR \fB=\fR \fIchksum\fR\fB\&.typestr\fR
5779 .fi
5780 .if n \{\
5781 .RE
5782 .\}
5783 .sp
5784 Return the type of the checksum as a string, e\&.g\&. "sha256"\&.
5785 .sp
5786 .if n \{\
5787 .RS 4
5788 .\}
5789 .nf
5790 \fB<equality>\fR
5791 \fBif (\fR\fI$chksum1\fR \fB==\fR \fI$chksum2\fR\fB)\fR
5792 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR\fB:\fR
5793 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR
5794 .fi
5795 .if n \{\
5796 .RE
5797 .\}
5798 .sp
5799 Checksums are equal if they are of the same type and the finalized results are the same\&.
5800 .sp
5801 .if n \{\
5802 .RS 4
5803 .\}
5804 .nf
5805 \fB<stringification>\fR
5806 my \fI$str\fR \fB=\fR \fI$chksum\fR\fB\->str\fR;
5807 \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR
5808 \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR
5809 .fi
5810 .if n \{\
5811 .RE
5812 .\}
5813 .sp
5814 If the checksum is finished, the checksum is returned as "<type>:<hex>" string\&. Otherwise "<type>:unfinished" is returned\&.
5815 .SH "FILE MANAGEMENT"
5816 .sp
5817 This functions were added because libsolv uses standard \fBFILE\fR pointers to read/write files, but languages like perl have their own implementation of files\&. The libsolv functions also support decompression and compression, the algorithm is selected by looking at the file name extension\&.
5818 .sp
5819 .if n \{\
5820 .RS 4
5821 .\}
5822 .nf
5823 \fBFILE *xfopen(char *\fR\fIfn\fR\fB, char *\fR\fImode\fR \fB= "r")\fR
5824 my \fI$file\fR \fB= solv::xfopen(\fR\fI$path\fR\fB)\fR;
5825 \fIfile\fR \fB= solv\&.xfopen(\fR\fIpath\fR\fB)\fR
5826 \fIfile\fR \fB= Solv::xfopen(\fR\fIpath\fR\fB)\fR
5827 .fi
5828 .if n \{\
5829 .RE
5830 .\}
5831 .sp
5832 Open a file at the specified path\&. The mode argument is passed on to the stdio library\&.
5833 .sp
5834 .if n \{\
5835 .RS 4
5836 .\}
5837 .nf
5838 \fBFILE *xfopen_fd(char *\fR\fIfn\fR\fB, int\fR \fIfileno\fR\fB)\fR
5839 my \fI$file\fR \fB= solv::xfopen_fd(\fR\fI$path\fR\fB,\fR \fI$fileno\fR\fB)\fR;
5840 \fIfile\fR \fB= solv\&.xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
5841 \fIfile\fR \fB= Solv::xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
5842 .fi
5843 .if n \{\
5844 .RE
5845 .\}
5846 .sp
5847 Create a file handle from the specified file descriptor\&. The path argument is only used to select the correct (de\-)compression algorithm, use an empty path if you want to make sure to read/write raw data\&. The file descriptor is dup()ed before the file handle is created\&.
5848 .SS "METHODS"
5849 .sp
5850 .if n \{\
5851 .RS 4
5852 .\}
5853 .nf
5854 \fBint fileno()\fR
5855 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->fileno()\fR;
5856 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
5857 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
5858 .fi
5859 .if n \{\
5860 .RE
5861 .\}
5862 .sp
5863 Return file file descriptor of the file\&. If the file is not open, \-1 is returned\&.
5864 .sp
5865 .if n \{\
5866 .RS 4
5867 .\}
5868 .nf
5869 \fBvoid cloexec(bool\fR \fIstate\fR\fB)\fR
5870 \fI$file\fR\fB\->cloexec(\fR\fI$state\fR\fB)\fR;
5871 \fIfile\fR\fB\&.cloexec(\fR\fIstate\fR\fB)\fR
5872 \fIfile\fR\fB\&.cloexec(\fR\fIstate\fR\fB)\fR
5873 .fi
5874 .if n \{\
5875 .RE
5876 .\}
5877 .sp
5878 Set the close\-on\-exec flag of the file descriptor\&. The xfopen function returns files with close\-on\-exec turned on, so if you want to pass a file to some other process you need to call cloexec(0) before calling exec\&.
5879 .sp
5880 .if n \{\
5881 .RS 4
5882 .\}
5883 .nf
5884 \fBint dup()\fR
5885 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->dup()\fR;
5886 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
5887 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
5888 .fi
5889 .if n \{\
5890 .RE
5891 .\}
5892 .sp
5893 Return a copy of the descriptor of the file\&. If the file is not open, \-1 is returned\&.
5894 .sp
5895 .if n \{\
5896 .RS 4
5897 .\}
5898 .nf
5899 \fBbool flush()\fR
5900 \fI$file\fR\fB\->flush()\fR;
5901 \fIfile\fR\fB\&.flush()\fR
5902 \fIfile\fR\fB\&.flush()\fR
5903 .fi
5904 .if n \{\
5905 .RE
5906 .\}
5907 .sp
5908 Flush the file\&. Returns false if there was an error\&. Flushing a closed file always returns true\&.
5909 .sp
5910 .if n \{\
5911 .RS 4
5912 .\}
5913 .nf
5914 \fBbool close()\fR
5915 \fI$file\fR\fB\->close()\fR;
5916 \fIfile\fR\fB\&.close()\fR
5917 \fIfile\fR\fB\&.close()\fR
5918 .fi
5919 .if n \{\
5920 .RE
5921 .\}
5922 .sp
5923 Close the file\&. This is needed for languages like Ruby that do not destruct objects right after they are no longer referenced\&. In that case, it is good style to close open files so that the file descriptors are freed right away\&. Returns false if there was an error\&.
5924 .SH "THE REPODATA CLASS"
5925 .sp
5926 The Repodata stores attributes for packages and the repository itself, each repository can have multiple repodata areas\&. You normally only need to directly access them if you implement lazy downloading of repository data\&. Repodata areas are created by calling the repository\(cqs add_repodata() method or by using repo_add methods without the REPO_REUSE_REPODATA or REPO_USE_LOADING flag\&.
5927 .SS "ATTRIBUTES"
5928 .sp
5929 .if n \{\
5930 .RS 4
5931 .\}
5932 .nf
5933 \fBRepo *repo;\fR                     /* read only */
5934 \fI$data\fR\fB\->{repo}\fR
5935 \fIdata\fR\fB\&.repo\fR
5936 \fIdata\fR\fB\&.repo\fR
5937 .fi
5938 .if n \{\
5939 .RE
5940 .\}
5941 .sp
5942 Back pointer to repository object\&.
5943 .sp
5944 .if n \{\
5945 .RS 4
5946 .\}
5947 .nf
5948 \fBId id;\fR                                  /* read only */
5949 \fI$data\fR\fB\->{id}\fR
5950 \fIdata\fR\fB\&.id\fR
5951 \fIdata\fR\fB\&.id\fR
5952 .fi
5953 .if n \{\
5954 .RE
5955 .\}
5956 .sp
5957 The id of the repodata area\&. Repodata ids of different repositories overlap\&.
5958 .SS "METHODS"
5959 .sp
5960 .if n \{\
5961 .RS 4
5962 .\}
5963 .nf
5964 \fBinternalize()\fR
5965 \fI$data\fR\fB\->internalize()\fR;
5966 \fIdata\fR\fB\&.internalize()\fR
5967 \fIdata\fR\fB\&.internalize()\fR
5968 .fi
5969 .if n \{\
5970 .RE
5971 .\}
5972 .sp
5973 Internalize newly added data\&. The lookup functions will only see the new data after it has been internalized\&.
5974 .sp
5975 .if n \{\
5976 .RS 4
5977 .\}
5978 .nf
5979 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR
5980 \fI$data\fR\fB\->write(\fR\fI$fp\fR\fB)\fR;
5981 \fIdata\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
5982 \fIdata\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
5983 .fi
5984 .if n \{\
5985 .RE
5986 .\}
5987 .sp
5988 Write the contents of the repodata area as solv file\&.
5989 .sp
5990 .if n \{\
5991 .RS 4
5992 .\}
5993 .nf
5994 \fBId str2dir(const char *\fR\fIdir\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
5995 my \fI$did\fR \fB=\fR \fIdata\fR\fB\->str2dir(\fR\fI$dir\fR\fB)\fR;
5996 \fIdid\fR \fB=\fR \fIdata\fR\fB\&.str2dir(\fR\fIdir\fR\fB)\fR
5997 \fIdid\fR \fB=\fR \fIdata\fR\fB\&.str2dir(\fR\fIdir\fR\fB)\fR
5998 .fi
5999 .if n \{\
6000 .RE
6001 .\}
6002 .sp
6003 .if n \{\
6004 .RS 4
6005 .\}
6006 .nf
6007 \fBconst char *dir2str(Id\fR \fIdid\fR\fB, const char *\fR\fIsuffix\fR \fB= 0)\fR
6008 \fI$dir\fR \fB=\fR \fIpool\fR\fB\->dir2str(\fR\fI$did\fR\fB)\fR;
6009 \fIdir\fR \fB=\fR \fIpool\fR\fB\&.dir2str(\fR\fIdid\fR\fB)\fR
6010 \fIdir\fR \fB=\fR \fIpool\fR\fB\&.dir2str(\fR\fIdid\fR\fB)\fR
6011 .fi
6012 .if n \{\
6013 .RE
6014 .\}
6015 .sp
6016 Convert a string (directory) into an Id and back\&. If the string is currently not in the pool and \fIcreate\fR is false, zero is returned\&.
6017 .sp
6018 .if n \{\
6019 .RS 4
6020 .\}
6021 .nf
6022 \fBvoid add_dirstr(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fIdir\fR\fB, const char *\fR\fIstr\fR\fB)\fR
6023 \fI$data\fR\fB\->add_dirstr(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$dir\fR\fB,\fR \fI$string\fR\fB)\fR;
6024 \fIdata\fR\fB\&.add_dirstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIdir\fR\fB,\fR \fIstring\fR\fB)\fR
6025 \fIdata\fR\fB\&.add_dirstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIdir\fR\fB,\fR \fIstring\fR\fB)\fR
6026 .fi
6027 .if n \{\
6028 .RE
6029 .\}
6030 .sp
6031 Add a file path consisting of a dirname Id and a basename string\&.
6032 .sp
6033 .if n \{\
6034 .RS 4
6035 .\}
6036 .nf
6037 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
6038 \fI$data\fR\fB\->add_solv(\fR\fI$fp\fR\fB)\fR;
6039 \fIdata\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
6040 \fIdata\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
6041 .fi
6042 .if n \{\
6043 .RE
6044 .\}
6045 .sp
6046 Replace a stub repodata object with the data from a solv file\&. This method automatically adds the REPO_USE_LOADING flag\&. It should only be used from a load callback\&.
6047 .sp
6048 .if n \{\
6049 .RS 4
6050 .\}
6051 .nf
6052 \fBvoid create_stubs()\fR
6053 \fI$data\fR\fB\->create_stubs()\fR;
6054 \fIdata\fR\fB\&.create_stubs()\fR
6055 \fIdata\fR\fB\&.create_stubs()\fR
6056 .fi
6057 .if n \{\
6058 .RE
6059 .\}
6060 .sp
6061 Create stub repodatas from the information stored in the repodata meta area\&.
6062 .sp
6063 .if n \{\
6064 .RS 4
6065 .\}
6066 .nf
6067 \fBvoid extend_to_repo()\fR
6068 \fI$data\fR\fB\->extend_to_repo()\fR;
6069 \fIdata\fR\fB\&.extend_to_repo()\fR
6070 \fIdata\fR\fB\&.extend_to_repo()\fR
6071 .fi
6072 .if n \{\
6073 .RE
6074 .\}
6075 .sp
6076 Extend the repodata so that it has the same size as the repo it belongs to\&. This method is needed when setting up a new extension repodata so that it matches the repository size\&. It is also needed when switching to a just written repodata extension to make the repodata match the written extension (which is always of the size of the repo)\&.
6077 .sp
6078 .if n \{\
6079 .RS 4
6080 .\}
6081 .nf
6082 \fB<equality>\fR
6083 \fBif (\fR\fI$data1\fR \fB==\fR \fI$data2\fR\fB)\fR
6084 \fBif\fR \fIdata1\fR \fB==\fR \fIdata2\fR\fB:\fR
6085 \fBif\fR \fIdata1\fR \fB==\fR \fIdata2\fR
6086 .fi
6087 .if n \{\
6088 .RE
6089 .\}
6090 .sp
6091 Two repodata objects are equal if they belong to the same repository and have the same id\&.
6092 .SS "DATA RETRIEVAL METHODS"
6093 .sp
6094 .if n \{\
6095 .RS 4
6096 .\}
6097 .nf
6098 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6099 my \fI$string\fR \fB=\fR \fI$data\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6100 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6101 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6102 .fi
6103 .if n \{\
6104 .RE
6105 .\}
6106 .sp
6107 .if n \{\
6108 .RS 4
6109 .\}
6110 .nf
6111 \fBconst char *lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6112 my \fI$string\fR \fB=\fR \fI$data\fR\fB\->lookup_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6113 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6114 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6115 .fi
6116 .if n \{\
6117 .RE
6118 .\}
6119 .sp
6120 .if n \{\
6121 .RS 4
6122 .\}
6123 .nf
6124 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
6125 my \fI$num\fR \fB=\fR \fI$data\fR\fB\->lookup_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6126 \fInum\fR \fB=\fR \fIdata\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6127 \fInum\fR \fB=\fR \fIdata\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6128 .fi
6129 .if n \{\
6130 .RE
6131 .\}
6132 .sp
6133 .if n \{\
6134 .RS 4
6135 .\}
6136 .nf
6137 \fBbool lookup_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6138 my \fI$bool\fR \fB=\fR \fI$data\fR\fB\->lookup_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6139 \fIbool\fR \fB=\fR \fIdata\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6140 \fIbool\fR \fB=\fR \fIdata\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6141 .fi
6142 .if n \{\
6143 .RE
6144 .\}
6145 .sp
6146 .if n \{\
6147 .RS 4
6148 .\}
6149 .nf
6150 \fBId *lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6151 my \fI@ids\fR \fB=\fR \fI$data\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6152 \fIids\fR \fB=\fR \fIdata\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6153 \fIids\fR \fB=\fR \fIdata\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6154 .fi
6155 .if n \{\
6156 .RE
6157 .\}
6158 .sp
6159 .if n \{\
6160 .RS 4
6161 .\}
6162 .nf
6163 \fBChksum lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6164 my \fI$chksum\fR \fB=\fR \fI$data\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6165 \fIchksum\fR \fB=\fR \fIdata\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6166 \fIchksum\fR \fB=\fR \fIdata\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6167 .fi
6168 .if n \{\
6169 .RE
6170 .\}
6171 .sp
6172 Lookup functions\&. Return the data element stored in the specified solvable\&. The methods probably only make sense to retrieve data from the special SOLVID_META solvid that stores repodata meta information\&.
6173 .SS "DATA STORAGE METHODS"
6174 .sp
6175 .if n \{\
6176 .RS 4
6177 .\}
6178 .nf
6179 \fBvoid set_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fIstr\fR\fB)\fR
6180 \fI$data\fR\fB\->set_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$str\fR\fB)\fR;
6181 \fIdata\fR\fB\&.set_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
6182 \fIdata\fR\fB\&.set_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
6183 .fi
6184 .if n \{\
6185 .RE
6186 .\}
6187 .sp
6188 .if n \{\
6189 .RS 4
6190 .\}
6191 .nf
6192 \fBvoid set_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR
6193 \fI$data\fR\fB\->set_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
6194 \fIdata\fR\fB\&.set_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
6195 \fIdata\fR\fB\&.set_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
6196 .fi
6197 .if n \{\
6198 .RE
6199 .\}
6200 .sp
6201 .if n \{\
6202 .RS 4
6203 .\}
6204 .nf
6205 \fBvoid set_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInum\fR\fB)\fR
6206 \fI$data\fR\fB\->set_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$num\fR\fB)\fR;
6207 \fIdata\fR\fB\&.set_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fInum\fR\fB)\fR
6208 \fIdata\fR\fB\&.set_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fInum\fR\fB)\fR
6209 .fi
6210 .if n \{\
6211 .RE
6212 .\}
6213 .sp
6214 .if n \{\
6215 .RS 4
6216 .\}
6217 .nf
6218 \fBvoid set_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6219 \fI$data\fR\fB\->set_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6220 \fIdata\fR\fB\&.set_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6221 \fIdata\fR\fB\&.set_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6222 .fi
6223 .if n \{\
6224 .RE
6225 .\}
6226 .sp
6227 .if n \{\
6228 .RS 4
6229 .\}
6230 .nf
6231 \fBvoid set_poolstr(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fIstr\fR\fB)\fR
6232 \fI$data\fR\fB\->set_poolstr(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$str\fR\fB)\fR;
6233 \fIdata\fR\fB\&.set_poolstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
6234 \fIdata\fR\fB\&.set_poolstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
6235 .fi
6236 .if n \{\
6237 .RE
6238 .\}
6239 .sp
6240 .if n \{\
6241 .RS 4
6242 .\}
6243 .nf
6244 \fBvoid set_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Chksum *\fR\fIchksum\fR\fB)\fR
6245 \fI$data\fR\fB\->set_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$chksum\fR\fB)\fR;
6246 \fIdata\fR\fB\&.set_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIchksum\fR\fB)\fR
6247 \fIdata\fR\fB\&.set_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIchksum\fR\fB)\fR
6248 .fi
6249 .if n \{\
6250 .RE
6251 .\}
6252 .sp
6253 .if n \{\
6254 .RS 4
6255 .\}
6256 .nf
6257 \fBvoid set_sourcepkg(Id\fR \fIsolvid\fR\fB, const char *\fR\fIsourcepkg\fR\fB)\fR
6258 \fI$data\fR\fB\&.set_sourcepkg(\fR\fI$solvid\fR\fB,\fR \fI$sourcepkg\fR\fB)\fR;
6259 \fIdata\fR\fB\&.set_sourcepkg(\fR\fIsolvid\fR\fB,\fR \fIsourcepkg\fR\fB)\fR
6260 \fIdata\fR\fB\&.set_sourcepkg(\fR\fIsolvid\fR\fB,\fR \fIsourcepkg\fR\fB)\fR
6261 .fi
6262 .if n \{\
6263 .RE
6264 .\}
6265 .sp
6266 .if n \{\
6267 .RS 4
6268 .\}
6269 .nf
6270 \fBvoid set_location(Id\fR \fIsolvid\fR\fB, unsigned int\fR \fImediano\fR\fB, const char *\fR\fIlocation\fR\fB)\fR
6271 \fI$data\fR\fB\&.set_location(\fR\fI$solvid\fR\fB,\fR \fI$mediano\fR\fB,\fR \fI$location\fR\fB)\fR;
6272 \fIdata\fR\fB\&.set_location(\fR\fIsolvid\fR\fB,\fR \fImediano\fR\fB,\fR \fIlocation\fR\fB)\fR
6273 \fIdata\fR\fB\&.set_location(\fR\fIsolvid\fR\fB,\fR \fImediano\fR\fB,\fR \fIlocation\fR\fB)\fR
6274 .fi
6275 .if n \{\
6276 .RE
6277 .\}
6278 .sp
6279 .if n \{\
6280 .RS 4
6281 .\}
6282 .nf
6283 \fBvoid add_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR
6284 \fI$data\fR\fB\->add_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
6285 \fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
6286 \fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
6287 .fi
6288 .if n \{\
6289 .RE
6290 .\}
6291 .sp
6292 .if n \{\
6293 .RS 4
6294 .\}
6295 .nf
6296 \fBId new_handle()\fR
6297 my \fI$handle\fR \fB=\fR \fI$data\fR\fB\->new_handle()\fR;
6298 \fIhandle\fR \fB=\fR \fIdata\fR\fB\&.new_handle()\fR
6299 \fIhandle\fR \fB=\fR \fIdata\fR\fB\&.new_handle()\fR
6300 .fi
6301 .if n \{\
6302 .RE
6303 .\}
6304 .sp
6305 .if n \{\
6306 .RS 4
6307 .\}
6308 .nf
6309 \fBvoid add_flexarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fIhandle\fR\fB)\fR
6310 \fI$data\fR\fB\->add_flexarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$handle\fR\fB)\fR;
6311 \fIdata\fR\fB\&.add_flexarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIhandle\fR\fB)\fR
6312 \fIdata\fR\fB\&.add_flexarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIhandle\fR\fB)\fR
6313 .fi
6314 .if n \{\
6315 .RE
6316 .\}
6317 .sp
6318 .if n \{\
6319 .RS 4
6320 .\}
6321 .nf
6322 \fBvoid unset(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6323 \fI$data\fR\fB\->unset(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6324 \fIdata\fR\fB\&.unset(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6325 \fIdata\fR\fB\&.unset(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6326 .fi
6327 .if n \{\
6328 .RE
6329 .\}
6330 .sp
6331 Data storage methods\&. Probably only useful to store data in the special SOLVID_META solvid that stores repodata meta information\&. Note that repodata areas can have their own Id pool (see the REPO_LOCALPOOL flag), so be careful if you need to store ids\&. Arrays are created by calling the add function for every element\&. A flexarray is an array of sub\-structures, call new_handle to create a new structure, use the handle as solvid to fill the structure with data and call add_flexarray to put the structure in an array\&.
6332 .SH "THE DATAPOS CLASS"
6333 .sp
6334 Datapos objects describe a specific position in the repository data area\&. Thus they are only valid until the repository is modified in some way\&. Datapos objects can be created by the pos() and parentpos() methods of a Datamatch object or by accessing the \(lqmeta\(rq attribute of a repository\&.
6335 .SS "ATTRIBUTES"
6336 .sp
6337 .if n \{\
6338 .RS 4
6339 .\}
6340 .nf
6341 \fBRepo *repo;\fR                     /* read only */
6342 \fI$data\fR\fB\->{repo}\fR
6343 \fIdata\fR\fB\&.repo\fR
6344 \fIdata\fR\fB\&.repo\fR
6345 .fi
6346 .if n \{\
6347 .RE
6348 .\}
6349 .sp
6350 Back pointer to repository object\&.
6351 .SS "METHODS"
6352 .sp
6353 .if n \{\
6354 .RS 4
6355 .\}
6356 .nf
6357 \fBDataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
6358 my \fI$di\fR \fB=\fR \fI$datapos\fR\fB\->Dataiterator(\fR\fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
6359 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
6360 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
6361 .fi
6362 .if n \{\
6363 .RE
6364 .\}
6365 .sp
6366 Create a Dataiterator at the position of the datapos object\&.
6367 .sp
6368 .if n \{\
6369 .RS 4
6370 .\}
6371 .nf
6372 \fBconst char *lookup_deltalocation(unsigned int *\fR\fIOUTPUT\fR\fB)\fR
6373 my \fB(\fR\fI$location\fR\fB,\fR \fI$mediano\fR\fB) =\fR \fI$datapos\fR\fB\->lookup_deltalocation()\fR;
6374 \fIlocation\fR\fB,\fR \fImediano\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltalocation()\fR
6375 \fIlocation\fR\fB,\fR \fImediano\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltalocation()\fR
6376 .fi
6377 .if n \{\
6378 .RE
6379 .\}
6380 .sp
6381 Return a tuple containing the on\-media location and an optional media number for a delta rpm\&. This obviously only works if the data position points to structure describing a delta rpm\&.
6382 .sp
6383 .if n \{\
6384 .RS 4
6385 .\}
6386 .nf
6387 \fBconst char *lookup_deltaseq()\fR
6388 my \fI$seq\fR \fB=\fR \fI$datapos\fR\fB\->lookup_deltaseq()\fR;
6389 \fIseq\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltaseq()\fR;
6390 \fIseq\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltaseq()\fR;
6391 .fi
6392 .if n \{\
6393 .RE
6394 .\}
6395 .sp
6396 Return the delta rpm sequence from the structure describing a delta rpm\&.
6397 .SS "DATA RETRIEVAL METHODS"
6398 .sp
6399 .if n \{\
6400 .RS 4
6401 .\}
6402 .nf
6403 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
6404 my \fI$string\fR \fB=\fR \fI$datapos\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
6405 \fIstring\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
6406 \fIstring\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
6407 .fi
6408 .if n \{\
6409 .RE
6410 .\}
6411 .sp
6412 .if n \{\
6413 .RS 4
6414 .\}
6415 .nf
6416 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6417 my \fI$id\fR \fB=\fR \fI$datapos\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
6418 \fIid\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
6419 \fIid\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
6420 .fi
6421 .if n \{\
6422 .RE
6423 .\}
6424 .sp
6425 .if n \{\
6426 .RS 4
6427 .\}
6428 .nf
6429 \fBunsigned long long lookup_num(Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
6430 my \fI$num\fR \fB=\fR \fI$datapos\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
6431 \fInum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
6432 \fInum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
6433 .fi
6434 .if n \{\
6435 .RE
6436 .\}
6437 .sp
6438 .if n \{\
6439 .RS 4
6440 .\}
6441 .nf
6442 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
6443 my \fI$bool\fR \fB=\fR \fI$datapos\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
6444 \fIbool\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
6445 \fIbool\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
6446 .fi
6447 .if n \{\
6448 .RE
6449 .\}
6450 .sp
6451 .if n \{\
6452 .RS 4
6453 .\}
6454 .nf
6455 \fBId *lookup_idarray(Id\fR \fIkeyname\fR\fB)\fR
6456 my \fI@ids\fR \fB=\fR \fI$datapos\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
6457 \fIids\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
6458 \fIids\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
6459 .fi
6460 .if n \{\
6461 .RE
6462 .\}
6463 .sp
6464 .if n \{\
6465 .RS 4
6466 .\}
6467 .nf
6468 \fBChksum lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
6469 my \fI$chksum\fR \fB=\fR \fI$datapos\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
6470 \fIchksum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
6471 \fIchksum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
6472 .fi
6473 .if n \{\
6474 .RE
6475 .\}
6476 .sp
6477 Lookup functions\&. Note that the returned Ids are always translated into the Ids of the global pool even if the repodata area contains its own pool\&.
6478 .sp
6479 .if n \{\
6480 .RS 4
6481 .\}
6482 .nf
6483 \fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
6484 my \fI$di\fR \fB=\fR \fI$datapos\fR\fB\->Dataiterator(\fR\fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
6485 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
6486 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
6487 .fi
6488 .if n \{\
6489 .RE
6490 .\}
6491 .sp
6492 .if n \{\
6493 .RS 4
6494 .\}
6495 .nf
6496 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
6497 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
6498 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
6499 .fi
6500 .if n \{\
6501 .RE
6502 .\}
6503 .sp
6504 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
6505 .SH "THE ALTERNATIVE CLASS"
6506 .sp
6507 An Alternative object describes a branch point in the solving process\&. The solver found more than one good way to fulfill a dependency and chose one\&. It recorded the other possibilities in the alternative object so that they can be presented to the user in the case a different solution is preferable\&.
6508 .SS "ATTRIBUTES"
6509 .sp
6510 .if n \{\
6511 .RS 4
6512 .\}
6513 .nf
6514 \fBSolver *solv;\fR                   /* read only */
6515 \fI$alternative\fR\fB\->{solv}\fR
6516 \fIalternative\fR\fB\&.solv\fR
6517 \fIalternative\fR\fB\&.solv\fR
6518 .fi
6519 .if n \{\
6520 .RE
6521 .\}
6522 .sp
6523 Back pointer to solver object\&.
6524 .sp
6525 .if n \{\
6526 .RS 4
6527 .\}
6528 .nf
6529 \fBId type;\fR                        /* read only */
6530 \fI$alternative\fR\fB\->{type}\fR
6531 \fIalternative\fR\fB\&.type\fR
6532 \fIalternative\fR\fB\&.type\fR
6533 .fi
6534 .if n \{\
6535 .RE
6536 .\}
6537 .sp
6538 The type of the alternative\&. Alternatives can be created because of rule fulfillment, because of recommended packages, and because of suggested packages (currently unused)\&. See below for a list of valid types\&.
6539 .sp
6540 .if n \{\
6541 .RS 4
6542 .\}
6543 .nf
6544 \fBRule rule;\fR                      /* read only */
6545 \fI$alternative\fR\fB\->{rule}\fR
6546 \fIalternative\fR\fB\&.rule\fR
6547 \fIalternative\fR\fB\&.rule\fR
6548 .fi
6549 .if n \{\
6550 .RE
6551 .\}
6552 .sp
6553 The rule that caused the creation of the alternative (SOLVER_ALTERNATIVE_TYPE_RULE)\&.
6554 .sp
6555 .if n \{\
6556 .RS 4
6557 .\}
6558 .nf
6559 \fBDep *dep;\fR                       /* read only */
6560 \fI$ruleinfo\fR\fB\->{dep}\fR
6561 \fIruleinfo\fR\fB\&.dep\fR
6562 \fIruleinfo\fR\fB\&.dep\fR
6563 .fi
6564 .if n \{\
6565 .RE
6566 .\}
6567 .sp
6568 The dependency that caused the creation of the alternative (SOLVER_ALTERNATIVE_TYPE_RECOMMENDS)\&.
6569 .sp
6570 .if n \{\
6571 .RS 4
6572 .\}
6573 .nf
6574 \fBDep *depsolvable;\fR               /* read only */
6575 \fI$ruleinfo\fR\fB\->{depsolvable}\fR
6576 \fIruleinfo\fR\fB\&.depsolvable\fR
6577 \fIruleinfo\fR\fB\&.depsolvable\fR
6578 .fi
6579 .if n \{\
6580 .RE
6581 .\}
6582 .sp
6583 The package containing the dependency (SOLVER_ALTERNATIVE_TYPE_RECOMMENDS)\&.
6584 .sp
6585 .if n \{\
6586 .RS 4
6587 .\}
6588 .nf
6589 \fBSolvable chosen;\fR                /* read only */
6590 \fI$alternative\fR\fB\->{chosen}\fR
6591 \fIalternative\fR\fB\&.chosen\fR
6592 \fIalternative\fR\fB\&.chosen\fR
6593 .fi
6594 .if n \{\
6595 .RE
6596 .\}
6597 .sp
6598 The solvable that the solver chose from the alternative\(cqs package set\&.
6599 .SS "CONSTANTS"
6600 .PP
6601 \fBSOLVER_ALTERNATIVE_TYPE_RULE\fR
6602 .RS 4
6603 The alternative was created when fulfilling a rule\&.
6604 .RE
6605 .PP
6606 \fBSOLVER_ALTERNATIVE_TYPE_RECOMMENDS\fR
6607 .RS 4
6608 The alternative was created when fulfilling a recommends dependency\&.
6609 .RE
6610 .PP
6611 \fBSOLVER_ALTERNATIVE_TYPE_SUGGESTS\fR
6612 .RS 4
6613 The alternative was created when fulfilling a suggests dependency\&.
6614 .RE
6615 .SS "METHODS"
6616 .sp
6617 .if n \{\
6618 .RS 4
6619 .\}
6620 .nf
6621 \fBSolvable *choices()\fR
6622 my \fI@choices\fR \fB=\fR \fI$alternative\fR\fB\->choices()\fR;
6623 \fIchoices\fR \fB=\fR \fIalternative\fR\fB\&.choices\fR
6624 \fIchoices\fR \fB=\fR \fIalternative\fR\fB\&.choices\fR
6625 .fi
6626 .if n \{\
6627 .RE
6628 .\}
6629 .sp
6630 Return the set of solvables that the solver could choose from when creating the alternative\&.
6631 .sp
6632 .if n \{\
6633 .RS 4
6634 .\}
6635 .nf
6636 \fB<stringification>\fR
6637 my \fI$str\fR \fB=\fR \fI$alternative\fR\fB\->str\fR;
6638 \fIstr\fR \fB= str(\fR\fIalternative\fR\fB)\fR
6639 \fIstr\fR \fB=\fR \fIalternative\fR\fB\&.to_s\fR
6640 .fi
6641 .if n \{\
6642 .RE
6643 .\}
6644 .sp
6645 Return a string describing the alternative\&.
6646 .SH "THE DECISION CLASS"
6647 .sp
6648 A decision is created when the solver fulfills dependencies\&. It can be either to install a package to satisfy a dependency or to conflict a dependency because it conflicts with another package or its dependencies cannot be met\&. Most decisions are caused by rule processing, but there are some other types like orphaned package handling or weak dependency handling\&.
6649 .SS "ATTRIBUTES"
6650 .sp
6651 .if n \{\
6652 .RS 4
6653 .\}
6654 .nf
6655 \fBSolver *solv;\fR                   /* read only */
6656 \fI$decision\fR\fB\->{solv}\fR
6657 \fIdecision\fR\fB\&.solv\fR
6658 \fIdecision\fR\fB\&.solv\fR
6659 .fi
6660 .if n \{\
6661 .RE
6662 .\}
6663 .sp
6664 Back pointer to solver object\&.
6665 .sp
6666 .if n \{\
6667 .RS 4
6668 .\}
6669 .nf
6670 \fBId p;\fR                           /* read only */
6671 \fI$decision\fR\fB\->{p}\fR
6672 \fIdecision\fR\fB\&.p\fR
6673 \fIdecision\fR\fB\&.p\fR
6674 .fi
6675 .if n \{\
6676 .RE
6677 .\}
6678 .sp
6679 The decision package id, positive for installs and negative for conflicts\&.
6680 .sp
6681 .if n \{\
6682 .RS 4
6683 .\}
6684 .nf
6685 \fBint reason;\fR                     /* read only */
6686 \fI$decision\fR\fB\->{reason}\fR
6687 \fIdecision\fR\fB\&.reason\fR
6688 \fIdecision\fR\fB\&.reason\fR
6689 .fi
6690 .if n \{\
6691 .RE
6692 .\}
6693 .sp
6694 The reason for the decision\&. See the SOLVER_REASON_ constants\&.
6695 .sp
6696 .if n \{\
6697 .RS 4
6698 .\}
6699 .nf
6700 \fBint infoid;\fR                     /* read only */
6701 \fI$decision\fR\fB\->{infoid}\fR
6702 \fIdecision\fR\fB\&.infoid\fR
6703 \fIdecision\fR\fB\&.infoid\fR
6704 .fi
6705 .if n \{\
6706 .RE
6707 .\}
6708 .sp
6709 Extra info for the decision\&. This is the rule id for decisions caused by rule fulfillment\&.
6710 .sp
6711 .if n \{\
6712 .RS 4
6713 .\}
6714 .nf
6715 \fBSolvable solvable;\fR              /* read only */
6716 \fI$decision\fR\fB\->{solvable}\fR
6717 \fIdecision\fR\fB\&.solvable\fR
6718 \fIdecision\fR\fB\&.solvable\fR
6719 .fi
6720 .if n \{\
6721 .RE
6722 .\}
6723 .sp
6724 The decision package object\&.
6725 .sp
6726 .if n \{\
6727 .RS 4
6728 .\}
6729 .nf
6730 \fBRule rule()\fR                     /* read only */
6731 \fI$decision\fR\fB\->{rule}\fR
6732 \fIdecision\fR\fB\&.rule\fR
6733 \fIdecision\fR\fB\&.rule\fR
6734 .fi
6735 .if n \{\
6736 .RE
6737 .\}
6738 .sp
6739 The rule object for decisions that where caused by rule fulfilment\&.
6740 .SS "METHODS"
6741 .sp
6742 .if n \{\
6743 .RS 4
6744 .\}
6745 .nf
6746 \fBRuleinfo info()\fR
6747 my \fI$info\fR \fB=\fR \fI$decision\fR\fB\->info()\fR;
6748 \fIinfo\fR \fB=\fR \fIdecision\fR\fB\&.info()\fR
6749 \fIinfo\fR \fB=\fR \fIdecision\fR\fB\&.info()\fR
6750 .fi
6751 .if n \{\
6752 .RE
6753 .\}
6754 .sp
6755 Return a Ruleinfo object describing the decision\&. Some reasons like SOLVER_REASON_WEAKDEP are not caused by rules, but can be expressed by a Ruleinfo object\&.
6756 .sp
6757 .if n \{\
6758 .RS 4
6759 .\}
6760 .nf
6761 \fBRuleinfo *allinfos()\fR
6762 my \fI@infos\fR \fB=\fR \fI$decision\fR\fB\->allinfos()\fR;
6763 \fIinfos\fR \fB=\fR \fIdecision\fR\fB\&.allinfos()\fR
6764 \fIinfos\fR \fB=\fR \fIdecision\fR\fB\&.allinfos()\fR
6765 .fi
6766 .if n \{\
6767 .RE
6768 .\}
6769 .sp
6770 Same as info(), but all Ruleinfo objects describing the decision are returned\&.
6771 .sp
6772 .if n \{\
6773 .RS 4
6774 .\}
6775 .nf
6776 \fBconst char *reasonstr()\fR
6777 my \fIstr\fR \fB=\fR \fI$decision\fR\fB\->reasonstr()\fR
6778 \fIstr\fR \fB=\fR \fIdecision\fR\fB\&.reasonstr()\fR
6779 \fIstr\fR \fB=\fR \fIdecision\fR\fB\&.reasonstr()\fR
6780 .fi
6781 .if n \{\
6782 .RE
6783 .\}
6784 .sp
6785 Return a string describing why a decision was done (but without the decision itself)\&.
6786 .sp
6787 .if n \{\
6788 .RS 4
6789 .\}
6790 .nf
6791 \fB<stringification>\fR
6792 my \fI$str\fR \fB=\fR \fI$decison\fR\fB\->str\fR;
6793 \fIstr\fR \fB= str(\fR\fIdecision\fR\fB)\fR
6794 \fIstr\fR \fB=\fR \fIdecision\fR\fB\&.to_s\fR
6795 .fi
6796 .if n \{\
6797 .RE
6798 .\}
6799 .sp
6800 Return a string describing the decision (but without the reason)\&.
6801 .SH "THE DECISIONSET CLASS"
6802 .sp
6803 A decisionset consists of multiple decisions of the same reason and type that can be presented to the user as a single action\&.
6804 .SS "ATTRIBUTES"
6805 .sp
6806 .if n \{\
6807 .RS 4
6808 .\}
6809 .nf
6810 \fBSolver *solv;\fR                   /* read only */
6811 \fI$decision\fR\fB\->{solv}\fR
6812 \fIdecision\fR\fB\&.solv\fR
6813 \fIdecision\fR\fB\&.solv\fR
6814 .fi
6815 .if n \{\
6816 .RE
6817 .\}
6818 .sp
6819 Back pointer to solver object\&.
6820 .sp
6821 .if n \{\
6822 .RS 4
6823 .\}
6824 .nf
6825 \fBId p;\fR                           /* read only */
6826 \fI$decision\fR\fB\->{p}\fR
6827 \fIdecision\fR\fB\&.p\fR
6828 \fIdecision\fR\fB\&.p\fR
6829 .fi
6830 .if n \{\
6831 .RE
6832 .\}
6833 .sp
6834 The package id of the first decision, positive for installs and negative for conflicts\&.
6835 .sp
6836 .if n \{\
6837 .RS 4
6838 .\}
6839 .nf
6840 \fBint reason;\fR                     /* read only */
6841 \fI$decision\fR\fB\->{reason}\fR
6842 \fIdecision\fR\fB\&.reason\fR
6843 \fIdecision\fR\fB\&.reason\fR
6844 .fi
6845 .if n \{\
6846 .RE
6847 .\}
6848 .sp
6849 The reason for the decisions in the set\&. See the SOLVER_REASON_ constants\&.
6850 .sp
6851 .if n \{\
6852 .RS 4
6853 .\}
6854 .nf
6855 \fBint type;\fR                       /* read only */
6856 \fI$ruleinfo\fR\fB\->{type}\fR
6857 \fIruleinfo\fR\fB\&.type\fR
6858 \fIruleinfo\fR\fB\&.type\fR
6859 .fi
6860 .if n \{\
6861 .RE
6862 .\}
6863 .sp
6864 The type of the decision info\&. See the constant section of the solver class for the rule type list and the special type list\&.
6865 .sp
6866 .if n \{\
6867 .RS 4
6868 .\}
6869 .nf
6870 \fBDep *dep;\fR                       /* read only */
6871 \fI$ruleinfo\fR\fB\->{dep}\fR
6872 \fIruleinfo\fR\fB\&.dep\fR
6873 \fIruleinfo\fR\fB\&.dep\fR
6874 .fi
6875 .if n \{\
6876 .RE
6877 .\}
6878 .sp
6879 The dependency that caused the decision
6880 .sp
6881 .if n \{\
6882 .RS 4
6883 .\}
6884 .nf
6885 \fBDep *dep_id;\fR                    /* read only */
6886 \fI$ruleinfo\fR\fB\->{\fR\fIdep_id\fR\fB}\fR
6887 \fIruleinfo\fR\fB\&.dep_id\fR
6888 \fIruleinfo\fR\fB\&.dep_id\fR
6889 .fi
6890 .if n \{\
6891 .RE
6892 .\}
6893 .sp
6894 The Id of the dependency that caused the decision\&.
6895 .SS "METHODS"
6896 .sp
6897 .if n \{\
6898 .RS 4
6899 .\}
6900 .nf
6901 \fBDecision *decisions()\fR
6902 my \fI@decisions\fR \fB=\fR \fI$decisionset\fR\fB\->decisions()\fR;
6903 \fIdecisions\fR \fB=\fR \fIdecisionset\fR\fB\&.decisions()\fR
6904 \fIdecisions\fR \fB=\fR \fIdecisionset\fR\fB\&.decisions()\fR
6905 .fi
6906 .if n \{\
6907 .RE
6908 .\}
6909 .sp
6910 Return all the decisions of the set\&.
6911 .sp
6912 .if n \{\
6913 .RS 4
6914 .\}
6915 .nf
6916 \fBSolvable *solvables()\fR
6917 my \fI@pkgs\fR \fB=\fR \fI$decisionset\fR\fB\->solvables()\fR;
6918 \fIpkgs\fR \fB=\fR \fIdecisionset\fR\fB\&.solvables()\fR
6919 \fIpkgs\fR \fB=\fR \fIdecisionset\fR\fB\&.solvables()\fR
6920 .fi
6921 .if n \{\
6922 .RE
6923 .\}
6924 .sp
6925 Return all the packages that were decided in the set\&.
6926 .sp
6927 .if n \{\
6928 .RS 4
6929 .\}
6930 .nf
6931 \fBconst char *reasonstr()\fR
6932 my \fIstr\fR \fB=\fR \fI$decision\fR\fB\->reasonstr()\fR;
6933 \fIstr\fR \fB=\fR \fIdecision\fR\fB\&.reasonstr()\fR
6934 \fIstr\fR \fB=\fR \fIdecision\fR\fB\&.reasonstr()\fR
6935 .fi
6936 .if n \{\
6937 .RE
6938 .\}
6939 .sp
6940 Return a string describing why the decisions were done (but without the decisions themself)\&.
6941 .sp
6942 .if n \{\
6943 .RS 4
6944 .\}
6945 .nf
6946 \fB<stringification>\fR
6947 my \fI$str\fR \fB=\fR \fI$decison\fR\fB\->str\fR;
6948 \fIstr\fR \fB= str(\fR\fIdecision\fR\fB)\fR
6949 \fIstr\fR \fB=\fR \fIdecision\fR\fB\&.to_s\fR
6950 .fi
6951 .if n \{\
6952 .RE
6953 .\}
6954 .sp
6955 Return a string describing the decisions (but without the reason)\&.
6956 .SH "AUTHOR"
6957 .sp
6958 Michael Schroeder <mls@suse\&.de>