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