Imported Upstream version 0.7.6
[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: 07/01/2019
6 .\"    Manual: LIBSOLV
7 .\"    Source: libsolv
8 .\"  Language: English
9 .\"
10 .TH "LIBSOLV\-BINDINGS" "3" "07/01/2019" "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, and ruby\&. 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 .SS "METHODS"
615 .sp
616 .if n \{\
617 .RS 4
618 .\}
619 .nf
620 \fBvoid free()\fR
621 \fI$pool\fR\fB\->free()\fR;
622 \fIpool\fR\fB\&.free()\fR
623 \fIpool\fR\fB\&.free()\fR
624 .fi
625 .if n \{\
626 .RE
627 .\}
628 .sp
629 Force a free of the pool\&. After this call, you must not access any object that still references the pool\&.
630 .sp
631 .if n \{\
632 .RS 4
633 .\}
634 .nf
635 \fBvoid disown()\fR
636 \fI$pool\fR\fB\->disown()\fR;
637 \fIpool\fR\fB\&.disown()\fR
638 \fIpool\fR\fB\&.disown()\fR
639 .fi
640 .if n \{\
641 .RE
642 .\}
643 .sp
644 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\&.
645 .sp
646 .if n \{\
647 .RS 4
648 .\}
649 .nf
650 \fBvoid setdebuglevel(int\fR \fIlevel\fR\fB)\fR
651 \fI$pool\fR\fB\->setdebuglevel(\fR\fI$level\fR\fB)\fR;
652 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
653 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
654 .fi
655 .if n \{\
656 .RE
657 .\}
658 .sp
659 Set the debug level\&. A value of zero means no debug output, the higher the value, the more output is generated\&.
660 .sp
661 .if n \{\
662 .RS 4
663 .\}
664 .nf
665 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
666 my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
667 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
668 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
669 .fi
670 .if n \{\
671 .RE
672 .\}
673 .sp
674 .if n \{\
675 .RS 4
676 .\}
677 .nf
678 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
679 my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
680 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
681 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
682 .fi
683 .if n \{\
684 .RE
685 .\}
686 .sp
687 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\&.
688 .sp
689 .if n \{\
690 .RS 4
691 .\}
692 .nf
693 \fBvoid set_rootdir(const char *\fR\fIrootdir\fR\fB)\fR
694 \fI$pool\fR\fB\->set_rootdir(\fR\fIrootdir\fR\fB)\fR;
695 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
696 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
697 .fi
698 .if n \{\
699 .RE
700 .\}
701 .sp
702 .if n \{\
703 .RS 4
704 .\}
705 .nf
706 \fBconst char *get_rootdir()\fR
707 my \fI$rootdir\fR \fB=\fR \fI$pool\fR\fB\->get_rootdir()\fR;
708 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
709 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
710 .fi
711 .if n \{\
712 .RE
713 .\}
714 .sp
715 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\&.
716 .sp
717 .if n \{\
718 .RS 4
719 .\}
720 .nf
721 \fBvoid setarch(const char *\fR\fIarch\fR \fB= 0)\fR
722 \fI$pool\fR\fB\->setarch()\fR;
723 \fIpool\fR\fB\&.setarch()\fR
724 \fIpool\fR\fB\&.setarch()\fR
725 .fi
726 .if n \{\
727 .RE
728 .\}
729 .sp
730 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\&.
731 .sp
732 .if n \{\
733 .RS 4
734 .\}
735 .nf
736 \fBRepo add_repo(const char *\fR\fIname\fR\fB)\fR
737 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->add_repo(\fR\fI$name\fR\fB)\fR;
738 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
739 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
740 .fi
741 .if n \{\
742 .RE
743 .\}
744 .sp
745 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\&.
746 .sp
747 .if n \{\
748 .RS 4
749 .\}
750 .nf
751 \fBRepoiterator repos_iter()\fR
752 \fBfor my\fR \fI$repo\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->repos_iter()})\fR
753 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter():\fR
754 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter()\fR
755 .fi
756 .if n \{\
757 .RE
758 .\}
759 .sp
760 Iterate over the existing repositories\&.
761 .sp
762 .if n \{\
763 .RS 4
764 .\}
765 .nf
766 \fBSolvableiterator solvables_iter()\fR
767 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->solvables_iter()})\fR
768 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter():\fR
769 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter()\fR
770 .fi
771 .if n \{\
772 .RE
773 .\}
774 .sp
775 Iterate over the existing solvables\&.
776 .sp
777 .if n \{\
778 .RS 4
779 .\}
780 .nf
781 \fBDep Dep(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
782 my \fI$dep\fR \fB=\fR \fI$pool\fR\fB\->Dep(\fR\fI$string\fR\fB)\fR;
783 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
784 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
785 .fi
786 .if n \{\
787 .RE
788 .\}
789 .sp
790 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\&.
791 .sp
792 .if n \{\
793 .RS 4
794 .\}
795 .nf
796 \fBvoid addfileprovides()\fR
797 \fI$pool\fR\fB\->addfileprovides()\fR;
798 \fIpool\fR\fB\&.addfileprovides()\fR
799 \fIpool\fR\fB\&.addfileprovides()\fR
800 .fi
801 .if n \{\
802 .RE
803 .\}
804 .sp
805 .if n \{\
806 .RS 4
807 .\}
808 .nf
809 \fBId *addfileprovides_queue()\fR
810 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->addfileprovides_queue()\fR;
811 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
812 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
813 .fi
814 .if n \{\
815 .RE
816 .\}
817 .sp
818 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\&.
819 .sp
820 .if n \{\
821 .RS 4
822 .\}
823 .nf
824 \fBvoid createwhatprovides()\fR
825 \fI$pool\fR\fB\->createwhatprovides()\fR;
826 \fIpool\fR\fB\&.createwhatprovides()\fR
827 \fIpool\fR\fB\&.createwhatprovides()\fR
828 .fi
829 .if n \{\
830 .RE
831 .\}
832 .sp
833 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()\&.
834 .sp
835 .if n \{\
836 .RS 4
837 .\}
838 .nf
839 \fBSolvable *whatprovides(DepId\fR \fIdep\fR\fB)\fR
840 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatprovides(\fR\fI$dep\fR\fB)\fR;
841 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
842 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
843 .fi
844 .if n \{\
845 .RE
846 .\}
847 .sp
848 Return all solvables that provide the specified dependency\&. You can use either a Dep object or a simple Id as argument\&.
849 .sp
850 .if n \{\
851 .RS 4
852 .\}
853 .nf
854 \fBSolvable *best_solvables(Solvable *\fR\fIsolvables\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
855 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->best_solvables(\fR\fI$solvables\fR\fB)\fR;
856 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.best_solvables(\fR\fIsolvables\fR\fB)\fR
857 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.best_solvables(\fR\fIsolvables\fR\fB)\fR
858 .fi
859 .if n \{\
860 .RE
861 .\}
862 .sp
863 Filter list of solvables by repo priority, architecture and version\&.
864 .sp
865 .if n \{\
866 .RS 4
867 .\}
868 .nf
869 \fBSolvable *whatmatchessolvable(Id\fR \fIkeyname\fR\fB, Solvable\fR \fIsolvable\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
870 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatmatchessolvable(\fR\fI$keyname\fR\fB,\fR \fI$solvable\fR\fB)\fR
871 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatmatchessolvable(\fR\fIkeyname\fR\fB,\fR \fIsolvable\fR\fB)\fR
872 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatmatchessolvable(\fR\fIkeyname\fR\fB,\fR \fIsolvable\fR\fB)\fR
873 .fi
874 .if n \{\
875 .RE
876 .\}
877 .sp
878 Return all solvables that match package dependencies against solvable\(cqs provides\&.
879 .sp
880 .if n \{\
881 .RS 4
882 .\}
883 .nf
884 \fBId *matchprovidingids(const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
885 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->matchprovidingids(\fR\fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
886 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
887 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
888 .fi
889 .if n \{\
890 .RE
891 .\}
892 .sp
893 Search the names of all provides and return the ones matching the specified string\&. See the Dataiterator class for the allowed flags\&.
894 .sp
895 .if n \{\
896 .RS 4
897 .\}
898 .nf
899 \fBId towhatprovides(Id *\fR\fIids\fR\fB)\fR
900 my \fI$offset\fR \fB=\fR \fI$pool\fR\fB\->towhatprovides(\e\fR\fI@ids\fR\fB)\fR;
901 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
902 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
903 .fi
904 .if n \{\
905 .RE
906 .\}
907 .sp
908 \(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\&.
909 .sp
910 .if n \{\
911 .RS 4
912 .\}
913 .nf
914 \fBvoid set_namespaceproviders(DepId\fR \fIns\fR\fB, DepId\fR \fIevr\fR\fB, bool\fR \fIvalue\fR \fB= 1)\fR
915 \fI$pool\fR\fB\->set_namespaceproviders(\fR\fI$ns\fR\fB,\fR \fI$evr\fR\fB, 1)\fR;
916 \fIpool\fR\fB\&.set_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB,\fR \fITrue\fR\fB)\fR
917 \fIpool\fR\fB\&.set_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB,\fR \fItrue\fR\fB)\fR
918 .fi
919 .if n \{\
920 .RE
921 .\}
922 .sp
923 Manually set a namespace provides entry in the whatprovides index\&.
924 .sp
925 .if n \{\
926 .RS 4
927 .\}
928 .nf
929 \fBvoid flush_namespaceproviders(DepId\fR \fIns\fR\fB, DepId\fR \fIevr\fR\fB)\fR
930 \fI$pool\fR\fB\->flush_namespaceproviders(\fR\fI$ns\fR\fB,\fR \fI$evr\fR\fB)\fR;
931 \fI$pool\fR\fB\&.flush_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB)\fR
932 \fI$pool\fR\fB\&.flush_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB)\fR
933 .fi
934 .if n \{\
935 .RE
936 .\}
937 .sp
938 Flush the cache of all namespaceprovides matching the specified namespace dependency\&. You can use zero as a wildcard argument\&.
939 .sp
940 .if n \{\
941 .RS 4
942 .\}
943 .nf
944 \fBbool isknownarch(DepId\fR \fIid\fR\fB)\fR
945 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->isknownarch(\fR\fI$id\fR\fB)\fR;
946 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch(\fR\fIid\fR\fB)\fR
947 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch?(\fR\fIid\fR\fB)\fR
948 .fi
949 .if n \{\
950 .RE
951 .\}
952 .sp
953 Return true if the specified Id describes a known architecture\&.
954 .sp
955 .if n \{\
956 .RS 4
957 .\}
958 .nf
959 \fBSolver Solver()\fR
960 my \fI$solver\fR \fB=\fR \fI$pool\fR\fB\->Solver()\fR;
961 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
962 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
963 .fi
964 .if n \{\
965 .RE
966 .\}
967 .sp
968 Create a new solver object\&.
969 .sp
970 .if n \{\
971 .RS 4
972 .\}
973 .nf
974 \fBJob Job(int\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
975 my \fI$job\fR \fB=\fR \fI$pool\fR\fB\->Job(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
976 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
977 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
978 .fi
979 .if n \{\
980 .RE
981 .\}
982 .sp
983 Create a new Job object\&. Kind of low level, in most cases you would instead use a Selection or Dep job constructor\&.
984 .sp
985 .if n \{\
986 .RS 4
987 .\}
988 .nf
989 \fBSelection Selection()\fR
990 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection()\fR;
991 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
992 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
993 .fi
994 .if n \{\
995 .RE
996 .\}
997 .sp
998 Create an empty selection\&. Useful as a starting point for merging other selections\&.
999 .sp
1000 .if n \{\
1001 .RS 4
1002 .\}
1003 .nf
1004 \fBSelection Selection_all()\fR
1005 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection_all()\fR;
1006 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
1007 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
1008 .fi
1009 .if n \{\
1010 .RE
1011 .\}
1012 .sp
1013 Create a selection containing all packages\&. Useful as starting point for intersecting other selections or for update/distupgrade jobs\&.
1014 .sp
1015 .if n \{\
1016 .RS 4
1017 .\}
1018 .nf
1019 \fBSelection select(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB)\fR
1020 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->select(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1021 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1022 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1023 .fi
1024 .if n \{\
1025 .RE
1026 .\}
1027 .sp
1028 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\&.
1029 .sp
1030 .if n \{\
1031 .RS 4
1032 .\}
1033 .nf
1034 \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
1035 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;
1036 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchdeps(\fR\fIname\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1037 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchdeps(\fR\fIname\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1038 .fi
1039 .if n \{\
1040 .RE
1041 .\}
1042 .sp
1043 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\&.
1044 .sp
1045 .if n \{\
1046 .RS 4
1047 .\}
1048 .nf
1049 \fBSelection matchdepid(DepId\fR \fIdep\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1050 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;
1051 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchdepid(\fR\fIdep\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1052 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchdepid(\fR\fIdep\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1053 .fi
1054 .if n \{\
1055 .RE
1056 .\}
1057 .sp
1058 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\&.
1059 .sp
1060 .if n \{\
1061 .RS 4
1062 .\}
1063 .nf
1064 \fBSelection matchsolvable(Solvable\fR \fIsolvable\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1065 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;
1066 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchsolvable(\fR\fIsolvable\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1067 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.matchsolvable(\fR\fIsolvable\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
1068 .fi
1069 .if n \{\
1070 .RE
1071 .\}
1072 .sp
1073 Create a selection by matching package dependencies against the specified solvable\(cqs provides\&.
1074 .sp
1075 .if n \{\
1076 .RS 4
1077 .\}
1078 .nf
1079 \fBvoid setpooljobs(Jobs *\fR\fIjobs\fR\fB)\fR
1080 \fI$pool\fR\fB\->setpooljobs(\e\fR\fI@jobs\fR\fB)\fR;
1081 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
1082 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
1083 .fi
1084 .if n \{\
1085 .RE
1086 .\}
1087 .sp
1088 .if n \{\
1089 .RS 4
1090 .\}
1091 .nf
1092 \fBJob *getpooljobs()\fR
1093 \fI@jobs\fR \fB=\fR \fI$pool\fR\fB\->getpooljobs()\fR;
1094 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
1095 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
1096 .fi
1097 .if n \{\
1098 .RE
1099 .\}
1100 .sp
1101 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\&.
1102 .sp
1103 .if n \{\
1104 .RS 4
1105 .\}
1106 .nf
1107 \fBvoid set_loadcallback(Callable *\fR\fIcallback\fR\fB)\fR
1108 \fI$pool\fR\fB\->setloadcallback(\e\fR\fI&callbackfunction\fR\fB)\fR;
1109 \fIpool\fR\fB\&.setloadcallback(\fR\fIcallbackfunction\fR\fB)\fR
1110 \fIpool\fR\fB\&.setloadcallback { |\fR\fIrepodata\fR\fB| \&.\&.\&. }\fR
1111 .fi
1112 .if n \{\
1113 .RE
1114 .\}
1115 .sp
1116 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\&.
1117 .sp
1118 .if n \{\
1119 .RS 4
1120 .\}
1121 .nf
1122 /* bindings only */
1123 \fI$pool\fR\fB\->appdata_disown()\fR
1124 \fIpool\fR\fB\&.appdata_disown()\fR
1125 \fIpool\fR\fB\&.appdata_disown()\fR
1126 .fi
1127 .if n \{\
1128 .RE
1129 .\}
1130 .sp
1131 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\&.)
1132 .sp
1133 .if n \{\
1134 .RS 4
1135 .\}
1136 .nf
1137 \fBId *get_considered_list()\fR
1138 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->get_considered_list()\fR;
1139 \fIids\fR \fB=\fR \fIpool\fR\fB\&.get_considered_list()\fR
1140 \fIids\fR \fB=\fR \fIpool\fR\fB\&.get_considered_list()\fR
1141 .fi
1142 .if n \{\
1143 .RE
1144 .\}
1145 .sp
1146 .if n \{\
1147 .RS 4
1148 .\}
1149 .nf
1150 \fBvoid set_considered_list(Id *\fR\fIids\fR\fB)\fR
1151 \fI$pool\fR\fB\->set_considered_list(\e\fR\fI@ids\fR\fB)\fR;
1152 \fIpool\fR\fB\&.set_considered_list(\fR\fIids\fR\fB)\fR
1153 \fIpool\fR\fB\&.set_considered_list(\fR\fIids\fR\fB)\fR
1154 .fi
1155 .if n \{\
1156 .RE
1157 .\}
1158 .sp
1159 Get/set the list of solvables that are eligible for installation\&. Note that you need to recreate the whatprovides hash after changing the list\&.
1160 .sp
1161 .if n \{\
1162 .RS 4
1163 .\}
1164 .nf
1165 \fBId *get_disabled_list()\fR
1166 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->get_disabled_list()\fR;
1167 \fIids\fR \fB=\fR \fIpool\fR\fB\&.get_disabled_list()\fR
1168 \fIids\fR \fB=\fR \fIpool\fR\fB\&.get_disabled_list()\fR
1169 .fi
1170 .if n \{\
1171 .RE
1172 .\}
1173 .sp
1174 .if n \{\
1175 .RS 4
1176 .\}
1177 .nf
1178 \fBvoid set_disabled_list(Id *\fR\fIids\fR\fB)\fR
1179 \fI$pool\fR\fB\->set_disabled_list(\e\fR\fI@ids\fR\fB)\fR;
1180 \fIpool\fR\fB\&.set_disabled_list(\fR\fIids\fR\fB)\fR
1181 \fIpool\fR\fB\&.set_disabled_list(\fR\fIids\fR\fB)\fR
1182 .fi
1183 .if n \{\
1184 .RE
1185 .\}
1186 .sp
1187 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\&.
1188 .SS "DATA RETRIEVAL METHODS"
1189 .sp
1190 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,
1191 .sp
1192 .if n \{\
1193 .RS 4
1194 .\}
1195 .nf
1196 \fB$solv::SOLVABLE_SUMMARY\fR
1197 \fBsolv\&.SOLVABLE_SUMMARY\fR
1198 \fBSolv::SOLVABLE_SUMMARY\fR
1199 .fi
1200 .if n \{\
1201 .RE
1202 .\}
1203 .sp
1204 selects the \(lqSummary\(rq entry of a solvable\&. The \fIsolvid\fR argument selects the desired solvable by Id\&.
1205 .sp
1206 .if n \{\
1207 .RS 4
1208 .\}
1209 .nf
1210 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1211 my \fI$string\fR \fB=\fR \fI$pool\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1212 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1213 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1214 .fi
1215 .if n \{\
1216 .RE
1217 .\}
1218 .sp
1219 .if n \{\
1220 .RS 4
1221 .\}
1222 .nf
1223 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1224 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->lookup_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1225 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1226 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1227 .fi
1228 .if n \{\
1229 .RE
1230 .\}
1231 .sp
1232 .if n \{\
1233 .RS 4
1234 .\}
1235 .nf
1236 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
1237 my \fI$num\fR \fB=\fR \fI$pool\fR\fB\->lookup_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1238 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1239 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1240 .fi
1241 .if n \{\
1242 .RE
1243 .\}
1244 .sp
1245 .if n \{\
1246 .RS 4
1247 .\}
1248 .nf
1249 \fBbool lookup_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1250 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->lookup_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1251 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1252 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1253 .fi
1254 .if n \{\
1255 .RE
1256 .\}
1257 .sp
1258 .if n \{\
1259 .RS 4
1260 .\}
1261 .nf
1262 \fBId *lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1263 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1264 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1265 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1266 .fi
1267 .if n \{\
1268 .RE
1269 .\}
1270 .sp
1271 .if n \{\
1272 .RS 4
1273 .\}
1274 .nf
1275 \fBChksum lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
1276 my \fI$chksum\fR \fB=\fR \fI$pool\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
1277 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1278 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
1279 .fi
1280 .if n \{\
1281 .RE
1282 .\}
1283 .sp
1284 Lookup functions\&. Return the data element stored in the specified solvable\&. You should probably use the methods of the Solvable class instead\&.
1285 .sp
1286 .if n \{\
1287 .RS 4
1288 .\}
1289 .nf
1290 \fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
1291 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;
1292 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1293 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1294 .fi
1295 .if n \{\
1296 .RE
1297 .\}
1298 .sp
1299 .if n \{\
1300 .RS 4
1301 .\}
1302 .nf
1303 \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
1304 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;
1305 \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
1306 \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
1307 .fi
1308 .if n \{\
1309 .RE
1310 .\}
1311 .sp
1312 .if n \{\
1313 .RS 4
1314 .\}
1315 .nf
1316 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1317 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1318 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1319 .fi
1320 .if n \{\
1321 .RE
1322 .\}
1323 .sp
1324 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\&.
1325 .SS "ID METHODS"
1326 .sp
1327 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\&.
1328 .sp
1329 .if n \{\
1330 .RS 4
1331 .\}
1332 .nf
1333 \fBRepo id2repo(Id\fR \fIid\fR\fB)\fR
1334 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->id2repo(\fR\fI$id\fR\fB)\fR;
1335 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
1336 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
1337 .fi
1338 .if n \{\
1339 .RE
1340 .\}
1341 .sp
1342 Lookup an existing Repository by id\&. You can also do this by using the \fBrepos\fR attribute\&.
1343 .sp
1344 .if n \{\
1345 .RS 4
1346 .\}
1347 .nf
1348 \fBSolvable id2solvable(Id\fR \fIid\fR\fB)\fR
1349 \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->id2solvable(\fR\fI$id\fR\fB)\fR;
1350 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
1351 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
1352 .fi
1353 .if n \{\
1354 .RE
1355 .\}
1356 .sp
1357 Lookup an existing Repository by id\&. You can also do this by using the \fBsolvables\fR attribute\&.
1358 .sp
1359 .if n \{\
1360 .RS 4
1361 .\}
1362 .nf
1363 \fBconst char *solvid2str(Id\fR \fIid\fR\fB)\fR
1364 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvid2str(\fR\fI$id\fR\fB)\fR;
1365 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
1366 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
1367 .fi
1368 .if n \{\
1369 .RE
1370 .\}
1371 .sp
1372 Return a string describing the Solvable with the specified id\&. The string consists of the name, version, and architecture of the Solvable\&.
1373 .sp
1374 .if n \{\
1375 .RS 4
1376 .\}
1377 .nf
1378 \fBId str2id(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1379 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->str2id(\fR\fI$string\fR\fB)\fR;
1380 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
1381 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
1382 .fi
1383 .if n \{\
1384 .RE
1385 .\}
1386 .sp
1387 .if n \{\
1388 .RS 4
1389 .\}
1390 .nf
1391 \fBconst char *id2str(Id\fR \fIid\fR\fB)\fR
1392 \fI$string\fR \fB=\fR \fIpool\fR\fB\->id2str(\fR\fI$id\fR\fB)\fR;
1393 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
1394 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
1395 .fi
1396 .if n \{\
1397 .RE
1398 .\}
1399 .sp
1400 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\&.
1401 .sp
1402 .if n \{\
1403 .RS 4
1404 .\}
1405 .nf
1406 \fBId rel2id(Id\fR \fIname\fR\fB, Id\fR \fIevr\fR\fB, int\fR \fIflags\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1407 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;
1408 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
1409 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
1410 .fi
1411 .if n \{\
1412 .RE
1413 .\}
1414 .sp
1415 Create a \(lqrelational\(rq dependency\&. Such dependencies consist of a name part, \fIflags\fR describing the relation, and a version part\&. The flags are:
1416 .sp
1417 .if n \{\
1418 .RS 4
1419 .\}
1420 .nf
1421 \fB$solv::REL_EQ | $solv::REL_GT | $solv::REL_LT\fR
1422 \fBsolv\&.REL_EQ | solv\&.REL_GT | solv\&.REL_LT\fR
1423 \fBSolv::REL_EQ | Solv::REL_GT | Solv::REL_LT\fR
1424 .fi
1425 .if n \{\
1426 .RE
1427 .\}
1428 .sp
1429 Thus, if you want a \(lq<=\(rq relation, you would use \fBREL_LT | REL_EQ\fR\&.
1430 .sp
1431 .if n \{\
1432 .RS 4
1433 .\}
1434 .nf
1435 \fBId id2langid(Id\fR \fIid\fR\fB, const char *\fR\fIlang\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1436 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->id2langid(\fR\fI$id\fR\fB,\fR \fI$language\fR\fB)\fR;
1437 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
1438 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
1439 .fi
1440 .if n \{\
1441 .RE
1442 .\}
1443 .sp
1444 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\&.
1445 .sp
1446 .if n \{\
1447 .RS 4
1448 .\}
1449 .nf
1450 \fBconst char *dep2str(Id\fR \fIid\fR\fB)\fR
1451 \fI$string\fR \fB=\fR \fIpool\fR\fB\->dep2str(\fR\fI$id\fR\fB)\fR;
1452 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
1453 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
1454 .fi
1455 .if n \{\
1456 .RE
1457 .\}
1458 .sp
1459 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\&.
1460 .SH "THE DEPENDENCY CLASS"
1461 .sp
1462 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\&.
1463 .SS "ATTRIBUTES"
1464 .sp
1465 .if n \{\
1466 .RS 4
1467 .\}
1468 .nf
1469 \fBPool *pool;\fR             /* read only */
1470 \fI$dep\fR\fB\->{pool}\fR
1471 \fIdep\fR\fB\&.pool\fR
1472 \fIdep\fR\fB\&.pool\fR
1473 .fi
1474 .if n \{\
1475 .RE
1476 .\}
1477 .sp
1478 Back reference to the pool this dependency belongs to\&.
1479 .sp
1480 .if n \{\
1481 .RS 4
1482 .\}
1483 .nf
1484 \fBId id;\fR          /* read only */
1485 \fI$dep\fR\fB\->{id}\fR
1486 \fIdep\fR\fB\&.id\fR
1487 \fIdep\fR\fB\&.id\fR
1488 .fi
1489 .if n \{\
1490 .RE
1491 .\}
1492 .sp
1493 The id of this dependency\&.
1494 .SH "METHODS"
1495 .sp
1496 .if n \{\
1497 .RS 4
1498 .\}
1499 .nf
1500 \fBDep Rel(int\fR \fIflags\fR\fB, DepId\fR \fIevrid\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1501 my \fI$reldep\fR \fB=\fR \fI$dep\fR\fB\->Rel(\fR\fI$flags\fR\fB,\fR \fI$evrdep\fR\fB)\fR;
1502 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
1503 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
1504 .fi
1505 .if n \{\
1506 .RE
1507 .\}
1508 .sp
1509 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\&.
1510 .sp
1511 .if n \{\
1512 .RS 4
1513 .\}
1514 .nf
1515 \fBSelection Selection_name(int\fR \fIsetflags\fR \fB= 0)\fR
1516 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_name()\fR;
1517 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
1518 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
1519 .fi
1520 .if n \{\
1521 .RE
1522 .\}
1523 .sp
1524 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\&.
1525 .sp
1526 .if n \{\
1527 .RS 4
1528 .\}
1529 .nf
1530 \fBSelection Selection_provides(int\fR \fIsetflags\fR \fB= 0)\fR
1531 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_provides()\fR;
1532 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
1533 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
1534 .fi
1535 .if n \{\
1536 .RE
1537 .\}
1538 .sp
1539 Create a Selection from a dependency\&. The selection consists of all packages that have at least one provides matching the dependency\&.
1540 .sp
1541 .if n \{\
1542 .RS 4
1543 .\}
1544 .nf
1545 \fBconst char *str()\fR
1546 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str()\fR;
1547 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
1548 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
1549 .fi
1550 .if n \{\
1551 .RE
1552 .\}
1553 .sp
1554 Return a string describing the dependency\&.
1555 .sp
1556 .if n \{\
1557 .RS 4
1558 .\}
1559 .nf
1560 \fB<stringification>\fR
1561 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str\fR;
1562 \fIstr\fR \fB= str(\fR\fIdep\fR\fB)\fR
1563 \fIstr\fR \fB=\fR \fIdep\fR\fB\&.to_s\fR
1564 .fi
1565 .if n \{\
1566 .RE
1567 .\}
1568 .sp
1569 Same as calling the str() method\&.
1570 .sp
1571 .if n \{\
1572 .RS 4
1573 .\}
1574 .nf
1575 \fB<equality>\fR
1576 \fBif (\fR\fI$dep1\fR \fB==\fR \fI$dep2\fR\fB)\fR
1577 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR\fB:\fR
1578 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR
1579 .fi
1580 .if n \{\
1581 .RE
1582 .\}
1583 .sp
1584 Two dependencies are equal if they are part of the same pool and have the same ids\&.
1585 .SH "THE REPOSITORY CLASS"
1586 .sp
1587 A Repository describes a group of packages, normally coming from the same source\&. Repositories are created by the Pool\(cqs add_repo() method\&.
1588 .SS "ATTRIBUTES"
1589 .sp
1590 .if n \{\
1591 .RS 4
1592 .\}
1593 .nf
1594 \fBPool *pool;\fR                     /* read only */
1595 \fI$repo\fR\fB\->{pool}\fR
1596 \fIrepo\fR\fB\&.pool\fR
1597 \fIrepo\fR\fB\&.pool\fR
1598 .fi
1599 .if n \{\
1600 .RE
1601 .\}
1602 .sp
1603 Back reference to the pool this dependency belongs to\&.
1604 .sp
1605 .if n \{\
1606 .RS 4
1607 .\}
1608 .nf
1609 \fBId id;\fR                          /* read only */
1610 \fI$repo\fR\fB\->{id}\fR
1611 \fIrepo\fR\fB\&.id\fR
1612 \fIrepo\fR\fB\&.id\fR
1613 .fi
1614 .if n \{\
1615 .RE
1616 .\}
1617 .sp
1618 The id of the repository\&.
1619 .sp
1620 .if n \{\
1621 .RS 4
1622 .\}
1623 .nf
1624 \fBconst char *name;\fR               /* read/write */
1625 \fI$repo\fR\fB\->{name}\fR
1626 \fIrepo\fR\fB\&.name\fR
1627 \fIrepo\fR\fB\&.name\fR
1628 .fi
1629 .if n \{\
1630 .RE
1631 .\}
1632 .sp
1633 The repositories name\&. To libsolv, the name is just a string with no specific meaning\&.
1634 .sp
1635 .if n \{\
1636 .RS 4
1637 .\}
1638 .nf
1639 \fBint priority;\fR                   /* read/write */
1640 \fI$repo\fR\fB\->{priority}\fR
1641 \fIrepo\fR\fB\&.priority\fR
1642 \fIrepo\fR\fB\&.priority\fR
1643 .fi
1644 .if n \{\
1645 .RE
1646 .\}
1647 .sp
1648 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\&.
1649 .sp
1650 .if n \{\
1651 .RS 4
1652 .\}
1653 .nf
1654 \fBint subpriority;\fR                /* read/write */
1655 \fI$repo\fR\fB\->{subpriority}\fR
1656 \fIrepo\fR\fB\&.subpriority\fR
1657 \fIrepo\fR\fB\&.subpriority\fR
1658 .fi
1659 .if n \{\
1660 .RE
1661 .\}
1662 .sp
1663 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\&.
1664 .sp
1665 .if n \{\
1666 .RS 4
1667 .\}
1668 .nf
1669 \fBint nsolvables;\fR                 /* read only */
1670 \fI$repo\fR\fB\->{nsolvables}\fR
1671 \fIrepo\fR\fB\&.nsolvables\fR
1672 \fIrepo\fR\fB\&.nsolvables\fR
1673 .fi
1674 .if n \{\
1675 .RE
1676 .\}
1677 .sp
1678 The number of solvables in this repository\&.
1679 .sp
1680 .if n \{\
1681 .RS 4
1682 .\}
1683 .nf
1684 \fBvoid *appdata;\fR                  /* read/write */
1685 \fI$repo\fR\fB\->{appdata}\fR
1686 \fIrepo\fR\fB\&.appdata\fR
1687 \fIrepo\fR\fB\&.appdata\fR
1688 .fi
1689 .if n \{\
1690 .RE
1691 .\}
1692 .sp
1693 Application specific data that may be used in any way by the code using the repository\&.
1694 .sp
1695 .if n \{\
1696 .RS 4
1697 .\}
1698 .nf
1699 \fBDatapos *meta;\fR                  /* read only */
1700 \fI$repo\fR\fB\->{meta}\fR
1701 \fIrepo\fR\fB\&.meta\fR
1702 \fIrepo\fR\fB\&.meta\fR
1703 .fi
1704 .if n \{\
1705 .RE
1706 .\}
1707 .sp
1708 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\&.
1709 .SS "CONSTANTS"
1710 .PP
1711 \fBREPO_REUSE_REPODATA\fR
1712 .RS 4
1713 Reuse the last repository data area (\(lqrepodata\(rq) instead of creating a new area\&.
1714 .RE
1715 .PP
1716 \fBREPO_NO_INTERNALIZE\fR
1717 .RS 4
1718 Do not internalize the added repository data\&. This is useful if you plan to add more data because internalization is a costly operation\&.
1719 .RE
1720 .PP
1721 \fBREPO_LOCALPOOL\fR
1722 .RS 4
1723 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\&.
1724 .RE
1725 .PP
1726 \fBREPO_USE_LOADING\fR
1727 .RS 4
1728 Use the repodata that is currently being loaded instead of creating a new one\&. This only makes sense if used in a load callback\&.
1729 .RE
1730 .PP
1731 \fBREPO_EXTEND_SOLVABLES\fR
1732 .RS 4
1733 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\&.
1734 .RE
1735 .PP
1736 \fBREPO_USE_ROOTDIR\fR
1737 .RS 4
1738 Prepend the pool\(cqs rootdir to the path when doing file operations\&.
1739 .RE
1740 .PP
1741 \fBREPO_NO_LOCATION\fR
1742 .RS 4
1743 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\&.
1744 .RE
1745 .PP
1746 \fBSOLV_ADD_NO_STUBS\fR
1747 .RS 4
1748 Do not create stubs for repository parts that can be downloaded on demand\&.
1749 .RE
1750 .PP
1751 \fBSUSETAGS_RECORD_SHARES\fR
1752 .RS 4
1753 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\&.
1754 .RE
1755 .SS "METHODS"
1756 .sp
1757 .if n \{\
1758 .RS 4
1759 .\}
1760 .nf
1761 \fBvoid free(bool\fR \fIreuseids\fR \fB= 0)\fR
1762 \fI$repo\fR\fB\->free()\fR;
1763 \fIrepo\fR\fB\&.free()\fR
1764 \fIrepo\fR\fB\&.free()\fR
1765 .fi
1766 .if n \{\
1767 .RE
1768 .\}
1769 .sp
1770 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\&.
1771 .sp
1772 .if n \{\
1773 .RS 4
1774 .\}
1775 .nf
1776 \fBvoid empty(bool\fR \fIreuseids\fR \fB= 0)\fR
1777 \fI$repo\fR\fB\->empty()\fR;
1778 \fIrepo\fR\fB\&.empty()\fR
1779 \fIrepo\fR\fB\&.empty()\fR
1780 .fi
1781 .if n \{\
1782 .RE
1783 .\}
1784 .sp
1785 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\&.
1786 .sp
1787 .if n \{\
1788 .RS 4
1789 .\}
1790 .nf
1791 \fBbool isempty()\fR
1792 \fI$repo\fR\fB\->isempty()\fR
1793 \fIrepo\fR\fB\&.empty()\fR
1794 \fIrepo\fR\fB\&.empty?\fR
1795 .fi
1796 .if n \{\
1797 .RE
1798 .\}
1799 .sp
1800 Return true if there are no solvables in this repository\&.
1801 .sp
1802 .if n \{\
1803 .RS 4
1804 .\}
1805 .nf
1806 \fBvoid internalize()\fR
1807 \fI$repo\fR\fB\->internalize()\fR;
1808 \fIrepo\fR\fB\&.internalize()\fR
1809 \fIrepo\fR\fB\&.internalize()\fR
1810 .fi
1811 .if n \{\
1812 .RE
1813 .\}
1814 .sp
1815 Internalize added data\&. Data must be internalized before it is available to the lookup and data iterator functions\&.
1816 .sp
1817 .if n \{\
1818 .RS 4
1819 .\}
1820 .nf
1821 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR
1822 \fI$repo\fR\fB\->write(\fR\fI$fp\fR\fB)\fR
1823 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1824 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1825 .fi
1826 .if n \{\
1827 .RE
1828 .\}
1829 .sp
1830 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\&.
1831 .sp
1832 .if n \{\
1833 .RS 4
1834 .\}
1835 .nf
1836 \fBSolvableiterator solvables_iter()\fR
1837 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$repo\fR\fB\->solvables_iter()})\fR
1838 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter():\fR
1839 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter()\fR
1840 .fi
1841 .if n \{\
1842 .RE
1843 .\}
1844 .sp
1845 Iterate over all solvables in a repository\&.
1846 .sp
1847 .if n \{\
1848 .RS 4
1849 .\}
1850 .nf
1851 \fBRepodata add_repodata(int\fR \fIflags\fR \fB= 0)\fR
1852 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->add_repodata()\fR;
1853 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1854 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1855 .fi
1856 .if n \{\
1857 .RE
1858 .\}
1859 .sp
1860 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\&.
1861 .sp
1862 .if n \{\
1863 .RS 4
1864 .\}
1865 .nf
1866 \fBvoid create_stubs()\fR
1867 \fI$repo\fR\fB\->create_stubs()\fR;
1868 \fIrepo\fR\fB\&.create_stubs()\fR
1869 \fIrepo\fR\fB\&.create_stubs()\fR
1870 .fi
1871 .if n \{\
1872 .RE
1873 .\}
1874 .sp
1875 Calls the create_stubs() repodata method for the last repodata of the repository\&.
1876 .sp
1877 .if n \{\
1878 .RS 4
1879 .\}
1880 .nf
1881 \fBbool iscontiguous()\fR
1882 \fI$repo\fR\fB\->iscontiguous()\fR
1883 \fIrepo\fR\fB\&.iscontiguous()\fR
1884 \fIrepo\fR\fB\&.iscontiguous?\fR
1885 .fi
1886 .if n \{\
1887 .RE
1888 .\}
1889 .sp
1890 Return true if the solvables of this repository are all in a single block with no holes, i\&.e\&. they have consecutive ids\&.
1891 .sp
1892 .if n \{\
1893 .RS 4
1894 .\}
1895 .nf
1896 \fBRepodata first_repodata()\fR
1897 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->first_repodata()\fR;
1898 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1899 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1900 .fi
1901 .if n \{\
1902 .RE
1903 .\}
1904 .sp
1905 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\&.
1906 .sp
1907 .if n \{\
1908 .RS 4
1909 .\}
1910 .nf
1911 \fBSelection Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1912 my \fI$sel\fR \fB=\fR \fI$repo\fR\fB\->Selection()\fR;
1913 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1914 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1915 .fi
1916 .if n \{\
1917 .RE
1918 .\}
1919 .sp
1920 Create a Selection consisting of all packages in the repository\&.
1921 .sp
1922 .if n \{\
1923 .RS 4
1924 .\}
1925 .nf
1926 \fBDataiterator Dataiterator(Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
1927 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;
1928 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1929 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1930 .fi
1931 .if n \{\
1932 .RE
1933 .\}
1934 .sp
1935 .if n \{\
1936 .RS 4
1937 .\}
1938 .nf
1939 \fBDataiterator Dataiterator_meta(Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
1940 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;
1941 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator_meta(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1942 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator_meta(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1943 .fi
1944 .if n \{\
1945 .RE
1946 .\}
1947 .sp
1948 .if n \{\
1949 .RS 4
1950 .\}
1951 .nf
1952 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1953 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1954 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1955 .fi
1956 .if n \{\
1957 .RE
1958 .\}
1959 .sp
1960 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\&.
1961 .sp
1962 .if n \{\
1963 .RS 4
1964 .\}
1965 .nf
1966 \fB<stringification>\fR
1967 my \fI$str\fR \fB=\fR \fI$repo\fR\fB\->str\fR;
1968 \fIstr\fR \fB= str(\fR\fIrepo\fR\fB)\fR
1969 \fIstr\fR \fB=\fR \fIrepo\fR\fB\&.to_s\fR
1970 .fi
1971 .if n \{\
1972 .RE
1973 .\}
1974 .sp
1975 Return the name of the repository, or "Repo#<id>" if no name is set\&.
1976 .sp
1977 .if n \{\
1978 .RS 4
1979 .\}
1980 .nf
1981 \fB<equality>\fR
1982 \fBif (\fR\fI$repo1\fR \fB==\fR \fI$repo2\fR\fB)\fR
1983 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR\fB:\fR
1984 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR
1985 .fi
1986 .if n \{\
1987 .RE
1988 .\}
1989 .sp
1990 Two repositories are equal if they belong to the same pool and have the same id\&.
1991 .SS "DATA ADD METHODS"
1992 .sp
1993 .if n \{\
1994 .RS 4
1995 .\}
1996 .nf
1997 \fBSolvable add_solvable()\fR
1998 \fI$repo\fR\fB\->add_solvable()\fR;
1999 \fIrepo\fR\fB\&.add_solvable()\fR
2000 \fIrepo\fR\fB\&.add_solvable()\fR
2001 .fi
2002 .if n \{\
2003 .RE
2004 .\}
2005 .sp
2006 Add a single empty solvable to the repository\&. Returns a Solvable object, see the Solvable class for more information\&.
2007 .sp
2008 .if n \{\
2009 .RS 4
2010 .\}
2011 .nf
2012 \fBbool add_solv(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2013 \fI$repo\fR\fB\->add_solv(\fR\fI$name\fR\fB)\fR;
2014 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB)\fR
2015 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB)\fR
2016 .fi
2017 .if n \{\
2018 .RE
2019 .\}
2020 .sp
2021 .if n \{\
2022 .RS 4
2023 .\}
2024 .nf
2025 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2026 \fI$repo\fR\fB\->add_solv(\fR\fI$fp\fR\fB)\fR;
2027 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
2028 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
2029 .fi
2030 .if n \{\
2031 .RE
2032 .\}
2033 .sp
2034 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\&.
2035 .sp
2036 .if n \{\
2037 .RS 4
2038 .\}
2039 .nf
2040 \fBbool add_rpmdb(int\fR \fIflags\fR \fB= 0)\fR
2041 \fI$repo\fR\fB\->add_rpmdb()\fR;
2042 \fIrepo\fR\fB\&.add_rpmdb()\fR
2043 \fIrepo\fR\fB\&.add_rpmdb()\fR
2044 .fi
2045 .if n \{\
2046 .RE
2047 .\}
2048 .sp
2049 .if n \{\
2050 .RS 4
2051 .\}
2052 .nf
2053 \fBbool add_rpmdb_reffp(FILE *\fR\fIreffp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2054 \fI$repo\fR\fB\->add_rpmdb_reffp(\fR\fI$reffp\fR\fB)\fR;
2055 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fIreffp\fR\fB)\fR
2056 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fIreffp\fR\fB)\fR
2057 .fi
2058 .if n \{\
2059 .RE
2060 .\}
2061 .sp
2062 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\&.
2063 .sp
2064 .if n \{\
2065 .RS 4
2066 .\}
2067 .nf
2068 \fBSolvable add_rpm(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2069 my \fI$solvable\fR \fB=\fR \fI$repo\fR\fB\->add_rpm(\fR\fI$filename\fR\fB)\fR;
2070 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_rpm(\fR\fIfilename\fR\fB)\fR
2071 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_rpm(\fR\fIfilename\fR\fB)\fR
2072 .fi
2073 .if n \{\
2074 .RE
2075 .\}
2076 .sp
2077 Add the metadata of a single rpm package to the repository\&.
2078 .sp
2079 .if n \{\
2080 .RS 4
2081 .\}
2082 .nf
2083 \fBbool add_rpmdb_pubkeys(int\fR \fIflags\fR \fB= 0)\fR
2084 \fI$repo\fR\fB\->add_rpmdb_pubkeys()\fR;
2085 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
2086 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
2087 .fi
2088 .if n \{\
2089 .RE
2090 .\}
2091 .sp
2092 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\&.
2093 .sp
2094 .if n \{\
2095 .RS 4
2096 .\}
2097 .nf
2098 \fBSolvable add_pubkey(const char *\fR\fIkeyfile\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2099 my \fI$solvable\fR \fB=\fR \fI$repo\fR\fB\->add_pubkey(\fR\fI$keyfile\fR\fB)\fR;
2100 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_pubkey(\fR\fIkeyfile\fR\fB)\fR
2101 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_pubkey(\fR\fIkeyfile\fR\fB)\fR
2102 .fi
2103 .if n \{\
2104 .RE
2105 .\}
2106 .sp
2107 Add a pubkey from a file to the repository\&.
2108 .sp
2109 .if n \{\
2110 .RS 4
2111 .\}
2112 .nf
2113 \fBbool add_rpmmd(FILE *\fR\fIfp\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2114 \fI$repo\fR\fB\->add_rpmmd(\fR\fI$fp\fR\fB,\fR \fIundef\fR\fB)\fR;
2115 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fINone\fR\fB)\fR
2116 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fInil\fR\fB)\fR
2117 .fi
2118 .if n \{\
2119 .RE
2120 .\}
2121 .sp
2122 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\&.
2123 .sp
2124 .if n \{\
2125 .RS 4
2126 .\}
2127 .nf
2128 \fBbool add_repomdxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2129 \fI$repo\fR\fB\->add_repomdxml(\fR\fI$fp\fR\fB)\fR;
2130 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
2131 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
2132 .fi
2133 .if n \{\
2134 .RE
2135 .\}
2136 .sp
2137 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\&.
2138 .sp
2139 .if n \{\
2140 .RS 4
2141 .\}
2142 .nf
2143 \fBbool add_updateinfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2144 \fI$repo\fR\fB\->add_updateinfoxml(\fR\fI$fp\fR\fB)\fR;
2145 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
2146 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
2147 .fi
2148 .if n \{\
2149 .RE
2150 .\}
2151 .sp
2152 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\&.
2153 .sp
2154 .if n \{\
2155 .RS 4
2156 .\}
2157 .nf
2158 \fBbool add_deltainfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2159 \fI$repo\fR\fB\->add_deltainfoxml(\fR\fI$fp\fR\fB)\fR;
2160 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
2161 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
2162 .fi
2163 .if n \{\
2164 .RE
2165 .\}
2166 .sp
2167 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\&.
2168 .sp
2169 .if n \{\
2170 .RS 4
2171 .\}
2172 .nf
2173 \fBbool add_debdb(int\fR \fIflags\fR \fB= 0)\fR
2174 \fI$repo\fR\fB\->add_debdb()\fR;
2175 \fIrepo\fR\fB\&.add_debdb()\fR
2176 \fIrepo\fR\fB\&.add_debdb()\fR
2177 .fi
2178 .if n \{\
2179 .RE
2180 .\}
2181 .sp
2182 Add the contents of the debian installed package database to the repository\&.
2183 .sp
2184 .if n \{\
2185 .RS 4
2186 .\}
2187 .nf
2188 \fBbool add_debpackages(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2189 \fI$repo\fR\fB\->add_debpackages(\fR\fI$fp\fR\fB)\fR;
2190 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
2191 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
2192 .fi
2193 .if n \{\
2194 .RE
2195 .\}
2196 .sp
2197 Add the contents of the debian repository metadata (the "packages" file) to the repository\&.
2198 .sp
2199 .if n \{\
2200 .RS 4
2201 .\}
2202 .nf
2203 \fBSolvable add_deb(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2204 my \fI$solvable\fR \fB=\fR \fI$repo\fR\fB\->add_deb(\fR\fI$filename\fR\fB)\fR;
2205 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
2206 \fIsolvable\fR \fB=\fR \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
2207 .fi
2208 .if n \{\
2209 .RE
2210 .\}
2211 .sp
2212 Add the metadata of a single deb package to the repository\&.
2213 .sp
2214 .if n \{\
2215 .RS 4
2216 .\}
2217 .nf
2218 \fBbool add_mdk(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2219 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
2220 \fIrepo\fR\fB\&.add_mdk(\fR\fIfp\fR\fB)\fR
2221 \fIrepo\fR\fB\&.add_mdk(\fR\fIfp\fR\fB)\fR
2222 .fi
2223 .if n \{\
2224 .RE
2225 .\}
2226 .sp
2227 Add the contents of the mageia/mandriva repository metadata (the "synthesis\&.hdlist" file) to the repository\&.
2228 .sp
2229 .if n \{\
2230 .RS 4
2231 .\}
2232 .nf
2233 \fBbool add_mdk_info(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2234 \fI$repo\fR\fB\->add_mdk_info(\fR\fI$fp\fR\fB)\fR;
2235 \fIrepo\fR\fB\&.add_mdk_info(\fR\fIfp\fR\fB)\fR
2236 \fIrepo\fR\fB\&.add_mdk_info(\fR\fIfp\fR\fB)\fR
2237 .fi
2238 .if n \{\
2239 .RE
2240 .\}
2241 .sp
2242 Extend the packages from the synthesis file with the info\&.xml and files\&.xml data\&. Do not forget to specify \fBREPO_EXTEND_SOLVABLES\fR\&.
2243 .sp
2244 .if n \{\
2245 .RS 4
2246 .\}
2247 .nf
2248 \fBbool add_arch_repo(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2249 \fI$repo\fR\fB\->add_arch_repo(\fR\fI$fp\fR\fB)\fR;
2250 \fIrepo\fR\fB\&.add_arch_repo(\fR\fIfp\fR\fB)\fR
2251 \fIrepo\fR\fB\&.add_arch_repo(\fR\fIfp\fR\fB)\fR
2252 .fi
2253 .if n \{\
2254 .RE
2255 .\}
2256 .sp
2257 Add the contents of the archlinux repository metadata (the "\&.db\&.tar" file) to the repository\&.
2258 .sp
2259 .if n \{\
2260 .RS 4
2261 .\}
2262 .nf
2263 \fBbool add_arch_local(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2264 \fI$repo\fR\fB\->add_arch_local(\fR\fI$dir\fR\fB)\fR;
2265 \fIrepo\fR\fB\&.add_arch_local(\fR\fIdir\fR\fB)\fR
2266 \fIrepo\fR\fB\&.add_arch_local(\fR\fIdir\fR\fB)\fR
2267 .fi
2268 .if n \{\
2269 .RE
2270 .\}
2271 .sp
2272 Add the contents of the archlinux installed package database to the repository\&. The \fIdir\fR parameter is usually set to "/var/lib/pacman/local"\&.
2273 .sp
2274 .if n \{\
2275 .RS 4
2276 .\}
2277 .nf
2278 \fBbool add_content(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2279 \fI$repo\fR\fB\->add_content(\fR\fI$fp\fR\fB)\fR;
2280 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
2281 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
2282 .fi
2283 .if n \{\
2284 .RE
2285 .\}
2286 .sp
2287 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\&.
2288 .sp
2289 .if n \{\
2290 .RS 4
2291 .\}
2292 .nf
2293 \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
2294 \fI$repo\fR\fB\->add_susetags(\fR\fI$fp\fR\fB,\fR \fI$defvendor\fR\fB,\fR \fI$language\fR\fB)\fR;
2295 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
2296 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
2297 .fi
2298 .if n \{\
2299 .RE
2300 .\}
2301 .sp
2302 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\&.
2303 .sp
2304 .if n \{\
2305 .RS 4
2306 .\}
2307 .nf
2308 \fBbool add_products(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
2309 \fI$repo\fR\fB\->add_products(\fR\fI$dir\fR\fB)\fR;
2310 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
2311 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
2312 .fi
2313 .if n \{\
2314 .RE
2315 .\}
2316 .sp
2317 Add the installed SUSE products database to the repository\&. The \fIdir\fR parameter is usually "/etc/products\&.d"\&.
2318 .SH "THE SOLVABLE CLASS"
2319 .sp
2320 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\&.
2321 .SS "ATTRIBUTES"
2322 .sp
2323 .if n \{\
2324 .RS 4
2325 .\}
2326 .nf
2327 \fBRepo *repo;\fR                     /* read only */
2328 \fI$solvable\fR\fB\->{repo}\fR
2329 \fIsolvable\fR\fB\&.repo\fR
2330 \fIsolvable\fR\fB\&.repo\fR
2331 .fi
2332 .if n \{\
2333 .RE
2334 .\}
2335 .sp
2336 The repository this solvable belongs to\&.
2337 .sp
2338 .if n \{\
2339 .RS 4
2340 .\}
2341 .nf
2342 \fBPool *pool;\fR                     /* read only */
2343 \fI$solvable\fR\fB\->{pool}\fR
2344 \fIsolvable\fR\fB\&.pool\fR
2345 \fIsolvable\fR\fB\&.pool\fR
2346 .fi
2347 .if n \{\
2348 .RE
2349 .\}
2350 .sp
2351 The pool this solvable belongs to, same as the pool of the repo\&.
2352 .sp
2353 .if n \{\
2354 .RS 4
2355 .\}
2356 .nf
2357 \fBId id;\fR                          /* read only */
2358 \fI$solvable\fR\fB\->{id}\fR
2359 \fIsolvable\fR\fB\&.id\fR
2360 \fIsolvable\fR\fB\&.id\fR
2361 .fi
2362 .if n \{\
2363 .RE
2364 .\}
2365 .sp
2366 The specific id of the solvable\&.
2367 .sp
2368 .if n \{\
2369 .RS 4
2370 .\}
2371 .nf
2372 \fBchar *name;\fR                     /* read/write */
2373 \fI$solvable\fR\fB\->{name}\fR
2374 \fIsolvable\fR\fB\&.name\fR
2375 \fIsolvable\fR\fB\&.name\fR
2376 .fi
2377 .if n \{\
2378 .RE
2379 .\}
2380 .sp
2381 .if n \{\
2382 .RS 4
2383 .\}
2384 .nf
2385 \fBchar *evr;\fR                      /* read/write */
2386 \fI$solvable\fR\fB\->{evr}\fR
2387 \fIsolvable\fR\fB\&.evr\fR
2388 \fIsolvable\fR\fB\&.evr\fR
2389 .fi
2390 .if n \{\
2391 .RE
2392 .\}
2393 .sp
2394 .if n \{\
2395 .RS 4
2396 .\}
2397 .nf
2398 \fBchar *arch;\fR                     /* read/write */
2399 \fI$solvable\fR\fB\->{arch}\fR
2400 \fIsolvable\fR\fB\&.arch\fR
2401 \fIsolvable\fR\fB\&.arch\fR
2402 .fi
2403 .if n \{\
2404 .RE
2405 .\}
2406 .sp
2407 .if n \{\
2408 .RS 4
2409 .\}
2410 .nf
2411 \fBchar *vendor;\fR                   /* read/write */
2412 \fI$solvable\fR\fB\->{vendor}\fR
2413 \fIsolvable\fR\fB\&.vendor\fR
2414 \fIsolvable\fR\fB\&.vendor\fR
2415 .fi
2416 .if n \{\
2417 .RE
2418 .\}
2419 .sp
2420 Easy access to often used attributes of solvables\&. They are internally stored as Ids\&.
2421 .sp
2422 .if n \{\
2423 .RS 4
2424 .\}
2425 .nf
2426 \fBId nameid;\fR                      /* read/write */
2427 \fI$solvable\fR\fB\->{nameid}\fR
2428 \fIsolvable\fR\fB\&.nameid\fR
2429 \fIsolvable\fR\fB\&.nameid\fR
2430 .fi
2431 .if n \{\
2432 .RE
2433 .\}
2434 .sp
2435 .if n \{\
2436 .RS 4
2437 .\}
2438 .nf
2439 \fBId evrid;\fR                       /* read/write */
2440 \fI$solvable\fR\fB\->{evrid}\fR
2441 \fIsolvable\fR\fB\&.evrid\fR
2442 \fIsolvable\fR\fB\&.evrid\fR
2443 .fi
2444 .if n \{\
2445 .RE
2446 .\}
2447 .sp
2448 .if n \{\
2449 .RS 4
2450 .\}
2451 .nf
2452 \fBId archid;\fR                      /* read/write */
2453 \fI$solvable\fR\fB\->{archid}\fR
2454 \fIsolvable\fR\fB\&.archid\fR
2455 \fIsolvable\fR\fB\&.archid\fR
2456 .fi
2457 .if n \{\
2458 .RE
2459 .\}
2460 .sp
2461 .if n \{\
2462 .RS 4
2463 .\}
2464 .nf
2465 \fBId vendorid;\fR                    /* read/write */
2466 \fI$solvable\fR\fB\->{vendorid}\fR
2467 \fIsolvable\fR\fB\&.vendorid\fR
2468 \fIsolvable\fR\fB\&.vendorid\fR
2469 .fi
2470 .if n \{\
2471 .RE
2472 .\}
2473 .sp
2474 Raw interface to the ids\&. Useful if you want to search for a specific id and want to avoid the string compare overhead\&.
2475 .SS "METHODS"
2476 .sp
2477 .if n \{\
2478 .RS 4
2479 .\}
2480 .nf
2481 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
2482 my \fI$string\fR \fB=\fR \fI$solvable\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
2483 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
2484 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
2485 .fi
2486 .if n \{\
2487 .RE
2488 .\}
2489 .sp
2490 .if n \{\
2491 .RS 4
2492 .\}
2493 .nf
2494 \fBId lookup_id(Id\fR \fIkeyname\fR\fB)\fR
2495 my \fI$id\fR \fB=\fR \fI$solvable\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
2496 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
2497 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
2498 .fi
2499 .if n \{\
2500 .RE
2501 .\}
2502 .sp
2503 .if n \{\
2504 .RS 4
2505 .\}
2506 .nf
2507 \fBunsigned long long lookup_num(Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
2508 my \fI$num\fR \fB=\fR \fI$solvable\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
2509 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
2510 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
2511 .fi
2512 .if n \{\
2513 .RE
2514 .\}
2515 .sp
2516 .if n \{\
2517 .RS 4
2518 .\}
2519 .nf
2520 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
2521 my \fI$bool\fR \fB=\fR \fI$solvable\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
2522 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
2523 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
2524 .fi
2525 .if n \{\
2526 .RE
2527 .\}
2528 .sp
2529 .if n \{\
2530 .RS 4
2531 .\}
2532 .nf
2533 \fBChksum lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
2534 my \fI$chksum\fR \fB=\fR \fI$solvable\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
2535 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
2536 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
2537 .fi
2538 .if n \{\
2539 .RE
2540 .\}
2541 .sp
2542 .if n \{\
2543 .RS 4
2544 .\}
2545 .nf
2546 \fBId *lookup_idarray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2547 my \fI@ids\fR \fB=\fR \fI$solvable\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
2548 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
2549 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
2550 .fi
2551 .if n \{\
2552 .RE
2553 .\}
2554 .sp
2555 .if n \{\
2556 .RS 4
2557 .\}
2558 .nf
2559 \fBDep *lookup_deparray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2560 my \fI@deps\fR \fB=\fR \fI$solvable\fR\fB\->lookup_deparray(\fR\fI$keyname\fR\fB)\fR;
2561 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
2562 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
2563 .fi
2564 .if n \{\
2565 .RE
2566 .\}
2567 .sp
2568 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\&.
2569 .sp
2570 .if n \{\
2571 .RS 4
2572 .\}
2573 .nf
2574 \fBconst char *lookup_location(unsigned int *\fR\fIOUTPUT\fR\fB)\fR;
2575 my \fB(\fR\fI$location\fR\fB,\fR \fI$mediano\fR\fB) =\fR \fI$solvable\fR\fB\->lookup_location()\fR;
2576 \fIlocation\fR\fB,\fR \fImediano\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
2577 \fIlocation\fR\fB,\fR \fImediano\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
2578 .fi
2579 .if n \{\
2580 .RE
2581 .\}
2582 .sp
2583 Return a tuple containing the on\-media location and an optional media number for multi\-part repositories (e\&.g\&. repositories spawning multiple DVDs)\&.
2584 .sp
2585 .if n \{\
2586 .RS 4
2587 .\}
2588 .nf
2589 \fBconst char *lookup_sourcepkg()\fR;
2590 my \fI$sourcepkg\fR \fB=\fR \fI$solvable\fR\fB\->lookup_sourcepkg()\fR;
2591 \fIsourcepkg\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_sourcepkg()\fR
2592 \fIsourcepkg\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_sourcepkg()\fR
2593 .fi
2594 .if n \{\
2595 .RE
2596 .\}
2597 .sp
2598 Return a sourcepkg name associated with solvable\&.
2599 .sp
2600 .if n \{\
2601 .RS 4
2602 .\}
2603 .nf
2604 \fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
2605 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;
2606 \fIdi\fR \fB=\fR \fIsolvable\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2607 \fIdi\fR \fB=\fR \fIsolvable\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2608 .fi
2609 .if n \{\
2610 .RE
2611 .\}
2612 .sp
2613 .if n \{\
2614 .RS 4
2615 .\}
2616 .nf
2617 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2618 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2619 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2620 .fi
2621 .if n \{\
2622 .RE
2623 .\}
2624 .sp
2625 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
2626 .sp
2627 .if n \{\
2628 .RS 4
2629 .\}
2630 .nf
2631 \fBvoid add_deparray(Id\fR \fIkeyname\fR\fB, DepId\fR \fIdep\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR;
2632 \fI$solvable\fR\fB\->add_deparray(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR;
2633 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2634 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2635 .fi
2636 .if n \{\
2637 .RE
2638 .\}
2639 .sp
2640 Add a new dependency to the attributes stored in keyname\&.
2641 .sp
2642 .if n \{\
2643 .RS 4
2644 .\}
2645 .nf
2646 \fBvoid unset(Id\fR \fIkeyname\fR\fB)\fR;
2647 \fI$solvable\fR\fB\->unset(\fR\fI$keyname\fR\fB)\fR;
2648 \fIsolvable\fR\fB\&.unset(\fR\fIkeyname\fR\fB)\fR
2649 \fIsolvable\fR\fB\&.unset(\fR\fIkeyname\fR\fB)\fR
2650 .fi
2651 .if n \{\
2652 .RE
2653 .\}
2654 .sp
2655 Delete data stored for the specific keyname\&.
2656 .sp
2657 .if n \{\
2658 .RS 4
2659 .\}
2660 .nf
2661 \fBbool installable()\fR;
2662 \fI$solvable\fR\fB\->installable()\fR
2663 \fIsolvable\fR\fB\&.installable()\fR
2664 \fIsolvable\fR\fB\&.installable?\fR
2665 .fi
2666 .if n \{\
2667 .RE
2668 .\}
2669 .sp
2670 Return true if the solvable is installable on the system\&. Solvables are not installable if the system does not support their architecture\&.
2671 .sp
2672 .if n \{\
2673 .RS 4
2674 .\}
2675 .nf
2676 \fBbool isinstalled()\fR;
2677 \fI$solvable\fR\fB\->isinstalled()\fR
2678 \fIsolvable\fR\fB\&.isinstalled()\fR
2679 \fIsolvable\fR\fB\&.isinstalled?\fR
2680 .fi
2681 .if n \{\
2682 .RE
2683 .\}
2684 .sp
2685 Return true if the solvable is installed on the system\&.
2686 .sp
2687 .if n \{\
2688 .RS 4
2689 .\}
2690 .nf
2691 \fBbool identical(Solvable *\fR\fIother\fR\fB)\fR
2692 \fI$solvable\fR\fB\->identical(\fR\fI$other\fR\fB)\fR
2693 \fIsolvable\fR\fB\&.identical(\fR\fIother\fR\fB)\fR
2694 \fIsolvable\fR\fB\&.identical?(\fR\fIother\fR\fB)\fR
2695 .fi
2696 .if n \{\
2697 .RE
2698 .\}
2699 .sp
2700 Return true if the two solvables are identical\&.
2701 .sp
2702 .if n \{\
2703 .RS 4
2704 .\}
2705 .nf
2706 \fBint evrcmp(Solvable *\fR\fIother\fR\fB)\fR
2707 \fI$solvable\fR\fB\->evrcmp(\fR\fI$other\fR\fB)\fR
2708 \fIsolvable\fR\fB\&.evrcmp(\fR\fIother\fR\fB)\fR
2709 \fIsolvable\fR\fB\&.evrcmp(\fR\fIother\fR\fB)\fR
2710 .fi
2711 .if n \{\
2712 .RE
2713 .\}
2714 .sp
2715 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\&.
2716 .sp
2717 .if n \{\
2718 .RS 4
2719 .\}
2720 .nf
2721 \fBint matchesdep(Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2722 \fI$solvable\fR\fB\->matchesdep(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR
2723 \fIsolvable\fR\fB\&.matchesdep(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2724 \fIsolvable\fR\fB\&.matchesdep?(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2725 .fi
2726 .if n \{\
2727 .RE
2728 .\}
2729 .sp
2730 Return true if the dependencies stored in keyname match the specified dependency\&.
2731 .sp
2732 .if n \{\
2733 .RS 4
2734 .\}
2735 .nf
2736 \fBSelection Selection(int\fR \fIsetflags\fR \fB= 0)\fR
2737 my \fI$sel\fR \fB=\fR \fI$solvable\fR\fB\->Selection()\fR;
2738 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
2739 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
2740 .fi
2741 .if n \{\
2742 .RE
2743 .\}
2744 .sp
2745 Create a Selection containing just the single solvable\&.
2746 .sp
2747 .if n \{\
2748 .RS 4
2749 .\}
2750 .nf
2751 \fBconst char *str()\fR
2752 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str()\fR;
2753 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
2754 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
2755 .fi
2756 .if n \{\
2757 .RE
2758 .\}
2759 .sp
2760 Return a string describing the solvable\&. The string consists of the name, version, and architecture of the Solvable\&.
2761 .sp
2762 .if n \{\
2763 .RS 4
2764 .\}
2765 .nf
2766 \fB<stringification>\fR
2767 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str\fR;
2768 \fIstr\fR \fB= str(\fR\fIsolvable\fR\fB)\fR
2769 \fIstr\fR \fB=\fR \fIsolvable\fR\fB\&.to_s\fR
2770 .fi
2771 .if n \{\
2772 .RE
2773 .\}
2774 .sp
2775 Same as calling the str() method\&.
2776 .sp
2777 .if n \{\
2778 .RS 4
2779 .\}
2780 .nf
2781 \fB<equality>\fR
2782 \fBif (\fR\fI$solvable1\fR \fB==\fR \fI$solvable2\fR\fB)\fR
2783 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR\fB:\fR
2784 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR
2785 .fi
2786 .if n \{\
2787 .RE
2788 .\}
2789 .sp
2790 Two solvables are equal if they are part of the same pool and have the same ids\&.
2791 .SH "THE DATAITERATOR CLASS"
2792 .sp
2793 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\&.
2794 .SS "CONSTANTS"
2795 .PP
2796 \fBSEARCH_STRING\fR
2797 .RS 4
2798 Return a match if the search string matches the value\&.
2799 .RE
2800 .PP
2801 \fBSEARCH_STRINGSTART\fR
2802 .RS 4
2803 Return a match if the value starts with the search string\&.
2804 .RE
2805 .PP
2806 \fBSEARCH_STRINGEND\fR
2807 .RS 4
2808 Return a match if the value ends with the search string\&.
2809 .RE
2810 .PP
2811 \fBSEARCH_SUBSTRING\fR
2812 .RS 4
2813 Return a match if the search string can be matched somewhere in the value\&.
2814 .RE
2815 .PP
2816 \fBSEARCH_GLOB\fR
2817 .RS 4
2818 Do a glob match of the search string against the value\&.
2819 .RE
2820 .PP
2821 \fBSEARCH_REGEX\fR
2822 .RS 4
2823 Do a regular expression match of the search string against the value\&.
2824 .RE
2825 .PP
2826 \fBSEARCH_NOCASE\fR
2827 .RS 4
2828 Ignore case when matching strings\&. Works for all the above match types\&.
2829 .RE
2830 .PP
2831 \fBSEARCH_FILES\fR
2832 .RS 4
2833 Match the complete filenames of the file list, not just the base name\&.
2834 .RE
2835 .PP
2836 \fBSEARCH_COMPLETE_FILELIST\fR
2837 .RS 4
2838 When matching the file list, check every file of the package not just the subset from the primary metadata\&.
2839 .RE
2840 .PP
2841 \fBSEARCH_CHECKSUMS\fR
2842 .RS 4
2843 Allow the matching of checksum entries\&.
2844 .RE
2845 .SS "METHODS"
2846 .sp
2847 .if n \{\
2848 .RS 4
2849 .\}
2850 .nf
2851 \fBvoid prepend_keyname(Id\fR \fIkeyname\fR\fB)\fR;
2852 \fI$di\fR\fB\->prepend_keyname(\fR\fI$keyname\fR\fB)\fR;
2853 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2854 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2855 .fi
2856 .if n \{\
2857 .RE
2858 .\}
2859 .sp
2860 Do a sub\-search in the array stored in keyname\&.
2861 .sp
2862 .if n \{\
2863 .RS 4
2864 .\}
2865 .nf
2866 \fBvoid skip_solvable()\fR;
2867 \fI$di\fR\fB\->skip_solvable()\fR;
2868 \fIdi\fR\fB\&.skip_solvable()\fR
2869 \fIdi\fR\fB\&.skip_solvable()\fR
2870 .fi
2871 .if n \{\
2872 .RE
2873 .\}
2874 .sp
2875 Stop matching the current solvable and advance to the next one\&.
2876 .sp
2877 .if n \{\
2878 .RS 4
2879 .\}
2880 .nf
2881 \fB<iteration>\fR
2882 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2883 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2884 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2885 .fi
2886 .if n \{\
2887 .RE
2888 .\}
2889 .sp
2890 Iterate through the matches\&. If there is a match, the object in d will be of type Datamatch\&.
2891 .SH "THE DATAMATCH CLASS"
2892 .sp
2893 Objects of this type will be created for every value matched by a dataiterator\&.
2894 .SS "ATTRIBUTES"
2895 .sp
2896 .if n \{\
2897 .RS 4
2898 .\}
2899 .nf
2900 \fBPool *pool;\fR                             /* read only */
2901 \fI$d\fR\fB\->{pool}\fR
2902 \fId\fR\fB\&.pool\fR
2903 \fId\fR\fB\&.pool\fR
2904 .fi
2905 .if n \{\
2906 .RE
2907 .\}
2908 .sp
2909 Back pointer to pool\&.
2910 .sp
2911 .if n \{\
2912 .RS 4
2913 .\}
2914 .nf
2915 \fBRepo *repo;\fR                             /* read only */
2916 \fI$d\fR\fB\->{repo}\fR
2917 \fId\fR\fB\&.repo\fR
2918 \fId\fR\fB\&.repo\fR
2919 .fi
2920 .if n \{\
2921 .RE
2922 .\}
2923 .sp
2924 The repository containing the matched object\&.
2925 .sp
2926 .if n \{\
2927 .RS 4
2928 .\}
2929 .nf
2930 \fBSolvable *solvable;\fR                     /* read only */
2931 \fI$d\fR\fB\->{solvable}\fR
2932 \fId\fR\fB\&.solvable\fR
2933 \fId\fR\fB\&.solvable\fR
2934 .fi
2935 .if n \{\
2936 .RE
2937 .\}
2938 .sp
2939 The solvable containing the value that was matched\&.
2940 .sp
2941 .if n \{\
2942 .RS 4
2943 .\}
2944 .nf
2945 \fBId solvid;\fR                              /* read only */
2946 \fI$d\fR\fB\->{solvid}\fR
2947 \fId\fR\fB\&.solvid\fR
2948 \fId\fR\fB\&.solvid\fR
2949 .fi
2950 .if n \{\
2951 .RE
2952 .\}
2953 .sp
2954 The id of the solvable that matched\&.
2955 .sp
2956 .if n \{\
2957 .RS 4
2958 .\}
2959 .nf
2960 \fBId\fR \fIkey_id\fR;
2961 \fI$d\fR\fB\->{\fR\fIkey_id\fR\fB}\fR
2962 \fId\fR\fB\&.key_id\fR
2963 \fId\fR\fB\&.key_id\fR
2964 .fi
2965 .if n \{\
2966 .RE
2967 .\}
2968 .sp
2969 .if n \{\
2970 .RS 4
2971 .\}
2972 .nf
2973 \fBconst char *\fR\fIkey_idstr\fR;
2974 \fI$d\fR\fB\->{\fR\fIkey_idstr\fR\fB}\fR
2975 \fId\fR\fB\&.key_idstr\fR
2976 \fId\fR\fB\&.key_idstr\fR
2977 .fi
2978 .if n \{\
2979 .RE
2980 .\}
2981 .sp
2982 The keyname that matched, either as id or string\&.
2983 .sp
2984 .if n \{\
2985 .RS 4
2986 .\}
2987 .nf
2988 \fBId\fR \fItype_id\fR;
2989 \fI$d\fR\fB\->{\fR\fItype_id\fR\fB}\fR
2990 \fId\fR\fB\&.type_id\fR
2991 \fId\fR\fB\&.type_id\fR
2992 .fi
2993 .if n \{\
2994 .RE
2995 .\}
2996 .sp
2997 .if n \{\
2998 .RS 4
2999 .\}
3000 .nf
3001 \fBconst char *\fR\fItype_idstr\fR;
3002 \fI$d\fR\fB\->{\fR\fItype_idstr\fR\fB}\fR;
3003 \fId\fR\fB\&.type_idstr\fR
3004 \fId\fR\fB\&.type_idstr\fR
3005 .fi
3006 .if n \{\
3007 .RE
3008 .\}
3009 .sp
3010 The key type of the value that was matched, either as id or string\&.
3011 .sp
3012 .if n \{\
3013 .RS 4
3014 .\}
3015 .nf
3016 \fBId\fR \fIid\fR;
3017 \fI$d\fR\fB\->{id}\fR
3018 \fId\fR\fB\&.id\fR
3019 \fId\fR\fB\&.id\fR
3020 .fi
3021 .if n \{\
3022 .RE
3023 .\}
3024 .sp
3025 .if n \{\
3026 .RS 4
3027 .\}
3028 .nf
3029 \fBId\fR \fIidstr\fR;
3030 \fI$d\fR\fB\->{idstr}\fR
3031 \fId\fR\fB\&.idstr\fR
3032 \fId\fR\fB\&.idstr\fR
3033 .fi
3034 .if n \{\
3035 .RE
3036 .\}
3037 .sp
3038 The Id of the value that was matched (only valid for id types), either as id or string\&.
3039 .sp
3040 .if n \{\
3041 .RS 4
3042 .\}
3043 .nf
3044 \fBconst char *\fR\fIstr\fR;
3045 \fI$d\fR\fB\->{str}\fR
3046 \fId\fR\fB\&.str\fR
3047 \fId\fR\fB\&.str\fR
3048 .fi
3049 .if n \{\
3050 .RE
3051 .\}
3052 .sp
3053 The string value that was matched (only valid for string types)\&.
3054 .sp
3055 .if n \{\
3056 .RS 4
3057 .\}
3058 .nf
3059 \fBunsigned long long\fR \fInum\fR;
3060 \fI$d\fR\fB\->{num}\fR
3061 \fId\fR\fB\&.num\fR
3062 \fId\fR\fB\&.num\fR
3063 .fi
3064 .if n \{\
3065 .RE
3066 .\}
3067 .sp
3068 The numeric value that was matched (only valid for numeric types)\&.
3069 .sp
3070 .if n \{\
3071 .RS 4
3072 .\}
3073 .nf
3074 \fBunsigned int\fR \fInum2\fR;
3075 \fI$d\fR\fB\->{num2}\fR
3076 \fId\fR\fB\&.num2\fR
3077 \fId\fR\fB\&.num2\fR
3078 .fi
3079 .if n \{\
3080 .RE
3081 .\}
3082 .sp
3083 The secondary numeric value that was matched (only valid for types containing two values)\&.
3084 .sp
3085 .if n \{\
3086 .RS 4
3087 .\}
3088 .nf
3089 \fBunsigned int\fR \fIbinary\fR;
3090 \fI$d\fR\fB\->{binary}\fR
3091 \fId\fR\fB\&.binary\fR
3092 \fId\fR\fB\&.binary\fR
3093 .fi
3094 .if n \{\
3095 .RE
3096 .\}
3097 .sp
3098 The value in binary form, useful for checksums and other data that cannot be represented as a string\&.
3099 .SS "METHODS"
3100 .sp
3101 .if n \{\
3102 .RS 4
3103 .\}
3104 .nf
3105 \fBDatapos pos()\fR;
3106 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->pos()\fR;
3107 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
3108 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
3109 .fi
3110 .if n \{\
3111 .RE
3112 .\}
3113 .sp
3114 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\&.
3115 .sp
3116 .if n \{\
3117 .RS 4
3118 .\}
3119 .nf
3120 \fBDatapos parentpos()\fR;
3121 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->parentpos()\fR;
3122 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
3123 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
3124 .fi
3125 .if n \{\
3126 .RE
3127 .\}
3128 .sp
3129 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\&.
3130 .sp
3131 .if n \{\
3132 .RS 4
3133 .\}
3134 .nf
3135 \fB<stringification>\fR
3136 my \fI$str\fR \fB=\fR \fI$d\fR\fB\->str\fR;
3137 \fIstr\fR \fB= str(\fR\fId\fR\fB)\fR
3138 \fIstr\fR \fB=\fR \fId\fR\fB\&.to_s\fR
3139 .fi
3140 .if n \{\
3141 .RE
3142 .\}
3143 .sp
3144 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\&.
3145 .SH "THE SELECTION CLASS"
3146 .sp
3147 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\&.
3148 .SS "CONSTANTS"
3149 .PP
3150 \fBSELECTION_NAME\fR
3151 .RS 4
3152 Create the selection by matching package names\&.
3153 .RE
3154 .PP
3155 \fBSELECTION_PROVIDES\fR
3156 .RS 4
3157 Create the selection by matching package provides\&.
3158 .RE
3159 .PP
3160 \fBSELECTION_FILELIST\fR
3161 .RS 4
3162 Create the selection by matching package files\&.
3163 .RE
3164 .PP
3165 \fBSELECTION_CANON\fR
3166 .RS 4
3167 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\&.
3168 .RE
3169 .PP
3170 \fBSELECTION_DOTARCH\fR
3171 .RS 4
3172 Allow an "\&.<architecture>" suffix when matching names or provides\&.
3173 .RE
3174 .PP
3175 \fBSELECTION_REL\fR
3176 .RS 4
3177 Allow the specification of a relation when matching names or dependencies, e\&.g\&. "name >= 1\&.2"\&.
3178 .RE
3179 .PP
3180 \fBSELECTION_GLOB\fR
3181 .RS 4
3182 Allow glob matching for package names, package provides, and file names\&.
3183 .RE
3184 .PP
3185 \fBSELECTION_NOCASE\fR
3186 .RS 4
3187 Ignore case when matching package names, package provides, and file names\&.
3188 .RE
3189 .PP
3190 \fBSELECTION_FLAT\fR
3191 .RS 4
3192 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\&.
3193 .RE
3194 .PP
3195 \fBSELECTION_SKIP_KIND\fR
3196 .RS 4
3197 Remove a "packagekind:" prefix from the package names\&.
3198 .RE
3199 .PP
3200 \fBSELECTION_MATCH_DEPSTR\fR
3201 .RS 4
3202 When matching dependencies, do a string match on the result of dep2str instead of using the normal dependency intersect algorithm\&.
3203 .RE
3204 .PP
3205 \fBSELECTION_INSTALLED_ONLY\fR
3206 .RS 4
3207 Limit the package search to installed packages\&.
3208 .RE
3209 .PP
3210 \fBSELECTION_SOURCE_ONLY\fR
3211 .RS 4
3212 Limit the package search to source packages only\&.
3213 .RE
3214 .PP
3215 \fBSELECTION_WITH_SOURCE\fR
3216 .RS 4
3217 Extend the package search to also match source packages\&. The default is only to match binary packages\&.
3218 .RE
3219 .PP
3220 \fBSELECTION_WITH_DISABLED\fR
3221 .RS 4
3222 Extend the package search to also include disabled packages\&.
3223 .RE
3224 .PP
3225 \fBSELECTION_WITH_BADARCH\fR
3226 .RS 4
3227 Extend the package search to also include packages that are not installable on the configured architecture\&.
3228 .RE
3229 .PP
3230 \fBSELECTION_WITH_ALL\fR
3231 .RS 4
3232 Shortcut for selecting the three modifiers above\&.
3233 .RE
3234 .PP
3235 \fBSELECTION_ADD\fR
3236 .RS 4
3237 Add the result of the match to the current selection instead of replacing it\&.
3238 .RE
3239 .PP
3240 \fBSELECTION_SUBTRACT\fR
3241 .RS 4
3242 Remove the result of the match to the current selection instead of replacing it\&.
3243 .RE
3244 .PP
3245 \fBSELECTION_FILTER\fR
3246 .RS 4
3247 Intersect the result of the match to the current selection instead of replacing it\&.
3248 .RE
3249 .SS "ATTRIBUTES"
3250 .sp
3251 .if n \{\
3252 .RS 4
3253 .\}
3254 .nf
3255 \fBPool *pool;\fR                             /* read only */
3256 \fI$d\fR\fB\->{pool}\fR
3257 \fId\fR\fB\&.pool\fR
3258 \fId\fR\fB\&.pool\fR
3259 .fi
3260 .if n \{\
3261 .RE
3262 .\}
3263 .sp
3264 Back pointer to pool\&.
3265 .sp
3266 .if n \{\
3267 .RS 4
3268 .\}
3269 .nf
3270 \fBint flags;\fR                              /* read only */
3271 \fI$sel\fR\fB\->{flags}\fR
3272 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags\fR
3273 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags\fR
3274 .fi
3275 .if n \{\
3276 .RE
3277 .\}
3278 .sp
3279 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\&.
3280 .SS "METHODS"
3281 .sp
3282 .if n \{\
3283 .RS 4
3284 .\}
3285 .nf
3286 \fBbool isempty()\fR
3287 \fI$sel\fR\fB\->isempty()\fR
3288 \fIsel\fR\fB\&.isempty()\fR
3289 \fIsel\fR\fB\&.isempty?\fR
3290 .fi
3291 .if n \{\
3292 .RE
3293 .\}
3294 .sp
3295 Return true if the selection is empty, i\&.e\&. no package could be matched\&.
3296 .sp
3297 .if n \{\
3298 .RS 4
3299 .\}
3300 .nf
3301 \fBSelection clone(int\fR \fIflags\fR \fB= 0)\fR
3302 my \fI$cloned\fR \fB=\fR \fI$sel\fR\fB\->clone()\fR;
3303 \fIcloned\fR \fB=\fR \fIsel\fR\fB\&.clone()\fR
3304 \fIcloned\fR \fB=\fR \fIsel\fR\fB\&.clone()\fR
3305 .fi
3306 .if n \{\
3307 .RE
3308 .\}
3309 .sp
3310 Return a copy of a selection\&.
3311 .sp
3312 .if n \{\
3313 .RS 4
3314 .\}
3315 .nf
3316 \fBvoid filter(Selection *\fR\fIother\fR\fB)\fR
3317 \fI$sel\fR\fB\->filter(\fR\fI$other\fR\fB)\fR;
3318 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
3319 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
3320 .fi
3321 .if n \{\
3322 .RE
3323 .\}
3324 .sp
3325 Intersect two selections\&. Packages will only stay in the selection if there are also included in the other selecting\&. Does an in\-place modification\&.
3326 .sp
3327 .if n \{\
3328 .RS 4
3329 .\}
3330 .nf
3331 \fBvoid add(Selection *\fR\fIother\fR\fB)\fR
3332 \fI$sel\fR\fB\->add(\fR\fI$other\fR\fB)\fR;
3333 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
3334 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
3335 .fi
3336 .if n \{\
3337 .RE
3338 .\}
3339 .sp
3340 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\&.
3341 .sp
3342 .if n \{\
3343 .RS 4
3344 .\}
3345 .nf
3346 \fBvoid subtract(Selection *\fR\fIother\fR\fB)\fR
3347 \fI$sel\fR\fB\->subtract(\fR\fI$other\fR\fB)\fR;
3348 \fIsel\fR\fB\&.subtract(\fR\fIother\fR\fB)\fR
3349 \fIsel\fR\fB\&.subtract(\fR\fIother\fR\fB)\fR
3350 .fi
3351 .if n \{\
3352 .RE
3353 .\}
3354 .sp
3355 Remove the packages of the other selection from the packages of the selection object\&. Does an in\-place modification\&.
3356 .sp
3357 .if n \{\
3358 .RS 4
3359 .\}
3360 .nf
3361 \fBvoid add_raw(Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
3362 \fI$sel\fR\fB\->add_raw(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
3363 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
3364 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
3365 .fi
3366 .if n \{\
3367 .RE
3368 .\}
3369 .sp
3370 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\&.
3371 .sp
3372 .if n \{\
3373 .RS 4
3374 .\}
3375 .nf
3376 \fBJob *jobs(int\fR \fIaction\fR\fB)\fR
3377 my \fI@jobs\fR \fB=\fR \fI$sel\fR\fB\->jobs(\fR\fI$action\fR\fB)\fR;
3378 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
3379 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
3380 .fi
3381 .if n \{\
3382 .RE
3383 .\}
3384 .sp
3385 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\&.
3386 .sp
3387 .if n \{\
3388 .RS 4
3389 .\}
3390 .nf
3391 \fBSolvable *solvables()\fR
3392 my \fI@solvables\fR \fB=\fR \fI$sel\fR\fB\->solvables()\fR;
3393 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
3394 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
3395 .fi
3396 .if n \{\
3397 .RE
3398 .\}
3399 .sp
3400 Convert a selection into an array of Solvable objects\&.
3401 .sp
3402 .if n \{\
3403 .RS 4
3404 .\}
3405 .nf
3406 \fBvoid select(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB)\fR
3407 \fI$sel\fR\fB\->select(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
3408 \fIsel\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
3409 \fIsel\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
3410 .fi
3411 .if n \{\
3412 .RE
3413 .\}
3414 .sp
3415 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\&.
3416 .sp
3417 .if n \{\
3418 .RS 4
3419 .\}
3420 .nf
3421 \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
3422 \fI$sel\fR\fB\->matchdeps(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
3423 \fIsel\fR\fB\&.matchdeps(\fR\fIname\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3424 \fIsel\fR\fB\&.matchdeps(\fR\fIname\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3425 .fi
3426 .if n \{\
3427 .RE
3428 .\}
3429 .sp
3430 Do a matchdeps operation and combine the result with the current selection\&.
3431 .sp
3432 .if n \{\
3433 .RS 4
3434 .\}
3435 .nf
3436 \fBvoid matchdepid(DepId\fR \fIdep\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
3437 \fI$sel\fR\fB\->matchdepid(\fR\fI$dep\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
3438 \fIsel\fR\fB\&.matchdepid(\fR\fIdep\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3439 \fIsel\fR\fB\&.matchdepid(\fR\fIdep\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3440 .fi
3441 .if n \{\
3442 .RE
3443 .\}
3444 .sp
3445 Do a matchdepid operation and combine the result with the current selection\&.
3446 .sp
3447 .if n \{\
3448 .RS 4
3449 .\}
3450 .nf
3451 \fBvoid matchsolvable(Solvable\fR \fIsolvable\fR\fB, int\fR \fIflags\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
3452 \fI$sel\fR\fB\->matchsolvable(\fR\fI$solvable\fR\fB,\fR \fI$flags\fR\fB,\fR \fI$keyname\fR\fB)\fR;
3453 \fIsel\fR\fB\&.matchsolvable(\fR\fIsolvable\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3454 \fIsel\fR\fB\&.matchsolvable(\fR\fIsolvable\fR\fB,\fR \fIflags\fR\fB,\fR \fIkeyname\fR\fB)\fR
3455 .fi
3456 .if n \{\
3457 .RE
3458 .\}
3459 .sp
3460 Do a matchsolvable operation and combine the result with the current selection\&.
3461 .sp
3462 .if n \{\
3463 .RS 4
3464 .\}
3465 .nf
3466 \fB<stringification>\fR
3467 my \fI$str\fR \fB=\fR \fI$sel\fR\fB\->str\fR;
3468 \fIstr\fR \fB= str(\fR\fIsel\fR\fB)\fR
3469 \fIstr\fR \fB=\fR \fIsel\fR\fB\&.to_s\fR
3470 .fi
3471 .if n \{\
3472 .RE
3473 .\}
3474 .sp
3475 Return a string describing the selection\&.
3476 .SH "THE JOB CLASS"
3477 .sp
3478 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\&.
3479 .SS "CONSTANTS"
3480 .sp
3481 Selection constants:
3482 .PP
3483 \fBSOLVER_SOLVABLE\fR
3484 .RS 4
3485 The \(lqwhat\(rq part is the id of a solvable\&.
3486 .RE
3487 .PP
3488 \fBSOLVER_SOLVABLE_NAME\fR
3489 .RS 4
3490 The \(lqwhat\(rq part is the id of a package name\&.
3491 .RE
3492 .PP
3493 \fBSOLVER_SOLVABLE_PROVIDES\fR
3494 .RS 4
3495 The \(lqwhat\(rq part is the id of a package provides\&.
3496 .RE
3497 .PP
3498 \fBSOLVER_SOLVABLE_ONE_OF\fR
3499 .RS 4
3500 The \(lqwhat\(rq part is an offset into the \(lqwhatprovides\(rq data, created by calling the towhatprovides() pool method\&.
3501 .RE
3502 .PP
3503 \fBSOLVER_SOLVABLE_REPO\fR
3504 .RS 4
3505 The \(lqwhat\(rq part is the id of a repository\&.
3506 .RE
3507 .PP
3508 \fBSOLVER_SOLVABLE_ALL\fR
3509 .RS 4
3510 The \(lqwhat\(rq part is ignored, all packages are selected\&.
3511 .RE
3512 .PP
3513 \fBSOLVER_SOLVABLE_SELECTMASK\fR
3514 .RS 4
3515 A mask containing all the above selection bits\&.
3516 .RE
3517 .sp
3518 Action constants:
3519 .PP
3520 \fBSOLVER_NOOP\fR
3521 .RS 4
3522 Do nothing\&.
3523 .RE
3524 .PP
3525 \fBSOLVER_INSTALL\fR
3526 .RS 4
3527 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)\&.
3528 .RE
3529 .PP
3530 \fBSOLVER_ERASE\fR
3531 .RS 4
3532 Erase all of the packages from the specified set\&. If a package is not installed, erasing it will keep it from getting installed\&.
3533 .RE
3534 .PP
3535 \fBSOLVER_UPDATE\fR
3536 .RS 4
3537 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\&.
3538 .RE
3539 .PP
3540 \fBSOLVER_WEAKENDEPS\fR
3541 .RS 4
3542 Allow to break the dependencies of the matching packages\&. Handle with care\&.
3543 .RE
3544 .PP
3545 \fBSOLVER_MULTIVERSION\fR
3546 .RS 4
3547 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)\&.
3548 .RE
3549 .PP
3550 \fBSOLVER_LOCK\fR
3551 .RS 4
3552 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\&.
3553 .RE
3554 .PP
3555 \fBSOLVER_DISTUPGRADE\fR
3556 .RS 4
3557 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\&.
3558 .RE
3559 .PP
3560 \fBSOLVER_DROP_ORPHANED\fR
3561 .RS 4
3562 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\&.
3563 .RE
3564 .PP
3565 \fBSOLVER_VERIFY\fR
3566 .RS 4
3567 Fix dependency problems of matching installed packages\&. The default is to ignore dependency problems for installed packages\&.
3568 .RE
3569 .PP
3570 \fBSOLVER_USERINSTALLED\fR
3571 .RS 4
3572 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\&.
3573 .RE
3574 .PP
3575 \fBSOLVER_ALLOWUNINSTALL\fR
3576 .RS 4
3577 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\&.
3578 .RE
3579 .PP
3580 \fBSOLVER_FAVOR\fR
3581 .RS 4
3582 Prefer the specified packages if the solver encounters an alternative\&. If a job contains multiple matching favor/disfavor elements, the last one takes precedence\&.
3583 .RE
3584 .PP
3585 \fBSOLVER_DISFAVOR\fR
3586 .RS 4
3587 Avoid the specified packages if the solver encounters an alternative\&. This can also be used to block recommended or supplemented packages from being installed\&.
3588 .RE
3589 .PP
3590 \fBSOLVER_JOBMASK\fR
3591 .RS 4
3592 A mask containing all the above action bits\&.
3593 .RE
3594 .sp
3595 Action modifier constants:
3596 .PP
3597 \fBSOLVER_WEAK\fR
3598 .RS 4
3599 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\&.
3600 .RE
3601 .PP
3602 \fBSOLVER_ESSENTIAL\fR
3603 .RS 4
3604 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)\&.
3605 .RE
3606 .PP
3607 \fBSOLVER_CLEANDEPS\fR
3608 .RS 4
3609 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\&.
3610 .RE
3611 .PP
3612 \fBSOLVER_FORCEBEST\fR
3613 .RS 4
3614 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\&.
3615 .RE
3616 .PP
3617 \fBSOLVER_TARGETED\fR
3618 .RS 4
3619 Forces targeted operation update and distupgrade jobs\&. See the section about targeted updates about more information\&.
3620 .RE
3621 .sp
3622 Set constants\&.
3623 .PP
3624 \fBSOLVER_SETEV\fR
3625 .RS 4
3626 The job specified the exact epoch and version of the package set\&.
3627 .RE
3628 .PP
3629 \fBSOLVER_SETEVR\fR
3630 .RS 4
3631 The job specified the exact epoch, version, and release of the package set\&.
3632 .RE
3633 .PP
3634 \fBSOLVER_SETARCH\fR
3635 .RS 4
3636 The job specified the exact architecture of the packages from the set\&.
3637 .RE
3638 .PP
3639 \fBSOLVER_SETVENDOR\fR
3640 .RS 4
3641 The job specified the exact vendor of the packages from the set\&.
3642 .RE
3643 .PP
3644 \fBSOLVER_SETREPO\fR
3645 .RS 4
3646 The job specified the exact repository of the packages from the set\&.
3647 .RE
3648 .PP
3649 \fBSOLVER_SETNAME\fR
3650 .RS 4
3651 The job specified the exact name of the packages from the set\&.
3652 .RE
3653 .PP
3654 \fBSOLVER_NOAUTOSET\fR
3655 .RS 4
3656 Turn of automatic set flag generation for SOLVER_SOLVABLE jobs\&.
3657 .RE
3658 .PP
3659 \fBSOLVER_SETMASK\fR
3660 .RS 4
3661 A mask containing all the above set bits\&.
3662 .RE
3663 .sp
3664 See the section about set bits for more information\&.
3665 .SS "ATTRIBUTES"
3666 .sp
3667 .if n \{\
3668 .RS 4
3669 .\}
3670 .nf
3671 \fBPool *pool;\fR                             /* read only */
3672 \fI$job\fR\fB\->{pool}\fR
3673 \fId\fR\fB\&.pool\fR
3674 \fId\fR\fB\&.pool\fR
3675 .fi
3676 .if n \{\
3677 .RE
3678 .\}
3679 .sp
3680 Back pointer to pool\&.
3681 .sp
3682 .if n \{\
3683 .RS 4
3684 .\}
3685 .nf
3686 \fBId how;\fR                                 /* read/write */
3687 \fI$job\fR\fB\->{how}\fR
3688 \fId\fR\fB\&.how\fR
3689 \fId\fR\fB\&.how\fR
3690 .fi
3691 .if n \{\
3692 .RE
3693 .\}
3694 .sp
3695 Union of the selection, action, action modifier, and set flags\&. The selection part describes the semantics of the \(lqwhat\(rq Id\&.
3696 .sp
3697 .if n \{\
3698 .RS 4
3699 .\}
3700 .nf
3701 \fBId what;\fR                                /* read/write */
3702 \fI$job\fR\fB\->{what}\fR
3703 \fId\fR\fB\&.what\fR
3704 \fId\fR\fB\&.what\fR
3705 .fi
3706 .if n \{\
3707 .RE
3708 .\}
3709 .sp
3710 Id describing the set of packages, the meaning depends on the selection part of the \(lqhow\(rq attribute\&.
3711 .SS "METHODS"
3712 .sp
3713 .if n \{\
3714 .RS 4
3715 .\}
3716 .nf
3717 \fBSolvable *solvables()\fR
3718 my \fI@solvables\fR \fB=\fR \fI$job\fR\fB\->solvables()\fR;
3719 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
3720 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
3721 .fi
3722 .if n \{\
3723 .RE
3724 .\}
3725 .sp
3726 Return the set of solvables of the job as an array of Solvable objects\&.
3727 .sp
3728 .if n \{\
3729 .RS 4
3730 .\}
3731 .nf
3732 \fBbool isemptyupdate()\fR;
3733 \fI$job\fR\fB\->isemptyupdate()\fR
3734 \fIjob\fR\fB\&.isemptyupdate()\fR
3735 \fIjob\fR\fB\&.isemptyupdate?\fR
3736 .fi
3737 .if n \{\
3738 .RE
3739 .\}
3740 .sp
3741 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\&.
3742 .sp
3743 .if n \{\
3744 .RS 4
3745 .\}
3746 .nf
3747 \fB<stringification>\fR
3748 my \fI$str\fR \fB=\fR \fI$job\fR\fB\->str\fR;
3749 \fIstr\fR \fB= str(\fR\fIjob\fR\fB)\fR
3750 \fIstr\fR \fB=\fR \fIjob\fR\fB\&.to_s\fR
3751 .fi
3752 .if n \{\
3753 .RE
3754 .\}
3755 .sp
3756 Return a string describing the job\&.
3757 .sp
3758 .if n \{\
3759 .RS 4
3760 .\}
3761 .nf
3762 \fB<equality>\fR
3763 \fBif (\fR\fI$job1\fR \fB==\fR \fI$job2\fR\fB)\fR
3764 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR\fB:\fR
3765 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR
3766 .fi
3767 .if n \{\
3768 .RE
3769 .\}
3770 .sp
3771 Two jobs are equal if they belong to the same pool and both the \(lqhow\(rq and the \(lqwhat\(rq attributes are the same\&.
3772 .SS "TARGETED UPDATES"
3773 .sp
3774 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\&.
3775 .sp
3776 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\&.
3777 .sp
3778 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)\&.
3779 .sp
3780 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\&.
3781 .sp
3782 An untargeted update of "B" will do nothing, as "B" is not installed\&.
3783 .sp
3784 An targeted update of "B" will update "A\-1\&.1" to "B"\&.
3785 .sp
3786 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\&.
3787 .sp
3788 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\&.
3789 .sp
3790 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\&.
3791 .SS "SET BITS"
3792 .sp
3793 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\&.
3794 .sp
3795 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\&.
3796 .SH "THE SOLVER CLASS"
3797 .sp
3798 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\&.
3799 .SS "CONSTANTS"
3800 .sp
3801 Flags to modify some of the solver\(cqs behavior:
3802 .PP
3803 \fBSOLVER_FLAG_ALLOW_DOWNGRADE\fR
3804 .RS 4
3805 Allow the solver to downgrade packages without asking for confirmation (i\&.e\&. reporting a problem)\&.
3806 .RE
3807 .PP
3808 \fBSOLVER_FLAG_ALLOW_ARCHCHANGE\fR
3809 .RS 4
3810 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\&.
3811 .RE
3812 .PP
3813 \fBSOLVER_FLAG_ALLOW_VENDORCHANGE\fR
3814 .RS 4
3815 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\&.
3816 .RE
3817 .PP
3818 \fBSOLVER_FLAG_ALLOW_NAMECHANGE\fR
3819 .RS 4
3820 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\&.
3821 .RE
3822 .PP
3823 \fBSOLVER_FLAG_ALLOW_UNINSTALL\fR
3824 .RS 4
3825 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\&.
3826 .RE
3827 .PP
3828 \fBSOLVER_FLAG_DUP_ALLOW_DOWNGRADE\fR
3829 .RS 4
3830 Like SOLVER_FLAG_ALLOW_DOWNGRADE, but used in distupgrade mode\&.
3831 .RE
3832 .PP
3833 \fBSOLVER_FLAG_DUP_ALLOW_ARCHCHANGE\fR
3834 .RS 4
3835 Like SOLVER_FLAG_ALLOW_ARCHCHANGE, but used in distupgrade mode\&.
3836 .RE
3837 .PP
3838 \fBSOLVER_FLAG_DUP_ALLOW_VENDORCHANGE\fR
3839 .RS 4
3840 Like SOLVER_FLAG_ALLOW_VENDORCHANGE, but used in distupgrade mode\&.
3841 .RE
3842 .PP
3843 \fBSOLVER_FLAG_DUP_ALLOW_NAMECHANGE\fR
3844 .RS 4
3845 Like SOLVER_FLAG_ALLOW_NAMECHANGE, but used in distupgrade mode\&.
3846 .RE
3847 .PP
3848 \fBSOLVER_FLAG_NO_UPDATEPROVIDE\fR
3849 .RS 4
3850 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\&.
3851 .RE
3852 .PP
3853 \fBSOLVER_FLAG_NEED_UPDATEPROVIDE\fR
3854 .RS 4
3855 This is somewhat the opposite of SOLVER_FLAG_NO_UPDATEPROVIDE: Only packages that provide the installed package names are considered for updating\&.
3856 .RE
3857 .PP
3858 \fBSOLVER_FLAG_SPLITPROVIDES\fR
3859 .RS 4
3860 Make the solver aware of special provides of the form \(lq<packagename>:<path>\(rq used in SUSE systems to support package splits\&.
3861 .RE
3862 .PP
3863 \fBSOLVER_FLAG_IGNORE_RECOMMENDED\fR
3864 .RS 4
3865 Do not process optional (aka weak) dependencies\&.
3866 .RE
3867 .PP
3868 \fBSOLVER_FLAG_ADD_ALREADY_RECOMMENDED\fR
3869 .RS 4
3870 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\&.
3871 .RE
3872 .PP
3873 \fBSOLVER_FLAG_NO_INFARCHCHECK\fR
3874 .RS 4
3875 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\&.
3876 .RE
3877 .PP
3878 \fBSOLVER_FLAG_BEST_OBEY_POLICY\fR
3879 .RS 4
3880 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\&.
3881 .RE
3882 .PP
3883 \fBSOLVER_FLAG_NO_AUTOTARGET\fR
3884 .RS 4
3885 Do not enable auto\-targeting up update and distupgrade jobs\&. See the section on targeted updates for more information\&.
3886 .RE
3887 .PP
3888 \fBSOLVER_FLAG_KEEP_ORPHANS\fR
3889 .RS 4
3890 Do not allow orphaned packages to be deinstalled if they get in the way of resolving other packages\&.
3891 .RE
3892 .PP
3893 \fBSOLVER_FLAG_BREAK_ORPHANS\fR
3894 .RS 4
3895 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\&.
3896 .RE
3897 .PP
3898 \fBSOLVER_FLAG_FOCUS_INSTALLED\fR
3899 .RS 4
3900 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\&.
3901 .RE
3902 .PP
3903 \fBSOLVER_FLAG_FOCUS_BEST\fR
3904 .RS 4
3905 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\&.
3906 .RE
3907 .PP
3908 \fBSOLVER_FLAG_INSTALL_ALSO_UPDATES\fR
3909 .RS 4
3910 Update the package if a job is already fulfilled by an installed package\&.
3911 .RE
3912 .PP
3913 \fBSOLVER_FLAG_YUM_OBSOLETES\fR
3914 .RS 4
3915 Turn on yum\-like package split handling\&. See the yum documentation for more details\&.
3916 .RE
3917 .PP
3918 \fBSOLVER_FLAG_URPM_REORDER\fR
3919 .RS 4
3920 Turn on urpm like package reordering for kernel packages\&. See the urpm documentation for more details\&.
3921 .RE
3922 .sp
3923 Basic rule types:
3924 .PP
3925 \fBSOLVER_RULE_UNKNOWN\fR
3926 .RS 4
3927 A rule of an unknown class\&. You should never encounter those\&.
3928 .RE
3929 .PP
3930 \fBSOLVER_RULE_PKG\fR
3931 .RS 4
3932 A package dependency rule\&.
3933 .RE
3934 .PP
3935 \fBSOLVER_RULE_UPDATE\fR
3936 .RS 4
3937 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\&.
3938 .RE
3939 .PP
3940 \fBSOLVER_RULE_FEATURE\fR
3941 .RS 4
3942 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\&.
3943 .RE
3944 .PP
3945 \fBSOLVER_RULE_JOB\fR
3946 .RS 4
3947 Job rules implement the job given to the solver\&.
3948 .RE
3949 .PP
3950 \fBSOLVER_RULE_DISTUPGRADE\fR
3951 .RS 4
3952 These are simple negative assertions that make sure that only packages are kept that are also available in one of the repositories\&.
3953 .RE
3954 .PP
3955 \fBSOLVER_RULE_INFARCH\fR
3956 .RS 4
3957 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\&.
3958 .RE
3959 .PP
3960 \fBSOLVER_RULE_CHOICE\fR
3961 .RS 4
3962 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\&.
3963 .RE
3964 .PP
3965 \fBSOLVER_RULE_LEARNT\fR
3966 .RS 4
3967 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\&.
3968 .RE
3969 .sp
3970 Special dependency rule types:
3971 .PP
3972 \fBSOLVER_RULE_PKG_NOT_INSTALLABLE\fR
3973 .RS 4
3974 This rule was added to prevent the installation of a package of an architecture that does not work on the system\&.
3975 .RE
3976 .PP
3977 \fBSOLVER_RULE_PKG_NOTHING_PROVIDES_DEP\fR
3978 .RS 4
3979 The package contains a required dependency which was not provided by any package\&.
3980 .RE
3981 .PP
3982 \fBSOLVER_RULE_PKG_REQUIRES\fR
3983 .RS 4
3984 Similar to SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP, but in this case some packages provided the dependency but none of them could be installed due to other dependency issues\&.
3985 .RE
3986 .PP
3987 \fBSOLVER_RULE_PKG_SELF_CONFLICT\fR
3988 .RS 4
3989 The package conflicts with itself\&. This is not allowed by older rpm versions\&.
3990 .RE
3991 .PP
3992 \fBSOLVER_RULE_PKG_CONFLICTS\fR
3993 .RS 4
3994 To fulfill the dependencies two packages need to be installed, but one of the packages contains a conflict with the other one\&.
3995 .RE
3996 .PP
3997 \fBSOLVER_RULE_PKG_SAME_NAME\fR
3998 .RS 4
3999 The dependencies can only be fulfilled by multiple versions of a package, but installing multiple versions of the same package is not allowed\&.
4000 .RE
4001 .PP
4002 \fBSOLVER_RULE_PKG_OBSOLETES\fR
4003 .RS 4
4004 To fulfill the dependencies two packages need to be installed, but one of the packages obsoletes the other one\&.
4005 .RE
4006 .PP
4007 \fBSOLVER_RULE_PKG_IMPLICIT_OBSOLETES\fR
4008 .RS 4
4009 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\&.
4010 .RE
4011 .PP
4012 \fBSOLVER_RULE_PKG_INSTALLED_OBSOLETES\fR
4013 .RS 4
4014 To fulfill the dependencies a package needs to be installed that is obsoleted by an installed package\&. See the POOL_FLAG_NOINSTALLEDOBSOLETES flag\&.
4015 .RE
4016 .PP
4017 \fBSOLVER_RULE_JOB_NOTHING_PROVIDES_DEP\fR
4018 .RS 4
4019 The user asked for installation of a package providing a specific dependency, but no available package provides it\&.
4020 .RE
4021 .PP
4022 \fBSOLVER_RULE_JOB_UNKNOWN_PACKAGE\fR
4023 .RS 4
4024 The user asked for installation of a package with a specific name, but no available package has that name\&.
4025 .RE
4026 .PP
4027 \fBSOLVER_RULE_JOB_PROVIDED_BY_SYSTEM\fR
4028 .RS 4
4029 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\&.
4030 .RE
4031 .PP
4032 \fBSOLVER_RULE_JOB_UNSUPPORTED\fR
4033 .RS 4
4034 The user asked for something that is not yet implemented, e\&.g\&. the installation of all packages at once\&.
4035 .RE
4036 .sp
4037 Policy error constants
4038 .PP
4039 \fBPOLICY_ILLEGAL_DOWNGRADE\fR
4040 .RS 4
4041 The solver ask for permission before downgrading packages\&.
4042 .RE
4043 .PP
4044 \fBPOLICY_ILLEGAL_ARCHCHANGE\fR
4045 .RS 4
4046 The solver ask for permission before changing the architecture of installed packages\&.
4047 .RE
4048 .PP
4049 \fBPOLICY_ILLEGAL_VENDORCHANGE\fR
4050 .RS 4
4051 The solver ask for permission before changing the vendor of installed packages\&.
4052 .RE
4053 .PP
4054 \fBPOLICY_ILLEGAL_NAMECHANGE\fR
4055 .RS 4
4056 The solver ask for permission before replacing an installed packages with a package that has a different name\&.
4057 .RE
4058 .sp
4059 Solution element type constants
4060 .PP
4061 \fBSOLVER_SOLUTION_JOB\fR
4062 .RS 4
4063 The problem can be solved by removing the specified job\&.
4064 .RE
4065 .PP
4066 \fBSOLVER_SOLUTION_POOLJOB\fR
4067 .RS 4
4068 The problem can be solved by removing the specified job that is defined in the pool\&.
4069 .RE
4070 .PP
4071 \fBSOLVER_SOLUTION_INFARCH\fR
4072 .RS 4
4073 The problem can be solved by allowing the installation of the specified package with an inferior architecture\&.
4074 .RE
4075 .PP
4076 \fBSOLVER_SOLUTION_DISTUPGRADE\fR
4077 .RS 4
4078 The problem can be solved by allowing to keep the specified package installed\&.
4079 .RE
4080 .PP
4081 \fBSOLVER_SOLUTION_BEST\fR
4082 .RS 4
4083 The problem can be solved by allowing to install the specified package that is not the best available package\&.
4084 .RE
4085 .PP
4086 \fBSOLVER_SOLUTION_ERASE\fR
4087 .RS 4
4088 The problem can be solved by allowing to erase the specified package\&.
4089 .RE
4090 .PP
4091 \fBSOLVER_SOLUTION_REPLACE\fR
4092 .RS 4
4093 The problem can be solved by allowing to replace the package with some other package\&.
4094 .RE
4095 .PP
4096 \fBSOLVER_SOLUTION_REPLACE_DOWNGRADE\fR
4097 .RS 4
4098 The problem can be solved by allowing to replace the package with some other package that has a lower version\&.
4099 .RE
4100 .PP
4101 \fBSOLVER_SOLUTION_REPLACE_ARCHCHANGE\fR
4102 .RS 4
4103 The problem can be solved by allowing to replace the package with some other package that has a different architecture\&.
4104 .RE
4105 .PP
4106 \fBSOLVER_SOLUTION_REPLACE_VENDORCHANGE\fR
4107 .RS 4
4108 The problem can be solved by allowing to replace the package with some other package that has a different vendor\&.
4109 .RE
4110 .PP
4111 \fBSOLVER_SOLUTION_REPLACE_NAMECHANGE\fR
4112 .RS 4
4113 The problem can be solved by allowing to replace the package with some other package that has a different name\&.
4114 .RE
4115 .sp
4116 Reason constants
4117 .PP
4118 \fBSOLVER_REASON_UNRELATED\fR
4119 .RS 4
4120 The package status did not change as it was not related to any job\&.
4121 .RE
4122 .PP
4123 \fBSOLVER_REASON_UNIT_RULE\fR
4124 .RS 4
4125 The package was installed/erased/kept because of a unit rule, i\&.e\&. a rule where all literals but one were false\&.
4126 .RE
4127 .PP
4128 \fBSOLVER_REASON_KEEP_INSTALLED\fR
4129 .RS 4
4130 The package was chosen when trying to keep as many packages installed as possible\&.
4131 .RE
4132 .PP
4133 \fBSOLVER_REASON_RESOLVE_JOB\fR
4134 .RS 4
4135 The decision happened to fulfill a job rule\&.
4136 .RE
4137 .PP
4138 \fBSOLVER_REASON_UPDATE_INSTALLED\fR
4139 .RS 4
4140 The decision happened to fulfill a package update request\&.
4141 .RE
4142 .PP
4143 \fBSOLVER_REASON_CLEANDEPS_ERASE\fR
4144 .RS 4
4145 The package was erased when cleaning up dependencies from other erased packages\&.
4146 .RE
4147 .PP
4148 \fBSOLVER_REASON_RESOLVE\fR
4149 .RS 4
4150 The package was installed to fulfill package dependencies\&.
4151 .RE
4152 .PP
4153 \fBSOLVER_REASON_WEAKDEP\fR
4154 .RS 4
4155 The package was installed because of a weak dependency (Recommends or Supplements)\&.
4156 .RE
4157 .PP
4158 \fBSOLVER_REASON_RESOLVE_ORPHAN\fR
4159 .RS 4
4160 The decision about the package was made when deciding the fate of orphaned packages\&.
4161 .RE
4162 .PP
4163 \fBSOLVER_REASON_RECOMMENDED\fR
4164 .RS 4
4165 This is a special case of SOLVER_REASON_WEAKDEP\&.
4166 .RE
4167 .PP
4168 \fBSOLVER_REASON_SUPPLEMENTED\fR
4169 .RS 4
4170 This is a special case of SOLVER_REASON_WEAKDEP\&.
4171 .RE
4172 .SS "ATTRIBUTES"
4173 .sp
4174 .if n \{\
4175 .RS 4
4176 .\}
4177 .nf
4178 \fBPool *pool;\fR                             /* read only */
4179 \fI$job\fR\fB\->{pool}\fR
4180 \fId\fR\fB\&.pool\fR
4181 \fId\fR\fB\&.pool\fR
4182 .fi
4183 .if n \{\
4184 .RE
4185 .\}
4186 .sp
4187 Back pointer to pool\&.
4188 .SS "METHODS"
4189 .sp
4190 .if n \{\
4191 .RS 4
4192 .\}
4193 .nf
4194 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
4195 my \fI$oldvalue\fR \fB=\fR \fI$solver\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
4196 \fIoldvalue\fR \fB=\fR \fIsolver\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
4197 \fIoldvalue\fR \fB=\fR \fIsolver\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
4198 .fi
4199 .if n \{\
4200 .RE
4201 .\}
4202 .sp
4203 .if n \{\
4204 .RS 4
4205 .\}
4206 .nf
4207 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
4208 my \fI$value\fR \fB=\fR \fI$solver\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
4209 \fIvalue\fR \fB=\fR \fIsolver\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
4210 \fIvalue\fR \fB=\fR \fIsolver\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
4211 .fi
4212 .if n \{\
4213 .RE
4214 .\}
4215 .sp
4216 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\&.
4217 .sp
4218 .if n \{\
4219 .RS 4
4220 .\}
4221 .nf
4222 \fBProblem *solve(Job *\fR\fIjobs\fR\fB)\fR
4223 my \fI@problems\fR \fB=\fR \fI$solver\fR\fB\->solve(\e\fR\fI@jobs\fR\fB)\fR;
4224 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
4225 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
4226 .fi
4227 .if n \{\
4228 .RE
4229 .\}
4230 .sp
4231 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\&.
4232 .sp
4233 .if n \{\
4234 .RS 4
4235 .\}
4236 .nf
4237 \fBTransaction transaction()\fR
4238 my \fI$trans\fR \fB=\fR \fI$solver\fR\fB\->transaction()\fR;
4239 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
4240 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
4241 .fi
4242 .if n \{\
4243 .RE
4244 .\}
4245 .sp
4246 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\&.
4247 .sp
4248 .if n \{\
4249 .RS 4
4250 .\}
4251 .nf
4252 \fBint\fR \fIreason\fR \fB= describe_decision(Solvable *\fR\fIs\fR\fB, Rule *\fR\fIOUTPUT\fR\fB)\fR
4253 my \fB(\fR\fI$reason\fR\fB,\fR \fI$rule\fR\fB) =\fR \fI$solver\fR\fB\->describe_decision(\fR\fI$solvable\fR\fB)\fR;
4254 \fB(\fR\fIreason\fR\fB,\fR \fIrule\fR\fB) =\fR \fIsolver\fR\fB\&.describe_decision(\fR\fIsolvable\fR\fB)\fR
4255 \fB(\fR\fIreason\fR\fB,\fR \fIrule\fR\fB) =\fR \fIsolver\fR\fB\&.describe_decision(\fR\fIsolvable\fR\fB)\fR
4256 .fi
4257 .if n \{\
4258 .RE
4259 .\}
4260 .sp
4261 Return the reason why a specific solvable was installed or erased\&. For most of the reasons the rule that triggered the decision is also returned\&.
4262 .sp
4263 .if n \{\
4264 .RS 4
4265 .\}
4266 .nf
4267 \fBSolvable *get_recommended(bool\fR \fInoselected\fR\fB=0)\fR;
4268 my \fI@solvables\fR \fB=\fR \fI$solver\fR\fB\->get_recommended()\fR;
4269 \fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_recommended()\fR
4270 \fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_recommended()\fR
4271 .fi
4272 .if n \{\
4273 .RE
4274 .\}
4275 .sp
4276 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\&.
4277 .sp
4278 .if n \{\
4279 .RS 4
4280 .\}
4281 .nf
4282 \fBSolvable *get_suggested(bool\fR \fInoselected\fR\fB=0)\fR;
4283 my \fI@solvables\fR \fB=\fR \fI$solver\fR\fB\->get_suggested()\fR;
4284 \fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_suggested()\fR
4285 \fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_suggested()\fR
4286 .fi
4287 .if n \{\
4288 .RE
4289 .\}
4290 .sp
4291 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\&.
4292 .SH "THE PROBLEM CLASS"
4293 .sp
4294 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\&.
4295 .SS "ATTRIBUTES"
4296 .sp
4297 .if n \{\
4298 .RS 4
4299 .\}
4300 .nf
4301 \fBSolver *solv;\fR                           /* read only */
4302 \fI$problem\fR\fB\->{solv}\fR
4303 \fIproblem\fR\fB\&.solv\fR
4304 \fIproblem\fR\fB\&.solv\fR
4305 .fi
4306 .if n \{\
4307 .RE
4308 .\}
4309 .sp
4310 Back pointer to solver object\&.
4311 .sp
4312 .if n \{\
4313 .RS 4
4314 .\}
4315 .nf
4316 \fBId id;\fR                                  /* read only */
4317 \fI$problem\fR\fB\->{id}\fR
4318 \fIproblem\fR\fB\&.id\fR
4319 \fIproblem\fR\fB\&.id\fR
4320 .fi
4321 .if n \{\
4322 .RE
4323 .\}
4324 .sp
4325 Id of the problem\&. The first problem has Id 1, they are numbered consecutively\&.
4326 .SS "METHODS"
4327 .sp
4328 .if n \{\
4329 .RS 4
4330 .\}
4331 .nf
4332 \fBRule findproblemrule()\fR
4333 my \fI$probrule\fR \fB=\fR \fI$problem\fR\fB\->findproblemrule()\fR;
4334 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
4335 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
4336 .fi
4337 .if n \{\
4338 .RE
4339 .\}
4340 .sp
4341 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\&.
4342 .sp
4343 .if n \{\
4344 .RS 4
4345 .\}
4346 .nf
4347 \fBRule *findallproblemrules(bool\fR \fIunfiltered\fR \fB= 0)\fR
4348 my \fI@probrules\fR \fB=\fR \fI$problem\fR\fB\->findallproblemrules()\fR;
4349 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrules()\fR
4350 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrules()\fR
4351 .fi
4352 .if n \{\
4353 .RE
4354 .\}
4355 .sp
4356 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)\&.
4357 .sp
4358 .if n \{\
4359 .RS 4
4360 .\}
4361 .nf
4362 \fBSolution *solutions()\fR
4363 my \fI@solutions\fR \fB=\fR \fI$problem\fR\fB\->solutions()\fR;
4364 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
4365 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
4366 .fi
4367 .if n \{\
4368 .RE
4369 .\}
4370 .sp
4371 Return an array containing multiple possible solutions to fix the problem\&. See the solution class for more information\&.
4372 .sp
4373 .if n \{\
4374 .RS 4
4375 .\}
4376 .nf
4377 \fBint solution_count()\fR
4378 my \fI$cnt\fR \fB=\fR \fI$problem\fR\fB\->solution_count()\fR;
4379 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
4380 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
4381 .fi
4382 .if n \{\
4383 .RE
4384 .\}
4385 .sp
4386 Return the number of solutions without creating solution objects\&.
4387 .sp
4388 .if n \{\
4389 .RS 4
4390 .\}
4391 .nf
4392 \fB<stringification>\fR
4393 my \fI$str\fR \fB=\fR \fI$problem\fR\fB\->str\fR;
4394 \fIstr\fR \fB= str(\fR\fIproblem\fR\fB)\fR
4395 \fIstr\fR \fB=\fR \fIproblem\fR\fB\&.to_s\fR
4396 .fi
4397 .if n \{\
4398 .RE
4399 .\}
4400 .sp
4401 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\&.
4402 .SH "THE RULE CLASS"
4403 .sp
4404 Rules are the basic block of sat solving\&. Each package dependency gets translated into one or multiple rules\&.
4405 .SS "ATTRIBUTES"
4406 .sp
4407 .if n \{\
4408 .RS 4
4409 .\}
4410 .nf
4411 \fBSolver *solv;\fR                           /* read only */
4412 \fI$rule\fR\fB\->{solv}\fR
4413 \fIrule\fR\fB\&.solv\fR
4414 \fIrule\fR\fB\&.solv\fR
4415 .fi
4416 .if n \{\
4417 .RE
4418 .\}
4419 .sp
4420 Back pointer to solver object\&.
4421 .sp
4422 .if n \{\
4423 .RS 4
4424 .\}
4425 .nf
4426 \fBId id;\fR                                  /* read only */
4427 \fI$rule\fR\fB\->{id}\fR
4428 \fIrule\fR\fB\&.id\fR
4429 \fIrule\fR\fB\&.id\fR
4430 .fi
4431 .if n \{\
4432 .RE
4433 .\}
4434 .sp
4435 The id of the rule\&.
4436 .sp
4437 .if n \{\
4438 .RS 4
4439 .\}
4440 .nf
4441 \fBint type;\fR                               /* read only */
4442 \fI$rule\fR\fB\->{type}\fR
4443 \fIrule\fR\fB\&.type\fR
4444 \fIrule\fR\fB\&.type\fR
4445 .fi
4446 .if n \{\
4447 .RE
4448 .\}
4449 .sp
4450 The basic type of the rule\&. See the constant section of the solver class for the type list\&.
4451 .SS "METHODS"
4452 .sp
4453 .if n \{\
4454 .RS 4
4455 .\}
4456 .nf
4457 \fBRuleinfo info()\fR
4458 my \fI$ruleinfo\fR \fB=\fR \fI$rule\fR\fB\->info()\fR;
4459 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
4460 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
4461 .fi
4462 .if n \{\
4463 .RE
4464 .\}
4465 .sp
4466 Return a Ruleinfo object that contains information about why the rule was created\&. But see the allinfos() method below\&.
4467 .sp
4468 .if n \{\
4469 .RS 4
4470 .\}
4471 .nf
4472 \fBRuleinfo *allinfos()\fR
4473 my \fI@ruleinfos\fR \fB=\fR \fI$rule\fR\fB\->allinfos()\fR;
4474 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
4475 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
4476 .fi
4477 .if n \{\
4478 .RE
4479 .\}
4480 .sp
4481 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\&.
4482 .sp
4483 .if n \{\
4484 .RS 4
4485 .\}
4486 .nf
4487 \fB<equality>\fR
4488 \fBif (\fR\fI$rule1\fR \fB==\fR \fI$rule2\fR\fB)\fR
4489 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR\fB:\fR
4490 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR
4491 .fi
4492 .if n \{\
4493 .RE
4494 .\}
4495 .sp
4496 Two rules are equal if they belong to the same solver and have the same id\&.
4497 .SH "THE RULEINFO CLASS"
4498 .sp
4499 A Ruleinfo describes one reason why a rule was created\&.
4500 .SS "ATTRIBUTES"
4501 .sp
4502 .if n \{\
4503 .RS 4
4504 .\}
4505 .nf
4506 \fBSolver *solv;\fR                           /* read only */
4507 \fI$ruleinfo\fR\fB\->{solv}\fR
4508 \fIruleinfo\fR\fB\&.solv\fR
4509 \fIruleinfo\fR\fB\&.solv\fR
4510 .fi
4511 .if n \{\
4512 .RE
4513 .\}
4514 .sp
4515 Back pointer to solver object\&.
4516 .sp
4517 .if n \{\
4518 .RS 4
4519 .\}
4520 .nf
4521 \fBint type;\fR                               /* read only */
4522 \fI$ruleinfo\fR\fB\->{type}\fR
4523 \fIruleinfo\fR\fB\&.type\fR
4524 \fIruleinfo\fR\fB\&.type\fR
4525 .fi
4526 .if n \{\
4527 .RE
4528 .\}
4529 .sp
4530 The type of the ruleinfo\&. See the constant section of the solver class for the rule type list and the special type list\&.
4531 .sp
4532 .if n \{\
4533 .RS 4
4534 .\}
4535 .nf
4536 \fBDep *dep;\fR                               /* read only */
4537 \fI$ruleinfo\fR\fB\->{dep}\fR
4538 \fIruleinfo\fR\fB\&.dep\fR
4539 \fIruleinfo\fR\fB\&.dep\fR
4540 .fi
4541 .if n \{\
4542 .RE
4543 .\}
4544 .sp
4545 The dependency leading to the creation of the rule\&.
4546 .sp
4547 .if n \{\
4548 .RS 4
4549 .\}
4550 .nf
4551 \fBDep *dep_id;\fR                            /* read only */
4552 \fI$ruleinfo\fR\fB\->{\*(Aqdep_id\*(Aq}\fR
4553 \fIruleinfo\fR\fB\&.dep_id\fR
4554 \fIruleinfo\fR\fB\&.dep_id\fR
4555 .fi
4556 .if n \{\
4557 .RE
4558 .\}
4559 .sp
4560 The Id of the dependency leading to the creation of the rule, or zero\&.
4561 .sp
4562 .if n \{\
4563 .RS 4
4564 .\}
4565 .nf
4566 \fBSolvable *solvable;\fR                     /* read only */
4567 \fI$ruleinfo\fR\fB\->{solvable}\fR
4568 \fIruleinfo\fR\fB\&.solvable\fR
4569 \fIruleinfo\fR\fB\&.solvable\fR
4570 .fi
4571 .if n \{\
4572 .RE
4573 .\}
4574 .sp
4575 The involved Solvable, e\&.g\&. the one containing the dependency\&.
4576 .sp
4577 .if n \{\
4578 .RS 4
4579 .\}
4580 .nf
4581 \fBSolvable *othersolvable;\fR                /* read only */
4582 \fI$ruleinfo\fR\fB\->{othersolvable}\fR
4583 \fIruleinfo\fR\fB\&.othersolvable\fR
4584 \fIruleinfo\fR\fB\&.othersolvable\fR
4585 .fi
4586 .if n \{\
4587 .RE
4588 .\}
4589 .sp
4590 The other involved Solvable (if any), e\&.g\&. the one containing providing the dependency for conflicts\&.
4591 .sp
4592 .if n \{\
4593 .RS 4
4594 .\}
4595 .nf
4596 \fBconst char *problemstr()\fR;
4597 my \fI$str\fR \fB=\fR \fI$ruleinfo\fR\fB\->problemstr()\fR;
4598 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
4599 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
4600 .fi
4601 .if n \{\
4602 .RE
4603 .\}
4604 .sp
4605 A string describing the ruleinfo from a problem perspective\&. This probably only makes sense if the rule is part of a problem\&.
4606 .SH "THE SOLUTION CLASS"
4607 .sp
4608 A solution solves one specific problem\&. It consists of multiple solution elements that all need to be executed\&.
4609 .SS "ATTRIBUTES"
4610 .sp
4611 .if n \{\
4612 .RS 4
4613 .\}
4614 .nf
4615 \fBSolver *solv;\fR                           /* read only */
4616 \fI$solution\fR\fB\->{solv}\fR
4617 \fIsolution\fR\fB\&.solv\fR
4618 \fIsolution\fR\fB\&.solv\fR
4619 .fi
4620 .if n \{\
4621 .RE
4622 .\}
4623 .sp
4624 Back pointer to solver object\&.
4625 .sp
4626 .if n \{\
4627 .RS 4
4628 .\}
4629 .nf
4630 \fBId problemid;\fR                           /* read only */
4631 \fI$solution\fR\fB\->{problemid}\fR
4632 \fIsolution\fR\fB\&.problemid\fR
4633 \fIsolution\fR\fB\&.problemid\fR
4634 .fi
4635 .if n \{\
4636 .RE
4637 .\}
4638 .sp
4639 Id of the problem the solution solves\&.
4640 .sp
4641 .if n \{\
4642 .RS 4
4643 .\}
4644 .nf
4645 \fBId id;\fR                                  /* read only */
4646 \fI$solution\fR\fB\->{id}\fR
4647 \fIsolution\fR\fB\&.id\fR
4648 \fIsolution\fR\fB\&.id\fR
4649 .fi
4650 .if n \{\
4651 .RE
4652 .\}
4653 .sp
4654 Id of the solution\&. The first solution has Id 1, they are numbered consecutively\&.
4655 .SS "METHODS"
4656 .sp
4657 .if n \{\
4658 .RS 4
4659 .\}
4660 .nf
4661 \fBSolutionelement *elements(bool\fR \fIexpandreplaces\fR \fB= 0)\fR
4662 my \fI@solutionelements\fR \fB=\fR \fI$solution\fR\fB\->elements()\fR;
4663 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
4664 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
4665 .fi
4666 .if n \{\
4667 .RE
4668 .\}
4669 .sp
4670 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\&.
4671 .sp
4672 .if n \{\
4673 .RS 4
4674 .\}
4675 .nf
4676 \fBint element_count()\fR
4677 my \fI$cnt\fR \fB=\fR \fI$solution\fR\fB\->solution_count()\fR;
4678 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
4679 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
4680 .fi
4681 .if n \{\
4682 .RE
4683 .\}
4684 .sp
4685 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\&.
4686 .SH "THE SOLUTIONELEMENT CLASS"
4687 .sp
4688 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\&.
4689 .SS "ATTRIBUTES"
4690 .sp
4691 .if n \{\
4692 .RS 4
4693 .\}
4694 .nf
4695 \fBSolver *solv;\fR                           /* read only */
4696 \fI$solutionelement\fR\fB\->{solv}\fR
4697 \fIsolutionelement\fR\fB\&.solv\fR
4698 \fIsolutionelement\fR\fB\&.solv\fR
4699 .fi
4700 .if n \{\
4701 .RE
4702 .\}
4703 .sp
4704 Back pointer to solver object\&.
4705 .sp
4706 .if n \{\
4707 .RS 4
4708 .\}
4709 .nf
4710 \fBId problemid;\fR                           /* read only */
4711 \fI$solutionelement\fR\fB\->{problemid}\fR
4712 \fIsolutionelement\fR\fB\&.problemid\fR
4713 \fIsolutionelement\fR\fB\&.problemid\fR
4714 .fi
4715 .if n \{\
4716 .RE
4717 .\}
4718 .sp
4719 Id of the problem the element (partly) solves\&.
4720 .sp
4721 .if n \{\
4722 .RS 4
4723 .\}
4724 .nf
4725 \fBId solutionid;\fR                          /* read only */
4726 \fI$solutionelement\fR\fB\->{solutionid}\fR
4727 \fIsolutionelement\fR\fB\&.solutionid\fR
4728 \fIsolutionelement\fR\fB\&.solutionid\fR
4729 .fi
4730 .if n \{\
4731 .RE
4732 .\}
4733 .sp
4734 Id of the solution the element is a part of\&.
4735 .sp
4736 .if n \{\
4737 .RS 4
4738 .\}
4739 .nf
4740 \fBId id;\fR                                  /* read only */
4741 \fI$solutionelement\fR\fB\->{id}\fR
4742 \fIsolutionelement\fR\fB\&.id\fR
4743 \fIsolutionelement\fR\fB\&.id\fR
4744 .fi
4745 .if n \{\
4746 .RE
4747 .\}
4748 .sp
4749 Id of the solution element\&. The first element has Id 1, they are numbered consecutively\&.
4750 .sp
4751 .if n \{\
4752 .RS 4
4753 .\}
4754 .nf
4755 \fBId type;\fR                                /* read only */
4756 \fI$solutionelement\fR\fB\->{type}\fR
4757 \fIsolutionelement\fR\fB\&.type\fR
4758 \fIsolutionelement\fR\fB\&.type\fR
4759 .fi
4760 .if n \{\
4761 .RE
4762 .\}
4763 .sp
4764 Type of the solution element\&. See the constant section of the solver class for the existing types\&.
4765 .sp
4766 .if n \{\
4767 .RS 4
4768 .\}
4769 .nf
4770 \fBSolvable *solvable;\fR                     /* read only */
4771 \fI$solutionelement\fR\fB\->{solvable}\fR
4772 \fIsolutionelement\fR\fB\&.solvable\fR
4773 \fIsolutionelement\fR\fB\&.solvable\fR
4774 .fi
4775 .if n \{\
4776 .RE
4777 .\}
4778 .sp
4779 The installed solvable that needs to be replaced for replacement elements\&.
4780 .sp
4781 .if n \{\
4782 .RS 4
4783 .\}
4784 .nf
4785 \fBSolvable *replacement;\fR                  /* read only */
4786 \fI$solutionelement\fR\fB\->{replacement}\fR
4787 \fIsolutionelement\fR\fB\&.replacement\fR
4788 \fIsolutionelement\fR\fB\&.replacement\fR
4789 .fi
4790 .if n \{\
4791 .RE
4792 .\}
4793 .sp
4794 The solvable that needs to be installed to fix the problem\&.
4795 .sp
4796 .if n \{\
4797 .RS 4
4798 .\}
4799 .nf
4800 \fBint jobidx;\fR                             /* read only */
4801 \fI$solutionelement\fR\fB\->{jobidx}\fR
4802 \fIsolutionelement\fR\fB\&.jobidx\fR
4803 \fIsolutionelement\fR\fB\&.jobidx\fR
4804 .fi
4805 .if n \{\
4806 .RE
4807 .\}
4808 .sp
4809 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\&.
4810 .SS "METHODS"
4811 .sp
4812 .if n \{\
4813 .RS 4
4814 .\}
4815 .nf
4816 \fBSolutionelement *replaceelements()\fR
4817 my \fI@solutionelements\fR \fB=\fR \fI$solutionelement\fR\fB\->replaceelements()\fR;
4818 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
4819 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
4820 .fi
4821 .if n \{\
4822 .RE
4823 .\}
4824 .sp
4825 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\&.
4826 .sp
4827 .if n \{\
4828 .RS 4
4829 .\}
4830 .nf
4831 \fBint illegalreplace()\fR
4832 my \fI$illegal\fR \fB=\fR \fI$solutionelement\fR\fB\->illegalreplace()\fR;
4833 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
4834 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
4835 .fi
4836 .if n \{\
4837 .RE
4838 .\}
4839 .sp
4840 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\&.
4841 .sp
4842 .if n \{\
4843 .RS 4
4844 .\}
4845 .nf
4846 \fBJob Job()\fR
4847 my \fI$job\fR \fB=\fR \fI$solutionelement\fR\fB\->Job()\fR;
4848 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
4849 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
4850 .fi
4851 .if n \{\
4852 .RE
4853 .\}
4854 .sp
4855 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\&.
4856 .sp
4857 .if n \{\
4858 .RS 4
4859 .\}
4860 .nf
4861 \fBconst char *str()\fR
4862 my \fI$str\fR \fB=\fR \fI$solutionelement\fR\fB\->str()\fR;
4863 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
4864 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
4865 .fi
4866 .if n \{\
4867 .RE
4868 .\}
4869 .sp
4870 A string describing the change the solution element consists of\&.
4871 .SH "THE TRANSACTION CLASS"
4872 .sp
4873 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\&.
4874 .SS "CONSTANTS"
4875 .sp
4876 Transaction element types, both active and passive
4877 .PP
4878 \fBSOLVER_TRANSACTION_IGNORE\fR
4879 .RS 4
4880 This element does nothing\&. Used to map element types that do not match the view mode\&.
4881 .RE
4882 .PP
4883 \fBSOLVER_TRANSACTION_INSTALL\fR
4884 .RS 4
4885 This element installs a package\&.
4886 .RE
4887 .PP
4888 \fBSOLVER_TRANSACTION_ERASE\fR
4889 .RS 4
4890 This element erases a package\&.
4891 .RE
4892 .PP
4893 \fBSOLVER_TRANSACTION_MULTIINSTALL\fR
4894 .RS 4
4895 This element installs a package with a different version keeping the other versions installed\&.
4896 .RE
4897 .PP
4898 \fBSOLVER_TRANSACTION_MULTIREINSTALL\fR
4899 .RS 4
4900 This element reinstalls an installed package keeping the other versions installed\&.
4901 .RE
4902 .sp
4903 Transaction element types, active view
4904 .PP
4905 \fBSOLVER_TRANSACTION_REINSTALL\fR
4906 .RS 4
4907 This element re\-installs a package, i\&.e\&. installs the same package again\&.
4908 .RE
4909 .PP
4910 \fBSOLVER_TRANSACTION_CHANGE\fR
4911 .RS 4
4912 This element installs a package with same name, version, architecture but different content\&.
4913 .RE
4914 .PP
4915 \fBSOLVER_TRANSACTION_UPGRADE\fR
4916 .RS 4
4917 This element installs a newer version of an installed package\&.
4918 .RE
4919 .PP
4920 \fBSOLVER_TRANSACTION_DOWNGRADE\fR
4921 .RS 4
4922 This element installs an older version of an installed package\&.
4923 .RE
4924 .PP
4925 \fBSOLVER_TRANSACTION_OBSOLETES\fR
4926 .RS 4
4927 This element installs a package that obsoletes an installed package\&.
4928 .RE
4929 .sp
4930 Transaction element types, passive view
4931 .PP
4932 \fBSOLVER_TRANSACTION_REINSTALLED\fR
4933 .RS 4
4934 This element re\-installs a package, i\&.e\&. installs the same package again\&.
4935 .RE
4936 .PP
4937 \fBSOLVER_TRANSACTION_CHANGED\fR
4938 .RS 4
4939 This element replaces an installed package with one of the same name, version, architecture but different content\&.
4940 .RE
4941 .PP
4942 \fBSOLVER_TRANSACTION_UPGRADED\fR
4943 .RS 4
4944 This element replaces an installed package with a new version\&.
4945 .RE
4946 .PP
4947 \fBSOLVER_TRANSACTION_DOWNGRADED\fR
4948 .RS 4
4949 This element replaces an installed package with an old version\&.
4950 .RE
4951 .PP
4952 \fBSOLVER_TRANSACTION_OBSOLETED\fR
4953 .RS 4
4954 This element replaces an installed package with a package that obsoletes it\&.
4955 .RE
4956 .sp
4957 Pseudo element types for showing extra information used by classify()
4958 .PP
4959 \fBSOLVER_TRANSACTION_ARCHCHANGE\fR
4960 .RS 4
4961 This element replaces an installed package with a package of a different architecture\&.
4962 .RE
4963 .PP
4964 \fBSOLVER_TRANSACTION_VENDORCHANGE\fR
4965 .RS 4
4966 This element replaces an installed package with a package of a different vendor\&.
4967 .RE
4968 .sp
4969 Transaction mode flags
4970 .PP
4971 \fBSOLVER_TRANSACTION_SHOW_ACTIVE\fR
4972 .RS 4
4973 Filter for active view types\&. The default is to return passive view type, i\&.e\&. to show how the installed packages get changed\&.
4974 .RE
4975 .PP
4976 \fBSOLVER_TRANSACTION_SHOW_OBSOLETES\fR
4977 .RS 4
4978 Do not map the obsolete view type into INSTALL/ERASE elements\&.
4979 .RE
4980 .PP
4981 \fBSOLVER_TRANSACTION_SHOW_ALL\fR
4982 .RS 4
4983 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\&.
4984 .RE
4985 .PP
4986 \fBSOLVER_TRANSACTION_SHOW_MULTIINSTALL\fR
4987 .RS 4
4988 The library maps MULTIINSTALL elements to simple INSTALL elements\&. This flag can be used to disable the mapping\&.
4989 .RE
4990 .PP
4991 \fBSOLVER_TRANSACTION_CHANGE_IS_REINSTALL\fR
4992 .RS 4
4993 Use this flag if you want to map CHANGE elements to the REINSTALL type\&.
4994 .RE
4995 .PP
4996 \fBSOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE\fR
4997 .RS 4
4998 Use this flag if you want to map OBSOLETE elements to the UPGRADE type\&.
4999 .RE
5000 .PP
5001 \fBSOLVER_TRANSACTION_MERGE_ARCHCHANGES\fR
5002 .RS 4
5003 Do not add extra categories for every architecture change, instead cumulate them in one category\&.
5004 .RE
5005 .PP
5006 \fBSOLVER_TRANSACTION_MERGE_VENDORCHANGES\fR
5007 .RS 4
5008 Do not add extra categories for every vendor change, instead cumulate them in one category\&.
5009 .RE
5010 .PP
5011 \fBSOLVER_TRANSACTION_RPM_ONLY\fR
5012 .RS 4
5013 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\&.
5014 .RE
5015 .sp
5016 Transaction order flags
5017 .PP
5018 \fBSOLVER_TRANSACTION_KEEP_ORDERDATA\fR
5019 .RS 4
5020 Do not throw away the dependency graph used for ordering the transaction\&. This flag is needed if you want to do manual ordering\&.
5021 .RE
5022 .SS "ATTRIBUTES"
5023 .sp
5024 .if n \{\
5025 .RS 4
5026 .\}
5027 .nf
5028 \fBPool *pool;\fR                             /* read only */
5029 \fI$trans\fR\fB\->{pool}\fR
5030 \fItrans\fR\fB\&.pool\fR
5031 \fItrans\fR\fB\&.pool\fR
5032 .fi
5033 .if n \{\
5034 .RE
5035 .\}
5036 .sp
5037 Back pointer to pool\&.
5038 .SS "METHODS"
5039 .sp
5040 .if n \{\
5041 .RS 4
5042 .\}
5043 .nf
5044 \fBbool isempty()\fR;
5045 \fI$trans\fR\fB\->isempty()\fR
5046 \fItrans\fR\fB\&.isempty()\fR
5047 \fItrans\fR\fB\&.isempty?\fR
5048 .fi
5049 .if n \{\
5050 .RE
5051 .\}
5052 .sp
5053 Returns true if the transaction does not do anything, i\&.e\&. has no elements\&.
5054 .sp
5055 .if n \{\
5056 .RS 4
5057 .\}
5058 .nf
5059 \fBSolvable *newsolvables()\fR;
5060 my \fI@newsolvables\fR \fB=\fR \fI$trans\fR\fB\->newsolvables()\fR;
5061 \fInewsolvables\fR \fB=\fR \fItrans\fR\fB\&.newsolvables()\fR
5062 \fInewsolvables\fR \fB=\fR \fItrans\fR\fB\&.newsolvables()\fR
5063 .fi
5064 .if n \{\
5065 .RE
5066 .\}
5067 .sp
5068 Return all packages that are to be installed by the transaction\&. These are the packages that need to be downloaded from the repositories\&.
5069 .sp
5070 .if n \{\
5071 .RS 4
5072 .\}
5073 .nf
5074 \fBSolvable *keptsolvables()\fR;
5075 my \fI@keptsolvables\fR \fB=\fR \fI$trans\fR\fB\->keptsolvables()\fR;
5076 \fIkeptsolvables\fR \fB=\fR \fItrans\fR\fB\&.keptsolvables()\fR
5077 \fIkeptsolvables\fR \fB=\fR \fItrans\fR\fB\&.keptsolvables()\fR
5078 .fi
5079 .if n \{\
5080 .RE
5081 .\}
5082 .sp
5083 Return all installed packages that the transaction will keep installed\&.
5084 .sp
5085 .if n \{\
5086 .RS 4
5087 .\}
5088 .nf
5089 \fBSolvable *steps()\fR;
5090 my \fI@steps\fR \fB=\fR \fI$trans\fR\fB\->steps()\fR;
5091 \fIsteps\fR \fB=\fR \fItrans\fR\fB\&.steps()\fR
5092 \fIsteps\fR \fB=\fR \fItrans\fR\fB\&.steps()\fR
5093 .fi
5094 .if n \{\
5095 .RE
5096 .\}
5097 .sp
5098 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\&.
5099 .sp
5100 .if n \{\
5101 .RS 4
5102 .\}
5103 .nf
5104 \fBint steptype(Solvable *\fR\fIsolvable\fR\fB, int\fR \fImode\fR\fB)\fR
5105 my \fI$type\fR \fB=\fR \fI$trans\fR\fB\->steptype(\fR\fI$solvable\fR\fB,\fR \fI$mode\fR\fB)\fR;
5106 \fItype\fR \fB=\fR \fItrans\fR\fB\&.steptype(\fR\fIsolvable\fR\fB,\fR \fImode\fR\fB)\fR
5107 \fItype\fR \fB=\fR \fItrans\fR\fB\&.steptype(\fR\fIsolvable\fR\fB,\fR \fImode\fR\fB)\fR
5108 .fi
5109 .if n \{\
5110 .RE
5111 .\}
5112 .sp
5113 Return the transaction type of the specified solvable\&. See the CONSTANTS sections for the mode argument flags and the list of returned types\&.
5114 .sp
5115 .if n \{\
5116 .RS 4
5117 .\}
5118 .nf
5119 \fBTransactionClass *classify(int\fR \fImode\fR \fB= 0)\fR
5120 my \fI@classes\fR \fB=\fR \fI$trans\fR\fB\->classify()\fR;
5121 \fIclasses\fR \fB=\fR \fItrans\fR\fB\&.classify()\fR
5122 \fIclasses\fR \fB=\fR \fItrans\fR\fB\&.classify()\fR
5123 .fi
5124 .if n \{\
5125 .RE
5126 .\}
5127 .sp
5128 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\&.
5129 .sp
5130 .if n \{\
5131 .RS 4
5132 .\}
5133 .nf
5134 \fBSolvable othersolvable(Solvable *\fR\fIsolvable\fR\fB)\fR;
5135 my \fI$other\fR \fB=\fR \fI$trans\fR\fB\->othersolvable(\fR\fI$solvable\fR\fB)\fR;
5136 \fIother\fR \fB=\fR \fItrans\fR\fB\&.othersolvable(\fR\fIsolvable\fR\fB)\fR
5137 \fIother\fR \fB=\fR \fItrans\fR\fB\&.othersolvable(\fR\fIsolvable\fR\fB)\fR
5138 .fi
5139 .if n \{\
5140 .RE
5141 .\}
5142 .sp
5143 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\&.
5144 .sp
5145 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\&.
5146 .sp
5147 Thus, the \(lqother\(rq solvable is normally the package that is also shown for a given package\&.
5148 .sp
5149 .if n \{\
5150 .RS 4
5151 .\}
5152 .nf
5153 \fBSolvable *allothersolvables(Solvable *\fR\fIsolvable\fR\fB)\fR;
5154 my \fI@others\fR \fB=\fR \fI$trans\fR\fB\->allothersolvables(\fR\fI$solvable\fR\fB)\fR;
5155 \fIothers\fR \fB=\fR \fItrans\fR\fB\&.allothersolvables(\fR\fIsolvable\fR\fB)\fR
5156 \fIothers\fR \fB=\fR \fItrans\fR\fB\&.allothersolvables(\fR\fIsolvable\fR\fB)\fR
5157 .fi
5158 .if n \{\
5159 .RE
5160 .\}
5161 .sp
5162 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\&.
5163 .sp
5164 .if n \{\
5165 .RS 4
5166 .\}
5167 .nf
5168 \fBlong long calc_installsizechange()\fR;
5169 my \fI$change\fR \fB=\fR \fI$trans\fR\fB\->calc_installsizechange()\fR;
5170 \fIchange\fR \fB=\fR \fItrans\fR\fB\&.calc_installsizechange()\fR
5171 \fIchange\fR \fB=\fR \fItrans\fR\fB\&.calc_installsizechange()\fR
5172 .fi
5173 .if n \{\
5174 .RE
5175 .\}
5176 .sp
5177 Return the size change of the installed system in kilobytes (kibibytes)\&.
5178 .sp
5179 .if n \{\
5180 .RS 4
5181 .\}
5182 .nf
5183 \fBvoid order(int\fR \fIflags\fR \fB= 0)\fR;
5184 \fI$trans\fR\fB\->order()\fR;
5185 \fItrans\fR\fB\&.order()\fR
5186 \fItrans\fR\fB\&.order()\fR
5187 .fi
5188 .if n \{\
5189 .RE
5190 .\}
5191 .sp
5192 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\&.
5193 .SS "ACTIVE/PASSIVE VIEW"
5194 .sp
5195 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
5196 .sp
5197 .if n \{\
5198 .RS 4
5199 .\}
5200 .nf
5201 updated   A\-1\-1 (other: A\-2\-1)
5202 obsoleted B\-1\-1 (other: A\-2\-1)
5203 .fi
5204 .if n \{\
5205 .RE
5206 .\}
5207 .sp
5208 in passive mode, but
5209 .sp
5210 .if n \{\
5211 .RS 4
5212 .\}
5213 .nf
5214 update A\-2\-1 (other: A\-1\-1)
5215 erase  B
5216 .fi
5217 .if n \{\
5218 .RE
5219 .\}
5220 .sp
5221 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\&.
5222 .SH "THE TRANSACTIONCLASS CLASS"
5223 .sp
5224 Objects of this type are returned by the classify() Transaction method\&.
5225 .SS "ATTRIBUTES"
5226 .sp
5227 .if n \{\
5228 .RS 4
5229 .\}
5230 .nf
5231 \fBTransaction *transaction;\fR               /* read only */
5232 \fI$class\fR\fB\->{transaction}\fR
5233 \fIclass\fR\fB\&.transaction\fR
5234 \fIclass\fR\fB\&.transaction\fR
5235 .fi
5236 .if n \{\
5237 .RE
5238 .\}
5239 .sp
5240 Back pointer to transaction object\&.
5241 .sp
5242 .if n \{\
5243 .RS 4
5244 .\}
5245 .nf
5246 \fBint type;\fR                               /* read only */
5247 \fI$class\fR\fB\->{type}\fR
5248 \fIclass\fR\fB\&.type\fR
5249 \fIclass\fR\fB\&.type\fR
5250 .fi
5251 .if n \{\
5252 .RE
5253 .\}
5254 .sp
5255 The type of the transaction elements in the class\&.
5256 .sp
5257 .if n \{\
5258 .RS 4
5259 .\}
5260 .nf
5261 \fBint count;\fR                              /* read only */
5262 \fI$class\fR\fB\->{count}\fR
5263 \fIclass\fR\fB\&.count\fR
5264 \fIclass\fR\fB\&.count\fR
5265 .fi
5266 .if n \{\
5267 .RE
5268 .\}
5269 .sp
5270 The number of elements in the class\&.
5271 .sp
5272 .if n \{\
5273 .RS 4
5274 .\}
5275 .nf
5276 \fBconst char *\fR\fIfromstr\fR;
5277 \fI$class\fR\fB\->{fromstr}\fR
5278 \fIclass\fR\fB\&.fromstr\fR
5279 \fIclass\fR\fB\&.fromstr\fR
5280 .fi
5281 .if n \{\
5282 .RE
5283 .\}
5284 .sp
5285 The old vendor or architecture\&.
5286 .sp
5287 .if n \{\
5288 .RS 4
5289 .\}
5290 .nf
5291 \fBconst char *\fR\fItostr\fR;
5292 \fI$class\fR\fB\->{tostr}\fR
5293 \fIclass\fR\fB\&.tostr\fR
5294 \fIclass\fR\fB\&.tostr\fR
5295 .fi
5296 .if n \{\
5297 .RE
5298 .\}
5299 .sp
5300 The new vendor or architecture\&.
5301 .sp
5302 .if n \{\
5303 .RS 4
5304 .\}
5305 .nf
5306 \fBId\fR \fIfromid\fR;
5307 \fI$class\fR\fB\->{fromid}\fR
5308 \fIclass\fR\fB\&.fromid\fR
5309 \fIclass\fR\fB\&.fromid\fR
5310 .fi
5311 .if n \{\
5312 .RE
5313 .\}
5314 .sp
5315 The id of the old vendor or architecture\&.
5316 .sp
5317 .if n \{\
5318 .RS 4
5319 .\}
5320 .nf
5321 \fBId\fR \fItoid\fR;
5322 \fI$class\fR\fB\->{toid}\fR
5323 \fIclass\fR\fB\&.toid\fR
5324 \fIclass\fR\fB\&.toid\fR
5325 .fi
5326 .if n \{\
5327 .RE
5328 .\}
5329 .sp
5330 The id of the new vendor or architecture\&.
5331 .SS "METHODS"
5332 .sp
5333 .if n \{\
5334 .RS 4
5335 .\}
5336 .nf
5337 \fBvoid solvables()\fR;
5338 my \fI@solvables\fR \fB=\fR \fI$class\fR\fB\->solvables()\fR;
5339 \fIsolvables\fR \fB=\fR \fIclass\fR\fB\&.solvables()\fR
5340 \fIsolvables\fR \fB=\fR \fIclass\fR\fB\&.solvables()\fR
5341 .fi
5342 .if n \{\
5343 .RE
5344 .\}
5345 .sp
5346 Return the solvables for all transaction elements in the class\&.
5347 .SH "CHECKSUMS"
5348 .sp
5349 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\&.
5350 .SS "CLASS METHODS"
5351 .sp
5352 .if n \{\
5353 .RS 4
5354 .\}
5355 .nf
5356 \fBChksum Chksum(Id\fR \fItype\fR\fB)\fR
5357 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB)\fR;
5358 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB)\fR
5359 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB)\fR
5360 .fi
5361 .if n \{\
5362 .RE
5363 .\}
5364 .sp
5365 Create a checksum object\&. Currently the following types are supported:
5366 .sp
5367 .if n \{\
5368 .RS 4
5369 .\}
5370 .nf
5371 \fBREPOKEY_TYPE_MD5\fR
5372 \fBREPOKEY_TYPE_SHA1\fR
5373 \fBREPOKEY_TYPE_SHA256\fR
5374 .fi
5375 .if n \{\
5376 .RE
5377 .\}
5378 .sp
5379 These keys are constants in the \fBsolv\fR class\&.
5380 .sp
5381 .if n \{\
5382 .RS 4
5383 .\}
5384 .nf
5385 \fBChksum Chksum(Id\fR \fItype\fR\fB, const char *\fR\fIhex\fR\fB)\fR
5386 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB,\fR \fI$hex\fR\fB)\fR;
5387 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
5388 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
5389 .fi
5390 .if n \{\
5391 .RE
5392 .\}
5393 .sp
5394 Create an already finalized checksum object from a hex string\&.
5395 .sp
5396 .if n \{\
5397 .RS 4
5398 .\}
5399 .nf
5400 \fBChksum Chksum_from_bin(Id\fR \fItype\fR\fB, char *\fR\fIbin\fR\fB)\fR
5401 my \fI$chksum\fR \fB= solv::Chksum\->from_bin(\fR\fI$type\fR\fB,\fR \fI$bin\fR\fB)\fR;
5402 \fIchksum\fR \fB= solv\&.Chksum\&.from_bin(\fR\fItype\fR\fB,\fR \fIbin\fR\fB)\fR
5403 \fIchksum\fR \fB= Solv::Chksum\&.from_bin(\fR\fItype\fR\fB,\fR \fIbin\fR\fB)\fR
5404 .fi
5405 .if n \{\
5406 .RE
5407 .\}
5408 .sp
5409 Create an already finalized checksum object from a binary checksum\&.
5410 .SS "ATTRIBUTES"
5411 .sp
5412 .if n \{\
5413 .RS 4
5414 .\}
5415 .nf
5416 \fBId type;\fR                        /* read only */
5417 \fI$chksum\fR\fB\->{type}\fR
5418 \fIchksum\fR\fB\&.type\fR
5419 \fIchksum\fR\fB\&.type\fR
5420 .fi
5421 .if n \{\
5422 .RE
5423 .\}
5424 .sp
5425 Return the type of the checksum object\&.
5426 .SS "METHODS"
5427 .sp
5428 .if n \{\
5429 .RS 4
5430 .\}
5431 .nf
5432 \fBvoid add(const char *\fR\fIstr\fR\fB)\fR
5433 \fI$chksum\fR\fB\->add(\fR\fI$str\fR\fB)\fR;
5434 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
5435 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
5436 .fi
5437 .if n \{\
5438 .RE
5439 .\}
5440 .sp
5441 Add a (binary) string to the checksum\&.
5442 .sp
5443 .if n \{\
5444 .RS 4
5445 .\}
5446 .nf
5447 \fBvoid add_fp(FILE *\fR\fIfp\fR\fB)\fR
5448 \fI$chksum\fR\fB\->add_fp(\fR\fI$file\fR\fB)\fR;
5449 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
5450 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
5451 .fi
5452 .if n \{\
5453 .RE
5454 .\}
5455 .sp
5456 Add the contents of a file to the checksum\&.
5457 .sp
5458 .if n \{\
5459 .RS 4
5460 .\}
5461 .nf
5462 \fBvoid add_stat(const char *\fR\fIfilename\fR\fB)\fR
5463 \fI$chksum\fR\fB\->add_stat(\fR\fI$filename\fR\fB)\fR;
5464 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
5465 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
5466 .fi
5467 .if n \{\
5468 .RE
5469 .\}
5470 .sp
5471 Stat the file and add the dev/ino/size/mtime member to the checksum\&. If the stat fails, the members are zeroed\&.
5472 .sp
5473 .if n \{\
5474 .RS 4
5475 .\}
5476 .nf
5477 \fBvoid add_fstat(int\fR \fIfd\fR\fB)\fR
5478 \fI$chksum\fR\fB\->add_fstat(\fR\fI$fd\fR\fB)\fR;
5479 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
5480 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
5481 .fi
5482 .if n \{\
5483 .RE
5484 .\}
5485 .sp
5486 Same as add_stat, but instead of the filename a file descriptor is used\&.
5487 .sp
5488 .if n \{\
5489 .RS 4
5490 .\}
5491 .nf
5492 \fBunsigned char *raw()\fR
5493 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->raw()\fR;
5494 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
5495 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
5496 .fi
5497 .if n \{\
5498 .RE
5499 .\}
5500 .sp
5501 Finalize the checksum and return the result as raw bytes\&. This means that the result can contain NUL bytes or unprintable characters\&.
5502 .sp
5503 .if n \{\
5504 .RS 4
5505 .\}
5506 .nf
5507 \fBconst char *hex()\fR
5508 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->hex()\fR;
5509 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
5510 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
5511 .fi
5512 .if n \{\
5513 .RE
5514 .\}
5515 .sp
5516 Finalize the checksum and return the result as hex string\&.
5517 .sp
5518 .if n \{\
5519 .RS 4
5520 .\}
5521 .nf
5522 \fBconst char *typestr()\fR
5523 my \fI$typestr\fR \fB=\fR \fI$chksum\fR\fB\->typestr()\fR;
5524 \fItypestr\fR \fB=\fR \fIchksum\fR\fB\&.typestr\fR
5525 \fItypestr\fR \fB=\fR \fIchksum\fR\fB\&.typestr\fR
5526 .fi
5527 .if n \{\
5528 .RE
5529 .\}
5530 .sp
5531 Return the type of the checksum as a string, e\&.g\&. "sha256"\&.
5532 .sp
5533 .if n \{\
5534 .RS 4
5535 .\}
5536 .nf
5537 \fB<equality>\fR
5538 \fBif (\fR\fI$chksum1\fR \fB==\fR \fI$chksum2\fR\fB)\fR
5539 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR\fB:\fR
5540 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR
5541 .fi
5542 .if n \{\
5543 .RE
5544 .\}
5545 .sp
5546 Checksums are equal if they are of the same type and the finalized results are the same\&.
5547 .sp
5548 .if n \{\
5549 .RS 4
5550 .\}
5551 .nf
5552 \fB<stringification>\fR
5553 my \fI$str\fR \fB=\fR \fI$chksum\fR\fB\->str\fR;
5554 \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR
5555 \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR
5556 .fi
5557 .if n \{\
5558 .RE
5559 .\}
5560 .sp
5561 If the checksum is finished, the checksum is returned as "<type>:<hex>" string\&. Otherwise "<type>:unfinished" is returned\&.
5562 .SH "FILE MANAGEMENT"
5563 .sp
5564 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\&.
5565 .sp
5566 .if n \{\
5567 .RS 4
5568 .\}
5569 .nf
5570 \fBFILE *xfopen(char *\fR\fIfn\fR\fB, char *\fR\fImode\fR \fB= "r")\fR
5571 my \fI$file\fR \fB= solv::xfopen(\fR\fI$path\fR\fB)\fR;
5572 \fIfile\fR \fB= solv\&.xfopen(\fR\fIpath\fR\fB)\fR
5573 \fIfile\fR \fB= Solv::xfopen(\fR\fIpath\fR\fB)\fR
5574 .fi
5575 .if n \{\
5576 .RE
5577 .\}
5578 .sp
5579 Open a file at the specified path\&. The mode argument is passed on to the stdio library\&.
5580 .sp
5581 .if n \{\
5582 .RS 4
5583 .\}
5584 .nf
5585 \fBFILE *xfopen_fd(char *\fR\fIfn\fR\fB, int\fR \fIfileno\fR\fB)\fR
5586 my \fI$file\fR \fB= solv::xfopen_fd(\fR\fI$path\fR\fB,\fR \fI$fileno\fR\fB)\fR;
5587 \fIfile\fR \fB= solv\&.xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
5588 \fIfile\fR \fB= Solv::xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
5589 .fi
5590 .if n \{\
5591 .RE
5592 .\}
5593 .sp
5594 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\&.
5595 .SS "METHODS"
5596 .sp
5597 .if n \{\
5598 .RS 4
5599 .\}
5600 .nf
5601 \fBint fileno()\fR
5602 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->fileno()\fR;
5603 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
5604 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
5605 .fi
5606 .if n \{\
5607 .RE
5608 .\}
5609 .sp
5610 Return file file descriptor of the file\&. If the file is not open, \-1 is returned\&.
5611 .sp
5612 .if n \{\
5613 .RS 4
5614 .\}
5615 .nf
5616 \fBvoid cloexec(bool\fR \fIstate\fR\fB)\fR
5617 \fI$file\fR\fB\->cloexec(\fR\fI$state\fR\fB)\fR
5618 \fIfile\fR\fB\&.cloexec(\fR\fIstate\fR\fB)\fR
5619 \fIfile\fR\fB\&.cloexec(\fR\fIstate\fR\fB)\fR
5620 .fi
5621 .if n \{\
5622 .RE
5623 .\}
5624 .sp
5625 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\&.
5626 .sp
5627 .if n \{\
5628 .RS 4
5629 .\}
5630 .nf
5631 \fBint dup()\fR
5632 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->dup()\fR;
5633 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
5634 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
5635 .fi
5636 .if n \{\
5637 .RE
5638 .\}
5639 .sp
5640 Return a copy of the descriptor of the file\&. If the file is not open, \-1 is returned\&.
5641 .sp
5642 .if n \{\
5643 .RS 4
5644 .\}
5645 .nf
5646 \fBbool flush()\fR
5647 \fI$file\fR\fB\->flush()\fR;
5648 \fIfile\fR\fB\&.flush()\fR
5649 \fIfile\fR\fB\&.flush()\fR
5650 .fi
5651 .if n \{\
5652 .RE
5653 .\}
5654 .sp
5655 Flush the file\&. Returns false if there was an error\&. Flushing a closed file always returns true\&.
5656 .sp
5657 .if n \{\
5658 .RS 4
5659 .\}
5660 .nf
5661 \fBbool close()\fR
5662 \fI$file\fR\fB\->close()\fR;
5663 \fIfile\fR\fB\&.close()\fR
5664 \fIfile\fR\fB\&.close()\fR
5665 .fi
5666 .if n \{\
5667 .RE
5668 .\}
5669 .sp
5670 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\&.
5671 .SH "THE REPODATA CLASS"
5672 .sp
5673 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\&.
5674 .SS "ATTRIBUTES"
5675 .sp
5676 .if n \{\
5677 .RS 4
5678 .\}
5679 .nf
5680 \fBRepo *repo;\fR                     /* read only */
5681 \fI$data\fR\fB\->{repo}\fR
5682 \fIdata\fR\fB\&.repo\fR
5683 \fIdata\fR\fB\&.repo\fR
5684 .fi
5685 .if n \{\
5686 .RE
5687 .\}
5688 .sp
5689 Back pointer to repository object\&.
5690 .sp
5691 .if n \{\
5692 .RS 4
5693 .\}
5694 .nf
5695 \fBId id;\fR                                  /* read only */
5696 \fI$data\fR\fB\->{id}\fR
5697 \fIdata\fR\fB\&.id\fR
5698 \fIdata\fR\fB\&.id\fR
5699 .fi
5700 .if n \{\
5701 .RE
5702 .\}
5703 .sp
5704 The id of the repodata area\&. Repodata ids of different repositories overlap\&.
5705 .SS "METHODS"
5706 .sp
5707 .if n \{\
5708 .RS 4
5709 .\}
5710 .nf
5711 \fBinternalize()\fR;
5712 \fI$data\fR\fB\->internalize()\fR;
5713 \fIdata\fR\fB\&.internalize()\fR
5714 \fIdata\fR\fB\&.internalize()\fR
5715 .fi
5716 .if n \{\
5717 .RE
5718 .\}
5719 .sp
5720 Internalize newly added data\&. The lookup functions will only see the new data after it has been internalized\&.
5721 .sp
5722 .if n \{\
5723 .RS 4
5724 .\}
5725 .nf
5726 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR;
5727 \fI$data\fR\fB\->write(\fR\fI$fp\fR\fB)\fR;
5728 \fIdata\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
5729 \fIdata\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
5730 .fi
5731 .if n \{\
5732 .RE
5733 .\}
5734 .sp
5735 Write the contents of the repodata area as solv file\&.
5736 .sp
5737 .if n \{\
5738 .RS 4
5739 .\}
5740 .nf
5741 \fBId str2dir(const char *\fR\fIdir\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
5742 my \fI$did\fR \fB=\fR \fIdata\fR\fB\->str2dir(\fR\fI$dir\fR\fB)\fR;
5743 \fIdid\fR \fB=\fR \fIdata\fR\fB\&.str2dir(\fR\fIdir\fR\fB)\fR
5744 \fIdid\fR \fB=\fR \fIdata\fR\fB\&.str2dir(\fR\fIdir\fR\fB)\fR
5745 .fi
5746 .if n \{\
5747 .RE
5748 .\}
5749 .sp
5750 .if n \{\
5751 .RS 4
5752 .\}
5753 .nf
5754 \fBconst char *dir2str(Id\fR \fIdid\fR\fB, const char *\fR\fIsuffix\fR \fB= 0)\fR
5755 \fI$dir\fR \fB=\fR \fIpool\fR\fB\->dir2str(\fR\fI$did\fR\fB)\fR;
5756 \fIdir\fR \fB=\fR \fIpool\fR\fB\&.dir2str(\fR\fIdid\fR\fB)\fR
5757 \fIdir\fR \fB=\fR \fIpool\fR\fB\&.dir2str(\fR\fIdid\fR\fB)\fR
5758 .fi
5759 .if n \{\
5760 .RE
5761 .\}
5762 .sp
5763 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\&.
5764 .sp
5765 .if n \{\
5766 .RS 4
5767 .\}
5768 .nf
5769 \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
5770 \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
5771 \fIdata\fR\fB\&.add_dirstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIdir\fR\fB,\fR \fIstring\fR\fB)\fR
5772 \fIdata\fR\fB\&.add_dirstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIdir\fR\fB,\fR \fIstring\fR\fB)\fR
5773 .fi
5774 .if n \{\
5775 .RE
5776 .\}
5777 .sp
5778 Add a file path consisting of a dirname Id and a basename string\&.
5779 .sp
5780 .if n \{\
5781 .RS 4
5782 .\}
5783 .nf
5784 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR;
5785 \fI$data\fR\fB\->add_solv(\fR\fI$fp\fR\fB)\fR;
5786 \fIdata\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
5787 \fIdata\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
5788 .fi
5789 .if n \{\
5790 .RE
5791 .\}
5792 .sp
5793 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\&.
5794 .sp
5795 .if n \{\
5796 .RS 4
5797 .\}
5798 .nf
5799 \fBvoid create_stubs()\fR;
5800 \fI$data\fR\fB\->create_stubs()\fR
5801 \fIdata\fR\fB\&.create_stubs()\fR
5802 \fIdata\fR\fB\&.create_stubs()\fR
5803 .fi
5804 .if n \{\
5805 .RE
5806 .\}
5807 .sp
5808 Create stub repodatas from the information stored in the repodata meta area\&.
5809 .sp
5810 .if n \{\
5811 .RS 4
5812 .\}
5813 .nf
5814 \fBvoid extend_to_repo()\fR;
5815 \fI$data\fR\fB\->extend_to_repo()\fR;
5816 \fIdata\fR\fB\&.extend_to_repo()\fR
5817 \fIdata\fR\fB\&.extend_to_repo()\fR
5818 .fi
5819 .if n \{\
5820 .RE
5821 .\}
5822 .sp
5823 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)\&.
5824 .sp
5825 .if n \{\
5826 .RS 4
5827 .\}
5828 .nf
5829 \fB<equality>\fR
5830 \fBif (\fR\fI$data1\fR \fB==\fR \fI$data2\fR\fB)\fR
5831 \fBif\fR \fIdata1\fR \fB==\fR \fIdata2\fR\fB:\fR
5832 \fBif\fR \fIdata1\fR \fB==\fR \fIdata2\fR
5833 .fi
5834 .if n \{\
5835 .RE
5836 .\}
5837 .sp
5838 Two repodata objects are equal if they belong to the same repository and have the same id\&.
5839 .SS "DATA RETRIEVAL METHODS"
5840 .sp
5841 .if n \{\
5842 .RS 4
5843 .\}
5844 .nf
5845 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5846 my \fI$string\fR \fB=\fR \fI$data\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5847 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5848 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5849 .fi
5850 .if n \{\
5851 .RE
5852 .\}
5853 .sp
5854 .if n \{\
5855 .RS 4
5856 .\}
5857 .nf
5858 \fBconst char *lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5859 my \fI$string\fR \fB=\fR \fI$data\fR\fB\->lookup_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5860 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5861 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5862 .fi
5863 .if n \{\
5864 .RE
5865 .\}
5866 .sp
5867 .if n \{\
5868 .RS 4
5869 .\}
5870 .nf
5871 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
5872 my \fI$num\fR \fB=\fR \fI$data\fR\fB\->lookup_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5873 \fInum\fR \fB=\fR \fIdata\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5874 \fInum\fR \fB=\fR \fIdata\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5875 .fi
5876 .if n \{\
5877 .RE
5878 .\}
5879 .sp
5880 .if n \{\
5881 .RS 4
5882 .\}
5883 .nf
5884 \fBbool lookup_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5885 my \fI$bool\fR \fB=\fR \fI$data\fR\fB\->lookup_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5886 \fIbool\fR \fB=\fR \fIdata\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5887 \fIbool\fR \fB=\fR \fIdata\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5888 .fi
5889 .if n \{\
5890 .RE
5891 .\}
5892 .sp
5893 .if n \{\
5894 .RS 4
5895 .\}
5896 .nf
5897 \fBId *lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5898 my \fI@ids\fR \fB=\fR \fI$data\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5899 \fIids\fR \fB=\fR \fIdata\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5900 \fIids\fR \fB=\fR \fIdata\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5901 .fi
5902 .if n \{\
5903 .RE
5904 .\}
5905 .sp
5906 .if n \{\
5907 .RS 4
5908 .\}
5909 .nf
5910 \fBChksum lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5911 my \fI$chksum\fR \fB=\fR \fI$data\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5912 \fIchksum\fR \fB=\fR \fIdata\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5913 \fIchksum\fR \fB=\fR \fIdata\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5914 .fi
5915 .if n \{\
5916 .RE
5917 .\}
5918 .sp
5919 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\&.
5920 .SS "DATA STORAGE METHODS"
5921 .sp
5922 .if n \{\
5923 .RS 4
5924 .\}
5925 .nf
5926 \fBvoid set_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fIstr\fR\fB)\fR;
5927 \fI$data\fR\fB\->set_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$str\fR\fB)\fR;
5928 \fIdata\fR\fB\&.set_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5929 \fIdata\fR\fB\&.set_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5930 .fi
5931 .if n \{\
5932 .RE
5933 .\}
5934 .sp
5935 .if n \{\
5936 .RS 4
5937 .\}
5938 .nf
5939 \fBvoid set_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR;
5940 \fI$data\fR\fB\->set_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
5941 \fIdata\fR\fB\&.set_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5942 \fIdata\fR\fB\&.set_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5943 .fi
5944 .if n \{\
5945 .RE
5946 .\}
5947 .sp
5948 .if n \{\
5949 .RS 4
5950 .\}
5951 .nf
5952 \fBvoid set_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInum\fR\fB)\fR;
5953 \fI$data\fR\fB\->set_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$num\fR\fB)\fR;
5954 \fIdata\fR\fB\&.set_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fInum\fR\fB)\fR
5955 \fIdata\fR\fB\&.set_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fInum\fR\fB)\fR
5956 .fi
5957 .if n \{\
5958 .RE
5959 .\}
5960 .sp
5961 .if n \{\
5962 .RS 4
5963 .\}
5964 .nf
5965 \fBvoid set_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR;
5966 \fI$data\fR\fB\->set_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5967 \fIdata\fR\fB\&.set_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5968 \fIdata\fR\fB\&.set_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5969 .fi
5970 .if n \{\
5971 .RE
5972 .\}
5973 .sp
5974 .if n \{\
5975 .RS 4
5976 .\}
5977 .nf
5978 \fBvoid set_poolstr(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fIstr\fR\fB)\fR;
5979 \fI$data\fR\fB\->set_poolstr(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$str\fR\fB)\fR;
5980 \fIdata\fR\fB\&.set_poolstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5981 \fIdata\fR\fB\&.set_poolstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5982 .fi
5983 .if n \{\
5984 .RE
5985 .\}
5986 .sp
5987 .if n \{\
5988 .RS 4
5989 .\}
5990 .nf
5991 \fBvoid set_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Chksum *\fR\fIchksum\fR\fB)\fR;
5992 \fI$data\fR\fB\->set_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$chksum\fR\fB)\fR;
5993 \fIdata\fR\fB\&.set_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIchksum\fR\fB)\fR
5994 \fIdata\fR\fB\&.set_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIchksum\fR\fB)\fR
5995 .fi
5996 .if n \{\
5997 .RE
5998 .\}
5999 .sp
6000 .if n \{\
6001 .RS 4
6002 .\}
6003 .nf
6004 \fBvoid set_sourcepkg(Id\fR \fIsolvid\fR\fB, const char *\fR\fIsourcepkg\fR\fB)\fR;
6005 \fI$data\fR\fB\&.set_sourcepkg(\fR\fI$solvid\fR\fB,\fR \fI$sourcepkg\fR\fB)\fR;
6006 \fIdata\fR\fB\&.set_sourcepkg(\fR\fIsolvid\fR\fB,\fR \fIsourcepkg\fR\fB)\fR
6007 \fIdata\fR\fB\&.set_sourcepkg(\fR\fIsolvid\fR\fB,\fR \fIsourcepkg\fR\fB)\fR
6008 .fi
6009 .if n \{\
6010 .RE
6011 .\}
6012 .sp
6013 .if n \{\
6014 .RS 4
6015 .\}
6016 .nf
6017 \fBvoid set_location(Id\fR \fIsolvid\fR\fB, unsigned int\fR \fImediano\fR\fB, const char *\fR\fIlocation\fR\fB)\fR;
6018 \fI$data\fR\fB\&.set_location(\fR\fI$solvid\fR\fB,\fR \fI$mediano\fR\fB,\fR \fI$location\fR\fB)\fR;
6019 \fIdata\fR\fB\&.set_location(\fR\fIsolvid\fR\fB,\fR \fImediano\fR\fB,\fR \fIlocation\fR\fB)\fR
6020 \fIdata\fR\fB\&.set_location(\fR\fIsolvid\fR\fB,\fR \fImediano\fR\fB,\fR \fIlocation\fR\fB)\fR
6021 .fi
6022 .if n \{\
6023 .RE
6024 .\}
6025 .sp
6026 .if n \{\
6027 .RS 4
6028 .\}
6029 .nf
6030 \fBvoid add_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR;
6031 \fI$data\fR\fB\->add_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
6032 \fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
6033 \fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
6034 .fi
6035 .if n \{\
6036 .RE
6037 .\}
6038 .sp
6039 .if n \{\
6040 .RS 4
6041 .\}
6042 .nf
6043 \fBId new_handle()\fR;
6044 my \fI$handle\fR \fB=\fR \fI$data\fR\fB\->new_handle()\fR;
6045 \fIhandle\fR \fB=\fR \fIdata\fR\fB\&.new_handle()\fR
6046 \fIhandle\fR \fB=\fR \fIdata\fR\fB\&.new_handle()\fR
6047 .fi
6048 .if n \{\
6049 .RE
6050 .\}
6051 .sp
6052 .if n \{\
6053 .RS 4
6054 .\}
6055 .nf
6056 \fBvoid add_flexarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fIhandle\fR\fB)\fR;
6057 \fI$data\fR\fB\->add_flexarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$handle\fR\fB)\fR;
6058 \fIdata\fR\fB\&.add_flexarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIhandle\fR\fB)\fR
6059 \fIdata\fR\fB\&.add_flexarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIhandle\fR\fB)\fR
6060 .fi
6061 .if n \{\
6062 .RE
6063 .\}
6064 .sp
6065 .if n \{\
6066 .RS 4
6067 .\}
6068 .nf
6069 \fBvoid unset(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR;
6070 \fI$data\fR\fB\->unset(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
6071 \fIdata\fR\fB\&.unset(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6072 \fIdata\fR\fB\&.unset(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
6073 .fi
6074 .if n \{\
6075 .RE
6076 .\}
6077 .sp
6078 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\&.
6079 .SH "THE DATAPOS CLASS"
6080 .sp
6081 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\&.
6082 .SS "ATTRIBUTES"
6083 .sp
6084 .if n \{\
6085 .RS 4
6086 .\}
6087 .nf
6088 \fBRepo *repo;\fR                     /* read only */
6089 \fI$data\fR\fB\->{repo}\fR
6090 \fIdata\fR\fB\&.repo\fR
6091 \fIdata\fR\fB\&.repo\fR
6092 .fi
6093 .if n \{\
6094 .RE
6095 .\}
6096 .sp
6097 Back pointer to repository object\&.
6098 .SS "METHODS"
6099 .sp
6100 .if n \{\
6101 .RS 4
6102 .\}
6103 .nf
6104 \fBDataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
6105 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;
6106 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
6107 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
6108 .fi
6109 .if n \{\
6110 .RE
6111 .\}
6112 .sp
6113 Create a Dataiterator at the position of the datapos object\&.
6114 .sp
6115 .if n \{\
6116 .RS 4
6117 .\}
6118 .nf
6119 \fBconst char *lookup_deltalocation(unsigned int *\fR\fIOUTPUT\fR\fB)\fR;
6120 my \fB(\fR\fI$location\fR\fB,\fR \fI$mediano\fR\fB) =\fR \fI$datapos\fR\fB\->lookup_deltalocation()\fR;
6121 \fIlocation\fR\fB,\fR \fImediano\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltalocation()\fR
6122 \fIlocation\fR\fB,\fR \fImediano\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltalocation()\fR
6123 .fi
6124 .if n \{\
6125 .RE
6126 .\}
6127 .sp
6128 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\&.
6129 .sp
6130 .if n \{\
6131 .RS 4
6132 .\}
6133 .nf
6134 \fBconst char *lookup_deltaseq()\fR;
6135 my \fI$seq\fR \fB=\fR \fI$datapos\fR\fB\->lookup_deltaseq()\fR;
6136 \fIseq\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltaseq()\fR;
6137 \fIseq\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltaseq()\fR;
6138 .fi
6139 .if n \{\
6140 .RE
6141 .\}
6142 .sp
6143 Return the delta rpm sequence from the structure describing a delta rpm\&.
6144 .SS "DATA RETRIEVAL METHODS"
6145 .sp
6146 .if n \{\
6147 .RS 4
6148 .\}
6149 .nf
6150 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
6151 my \fI$string\fR \fB=\fR \fI$datapos\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
6152 \fIstring\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
6153 \fIstring\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_str(\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 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
6164 my \fI$id\fR \fB=\fR \fI$datapos\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
6165 \fIid\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
6166 \fIid\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
6167 .fi
6168 .if n \{\
6169 .RE
6170 .\}
6171 .sp
6172 .if n \{\
6173 .RS 4
6174 .\}
6175 .nf
6176 \fBunsigned long long lookup_num(Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
6177 my \fI$num\fR \fB=\fR \fI$datapos\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
6178 \fInum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
6179 \fInum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
6180 .fi
6181 .if n \{\
6182 .RE
6183 .\}
6184 .sp
6185 .if n \{\
6186 .RS 4
6187 .\}
6188 .nf
6189 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
6190 my \fI$bool\fR \fB=\fR \fI$datapos\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
6191 \fIbool\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
6192 \fIbool\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
6193 .fi
6194 .if n \{\
6195 .RE
6196 .\}
6197 .sp
6198 .if n \{\
6199 .RS 4
6200 .\}
6201 .nf
6202 \fBId *lookup_idarray(Id\fR \fIkeyname\fR\fB)\fR
6203 my \fI@ids\fR \fB=\fR \fI$datapos\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
6204 \fIids\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
6205 \fIids\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
6206 .fi
6207 .if n \{\
6208 .RE
6209 .\}
6210 .sp
6211 .if n \{\
6212 .RS 4
6213 .\}
6214 .nf
6215 \fBChksum lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
6216 my \fI$chksum\fR \fB=\fR \fI$datapos\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
6217 \fIchksum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
6218 \fIchksum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
6219 .fi
6220 .if n \{\
6221 .RE
6222 .\}
6223 .sp
6224 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\&.
6225 .sp
6226 .if n \{\
6227 .RS 4
6228 .\}
6229 .nf
6230 \fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
6231 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;
6232 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
6233 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
6234 .fi
6235 .if n \{\
6236 .RE
6237 .\}
6238 .sp
6239 .if n \{\
6240 .RS 4
6241 .\}
6242 .nf
6243 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
6244 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
6245 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
6246 .fi
6247 .if n \{\
6248 .RE
6249 .\}
6250 .sp
6251 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
6252 .SH "AUTHOR"
6253 .sp
6254 Michael Schroeder <mls@suse\&.de>