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