Imported Upstream version 0.6.12
[platform/upstream/libsolv.git] / doc / libsolv-bindings.3
1 '\" t
2 .\"     Title: Libsolv-Bindings
3 .\"    Author: [see the "Author" section]
4 .\" Generator: DocBook XSL Stylesheets v1.78.0 <http://docbook.sf.net/>
5 .\"      Date: 08/28/2015
6 .\"    Manual: LIBSOLV
7 .\"    Source: libsolv
8 .\"  Language: English
9 .\"
10 .TH "LIBSOLV\-BINDINGS" "3" "08/28/2015" "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\fR\fB::Pool_POOL_FLAG_OBSOLETEUSESCOLORS  1\fR
403 \fBputs [\fR\fI$solvable\fR \fBlookup_str\fR \fI$solv\fR\fB::SOLVABLE_SUMMARY]\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 then\(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 wand 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 betwen 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 than 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 an 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 an 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 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 the 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(\fR\fI$fp\fR\fB)\fR;
2074 \fIrepo\fR\fB\&.add_mdk(\fR\fIfp\fR\fB)\fR
2075 \fIrepo\fR\fB\&.add_mdk(\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 the 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 \fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
2429 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;
2430 \fIdi\fR \fB=\fR \fIsolvable\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2431 \fIdi\fR \fB=\fR \fIsolvable\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
2432 .fi
2433 .if n \{\
2434 .RE
2435 .\}
2436 .sp
2437 .if n \{\
2438 .RS 4
2439 .\}
2440 .nf
2441 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2442 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2443 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2444 .fi
2445 .if n \{\
2446 .RE
2447 .\}
2448 .sp
2449 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
2450 .sp
2451 .if n \{\
2452 .RS 4
2453 .\}
2454 .nf
2455 \fBvoid add_deparray(Id\fR \fIkeyname\fR\fB, DepId\fR \fIdep\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR;
2456 \fI$solvable\fR\fB\->add_deparray(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR;
2457 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2458 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2459 .fi
2460 .if n \{\
2461 .RE
2462 .\}
2463 .sp
2464 Add a new dependency to the attributes stored in keyname\&.
2465 .sp
2466 .if n \{\
2467 .RS 4
2468 .\}
2469 .nf
2470 \fBvoid unset(Id\fR \fIkeyname\fR\fB)\fR;
2471 \fI$solvable\fR\fB\->unset(\fR\fI$keyname\fR\fB)\fR;
2472 \fIsolvable\fR\fB\&.unset(\fR\fIkeyname\fR\fB)\fR
2473 \fIsolvable\fR\fB\&.unset(\fR\fIkeyname\fR\fB)\fR
2474 .fi
2475 .if n \{\
2476 .RE
2477 .\}
2478 .sp
2479 Delete data stored for the specific keyname\&.
2480 .sp
2481 .if n \{\
2482 .RS 4
2483 .\}
2484 .nf
2485 \fBbool installable()\fR;
2486 \fI$solvable\fR\fB\->installable()\fR
2487 \fIsolvable\fR\fB\&.installable()\fR
2488 \fIsolvable\fR\fB\&.installable?\fR
2489 .fi
2490 .if n \{\
2491 .RE
2492 .\}
2493 .sp
2494 Return true if the solvable is installable on the system\&. Solvables are not installable if the system does not support their architecture\&.
2495 .sp
2496 .if n \{\
2497 .RS 4
2498 .\}
2499 .nf
2500 \fBbool isinstalled()\fR;
2501 \fI$solvable\fR\fB\->isinstalled()\fR
2502 \fIsolvable\fR\fB\&.isinstalled()\fR
2503 \fIsolvable\fR\fB\&.isinstalled?\fR
2504 .fi
2505 .if n \{\
2506 .RE
2507 .\}
2508 .sp
2509 Return true if the solvable is installed on the system\&.
2510 .sp
2511 .if n \{\
2512 .RS 4
2513 .\}
2514 .nf
2515 \fBbool identical(Solvable *\fR\fIother\fR\fB)\fR
2516 \fI$solvable\fR\fB\->identical(\fR\fI$other\fR\fB)\fR
2517 \fI$solvable\fR\fB\&.identical(\fR\fIother\fR\fB)\fR
2518 \fI$solvable\fR\fB\&.identical?(\fR\fIother\fR\fB)\fR
2519 .fi
2520 .if n \{\
2521 .RE
2522 .\}
2523 .sp
2524 Return true if the two solvables are identical\&.
2525 .sp
2526 .if n \{\
2527 .RS 4
2528 .\}
2529 .nf
2530 \fBint evrcmp(Solvable *\fR\fIother\fR\fB)\fR
2531 \fI$solvable\fR\fB\->evrcmp(\fR\fIother\fR\fB)\fR
2532 \fI$solvable\fR\fB\&.evrcmp(\fR\fIother\fR\fB)\fR
2533 \fI$solvable\fR\fB\&.evrcmp(\fR\fIother\fR\fB)\fR
2534 .fi
2535 .if n \{\
2536 .RE
2537 .\}
2538 .sp
2539 Returns \-1 if the epoch/version/release of the solvable is less then 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\&.
2540 .sp
2541 .if n \{\
2542 .RS 4
2543 .\}
2544 .nf
2545 \fBSelection Selection(int\fR \fIsetflags\fR \fB= 0)\fR
2546 my \fI$sel\fR \fB=\fR \fI$solvable\fR\fB\->Selection()\fR;
2547 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
2548 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
2549 .fi
2550 .if n \{\
2551 .RE
2552 .\}
2553 .sp
2554 Create a Selection containing just the single solvable\&.
2555 .sp
2556 .if n \{\
2557 .RS 4
2558 .\}
2559 .nf
2560 \fBconst char *str()\fR
2561 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str()\fR;
2562 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
2563 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
2564 .fi
2565 .if n \{\
2566 .RE
2567 .\}
2568 .sp
2569 Return a string describing the solvable\&. The string consists of the name, version, and architecture of the Solvable\&.
2570 .sp
2571 .if n \{\
2572 .RS 4
2573 .\}
2574 .nf
2575 \fB<stringification>\fR
2576 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str\fR;
2577 \fIstr\fR \fB= str(\fR\fIsolvable\fR\fB)\fR
2578 \fIstr\fR \fB=\fR \fIsolvable\fR\fB\&.to_s\fR
2579 .fi
2580 .if n \{\
2581 .RE
2582 .\}
2583 .sp
2584 Same as calling the str() method\&.
2585 .sp
2586 .if n \{\
2587 .RS 4
2588 .\}
2589 .nf
2590 \fB<equality>\fR
2591 \fBif (\fR\fI$solvable1\fR \fB==\fR \fI$solvable2\fR\fB)\fR
2592 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR\fB:\fR
2593 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR
2594 .fi
2595 .if n \{\
2596 .RE
2597 .\}
2598 .sp
2599 Two solvables are equal if they are part of the same pool and have the same ids\&.
2600 .SH "THE DATAITERATOR CLASS"
2601 .sp
2602 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\&.
2603 .SS "CONSTANTS"
2604 .PP
2605 \fBSEARCH_STRING\fR
2606 .RS 4
2607 Return a match if the search string matches the value\&.
2608 .RE
2609 .PP
2610 \fBSEARCH_STRINGSTART\fR
2611 .RS 4
2612 Return a match if the value starts with the search string\&.
2613 .RE
2614 .PP
2615 \fBSEARCH_STRINGEND\fR
2616 .RS 4
2617 Return a match if the value ends with the search string\&.
2618 .RE
2619 .PP
2620 \fBSEARCH_SUBSTRING\fR
2621 .RS 4
2622 Return a match if the search string can be matched somewhere in the value\&.
2623 .RE
2624 .PP
2625 \fBSEARCH_GLOB\fR
2626 .RS 4
2627 Do a glob match of the search string against the value\&.
2628 .RE
2629 .PP
2630 \fBSEARCH_REGEX\fR
2631 .RS 4
2632 Do a regular expression match of the search string against the value\&.
2633 .RE
2634 .PP
2635 \fBSEARCH_NOCASE\fR
2636 .RS 4
2637 Ignore case when matching strings\&. Works for all the above match types\&.
2638 .RE
2639 .PP
2640 \fBSEARCH_FILES\fR
2641 .RS 4
2642 Match the complete filenames of the file list, not just the base name\&.
2643 .RE
2644 .PP
2645 \fBSEARCH_COMPLETE_FILELIST\fR
2646 .RS 4
2647 When matching the file list, check every file of the package not just the subset from the primary metadata\&.
2648 .RE
2649 .PP
2650 \fBSEARCH_CHECKSUMS\fR
2651 .RS 4
2652 Allow the matching of checksum entries\&.
2653 .RE
2654 .SS "METHODS"
2655 .sp
2656 .if n \{\
2657 .RS 4
2658 .\}
2659 .nf
2660 \fBvoid prepend_keyname(Id\fR \fIkeyname\fR\fB)\fR;
2661 \fI$di\fR\fB\->prepend_keyname(\fR\fI$keyname\fR\fB)\fR;
2662 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2663 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2664 .fi
2665 .if n \{\
2666 .RE
2667 .\}
2668 .sp
2669 Do a sub\-search in the array stored in keyname\&.
2670 .sp
2671 .if n \{\
2672 .RS 4
2673 .\}
2674 .nf
2675 \fBvoid skip_solvable()\fR;
2676 \fI$di\fR\fB\->kip_solvable()\fR;
2677 \fIdi\fR\fB\&.skip_solvable()\fR
2678 \fIdi\fR\fB\&.skip_solvable()\fR
2679 .fi
2680 .if n \{\
2681 .RE
2682 .\}
2683 .sp
2684 Stop matching the current solvable and advance to the next one\&.
2685 .sp
2686 .if n \{\
2687 .RS 4
2688 .\}
2689 .nf
2690 \fB<iteration>\fR
2691 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2692 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2693 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2694 .fi
2695 .if n \{\
2696 .RE
2697 .\}
2698 .sp
2699 Iterate through the matches\&. If there is a match, the object in d will be of type Datamatch\&.
2700 .SH "THE DATAMATCH CLASS"
2701 .sp
2702 Objects of this type will be created for every value matched by a dataiterator\&.
2703 .SS "ATTRIBUTES"
2704 .sp
2705 .if n \{\
2706 .RS 4
2707 .\}
2708 .nf
2709 \fBPool *pool;\fR                             /* read only */
2710 \fI$d\fR\fB\->{pool}\fR
2711 \fId\fR\fB\&.pool\fR
2712 \fId\fR\fB\&.pool\fR
2713 .fi
2714 .if n \{\
2715 .RE
2716 .\}
2717 .sp
2718 Back pointer to pool\&.
2719 .sp
2720 .if n \{\
2721 .RS 4
2722 .\}
2723 .nf
2724 \fBRepo *repo;\fR                             /* read only */
2725 \fI$d\fR\fB\->{repo}\fR
2726 \fId\fR\fB\&.repo\fR
2727 \fId\fR\fB\&.repo\fR
2728 .fi
2729 .if n \{\
2730 .RE
2731 .\}
2732 .sp
2733 The repository containing the matched object\&.
2734 .sp
2735 .if n \{\
2736 .RS 4
2737 .\}
2738 .nf
2739 \fBSolvable *solvable;\fR                     /* read only */
2740 \fI$d\fR\fB\->{solvable}\fR
2741 \fId\fR\fB\&.solvable\fR
2742 \fId\fR\fB\&.solvable\fR
2743 .fi
2744 .if n \{\
2745 .RE
2746 .\}
2747 .sp
2748 The solvable containing the value that was matched\&.
2749 .sp
2750 .if n \{\
2751 .RS 4
2752 .\}
2753 .nf
2754 \fBId solvid;\fR                              /* read only */
2755 \fI$d\fR\fB\->{solvid}\fR
2756 \fId\fR\fB\&.solvid\fR
2757 \fId\fR\fB\&.solvid\fR
2758 .fi
2759 .if n \{\
2760 .RE
2761 .\}
2762 .sp
2763 The id of the solvable that matched\&.
2764 .sp
2765 .if n \{\
2766 .RS 4
2767 .\}
2768 .nf
2769 \fBId\fR \fIkey_id\fR;
2770 \fI$d\fR\fB\->{\fR\fIkey_id\fR\fB}\fR
2771 \fId\fR\fB\&.key_id\fR
2772 \fId\fR\fB\&.key_id\fR
2773 .fi
2774 .if n \{\
2775 .RE
2776 .\}
2777 .sp
2778 .if n \{\
2779 .RS 4
2780 .\}
2781 .nf
2782 \fBconst char *\fR\fIkey_idstr\fR;
2783 \fI$d\fR\fB\->{\fR\fIkey_idstr\fR\fB}\fR
2784 \fId\fR\fB\&.key_idstr\fR
2785 \fId\fR\fB\&.key_idstr\fR
2786 .fi
2787 .if n \{\
2788 .RE
2789 .\}
2790 .sp
2791 The keyname that matched, either as id or string\&.
2792 .sp
2793 .if n \{\
2794 .RS 4
2795 .\}
2796 .nf
2797 \fBId\fR \fItype_id\fR;
2798 \fI$d\fR\fB\->{\fR\fItype_id\fR\fB}\fR
2799 \fId\fR\fB\&.type_id\fR
2800 \fId\fR\fB\&.type_id\fR
2801 .fi
2802 .if n \{\
2803 .RE
2804 .\}
2805 .sp
2806 .if n \{\
2807 .RS 4
2808 .\}
2809 .nf
2810 \fBconst char *\fR\fItype_idstr\fR;
2811 \fI$d\fR\fB\->{\fR\fItype_idstr\fR\fB}\fR;
2812 \fId\fR\fB\&.type_idstr\fR
2813 \fId\fR\fB\&.type_idstr\fR
2814 .fi
2815 .if n \{\
2816 .RE
2817 .\}
2818 .sp
2819 The key type of the value that was matched, either as id or string\&.
2820 .sp
2821 .if n \{\
2822 .RS 4
2823 .\}
2824 .nf
2825 \fBId\fR \fIid\fR;
2826 \fI$d\fR\fB\->{id}\fR
2827 \fId\fR\fB\&.id\fR
2828 \fId\fR\fB\&.id\fR
2829 .fi
2830 .if n \{\
2831 .RE
2832 .\}
2833 .sp
2834 .if n \{\
2835 .RS 4
2836 .\}
2837 .nf
2838 \fBId\fR \fIidstr\fR;
2839 \fI$d\fR\fB\->{idstr}\fR
2840 \fId\fR\fB\&.idstr\fR
2841 \fId\fR\fB\&.idstr\fR
2842 .fi
2843 .if n \{\
2844 .RE
2845 .\}
2846 .sp
2847 The Id of the value that was matched (only valid for id types), either as id or string\&.
2848 .sp
2849 .if n \{\
2850 .RS 4
2851 .\}
2852 .nf
2853 \fBconst char *\fR\fIstr\fR;
2854 \fI$d\fR\fB\->{str}\fR
2855 \fId\fR\fB\&.str\fR
2856 \fId\fR\fB\&.str\fR
2857 .fi
2858 .if n \{\
2859 .RE
2860 .\}
2861 .sp
2862 The string value that was matched (only valid for string types)\&.
2863 .sp
2864 .if n \{\
2865 .RS 4
2866 .\}
2867 .nf
2868 \fBunsigned long long\fR \fInum\fR;
2869 \fI$d\fR\fB\->{num}\fR
2870 \fId\fR\fB\&.num\fR
2871 \fId\fR\fB\&.num\fR
2872 .fi
2873 .if n \{\
2874 .RE
2875 .\}
2876 .sp
2877 The numeric value that was matched (only valid for numeric types)\&.
2878 .sp
2879 .if n \{\
2880 .RS 4
2881 .\}
2882 .nf
2883 \fBunsigned int\fR \fInum2\fR;
2884 \fI$d\fR\fB\->{num2}\fR
2885 \fId\fR\fB\&.num2\fR
2886 \fId\fR\fB\&.num2\fR
2887 .fi
2888 .if n \{\
2889 .RE
2890 .\}
2891 .sp
2892 The secondary numeric value that was matched (only valid for types containing two values)\&.
2893 .sp
2894 .if n \{\
2895 .RS 4
2896 .\}
2897 .nf
2898 \fBunsigned int\fR \fIbinary\fR;
2899 \fI$d\fR\fB\->{binary}\fR
2900 \fId\fR\fB\&.binary\fR
2901 \fId\fR\fB\&.binary\fR
2902 .fi
2903 .if n \{\
2904 .RE
2905 .\}
2906 .sp
2907 The value in binary form, useful for checksums and other data that cannot be represented as a string\&.
2908 .SS "METHODS"
2909 .sp
2910 .if n \{\
2911 .RS 4
2912 .\}
2913 .nf
2914 \fBDatapos pos()\fR;
2915 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->pos()\fR;
2916 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
2917 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
2918 .fi
2919 .if n \{\
2920 .RE
2921 .\}
2922 .sp
2923 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\&.
2924 .sp
2925 .if n \{\
2926 .RS 4
2927 .\}
2928 .nf
2929 \fBDatapos parentpos()\fR;
2930 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->parentpos()\fR;
2931 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
2932 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
2933 .fi
2934 .if n \{\
2935 .RE
2936 .\}
2937 .sp
2938 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\&.
2939 .sp
2940 .if n \{\
2941 .RS 4
2942 .\}
2943 .nf
2944 \fB<stringification>\fR
2945 my \fI$str\fR \fB=\fR \fI$d\fR\fB\->str\fR;
2946 \fIstr\fR \fB= str(\fR\fId\fR\fB)\fR
2947 \fIstr\fR \fB=\fR \fId\fR\fB\&.to_s\fR
2948 .fi
2949 .if n \{\
2950 .RE
2951 .\}
2952 .sp
2953 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\&.
2954 .SH "THE SELECTION CLASS"
2955 .sp
2956 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\&.
2957 .SS "CONSTANTS"
2958 .PP
2959 \fBSELECTION_NAME\fR
2960 .RS 4
2961 Create the selection by matching package names\&.
2962 .RE
2963 .PP
2964 \fBSELECTION_PROVIDES\fR
2965 .RS 4
2966 Create the selection by matching package provides\&.
2967 .RE
2968 .PP
2969 \fBSELECTION_FILELIST\fR
2970 .RS 4
2971 Create the selection by matching package files\&.
2972 .RE
2973 .PP
2974 \fBSELECTION_CANON\fR
2975 .RS 4
2976 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\&.
2977 .RE
2978 .PP
2979 \fBSELECTION_DOTARCH\fR
2980 .RS 4
2981 Allow an \(lq\&.<architecture>\(rq suffix when matching names or provides\&.
2982 .RE
2983 .PP
2984 \fBSELECTION_REL\fR
2985 .RS 4
2986 Allow the specification of a relation when matching names or provides, e\&.g\&. "name >= 1\&.2"\&.
2987 .RE
2988 .PP
2989 \fBSELECTION_INSTALLED_ONLY\fR
2990 .RS 4
2991 Limit the package search to installed packages\&.
2992 .RE
2993 .PP
2994 \fBSELECTION_SOURCE_ONLY\fR
2995 .RS 4
2996 Limit the package search to source packages only\&.
2997 .RE
2998 .PP
2999 \fBSELECTION_WITH_SOURCE\fR
3000 .RS 4
3001 Extend the package search to also match source packages\&. The default is only to match binary packages\&.
3002 .RE
3003 .PP
3004 \fBSELECTION_GLOB\fR
3005 .RS 4
3006 Allow glob matching for package names, package provides, and file names\&.
3007 .RE
3008 .PP
3009 \fBSELECTION_NOCASE\fR
3010 .RS 4
3011 Ignore case when matching package names, package provides, and file names\&.
3012 .RE
3013 .PP
3014 \fBSELECTION_FLAT\fR
3015 .RS 4
3016 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\&.
3017 .RE
3018 .SS "ATTRIBUTES"
3019 .sp
3020 .if n \{\
3021 .RS 4
3022 .\}
3023 .nf
3024 \fBPool *pool;\fR                             /* read only */
3025 \fI$d\fR\fB\->{pool}\fR
3026 \fId\fR\fB\&.pool\fR
3027 \fId\fR\fB\&.pool\fR
3028 .fi
3029 .if n \{\
3030 .RE
3031 .\}
3032 .sp
3033 Back pointer to pool\&.
3034 .SS "METHODS"
3035 .sp
3036 .if n \{\
3037 .RS 4
3038 .\}
3039 .nf
3040 \fBint flags()\fR;
3041 my \fI$flags\fR \fB=\fR \fI$sel\fR\fB\->flags()\fR;
3042 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
3043 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
3044 .fi
3045 .if n \{\
3046 .RE
3047 .\}
3048 .sp
3049 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\&.
3050 .sp
3051 .if n \{\
3052 .RS 4
3053 .\}
3054 .nf
3055 \fBbool isempty()\fR;
3056 \fI$sel\fR\fB\->isempty()\fR
3057 \fIsel\fR\fB\&.isempty()\fR
3058 \fIsel\fR\fB\&.isempty?\fR
3059 .fi
3060 .if n \{\
3061 .RE
3062 .\}
3063 .sp
3064 Return true if the selection is empty, i\&.e\&. no package could be matched\&.
3065 .sp
3066 .if n \{\
3067 .RS 4
3068 .\}
3069 .nf
3070 \fBvoid filter(Selection *\fR\fIother\fR\fB)\fR
3071 \fI$sel\fR\fB\->filter(\fR\fI$other\fR\fB)\fR;
3072 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
3073 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
3074 .fi
3075 .if n \{\
3076 .RE
3077 .\}
3078 .sp
3079 Intersect two selections\&. Packages will only stay in the selection if there are also included in the other selecting\&. Does an in\-place modification\&.
3080 .sp
3081 .if n \{\
3082 .RS 4
3083 .\}
3084 .nf
3085 \fBvoid add(Selection *\fR\fIother\fR\fB)\fR
3086 \fI$sel\fR\fB\->add(\fR\fI$other\fR\fB)\fR;
3087 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
3088 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
3089 .fi
3090 .if n \{\
3091 .RE
3092 .\}
3093 .sp
3094 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\&.
3095 .sp
3096 .if n \{\
3097 .RS 4
3098 .\}
3099 .nf
3100 \fBvoid add_raw(Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
3101 \fI$sel\fR\fB\->add_raw(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
3102 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
3103 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
3104 .fi
3105 .if n \{\
3106 .RE
3107 .\}
3108 .sp
3109 Add a raw element to the selection\&. Check the Job class for information about the how and what parameters\&.
3110 .sp
3111 .if n \{\
3112 .RS 4
3113 .\}
3114 .nf
3115 \fBJob *jobs(int\fR \fIaction\fR\fB)\fR
3116 my \fI@jobs\fR \fB=\fR \fI$sel\fR\fB\->jobs(\fR\fI$action\fR\fB)\fR;
3117 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
3118 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
3119 .fi
3120 .if n \{\
3121 .RE
3122 .\}
3123 .sp
3124 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\&.
3125 .sp
3126 .if n \{\
3127 .RS 4
3128 .\}
3129 .nf
3130 \fBSolvable *solvables()\fR
3131 my \fI@solvables\fR \fB=\fR \fI$sel\fR\fB\->solvables()\fR;
3132 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
3133 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
3134 .fi
3135 .if n \{\
3136 .RE
3137 .\}
3138 .sp
3139 Convert a selection into an array of Solvable objects\&.
3140 .sp
3141 .if n \{\
3142 .RS 4
3143 .\}
3144 .nf
3145 \fB<stringification>\fR
3146 my \fI$str\fR \fB=\fR \fI$sel\fR\fB\->str\fR;
3147 \fIstr\fR \fB= str(\fR\fIsel\fR\fB)\fR
3148 \fIstr\fR \fB=\fR \fIsel\fR\fB\&.to_s\fR
3149 .fi
3150 .if n \{\
3151 .RE
3152 .\}
3153 .sp
3154 Return a string describing the selection\&.
3155 .SH "THE JOB CLASS"
3156 .sp
3157 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\&.
3158 .SS "CONSTANTS"
3159 .sp
3160 Selection constants:
3161 .PP
3162 \fBSOLVER_SOLVABLE\fR
3163 .RS 4
3164 The \(lqwhat\(rq part is the id of a solvable\&.
3165 .RE
3166 .PP
3167 \fBSOLVER_SOLVABLE_NAME\fR
3168 .RS 4
3169 The \(lqwhat\(rq part is the id of a package name\&.
3170 .RE
3171 .PP
3172 \fBSOLVER_SOLVABLE_PROVIDES\fR
3173 .RS 4
3174 The \(lqwhat\(rq part is the id of a package provides\&.
3175 .RE
3176 .PP
3177 \fBSOLVER_SOLVABLE_ONE_OF\fR
3178 .RS 4
3179 The \(lqwhat\(rq part is an offset into the \(lqwhatprovides\(rq data, created by calling the towhatprovides() pool method\&.
3180 .RE
3181 .PP
3182 \fBSOLVER_SOLVABLE_REPO\fR
3183 .RS 4
3184 The \(lqwhat\(rq part is the id of a repository\&.
3185 .RE
3186 .PP
3187 \fBSOLVER_SOLVABLE_ALL\fR
3188 .RS 4
3189 The \(lqwhat\(rq part is ignored, all packages are selected\&.
3190 .RE
3191 .PP
3192 \fBSOLVER_SOLVABLE_SELECTMASK\fR
3193 .RS 4
3194 A mask containing all the above selection bits\&.
3195 .RE
3196 .sp
3197 Action constants:
3198 .PP
3199 \fBSOLVER_NOOP\fR
3200 .RS 4
3201 Do nothing\&.
3202 .RE
3203 .PP
3204 \fBSOLVER_INSTALL\fR
3205 .RS 4
3206 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)\&.
3207 .RE
3208 .PP
3209 \fBSOLVER_ERASE\fR
3210 .RS 4
3211 Erase all of the packages from the specified set\&. If a package is not installed, erasing it will keep it from getting installed\&.
3212 .RE
3213 .PP
3214 \fBSOLVER_UPDATE\fR
3215 .RS 4
3216 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\&.
3217 .RE
3218 .PP
3219 \fBSOLVER_WEAKENDEPS\fR
3220 .RS 4
3221 Allow to break the dependencies of the matching packages\&. Handle with care\&.
3222 .RE
3223 .PP
3224 \fBSOLVER_MULTIVERSION\fR
3225 .RS 4
3226 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)\&.
3227 .RE
3228 .PP
3229 \fBSOLVER_LOCK\fR
3230 .RS 4
3231 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\&.
3232 .RE
3233 .PP
3234 \fBSOLVER_DISTUPGRADE\fR
3235 .RS 4
3236 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\&.
3237 .RE
3238 .PP
3239 \fBSOLVER_DROP_ORPHANED\fR
3240 .RS 4
3241 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\&.
3242 .RE
3243 .PP
3244 \fBSOLVER_VERIFY\fR
3245 .RS 4
3246 Fix dependency problems of matching installed packages\&. The default is to ignore dependency problems for installed packages\&.
3247 .RE
3248 .PP
3249 \fBSOLVER_USERINSTALLED\fR
3250 .RS 4
3251 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\&.
3252 .RE
3253 .PP
3254 \fBSOLVER_JOBMASK\fR
3255 .RS 4
3256 A mask containing all the above action bits\&.
3257 .RE
3258 .sp
3259 Action modifier constants:
3260 .PP
3261 \fBSOLVER_WEAK\fR
3262 .RS 4
3263 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\&.
3264 .RE
3265 .PP
3266 \fBSOLVER_ESSENTIAL\fR
3267 .RS 4
3268 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)\&.
3269 .RE
3270 .PP
3271 \fBSOLVER_CLEANDEPS\fR
3272 .RS 4
3273 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\&.
3274 .RE
3275 .PP
3276 \fBSOLVER_FORCEBEST\fR
3277 .RS 4
3278 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\&.
3279 .RE
3280 .PP
3281 \fBSOLVER_TARGETED\fR
3282 .RS 4
3283 Forces targeted operation update and distupgrade jobs\&. See the section about targeted updates about more information\&.
3284 .RE
3285 .sp
3286 Set constants\&.
3287 .PP
3288 \fBSOLVER_SETEV\fR
3289 .RS 4
3290 The job specified the exact epoch and version of the package set\&.
3291 .RE
3292 .PP
3293 \fBSOLVER_SETEVR\fR
3294 .RS 4
3295 The job specified the exact epoch, version, and release of the package set\&.
3296 .RE
3297 .PP
3298 \fBSOLVER_SETARCH\fR
3299 .RS 4
3300 The job specified the exact architecture of the packages from the set\&.
3301 .RE
3302 .PP
3303 \fBSOLVER_SETVENDOR\fR
3304 .RS 4
3305 The job specified the exact vendor of the packages from the set\&.
3306 .RE
3307 .PP
3308 \fBSOLVER_SETREPO\fR
3309 .RS 4
3310 The job specified the exact repository of the packages from the set\&.
3311 .RE
3312 .PP
3313 \fBSOLVER_SETNAME\fR
3314 .RS 4
3315 The job specified the exact name of the packages from the set\&.
3316 .RE
3317 .PP
3318 \fBSOLVER_NOAUTOSET\fR
3319 .RS 4
3320 Turn of automatic set flag generation for SOLVER_SOLVABLE jobs\&.
3321 .RE
3322 .PP
3323 \fBSOLVER_SETMASK\fR
3324 .RS 4
3325 A mask containing all the above set bits\&.
3326 .RE
3327 .sp
3328 See the section about set bits for more information\&.
3329 .SS "ATTRIBUTES"
3330 .sp
3331 .if n \{\
3332 .RS 4
3333 .\}
3334 .nf
3335 \fBPool *pool;\fR                             /* read only */
3336 \fI$job\fR\fB\->{pool}\fR
3337 \fId\fR\fB\&.pool\fR
3338 \fId\fR\fB\&.pool\fR
3339 .fi
3340 .if n \{\
3341 .RE
3342 .\}
3343 .sp
3344 Back pointer to pool\&.
3345 .sp
3346 .if n \{\
3347 .RS 4
3348 .\}
3349 .nf
3350 \fBId how;\fR                                 /* read/write */
3351 \fI$job\fR\fB\->{how}\fR
3352 \fId\fR\fB\&.how\fR
3353 \fId\fR\fB\&.how\fR
3354 .fi
3355 .if n \{\
3356 .RE
3357 .\}
3358 .sp
3359 Union of the selection, action, action modifier, and set flags\&. The selection part describes the semantics of the \(lqwhat\(rq Id\&.
3360 .sp
3361 .if n \{\
3362 .RS 4
3363 .\}
3364 .nf
3365 \fBId what;\fR                                /* read/write */
3366 \fI$job\fR\fB\->{what}\fR
3367 \fId\fR\fB\&.what\fR
3368 \fId\fR\fB\&.what\fR
3369 .fi
3370 .if n \{\
3371 .RE
3372 .\}
3373 .sp
3374 Id describing the set of packages, the meaning depends on the selection part of the \(lqhow\(rq attribute\&.
3375 .SS "METHODS"
3376 .sp
3377 .if n \{\
3378 .RS 4
3379 .\}
3380 .nf
3381 \fBSolvable *solvables()\fR
3382 my \fI@solvables\fR \fB=\fR \fI$job\fR\fB\->solvables()\fR;
3383 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
3384 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
3385 .fi
3386 .if n \{\
3387 .RE
3388 .\}
3389 .sp
3390 Return the set of solvables of the job as an array of Solvable objects\&.
3391 .sp
3392 .if n \{\
3393 .RS 4
3394 .\}
3395 .nf
3396 \fBbool isemptyupdate()\fR;
3397 \fI$job\fR\fB\->isemptyupdate()\fR
3398 \fIjob\fR\fB\&.isemptyupdate()\fR
3399 \fIjob\fR\fB\&.isemptyupdate?\fR
3400 .fi
3401 .if n \{\
3402 .RE
3403 .\}
3404 .sp
3405 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\&.
3406 .sp
3407 .if n \{\
3408 .RS 4
3409 .\}
3410 .nf
3411 \fB<stringification>\fR
3412 my \fI$str\fR \fB=\fR \fI$job\fR\fB\->str\fR;
3413 \fIstr\fR \fB= str(\fR\fIjob\fR\fB)\fR
3414 \fIstr\fR \fB=\fR \fIjob\fR\fB\&.to_s\fR
3415 .fi
3416 .if n \{\
3417 .RE
3418 .\}
3419 .sp
3420 Return a string describing the job\&.
3421 .sp
3422 .if n \{\
3423 .RS 4
3424 .\}
3425 .nf
3426 \fB<equality>\fR
3427 \fBif (\fR\fI$job1\fR \fB==\fR \fI$job2\fR\fB)\fR
3428 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR\fB:\fR
3429 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR
3430 .fi
3431 .if n \{\
3432 .RE
3433 .\}
3434 .sp
3435 Two jobs are equal if they belong to the same pool and both the \(lqhow\(rq and the \(lqwhat\(rq attributes are the same\&.
3436 .SS "TARGETED UPDATES"
3437 .sp
3438 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\&.
3439 .sp
3440 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\&.
3441 .sp
3442 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)\&.
3443 .sp
3444 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\&.
3445 .sp
3446 An untargeted update of "B" will do nothing, as "B" is not installed\&.
3447 .sp
3448 An targeted update of "B" will update "A\-1\&.1" to "B"\&.
3449 .sp
3450 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\&.
3451 .sp
3452 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\&.
3453 .sp
3454 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\&.
3455 .SS "SET BITS"
3456 .sp
3457 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\&.
3458 .sp
3459 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\&.
3460 .SH "THE SOLVER CLASS"
3461 .sp
3462 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\&.
3463 .SS "CONSTANTS"
3464 .sp
3465 Flags to modify some of the solver\(cqs behavior:
3466 .PP
3467 \fBSOLVER_FLAG_ALLOW_DOWNGRADE\fR
3468 .RS 4
3469 Allow the solver to downgrade packages without asking for confirmation (i\&.e\&. reporting a problem)\&.
3470 .RE
3471 .PP
3472 \fBSOLVER_FLAG_ALLOW_ARCHCHANGE\fR
3473 .RS 4
3474 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\&.
3475 .RE
3476 .PP
3477 \fBSOLVER_FLAG_ALLOW_VENDORCHANGE\fR
3478 .RS 4
3479 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\&.
3480 .RE
3481 .PP
3482 \fBSOLVER_FLAG_ALLOW_NAMECHANGE\fR
3483 .RS 4
3484 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\&.
3485 .RE
3486 .PP
3487 \fBSOLVER_FLAG_ALLOW_UNINSTALL\fR
3488 .RS 4
3489 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\&.
3490 .RE
3491 .PP
3492 \fBSOLVER_FLAG_DUP_ALLOW_DOWNGRADE\fR
3493 .RS 4
3494 Like SOLVER_FLAG_ALLOW_DOWNGRADE, but used in distupgrade mode\&.
3495 .RE
3496 .PP
3497 \fBSOLVER_FLAG_DUP_ALLOW_ARCHCHANGE\fR
3498 .RS 4
3499 Like SOLVER_FLAG_ALLOW_ARCHCHANGE, but used in distupgrade mode\&.
3500 .RE
3501 .PP
3502 \fBSOLVER_FLAG_DUP_ALLOW_VENDORCHANGE\fR
3503 .RS 4
3504 Like SOLVER_FLAG_ALLOW_VENDORCHANGE, but used in distupgrade mode\&.
3505 .RE
3506 .PP
3507 \fBSOLVER_FLAG_DUP_ALLOW_NAMECHANGE\fR
3508 .RS 4
3509 Like SOLVER_FLAG_ALLOW_NAMECHANGE, but used in distupgrade mode\&.
3510 .RE
3511 .PP
3512 \fBSOLVER_FLAG_NO_UPDATEPROVIDE\fR
3513 .RS 4
3514 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\&.
3515 .RE
3516 .PP
3517 \fBSOLVER_FLAG_SPLITPROVIDES\fR
3518 .RS 4
3519 Make the solver aware of special provides of the form \(lq<packagename>:<path>\(rq used in SUSE systems to support package splits\&.
3520 .RE
3521 .PP
3522 \fBSOLVER_FLAG_IGNORE_RECOMMENDED\fR
3523 .RS 4
3524 Do not process optional (aka weak) dependencies\&.
3525 .RE
3526 .PP
3527 \fBSOLVER_FLAG_ADD_ALREADY_RECOMMENDED\fR
3528 .RS 4
3529 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\&.
3530 .RE
3531 .PP
3532 \fBSOLVER_FLAG_NO_INFARCHCHECK\fR
3533 .RS 4
3534 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\&.
3535 .RE
3536 .PP
3537 \fBSOLVER_FLAG_BEST_OBEY_POLICY\fR
3538 .RS 4
3539 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\&.
3540 .RE
3541 .PP
3542 \fBSOLVER_FLAG_NO_AUTOTARGET\fR
3543 .RS 4
3544 Do not enable auto\-targeting up update and distupgrade jobs\&. See the section on targeted updates for more information\&.
3545 .RE
3546 .PP
3547 \fBSOLVER_FLAG_KEEP_ORPHANS\fR
3548 .RS 4
3549 Do not allow orphaned packages to be deinstalled if they get in the way of resolving other packages\&.
3550 .RE
3551 .PP
3552 \fBSOLVER_FLAG_BREAK_ORPHANS\fR
3553 .RS 4
3554 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\&.
3555 .RE
3556 .PP
3557 \fBSOLVER_FLAG_FOCUS_INSTALLED\fR
3558 .RS 4
3559 Resolve installed packages before resolving the given job\&. Setting this flag means that the solver will prefer picking a package version that fits the other installed packages over updating installed packages\&.
3560 .RE
3561 .sp
3562 Basic rule types:
3563 .PP
3564 \fBSOLVER_RULE_UNKNOWN\fR
3565 .RS 4
3566 A rule of an unknown class\&. You should never encounter those\&.
3567 .RE
3568 .PP
3569 \fBSOLVER_RULE_PKG\fR
3570 .RS 4
3571 A package dependency rule\&.
3572 .RE
3573 .PP
3574 \fBSOLVER_RULE_UPDATE\fR
3575 .RS 4
3576 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\&.
3577 .RE
3578 .PP
3579 \fBSOLVER_RULE_FEATURE\fR
3580 .RS 4
3581 Feature rules are fallback rules used when a 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\&.
3582 .RE
3583 .PP
3584 \fBSOLVER_RULE_JOB\fR
3585 .RS 4
3586 Job rules implement the job given to the solver\&.
3587 .RE
3588 .PP
3589 \fBSOLVER_RULE_DISTUPGRADE\fR
3590 .RS 4
3591 This are simple negative assertions that make sure that only packages are kept that are also available in one of the repositories\&.
3592 .RE
3593 .PP
3594 \fBSOLVER_RULE_INFARCH\fR
3595 .RS 4
3596 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\&.
3597 .RE
3598 .PP
3599 \fBSOLVER_RULE_CHOICE\fR
3600 .RS 4
3601 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\&.
3602 .RE
3603 .PP
3604 \fBSOLVER_RULE_LEARNT\fR
3605 .RS 4
3606 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 then other dependency solver implementations\&.
3607 .RE
3608 .sp
3609 Special dependency rule types:
3610 .PP
3611 \fBSOLVER_RULE_PKG_NOT_INSTALLABLE\fR
3612 .RS 4
3613 This rule was added to prevent the installation of a package of an architecture that does not work on the system\&.
3614 .RE
3615 .PP
3616 \fBSOLVER_RULE_PKG_NOTHING_PROVIDES_DEP\fR
3617 .RS 4
3618 The package contains a required dependency which was not provided by any package\&.
3619 .RE
3620 .PP
3621 \fBSOLVER_RULE_PKG_REQUIRES\fR
3622 .RS 4
3623 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\&.
3624 .RE
3625 .PP
3626 \fBSOLVER_RULE_PKG_SELF_CONFLICT\fR
3627 .RS 4
3628 The package conflicts with itself\&. This is not allowed by older rpm versions\&.
3629 .RE
3630 .PP
3631 \fBSOLVER_RULE_PKG_CONFLICTS\fR
3632 .RS 4
3633 To fulfill the dependencies two packages need to be installed, but one of the packages contains a conflict with the other one\&.
3634 .RE
3635 .PP
3636 \fBSOLVER_RULE_PKG_SAME_NAME\fR
3637 .RS 4
3638 The dependencies can only be fulfilled by multiple versions of a package, but installing multiple versions of the same package is not allowed\&.
3639 .RE
3640 .PP
3641 \fBSOLVER_RULE_PKG_OBSOLETES\fR
3642 .RS 4
3643 To fulfill the dependencies two packages need to be installed, but one of the packages obsoletes the other one\&.
3644 .RE
3645 .PP
3646 \fBSOLVER_RULE_PKG_IMPLICIT_OBSOLETES\fR
3647 .RS 4
3648 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\&.
3649 .RE
3650 .PP
3651 \fBSOLVER_RULE_PKG_INSTALLED_OBSOLETES\fR
3652 .RS 4
3653 To fulfill the dependencies a package needs to be installed that is obsoleted by an installed package\&. See the POOL_FLAG_NOINSTALLEDOBSOLETES flag\&.
3654 .RE
3655 .PP
3656 \fBSOLVER_RULE_JOB_NOTHING_PROVIDES_DEP\fR
3657 .RS 4
3658 The user asked for installation of a package providing a specific dependency, but no available package provides it\&.
3659 .RE
3660 .PP
3661 \fBSOLVER_RULE_JOB_UNKNOWN_PACKAGE\fR
3662 .RS 4
3663 The user asked for installation of a package with a specific name, but no available package has that name\&.
3664 .RE
3665 .PP
3666 \fBSOLVER_RULE_JOB_PROVIDED_BY_SYSTEM\fR
3667 .RS 4
3668 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\&.
3669 .RE
3670 .PP
3671 \fBSOLVER_RULE_JOB_UNSUPPORTED\fR
3672 .RS 4
3673 The user asked for something that is not yet implemented, e\&.g\&. the installation of all packages at once\&.
3674 .RE
3675 .sp
3676 Policy error constants
3677 .PP
3678 \fBPOLICY_ILLEGAL_DOWNGRADE\fR
3679 .RS 4
3680 The solver ask for permission before downgrading packages\&.
3681 .RE
3682 .PP
3683 \fBPOLICY_ILLEGAL_ARCHCHANGE\fR
3684 .RS 4
3685 The solver ask for permission before changing the architecture of installed packages\&.
3686 .RE
3687 .PP
3688 \fBPOLICY_ILLEGAL_VENDORCHANGE\fR
3689 .RS 4
3690 The solver ask for permission before changing the vendor of installed packages\&.
3691 .RE
3692 .PP
3693 \fBPOLICY_ILLEGAL_NAMECHANGE\fR
3694 .RS 4
3695 The solver ask for permission before replacing an installed packages with a package that has a different name\&.
3696 .RE
3697 .sp
3698 Solution element type constants
3699 .PP
3700 \fBSOLVER_SOLUTION_JOB\fR
3701 .RS 4
3702 The problem can be solved by removing the specified job\&.
3703 .RE
3704 .PP
3705 \fBSOLVER_SOLUTION_POOLJOB\fR
3706 .RS 4
3707 The problem can be solved by removing the specified job that is defined in the pool\&.
3708 .RE
3709 .PP
3710 \fBSOLVER_SOLUTION_INFARCH\fR
3711 .RS 4
3712 The problem can be solved by allowing the installation of the specified package with an inferior architecture\&.
3713 .RE
3714 .PP
3715 \fBSOLVER_SOLUTION_DISTUPGRADE\fR
3716 .RS 4
3717 The problem can be solved by allowing to keep the specified package installed\&.
3718 .RE
3719 .PP
3720 \fBSOLVER_SOLUTION_BEST\fR
3721 .RS 4
3722 The problem can be solved by allowing to install the specified package that is not the best available package\&.
3723 .RE
3724 .PP
3725 \fBSOLVER_SOLUTION_ERASE\fR
3726 .RS 4
3727 The problem can be solved by allowing to erase the specified package\&.
3728 .RE
3729 .PP
3730 \fBSOLVER_SOLUTION_REPLACE\fR
3731 .RS 4
3732 The problem can be solved by allowing to replace the package with some other package\&.
3733 .RE
3734 .PP
3735 \fBSOLVER_SOLUTION_REPLACE_DOWNGRADE\fR
3736 .RS 4
3737 The problem can be solved by allowing to replace the package with some other package that has a lower version\&.
3738 .RE
3739 .PP
3740 \fBSOLVER_SOLUTION_REPLACE_ARCHCHANGE\fR
3741 .RS 4
3742 The problem can be solved by allowing to replace the package with some other package that has a different architecture\&.
3743 .RE
3744 .PP
3745 \fBSOLVER_SOLUTION_REPLACE_VENDORCHANGE\fR
3746 .RS 4
3747 The problem can be solved by allowing to replace the package with some other package that has a different vendor\&.
3748 .RE
3749 .PP
3750 \fBSOLVER_SOLUTION_REPLACE_NAMECHANGE\fR
3751 .RS 4
3752 The problem can be solved by allowing to replace the package with some other package that has a different name\&.
3753 .RE
3754 .sp
3755 Reason constants
3756 .PP
3757 \fBSOLVER_REASON_UNRELATED\fR
3758 .RS 4
3759 The package status did not change as it was not related to any job\&.
3760 .RE
3761 .PP
3762 \fBSOLVER_REASON_UNIT_RULE\fR
3763 .RS 4
3764 The package was installed/erased/kept because of a unit rule, i\&.e\&. a rule where all literals but one were false\&.
3765 .RE
3766 .PP
3767 \fBSOLVER_REASON_KEEP_INSTALLED\fR
3768 .RS 4
3769 The package was chosen when trying to keep as many packages installed as possible\&.
3770 .RE
3771 .PP
3772 \fBSOLVER_REASON_RESOLVE_JOB\fR
3773 .RS 4
3774 The decision happened to fulfill a job rule\&.
3775 .RE
3776 .PP
3777 \fBSOLVER_REASON_UPDATE_INSTALLED\fR
3778 .RS 4
3779 The decision happened to fulfill a package update request\&.
3780 .RE
3781 .PP
3782 \fBSOLVER_REASON_CLEANDEPS_ERASE\fR
3783 .RS 4
3784 The package was erased when cleaning up dependencies from other erased packages\&.
3785 .RE
3786 .PP
3787 \fBSOLVER_REASON_RESOLVE\fR
3788 .RS 4
3789 The package was installed to fulfill package dependencies\&.
3790 .RE
3791 .PP
3792 \fBSOLVER_REASON_WEAKDEP\fR
3793 .RS 4
3794 The package was installed because of a weak dependency (Recommends or Supplements)\&.
3795 .RE
3796 .PP
3797 \fBSOLVER_REASON_RESOLVE_ORPHAN\fR
3798 .RS 4
3799 The decision about the package was made when deciding the fate of orphaned packages\&.
3800 .RE
3801 .PP
3802 \fBSOLVER_REASON_RECOMMENDED\fR
3803 .RS 4
3804 This is a special case of SOLVER_REASON_WEAKDEP\&.
3805 .RE
3806 .PP
3807 \fBSOLVER_REASON_SUPPLEMENTED\fR
3808 .RS 4
3809 This is a special case of SOLVER_REASON_WEAKDEP\&.
3810 .RE
3811 .SS "ATTRIBUTES"
3812 .sp
3813 .if n \{\
3814 .RS 4
3815 .\}
3816 .nf
3817 \fBPool *pool;\fR                             /* read only */
3818 \fI$job\fR\fB\->{pool}\fR
3819 \fId\fR\fB\&.pool\fR
3820 \fId\fR\fB\&.pool\fR
3821 .fi
3822 .if n \{\
3823 .RE
3824 .\}
3825 .sp
3826 Back pointer to pool\&.
3827 .SS "METHODS"
3828 .sp
3829 .if n \{\
3830 .RS 4
3831 .\}
3832 .nf
3833 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
3834 my \fI$oldvalue\fR \fB=\fR \fI$solver\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
3835 \fIoldvalue\fR \fB=\fR \fIsolver\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
3836 \fIoldvalue\fR \fB=\fR \fIsolver\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
3837 .fi
3838 .if n \{\
3839 .RE
3840 .\}
3841 .sp
3842 .if n \{\
3843 .RS 4
3844 .\}
3845 .nf
3846 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
3847 my \fI$value\fR \fB=\fR \fI$solver\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
3848 \fIvalue\fR \fB=\fR \fIsolver\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
3849 \fIvalue\fR \fB=\fR \fIsolver\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
3850 .fi
3851 .if n \{\
3852 .RE
3853 .\}
3854 .sp
3855 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\&.
3856 .sp
3857 .if n \{\
3858 .RS 4
3859 .\}
3860 .nf
3861 \fBProblem *solve(Job *\fR\fIjobs\fR\fB)\fR
3862 my \fI@problems\fR \fB=\fR \fI$solver\fR\fB\->solve(\e\fR\fI@jobs\fR\fB)\fR;
3863 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
3864 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
3865 .fi
3866 .if n \{\
3867 .RE
3868 .\}
3869 .sp
3870 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\&.
3871 .sp
3872 .if n \{\
3873 .RS 4
3874 .\}
3875 .nf
3876 \fBTransaction transaction()\fR
3877 my \fI$trans\fR \fB=\fR \fI$solver\fR\fB\->transaction()\fR;
3878 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
3879 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
3880 .fi
3881 .if n \{\
3882 .RE
3883 .\}
3884 .sp
3885 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\&.
3886 .sp
3887 .if n \{\
3888 .RS 4
3889 .\}
3890 .nf
3891 \fBint\fR \fIreason\fR \fB= describe_decision(Solvable *\fR\fIs\fR\fB, Rule *\fR\fIOUTPUT\fR\fB)\fR
3892 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;
3893 \fB(\fR\fIreason\fR\fB,\fR \fIrule\fR\fB) =\fR \fIsolver\fR\fB\&.describe_decision(\fR\fIsolvable\fR\fB)\fR
3894 \fB(\fR\fIreason\fR\fB,\fR \fIrule\fR\fB) =\fR \fIsolver\fR\fB\&.describe_decision(\fR\fIsolvable\fR\fB)\fR
3895 .fi
3896 .if n \{\
3897 .RE
3898 .\}
3899 .sp
3900 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\&.
3901 .SH "THE PROBLEM CLASS"
3902 .sp
3903 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\&.
3904 .SS "ATTRIBUTES"
3905 .sp
3906 .if n \{\
3907 .RS 4
3908 .\}
3909 .nf
3910 \fBSolver *solv;\fR                           /* read only */
3911 \fI$problem\fR\fB\->{solv}\fR
3912 \fIproblem\fR\fB\&.solv\fR
3913 \fIproblem\fR\fB\&.solv\fR
3914 .fi
3915 .if n \{\
3916 .RE
3917 .\}
3918 .sp
3919 Back pointer to solver object\&.
3920 .sp
3921 .if n \{\
3922 .RS 4
3923 .\}
3924 .nf
3925 \fBId id;\fR                                  /* read only */
3926 \fI$problem\fR\fB\->{id}\fR
3927 \fIproblem\fR\fB\&.id\fR
3928 \fIproblem\fR\fB\&.id\fR
3929 .fi
3930 .if n \{\
3931 .RE
3932 .\}
3933 .sp
3934 Id of the problem\&. The first problem has Id 1, they are numbered consecutively\&.
3935 .SS "METHODS"
3936 .sp
3937 .if n \{\
3938 .RS 4
3939 .\}
3940 .nf
3941 \fBRule findproblemrule()\fR
3942 my \fI$probrule\fR \fB=\fR \fI$problem\fR\fB\->findproblemrule()\fR;
3943 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
3944 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
3945 .fi
3946 .if n \{\
3947 .RE
3948 .\}
3949 .sp
3950 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\&.
3951 .sp
3952 .if n \{\
3953 .RS 4
3954 .\}
3955 .nf
3956 \fBRule *findallproblemrules(bool\fR \fIunfiltered\fR \fB= 0)\fR
3957 my \fI@probrules\fR \fB=\fR \fI$problem\fR\fB\->findallproblemrules()\fR;
3958 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrule()\fR
3959 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrule()\fR
3960 .fi
3961 .if n \{\
3962 .RE
3963 .\}
3964 .sp
3965 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)\&.
3966 .sp
3967 .if n \{\
3968 .RS 4
3969 .\}
3970 .nf
3971 \fBSolution *solutions()\fR
3972 my \fI@solutions\fR \fB=\fR \fI$problem\fR\fB\->solutions()\fR;
3973 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
3974 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
3975 .fi
3976 .if n \{\
3977 .RE
3978 .\}
3979 .sp
3980 Return an array containing multiple possible solutions to fix the problem\&. See the solution class for more information\&.
3981 .sp
3982 .if n \{\
3983 .RS 4
3984 .\}
3985 .nf
3986 \fBint solution_count()\fR
3987 my \fI$cnt\fR \fB=\fR \fI$problem\fR\fB\->solution_count()\fR;
3988 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
3989 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
3990 .fi
3991 .if n \{\
3992 .RE
3993 .\}
3994 .sp
3995 Return the number of solutions without creating solution objects\&.
3996 .sp
3997 .if n \{\
3998 .RS 4
3999 .\}
4000 .nf
4001 \fB<stringification>\fR
4002 my \fI$str\fR \fB=\fR \fI$problem\fR\fB\->str\fR;
4003 \fIstr\fR \fB= str(\fR\fIproblem\fR\fB)\fR
4004 \fIstr\fR \fB=\fR \fIproblem\fR\fB\&.to_s\fR
4005 .fi
4006 .if n \{\
4007 .RE
4008 .\}
4009 .sp
4010 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\&.
4011 .SH "THE RULE CLASS"
4012 .sp
4013 Rules are the basic block of sat solving\&. Each package dependency gets translated into one or multiple rules\&.
4014 .SS "ATTRIBUTES"
4015 .sp
4016 .if n \{\
4017 .RS 4
4018 .\}
4019 .nf
4020 \fBSolver *solv;\fR                           /* read only */
4021 \fI$rule\fR\fB\->{solv}\fR
4022 \fIrule\fR\fB\&.solv\fR
4023 \fIrule\fR\fB\&.solv\fR
4024 .fi
4025 .if n \{\
4026 .RE
4027 .\}
4028 .sp
4029 Back pointer to solver object\&.
4030 .sp
4031 .if n \{\
4032 .RS 4
4033 .\}
4034 .nf
4035 \fBId id;\fR                                  /* read only */
4036 \fI$rule\fR\fB\->{id}\fR
4037 \fIrule\fR\fB\&.id\fR
4038 \fIrule\fR\fB\&.id\fR
4039 .fi
4040 .if n \{\
4041 .RE
4042 .\}
4043 .sp
4044 The id of the rule\&.
4045 .sp
4046 .if n \{\
4047 .RS 4
4048 .\}
4049 .nf
4050 \fBint type;\fR                               /* read only */
4051 \fI$rule\fR\fB\->{type}\fR
4052 \fIrule\fR\fB\&.type\fR
4053 \fIrule\fR\fB\&.type\fR
4054 .fi
4055 .if n \{\
4056 .RE
4057 .\}
4058 .sp
4059 The basic type of the rule\&. See the constant section of the solver class for the type list\&.
4060 .SS "METHODS"
4061 .sp
4062 .if n \{\
4063 .RS 4
4064 .\}
4065 .nf
4066 \fBRuleinfo info()\fR
4067 my \fI$ruleinfo\fR \fB=\fR \fI$rule\fR\fB\->info()\fR;
4068 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
4069 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
4070 .fi
4071 .if n \{\
4072 .RE
4073 .\}
4074 .sp
4075 Return a Ruleinfo object that contains information about why the rule was created\&. But see the allinfos() method below\&.
4076 .sp
4077 .if n \{\
4078 .RS 4
4079 .\}
4080 .nf
4081 \fBRuleinfo *allinfos()\fR
4082 my \fI@ruleinfos\fR \fB=\fR \fI$rule\fR\fB\->allinfos()\fR;
4083 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
4084 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
4085 .fi
4086 .if n \{\
4087 .RE
4088 .\}
4089 .sp
4090 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\&.
4091 .sp
4092 .if n \{\
4093 .RS 4
4094 .\}
4095 .nf
4096 \fB<equality>\fR
4097 \fBif (\fR\fI$rule1\fR \fB==\fR \fI$rule2\fR\fB)\fR
4098 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR\fB:\fR
4099 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR
4100 .fi
4101 .if n \{\
4102 .RE
4103 .\}
4104 .sp
4105 Two rules are equal if they belong to the same solver and have the same id\&.
4106 .SH "THE RULEINFO CLASS"
4107 .sp
4108 A Ruleinfo describes one reason why a rule was created\&.
4109 .SS "ATTRIBUTES"
4110 .sp
4111 .if n \{\
4112 .RS 4
4113 .\}
4114 .nf
4115 \fBSolver *solv;\fR                           /* read only */
4116 \fI$ruleinfo\fR\fB\->{solv}\fR
4117 \fIruleinfo\fR\fB\&.solv\fR
4118 \fIruleinfo\fR\fB\&.solv\fR
4119 .fi
4120 .if n \{\
4121 .RE
4122 .\}
4123 .sp
4124 Back pointer to solver object\&.
4125 .sp
4126 .if n \{\
4127 .RS 4
4128 .\}
4129 .nf
4130 \fBint type;\fR                               /* read only */
4131 \fI$ruleinfo\fR\fB\->{type}\fR
4132 \fIruleinfo\fR\fB\&.type\fR
4133 \fIruleinfo\fR\fB\&.type\fR
4134 .fi
4135 .if n \{\
4136 .RE
4137 .\}
4138 .sp
4139 The type of the ruleinfo\&. See the constant section of the solver class for the rule type list and the special type list\&.
4140 .sp
4141 .if n \{\
4142 .RS 4
4143 .\}
4144 .nf
4145 \fBDep *dep;\fR                               /* read only */
4146 \fI$ruleinfo\fR\fB\->{dep}\fR
4147 \fIruleinfo\fR\fB\&.dep\fR
4148 \fIruleinfo\fR\fB\&.dep\fR
4149 .fi
4150 .if n \{\
4151 .RE
4152 .\}
4153 .sp
4154 The dependency leading to the creation of the rule\&.
4155 .sp
4156 .if n \{\
4157 .RS 4
4158 .\}
4159 .nf
4160 \fBDep *dep_id;\fR                            /* read only */
4161 \fI$ruleinfo\fR\fB\->{\*(Aqdep_id\*(Aq}\fR
4162 \fIruleinfo\fR\fB\&.dep_id\fR
4163 \fIruleinfo\fR\fB\&.dep_id\fR
4164 .fi
4165 .if n \{\
4166 .RE
4167 .\}
4168 .sp
4169 The Id of the dependency leading to the creation of the rule, or zero\&.
4170 .sp
4171 .if n \{\
4172 .RS 4
4173 .\}
4174 .nf
4175 \fBSolvable *solvable;\fR                     /* read only */
4176 \fI$ruleinfo\fR\fB\->{solvable}\fR
4177 \fIruleinfo\fR\fB\&.solvable\fR
4178 \fIruleinfo\fR\fB\&.solvable\fR
4179 .fi
4180 .if n \{\
4181 .RE
4182 .\}
4183 .sp
4184 The involved Solvable, e\&.g\&. the one containing the dependency\&.
4185 .sp
4186 .if n \{\
4187 .RS 4
4188 .\}
4189 .nf
4190 \fBSolvable *othersolvable;\fR                /* read only */
4191 \fI$ruleinfo\fR\fB\->{othersolvable}\fR
4192 \fIruleinfo\fR\fB\&.othersolvable\fR
4193 \fIruleinfo\fR\fB\&.othersolvable\fR
4194 .fi
4195 .if n \{\
4196 .RE
4197 .\}
4198 .sp
4199 The other involved Solvable (if any), e\&.g\&. the one containing providing the dependency for conflicts\&.
4200 .sp
4201 .if n \{\
4202 .RS 4
4203 .\}
4204 .nf
4205 \fBconst char *problemstr()\fR;
4206 my \fI$str\fR \fB=\fR \fI$ruleinfo\fR\fB\->problemstr()\fR;
4207 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
4208 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
4209 .fi
4210 .if n \{\
4211 .RE
4212 .\}
4213 .sp
4214 A string describing the ruleinfo from a problem perspective\&. This probably only makes sense if the rule is part of a problem\&.
4215 .SH "THE SOLUTION CLASS"
4216 .sp
4217 A solution solves one specific problem\&. It consists of multiple solution elements that all need to be executed\&.
4218 .SS "ATTRIBUTES"
4219 .sp
4220 .if n \{\
4221 .RS 4
4222 .\}
4223 .nf
4224 \fBSolver *solv;\fR                           /* read only */
4225 \fI$solution\fR\fB\->{solv}\fR
4226 \fIsolution\fR\fB\&.solv\fR
4227 \fIsolution\fR\fB\&.solv\fR
4228 .fi
4229 .if n \{\
4230 .RE
4231 .\}
4232 .sp
4233 Back pointer to solver object\&.
4234 .sp
4235 .if n \{\
4236 .RS 4
4237 .\}
4238 .nf
4239 \fBId problemid;\fR                           /* read only */
4240 \fI$solution\fR\fB\->{problemid}\fR
4241 \fIsolution\fR\fB\&.problemid\fR
4242 \fIsolution\fR\fB\&.problemid\fR
4243 .fi
4244 .if n \{\
4245 .RE
4246 .\}
4247 .sp
4248 Id of the problem the solution solves\&.
4249 .sp
4250 .if n \{\
4251 .RS 4
4252 .\}
4253 .nf
4254 \fBId id;\fR                                  /* read only */
4255 \fI$solution\fR\fB\->{id}\fR
4256 \fIsolution\fR\fB\&.id\fR
4257 \fIsolution\fR\fB\&.id\fR
4258 .fi
4259 .if n \{\
4260 .RE
4261 .\}
4262 .sp
4263 Id of the solution\&. The first solution has Id 1, they are numbered consecutively\&.
4264 .SS "METHODS"
4265 .sp
4266 .if n \{\
4267 .RS 4
4268 .\}
4269 .nf
4270 \fBSolutionelement *elements(bool\fR \fIexpandreplaces\fR \fB= 0)\fR
4271 my \fI@solutionelements\fR \fB=\fR \fI$solution\fR\fB\->elements()\fR;
4272 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
4273 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
4274 .fi
4275 .if n \{\
4276 .RE
4277 .\}
4278 .sp
4279 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\&.
4280 .sp
4281 .if n \{\
4282 .RS 4
4283 .\}
4284 .nf
4285 \fBint element_count()\fR
4286 my \fI$cnt\fR \fB=\fR \fI$solution\fR\fB\->solution_count()\fR;
4287 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
4288 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
4289 .fi
4290 .if n \{\
4291 .RE
4292 .\}
4293 .sp
4294 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\&.
4295 .SH "THE SOLUTIONELEMENT CLASS"
4296 .sp
4297 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\&.
4298 .SS "ATTRIBUTES"
4299 .sp
4300 .if n \{\
4301 .RS 4
4302 .\}
4303 .nf
4304 \fBSolver *solv;\fR                           /* read only */
4305 \fI$solutionelement\fR\fB\->{solv}\fR
4306 \fIsolutionelement\fR\fB\&.solv\fR
4307 \fIsolutionelement\fR\fB\&.solv\fR
4308 .fi
4309 .if n \{\
4310 .RE
4311 .\}
4312 .sp
4313 Back pointer to solver object\&.
4314 .sp
4315 .if n \{\
4316 .RS 4
4317 .\}
4318 .nf
4319 \fBId problemid;\fR                           /* read only */
4320 \fI$solutionelement\fR\fB\->{problemid}\fR
4321 \fIsolutionelement\fR\fB\&.problemid\fR
4322 \fIsolutionelement\fR\fB\&.problemid\fR
4323 .fi
4324 .if n \{\
4325 .RE
4326 .\}
4327 .sp
4328 Id of the problem the element (partly) solves\&.
4329 .sp
4330 .if n \{\
4331 .RS 4
4332 .\}
4333 .nf
4334 \fBId solutionid;\fR                          /* read only */
4335 \fI$solutionelement\fR\fB\->{solutionid}\fR
4336 \fIsolutionelement\fR\fB\&.solutionid\fR
4337 \fIsolutionelement\fR\fB\&.solutionid\fR
4338 .fi
4339 .if n \{\
4340 .RE
4341 .\}
4342 .sp
4343 Id of the solution the element is a part of\&.
4344 .sp
4345 .if n \{\
4346 .RS 4
4347 .\}
4348 .nf
4349 \fBId id;\fR                                  /* read only */
4350 \fI$solutionelement\fR\fB\->{id}\fR
4351 \fIsolutionelement\fR\fB\&.id\fR
4352 \fIsolutionelement\fR\fB\&.id\fR
4353 .fi
4354 .if n \{\
4355 .RE
4356 .\}
4357 .sp
4358 Id of the solution element\&. The first element has Id 1, they are numbered consecutively\&.
4359 .sp
4360 .if n \{\
4361 .RS 4
4362 .\}
4363 .nf
4364 \fBId type;\fR                                /* read only */
4365 \fI$solutionelement\fR\fB\->{type}\fR
4366 \fIsolutionelement\fR\fB\&.type\fR
4367 \fIsolutionelement\fR\fB\&.type\fR
4368 .fi
4369 .if n \{\
4370 .RE
4371 .\}
4372 .sp
4373 Type of the solution element\&. See the constant section of the solver class for the existing types\&.
4374 .sp
4375 .if n \{\
4376 .RS 4
4377 .\}
4378 .nf
4379 \fBSolvable *solvable;\fR                     /* read only */
4380 \fI$solutionelement\fR\fB\->{solvable}\fR
4381 \fIsolutionelement\fR\fB\&.solvable\fR
4382 \fIsolutionelement\fR\fB\&.solvable\fR
4383 .fi
4384 .if n \{\
4385 .RE
4386 .\}
4387 .sp
4388 The installed solvable that needs to be replaced for replacement elements\&.
4389 .sp
4390 .if n \{\
4391 .RS 4
4392 .\}
4393 .nf
4394 \fBSolvable *replacement;\fR                  /* read only */
4395 \fI$solutionelement\fR\fB\->{replacement}\fR
4396 \fIsolutionelement\fR\fB\&.replacement\fR
4397 \fIsolutionelement\fR\fB\&.replacement\fR
4398 .fi
4399 .if n \{\
4400 .RE
4401 .\}
4402 .sp
4403 The solvable that needs to be installed to fix the problem\&.
4404 .sp
4405 .if n \{\
4406 .RS 4
4407 .\}
4408 .nf
4409 \fBint jobidx;\fR                             /* read only */
4410 \fI$solutionelement\fR\fB\->{jobidx}\fR
4411 \fIsolutionelement\fR\fB\&.jobidx\fR
4412 \fIsolutionelement\fR\fB\&.jobidx\fR
4413 .fi
4414 .if n \{\
4415 .RE
4416 .\}
4417 .sp
4418 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\&.
4419 .SS "METHODS"
4420 .sp
4421 .if n \{\
4422 .RS 4
4423 .\}
4424 .nf
4425 \fBSolutionelement *replaceelements()\fR
4426 my \fI@solutionelements\fR \fB=\fR \fI$solutionelement\fR\fB\->replaceelements()\fR;
4427 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
4428 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
4429 .fi
4430 .if n \{\
4431 .RE
4432 .\}
4433 .sp
4434 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\&.
4435 .sp
4436 .if n \{\
4437 .RS 4
4438 .\}
4439 .nf
4440 \fBint illegalreplace()\fR
4441 my \fI$illegal\fR \fB=\fR \fI$solutionelement\fR\fB\->illegalreplace()\fR;
4442 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
4443 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
4444 .fi
4445 .if n \{\
4446 .RE
4447 .\}
4448 .sp
4449 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\&.
4450 .sp
4451 .if n \{\
4452 .RS 4
4453 .\}
4454 .nf
4455 \fBJob Job()\fR
4456 my \fI$job\fR \fB=\fR \fI$solutionelement\fR\fB\->Job()\fR;
4457 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
4458 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
4459 .fi
4460 .if n \{\
4461 .RE
4462 .\}
4463 .sp
4464 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 later two, a SOLVER_NOOB Job is created, you should replace the old job with the new one\&.
4465 .sp
4466 .if n \{\
4467 .RS 4
4468 .\}
4469 .nf
4470 \fBconst char *str()\fR
4471 my \fI$str\fR \fB=\fR \fI$solutionelement\fR\fB\->str()\fR;
4472 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
4473 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
4474 .fi
4475 .if n \{\
4476 .RE
4477 .\}
4478 .sp
4479 A string describing the change the solution element consists of\&.
4480 .SH "THE TRANSACTION CLASS"
4481 .sp
4482 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\&.
4483 .SS "CONSTANTS"
4484 .sp
4485 Transaction element types, both active and passive
4486 .PP
4487 \fBSOLVER_TRANSACTION_IGNORE\fR
4488 .RS 4
4489 This element does nothing\&. Used to map element types that do not match the view mode\&.
4490 .RE
4491 .PP
4492 \fBSOLVER_TRANSACTION_INSTALL\fR
4493 .RS 4
4494 This element installs a package\&.
4495 .RE
4496 .PP
4497 \fBSOLVER_TRANSACTION_ERASE\fR
4498 .RS 4
4499 This element erases a package\&.
4500 .RE
4501 .PP
4502 \fBSOLVER_TRANSACTION_MULTIINSTALL\fR
4503 .RS 4
4504 This element installs a package with a different version keeping the other versions installed\&.
4505 .RE
4506 .PP
4507 \fBSOLVER_TRANSACTION_MULTIREINSTALL\fR
4508 .RS 4
4509 This element reinstalls a installed package keeping the other versions installed\&.
4510 .RE
4511 .sp
4512 Transaction element types, active view
4513 .PP
4514 \fBSOLVER_TRANSACTION_REINSTALL\fR
4515 .RS 4
4516 This element re\-installs a package, i\&.e\&. installs the same package again\&.
4517 .RE
4518 .PP
4519 \fBSOLVER_TRANSACTION_CHANGE\fR
4520 .RS 4
4521 This element installs a package with same name, version, architecture but different content\&.
4522 .RE
4523 .PP
4524 \fBSOLVER_TRANSACTION_UPGRADE\fR
4525 .RS 4
4526 This element installs a newer version of an installed package\&.
4527 .RE
4528 .PP
4529 \fBSOLVER_TRANSACTION_DOWNGRADE\fR
4530 .RS 4
4531 This element installs a older version of an installed package\&.
4532 .RE
4533 .PP
4534 \fBSOLVER_TRANSACTION_OBSOLETES\fR
4535 .RS 4
4536 This element installs a package that obsoletes an installed package\&.
4537 .RE
4538 .sp
4539 Transaction element types, passive view
4540 .PP
4541 \fBSOLVER_TRANSACTION_REINSTALLED\fR
4542 .RS 4
4543 This element re\-installs a package, i\&.e\&. installs the same package again\&.
4544 .RE
4545 .PP
4546 \fBSOLVER_TRANSACTION_CHANGED\fR
4547 .RS 4
4548 This element replaces an installed package with one of the same name, version, architecture but different content\&.
4549 .RE
4550 .PP
4551 \fBSOLVER_TRANSACTION_UPGRADED\fR
4552 .RS 4
4553 This element replaces an installed package with a new version\&.
4554 .RE
4555 .PP
4556 \fBSOLVER_TRANSACTION_DOWNGRADED\fR
4557 .RS 4
4558 This element replaces an installed package with an old version\&.
4559 .RE
4560 .PP
4561 \fBSOLVER_TRANSACTION_OBSOLETED\fR
4562 .RS 4
4563 This element replaces an installed package with a package that obsoletes it\&.
4564 .RE
4565 .sp
4566 Pseudo element types for showing extra information used by classify()
4567 .PP
4568 \fBSOLVER_TRANSACTION_ARCHCHANGE\fR
4569 .RS 4
4570 This element replaces an installed package with a package of a different architecture\&.
4571 .RE
4572 .PP
4573 \fBSOLVER_TRANSACTION_VENDORCHANGE\fR
4574 .RS 4
4575 This element replaces an installed package with a package of a different vendor\&.
4576 .RE
4577 .sp
4578 Transaction mode flags
4579 .PP
4580 \fBSOLVER_TRANSACTION_SHOW_ACTIVE\fR
4581 .RS 4
4582 Filter for active view types\&. The default is to return passive view type, i\&.e\&. to show how the installed packages get changed\&.
4583 .RE
4584 .PP
4585 \fBSOLVER_TRANSACTION_SHOW_OBSOLETES\fR
4586 .RS 4
4587 Do not map the obsolete view type into INSTALL/ERASE elements\&.
4588 .RE
4589 .PP
4590 \fBSOLVER_TRANSACTION_SHOW_ALL\fR
4591 .RS 4
4592 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\&.
4593 .RE
4594 .PP
4595 \fBSOLVER_TRANSACTION_SHOW_MULTIINSTALL\fR
4596 .RS 4
4597 The library maps MULTIINSTALL elements to simple INSTALL elements\&. This flag can be used to disable the mapping\&.
4598 .RE
4599 .PP
4600 \fBSOLVER_TRANSACTION_CHANGE_IS_REINSTALL\fR
4601 .RS 4
4602 Use this flag if you want to map CHANGE elements to the REINSTALL type\&.
4603 .RE
4604 .PP
4605 \fBSOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE\fR
4606 .RS 4
4607 Use this flag if you want to map OBSOLETE elements to the UPGRADE type\&.
4608 .RE
4609 .PP
4610 \fBSOLVER_TRANSACTION_MERGE_ARCHCHANGES\fR
4611 .RS 4
4612 Do not add extra categories for every architecture change, instead cumulate them in one category\&.
4613 .RE
4614 .PP
4615 \fBSOLVER_TRANSACTION_MERGE_VENDORCHANGES\fR
4616 .RS 4
4617 Do not add extra categories for every vendor change, instead cumulate them in one category\&.
4618 .RE
4619 .PP
4620 \fBSOLVER_TRANSACTION_RPM_ONLY\fR
4621 .RS 4
4622 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\&.
4623 .RE
4624 .sp
4625 Transaction order flags
4626 .PP
4627 \fBSOLVER_TRANSACTION_KEEP_ORDERDATA\fR
4628 .RS 4
4629 Do not throw away the dependency graph used for ordering the transaction\&. This flag is needed if you want to do manual ordering\&.
4630 .RE
4631 .SS "ATTRIBUTES"
4632 .sp
4633 .if n \{\
4634 .RS 4
4635 .\}
4636 .nf
4637 \fBPool *pool;\fR                             /* read only */
4638 \fI$trans\fR\fB\->{pool}\fR
4639 \fItrans\fR\fB\&.pool\fR
4640 \fItrans\fR\fB\&.pool\fR
4641 .fi
4642 .if n \{\
4643 .RE
4644 .\}
4645 .sp
4646 Back pointer to pool\&.
4647 .SS "METHODS"
4648 .sp
4649 .if n \{\
4650 .RS 4
4651 .\}
4652 .nf
4653 \fBbool isempty()\fR;
4654 \fI$trans\fR\fB\->isempty()\fR
4655 \fItrans\fR\fB\&.isempty()\fR
4656 \fItrans\fR\fB\&.isempty?\fR
4657 .fi
4658 .if n \{\
4659 .RE
4660 .\}
4661 .sp
4662 Returns true if the transaction does not do anything, i\&.e\&. has no elements\&.
4663 .sp
4664 .if n \{\
4665 .RS 4
4666 .\}
4667 .nf
4668 \fBSolvable *newsolvables()\fR;
4669 my \fI@newsolvables\fR \fB=\fR \fI$trans\fR\fB\->newsolvables()\fR;
4670 \fInewsolvables\fR \fB=\fR \fItrans\fR\fB\&.newsolvables()\fR
4671 \fInewsolvables\fR \fB=\fR \fItrans\fR\fB\&.newsolvables()\fR
4672 .fi
4673 .if n \{\
4674 .RE
4675 .\}
4676 .sp
4677 Return all packages that are to be installed by the transaction\&. This are the packages that need to be downloaded from the repositories\&.
4678 .sp
4679 .if n \{\
4680 .RS 4
4681 .\}
4682 .nf
4683 \fBSolvable *keptsolvables()\fR;
4684 my \fI@keptsolvables\fR \fB=\fR \fI$trans\fR\fB\->keptsolvables()\fR;
4685 \fIkeptsolvables\fR \fB=\fR \fItrans\fR\fB\&.keptsolvables()\fR
4686 \fIkeptsolvables\fR \fB=\fR \fItrans\fR\fB\&.keptsolvables()\fR
4687 .fi
4688 .if n \{\
4689 .RE
4690 .\}
4691 .sp
4692 Return all installed packages that the transaction will keep installed\&.
4693 .sp
4694 .if n \{\
4695 .RS 4
4696 .\}
4697 .nf
4698 \fBSolvable *steps()\fR;
4699 my \fI@steps\fR \fB=\fR \fI$trans\fR\fB\->steps()\fR;
4700 \fIsteps\fR \fB=\fR \fItrans\fR\fB\&.steps()\fR
4701 \fIsteps\fR \fB=\fR \fItrans\fR\fB\&.steps()\fR
4702 .fi
4703 .if n \{\
4704 .RE
4705 .\}
4706 .sp
4707 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\&.
4708 .sp
4709 .if n \{\
4710 .RS 4
4711 .\}
4712 .nf
4713 \fBint steptype(Solvable *\fR\fIsolvable\fR\fB, int\fR \fImode\fR\fB)\fR
4714 my \fI$type\fR \fB=\fR \fI$trans\fR\fB\->steptype(\fR\fI$solvable\fR\fB,\fR \fI$mode\fR\fB)\fR;
4715 \fItype\fR \fB=\fR \fItrans\fR\fB\&.steptype(\fR\fIsolvable\fR\fB,\fR \fImode\fR\fB)\fR
4716 \fItype\fR \fB=\fR \fItrans\fR\fB\&.steptype(\fR\fIsolvable\fR\fB,\fR \fImode\fR\fB)\fR
4717 .fi
4718 .if n \{\
4719 .RE
4720 .\}
4721 .sp
4722 Return the transaction type of the specified solvable\&. See the CONSTANTS sections for the mode argument flags and the list of returned types\&.
4723 .sp
4724 .if n \{\
4725 .RS 4
4726 .\}
4727 .nf
4728 \fBTransactionClass *classify(int\fR \fImode\fR \fB= 0)\fR
4729 my \fI@classes\fR \fB=\fR \fI$trans\fR\fB\->classify()\fR;
4730 \fIclasses\fR \fB=\fR \fItrans\fR\fB\&.classify()\fR
4731 \fIclasses\fR \fB=\fR \fItrans\fR\fB\&.classify()\fR
4732 .fi
4733 .if n \{\
4734 .RE
4735 .\}
4736 .sp
4737 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\&.
4738 .sp
4739 .if n \{\
4740 .RS 4
4741 .\}
4742 .nf
4743 \fBSolvable othersolvable(Solvable *\fR\fIsolvable\fR\fB)\fR;
4744 my \fI$other\fR \fB=\fR \fI$trans\fR\fB\->othersolvable(\fR\fI$solvable\fR\fB)\fR;
4745 \fIother\fR \fB=\fR \fItrans\fR\fB\&.othersolvable(\fR\fIsolvable\fR\fB)\fR
4746 \fIother\fR \fB=\fR \fItrans\fR\fB\&.othersolvable(\fR\fIsolvable\fR\fB)\fR
4747 .fi
4748 .if n \{\
4749 .RE
4750 .\}
4751 .sp
4752 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\&.
4753 .sp
4754 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\&.
4755 .sp
4756 Thus, the \(lqother\(rq solvable is normally the package that is also shown for a given package\&.
4757 .sp
4758 .if n \{\
4759 .RS 4
4760 .\}
4761 .nf
4762 \fBSolvable *allothersolvables(Solvable *\fR\fIsolvable\fR\fB)\fR;
4763 my \fI@others\fR \fB=\fR \fI$trans\fR\fB\->allothersolvables(\fR\fI$solvable\fR\fB)\fR;
4764 \fIothers\fR \fB=\fR \fItrans\fR\fB\&.allothersolvables(\fR\fIsolvable\fR\fB)\fR
4765 \fIothers\fR \fB=\fR \fItrans\fR\fB\&.allothersolvables(\fR\fIsolvable\fR\fB)\fR
4766 .fi
4767 .if n \{\
4768 .RE
4769 .\}
4770 .sp
4771 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\&.
4772 .sp
4773 .if n \{\
4774 .RS 4
4775 .\}
4776 .nf
4777 \fBint calc_installsizechange()\fR;
4778 my \fI$change\fR \fB=\fR \fI$trans\fR\fB\->calc_installsizechange()\fR;
4779 \fIchange\fR \fB=\fR \fItrans\fR\fB\&.calc_installsizechange()\fR
4780 \fIchange\fR \fB=\fR \fItrans\fR\fB\&.calc_installsizechange()\fR
4781 .fi
4782 .if n \{\
4783 .RE
4784 .\}
4785 .sp
4786 Return the size change of the installed system in kilobytes (kibibytes)\&.
4787 .sp
4788 .if n \{\
4789 .RS 4
4790 .\}
4791 .nf
4792 \fBvoid order(int\fR \fIflags\fR \fB= 0)\fR;
4793 \fI$trans\fR\fB\->order()\fR;
4794 \fItrans\fR\fB\&.order()\fR
4795 \fItrans\fR\fB\&.order()\fR
4796 .fi
4797 .if n \{\
4798 .RE
4799 .\}
4800 .sp
4801 Order the steps in the transactions so that dependant 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\&.
4802 .SS "ACTIVE/PASSIVE VIEW"
4803 .sp
4804 Active view list 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 of multiple package get replaced by one new package\&. Say you have installed package A\-1\-1 and B\-1\-1, and now install A\-2\-1 with has a new dependency that obsoletes B\&. The transaction elements will be
4805 .sp
4806 .if n \{\
4807 .RS 4
4808 .\}
4809 .nf
4810 updated   A\-1\-1 (other: A\-2\-1)
4811 obsoleted B\-1\-1 (other: A\-2\-1)
4812 .fi
4813 .if n \{\
4814 .RE
4815 .\}
4816 .sp
4817 in passive mode, but
4818 .sp
4819 .if n \{\
4820 .RS 4
4821 .\}
4822 .nf
4823 update A\-2\-1 (other: A\-1\-1)
4824 erase  B
4825 .fi
4826 .if n \{\
4827 .RE
4828 .\}
4829 .sp
4830 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\&.
4831 .SH "THE TRANSACTIONCLASS CLASS"
4832 .sp
4833 Objects of this type are returned by the classify() Transaction method\&.
4834 .SS "ATTRIBUTES"
4835 .sp
4836 .if n \{\
4837 .RS 4
4838 .\}
4839 .nf
4840 \fBTransaction *transaction;\fR               /* read only */
4841 \fI$class\fR\fB\->{transaction}\fR
4842 \fIclass\fR\fB\&.transaction\fR
4843 \fIclass\fR\fB\&.transaction\fR
4844 .fi
4845 .if n \{\
4846 .RE
4847 .\}
4848 .sp
4849 Back pointer to transaction object\&.
4850 .sp
4851 .if n \{\
4852 .RS 4
4853 .\}
4854 .nf
4855 \fBint type;\fR                               /* read only */
4856 \fI$class\fR\fB\->{type}\fR
4857 \fIclass\fR\fB\&.type\fR
4858 \fIclass\fR\fB\&.type\fR
4859 .fi
4860 .if n \{\
4861 .RE
4862 .\}
4863 .sp
4864 The type of the transaction elements in the class\&.
4865 .sp
4866 .if n \{\
4867 .RS 4
4868 .\}
4869 .nf
4870 \fBint count;\fR                              /* read only */
4871 \fI$class\fR\fB\->{count}\fR
4872 \fIclass\fR\fB\&.count\fR
4873 \fIclass\fR\fB\&.count\fR
4874 .fi
4875 .if n \{\
4876 .RE
4877 .\}
4878 .sp
4879 The number of elements in the class\&.
4880 .sp
4881 .if n \{\
4882 .RS 4
4883 .\}
4884 .nf
4885 \fBconst char *\fR\fIfromstr\fR;
4886 \fI$class\fR\fB\->{fromstr}\fR
4887 \fIclass\fR\fB\&.fromstr\fR
4888 \fIclass\fR\fB\&.fromstr\fR
4889 .fi
4890 .if n \{\
4891 .RE
4892 .\}
4893 .sp
4894 The old vendor or architecture\&.
4895 .sp
4896 .if n \{\
4897 .RS 4
4898 .\}
4899 .nf
4900 \fBconst char *\fR\fItostr\fR;
4901 \fI$class\fR\fB\->{tostr}\fR
4902 \fIclass\fR\fB\&.tostr\fR
4903 \fIclass\fR\fB\&.tostr\fR
4904 .fi
4905 .if n \{\
4906 .RE
4907 .\}
4908 .sp
4909 The new vendor or architecture\&.
4910 .sp
4911 .if n \{\
4912 .RS 4
4913 .\}
4914 .nf
4915 \fBId\fR \fIfromid\fR;
4916 \fI$class\fR\fB\->{fromid}\fR
4917 \fIclass\fR\fB\&.fromid\fR
4918 \fIclass\fR\fB\&.fromid\fR
4919 .fi
4920 .if n \{\
4921 .RE
4922 .\}
4923 .sp
4924 The id of the old vendor or architecture\&.
4925 .sp
4926 .if n \{\
4927 .RS 4
4928 .\}
4929 .nf
4930 \fBId\fR \fItoid\fR;
4931 \fI$class\fR\fB\->{toid}\fR
4932 \fIclass\fR\fB\&.toid\fR
4933 \fIclass\fR\fB\&.toid\fR
4934 .fi
4935 .if n \{\
4936 .RE
4937 .\}
4938 .sp
4939 The id of the new vendor or architecture\&.
4940 .SS "METHODS"
4941 .sp
4942 .if n \{\
4943 .RS 4
4944 .\}
4945 .nf
4946 \fBvoid solvables()\fR;
4947 my \fI@solvables\fR \fB=\fR \fI$class\fR\fB\->solvables()\fR;
4948 \fIsolvables\fR \fB=\fR \fIclass\fR\fB\&.solvables()\fR
4949 \fIsolvables\fR \fB=\fR \fIclass\fR\fB\&.solvables()\fR
4950 .fi
4951 .if n \{\
4952 .RE
4953 .\}
4954 .sp
4955 Return the solvables for all transaction elements in the class\&.
4956 .SH "CHECKSUMS"
4957 .sp
4958 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\&.
4959 .SS "CLASS METHODS"
4960 .sp
4961 .if n \{\
4962 .RS 4
4963 .\}
4964 .nf
4965 \fBChksum Chksum(Id\fR \fItype\fR\fB)\fR
4966 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB)\fR;
4967 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB)\fR
4968 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB)\fR
4969 .fi
4970 .if n \{\
4971 .RE
4972 .\}
4973 .sp
4974 Create a checksum object\&. Currently the following types are supported:
4975 .sp
4976 .if n \{\
4977 .RS 4
4978 .\}
4979 .nf
4980 \fBREPOKEY_TYPE_MD5\fR
4981 \fBREPOKEY_TYPE_SHA1\fR
4982 \fBREPOKEY_TYPE_SHA256\fR
4983 .fi
4984 .if n \{\
4985 .RE
4986 .\}
4987 .sp
4988 These keys are constants in the \fBsolv\fR class\&.
4989 .sp
4990 .if n \{\
4991 .RS 4
4992 .\}
4993 .nf
4994 \fBChksum Chksum(Id\fR \fItype\fR\fB, const char *\fR\fIhex\fR\fB)\fR
4995 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB,\fR \fI$hex\fR\fB)\fR;
4996 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
4997 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
4998 .fi
4999 .if n \{\
5000 .RE
5001 .\}
5002 .sp
5003 Create an already finalized checksum object from a hex string\&.
5004 .sp
5005 .if n \{\
5006 .RS 4
5007 .\}
5008 .nf
5009 \fBChksum Chksum_from_bin(Id\fR \fItype\fR\fB, char *\fR\fIbin\fR\fB)\fR
5010 my \fI$chksum\fR \fB= solv::Chksum\->from_bin(\fR\fI$type\fR\fB,\fR \fI$bin\fR\fB)\fR;
5011 \fIchksum\fR \fB= solv\&.Chksum\&.from_bin(\fR\fItype\fR\fB,\fR \fIbin\fR\fB)\fR
5012 \fIchksum\fR \fB= Solv::Chksum\&.from_bin(\fR\fItype\fR\fB,\fR \fIbin\fR\fB)\fR
5013 .fi
5014 .if n \{\
5015 .RE
5016 .\}
5017 .sp
5018 Create an already finalized checksum object from a binary checksum\&.
5019 .SS "ATTRIBUTES"
5020 .sp
5021 .if n \{\
5022 .RS 4
5023 .\}
5024 .nf
5025 \fBId type;\fR                        /* read only */
5026 \fI$chksum\fR\fB\->{type}\fR
5027 \fIchksum\fR\fB\&.type\fR
5028 \fIchksum\fR\fB\&.type\fR
5029 .fi
5030 .if n \{\
5031 .RE
5032 .\}
5033 .sp
5034 Return the type of the checksum object\&.
5035 .SS "METHODS"
5036 .sp
5037 .if n \{\
5038 .RS 4
5039 .\}
5040 .nf
5041 \fBvoid add(const char *\fR\fIstr\fR\fB)\fR
5042 \fI$chksum\fR\fB\->add(\fR\fI$str\fR\fB)\fR;
5043 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
5044 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
5045 .fi
5046 .if n \{\
5047 .RE
5048 .\}
5049 .sp
5050 Add a (binary) string to the checksum\&.
5051 .sp
5052 .if n \{\
5053 .RS 4
5054 .\}
5055 .nf
5056 \fBvoid add_fp(FILE *\fR\fIfp\fR\fB)\fR
5057 \fI$chksum\fR\fB\->add_fp(\fR\fI$file\fR\fB)\fR;
5058 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
5059 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
5060 .fi
5061 .if n \{\
5062 .RE
5063 .\}
5064 .sp
5065 Add the contents of a file to the checksum\&.
5066 .sp
5067 .if n \{\
5068 .RS 4
5069 .\}
5070 .nf
5071 \fBvoid add_stat(const char *\fR\fIfilename\fR\fB)\fR
5072 \fI$chksum\fR\fB\->add_stat(\fR\fI$filename\fR\fB)\fR;
5073 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
5074 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
5075 .fi
5076 .if n \{\
5077 .RE
5078 .\}
5079 .sp
5080 Stat the file and add the dev/ino/size/mtime member to the checksum\&. If the stat fails, the members are zeroed\&.
5081 .sp
5082 .if n \{\
5083 .RS 4
5084 .\}
5085 .nf
5086 \fBvoid add_fstat(int\fR \fIfd\fR\fB)\fR
5087 \fI$chksum\fR\fB\->add_fstat(\fR\fI$fd\fR\fB)\fR;
5088 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
5089 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
5090 .fi
5091 .if n \{\
5092 .RE
5093 .\}
5094 .sp
5095 Same as add_stat, but instead of the filename a file descriptor is used\&.
5096 .sp
5097 .if n \{\
5098 .RS 4
5099 .\}
5100 .nf
5101 \fBunsigned char *raw()\fR
5102 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->raw()\fR;
5103 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
5104 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
5105 .fi
5106 .if n \{\
5107 .RE
5108 .\}
5109 .sp
5110 Finalize the checksum and return the result as raw bytes\&. This means that the result can contain NUL bytes or unprintable characters\&.
5111 .sp
5112 .if n \{\
5113 .RS 4
5114 .\}
5115 .nf
5116 \fBconst char *hex()\fR
5117 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->hex()\fR;
5118 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
5119 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
5120 .fi
5121 .if n \{\
5122 .RE
5123 .\}
5124 .sp
5125 Finalize the checksum and return the result as hex string\&.
5126 .sp
5127 .if n \{\
5128 .RS 4
5129 .\}
5130 .nf
5131 \fBconst char *typestr()\fR
5132 my \fI$typestr\fR \fB=\fR \fI$chksum\fR\fB\->typestr()\fR;
5133 \fItypestr\fR \fB=\fR \fIchksum\fR\fB\&.typestr\fR
5134 \fItypestr\fR \fB=\fR \fIchksum\fR\fB\&.typestr\fR
5135 .fi
5136 .if n \{\
5137 .RE
5138 .\}
5139 .sp
5140 Return the type of the checksum as a string, e\&.g\&. "sha256"\&.
5141 .sp
5142 .if n \{\
5143 .RS 4
5144 .\}
5145 .nf
5146 \fB<equality>\fR
5147 \fBif (\fR\fI$chksum1\fR \fB==\fR \fI$chksum2\fR\fB)\fR
5148 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR\fB:\fR
5149 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR
5150 .fi
5151 .if n \{\
5152 .RE
5153 .\}
5154 .sp
5155 Checksums are equal if they are of the same type and the finalized results are the same\&.
5156 .sp
5157 .if n \{\
5158 .RS 4
5159 .\}
5160 .nf
5161 \fB<stringification>\fR
5162 my \fI$str\fR \fB=\fR \fI$chksum\fR\fB\->str\fR;
5163 \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR
5164 \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR
5165 .fi
5166 .if n \{\
5167 .RE
5168 .\}
5169 .sp
5170 If the checksum is finished, the checksum is returned as "<type>:<hex>" string\&. Otherwise "<type>:unfinished" is returned\&.
5171 .SH "FILE MANAGEMENT"
5172 .sp
5173 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\&.
5174 .sp
5175 .if n \{\
5176 .RS 4
5177 .\}
5178 .nf
5179 \fBFILE *xfopen(char *\fR\fIfn\fR\fB, char *\fR\fImode\fR \fB= "r")\fR
5180 my \fI$file\fR \fB= solv::xfopen(\fR\fI$path\fR\fB)\fR;
5181 \fIfile\fR \fB= solv\&.xfopen(\fR\fIpath\fR\fB)\fR
5182 \fIfile\fR \fB= Solv::xfopen(\fR\fIpath\fR\fB)\fR
5183 .fi
5184 .if n \{\
5185 .RE
5186 .\}
5187 .sp
5188 Open a file at the specified path\&. The mode argument is passed on to the stdio library\&.
5189 .sp
5190 .if n \{\
5191 .RS 4
5192 .\}
5193 .nf
5194 \fBFILE *xfopen_fd(char *\fR\fIfn\fR\fB, int\fR \fIfileno\fR\fB)\fR
5195 my \fI$file\fR \fB= solv::xfopen_fd(\fR\fI$path\fR\fB,\fR \fI$fileno\fR\fB)\fR;
5196 \fIfile\fR \fB= solv\&.xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
5197 \fIfile\fR \fB= Solv::xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
5198 .fi
5199 .if n \{\
5200 .RE
5201 .\}
5202 .sp
5203 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\&.
5204 .SS "METHODS"
5205 .sp
5206 .if n \{\
5207 .RS 4
5208 .\}
5209 .nf
5210 \fBint fileno()\fR
5211 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->fileno()\fR;
5212 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
5213 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
5214 .fi
5215 .if n \{\
5216 .RE
5217 .\}
5218 .sp
5219 Return file file descriptor of the file\&. If the file is not open, \-1 is returned\&.
5220 .sp
5221 .if n \{\
5222 .RS 4
5223 .\}
5224 .nf
5225 \fBvoid cloexec(bool\fR \fIstate\fR\fB)\fR
5226 \fI$file\fR\fB\->cloexec(\fR\fI$state\fR\fB)\fR
5227 \fIfile\fR\fB\&.cloexec(\fR\fIstate\fR\fB)\fR
5228 \fIfile\fR\fB\&.cloexec(\fR\fIstate\fR\fB)\fR
5229 .fi
5230 .if n \{\
5231 .RE
5232 .\}
5233 .sp
5234 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\&.
5235 .sp
5236 .if n \{\
5237 .RS 4
5238 .\}
5239 .nf
5240 \fBint dup()\fR
5241 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->dup()\fR;
5242 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
5243 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
5244 .fi
5245 .if n \{\
5246 .RE
5247 .\}
5248 .sp
5249 Return a copy of the descriptor of the file\&. If the file is not open, \-1 is returned\&.
5250 .sp
5251 .if n \{\
5252 .RS 4
5253 .\}
5254 .nf
5255 \fBbool flush()\fR
5256 \fI$file\fR\fB\->flush()\fR;
5257 \fIfile\fR\fB\&.flush()\fR
5258 \fIfile\fR\fB\&.flush()\fR
5259 .fi
5260 .if n \{\
5261 .RE
5262 .\}
5263 .sp
5264 Flush the file\&. Returns false if there was an error\&. Flushing a closed file always returns true\&.
5265 .sp
5266 .if n \{\
5267 .RS 4
5268 .\}
5269 .nf
5270 \fBbool close()\fR
5271 \fI$file\fR\fB\->close()\fR;
5272 \fIfile\fR\fB\&.close()\fR
5273 \fIfile\fR\fB\&.close()\fR
5274 .fi
5275 .if n \{\
5276 .RE
5277 .\}
5278 .sp
5279 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\&.
5280 .SH "THE REPODATA CLASS"
5281 .sp
5282 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\&.
5283 .SS "ATTRIBUTES"
5284 .sp
5285 .if n \{\
5286 .RS 4
5287 .\}
5288 .nf
5289 \fBRepo *repo;\fR                     /* read only */
5290 \fI$data\fR\fB\->{repo}\fR
5291 \fIdata\fR\fB\&.repo\fR
5292 \fIdata\fR\fB\&.repo\fR
5293 .fi
5294 .if n \{\
5295 .RE
5296 .\}
5297 .sp
5298 Back pointer to repository object\&.
5299 .sp
5300 .if n \{\
5301 .RS 4
5302 .\}
5303 .nf
5304 \fBId id;\fR                                  /* read only */
5305 \fI$data\fR\fB\->{id}\fR
5306 \fIdata\fR\fB\&.id\fR
5307 \fIdata\fR\fB\&.id\fR
5308 .fi
5309 .if n \{\
5310 .RE
5311 .\}
5312 .sp
5313 The id of the repodata area\&. Repodata ids of different repositories overlap\&.
5314 .SS "METHODS"
5315 .sp
5316 .if n \{\
5317 .RS 4
5318 .\}
5319 .nf
5320 \fBinternalize()\fR;
5321 \fI$data\fR\fB\->internalize()\fR;
5322 \fIdata\fR\fB\&.internalize()\fR
5323 \fIdata\fR\fB\&.internalize()\fR
5324 .fi
5325 .if n \{\
5326 .RE
5327 .\}
5328 .sp
5329 Internalize newly added data\&. The lookup functions will only see the new data after it has been internalized\&.
5330 .sp
5331 .if n \{\
5332 .RS 4
5333 .\}
5334 .nf
5335 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR;
5336 \fI$data\fR\fB\->write(\fR\fI$fp\fR\fB)\fR;
5337 \fIdata\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
5338 \fIdata\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
5339 .fi
5340 .if n \{\
5341 .RE
5342 .\}
5343 .sp
5344 Write the contents of the repodata area as solv file\&.
5345 .sp
5346 .if n \{\
5347 .RS 4
5348 .\}
5349 .nf
5350 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR;
5351 \fI$data\fR\fB\->add_solv(\fR\fI$fp\fR\fB)\fR;
5352 \fIdata\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
5353 \fIdata\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
5354 .fi
5355 .if n \{\
5356 .RE
5357 .\}
5358 .sp
5359 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\&.
5360 .sp
5361 .if n \{\
5362 .RS 4
5363 .\}
5364 .nf
5365 \fBvoid create_stubs()\fR;
5366 \fI$data\fR\fB\->create_stubs()\fR
5367 \fIdata\fR\fB\&.create_stubs()\fR
5368 \fIdata\fR\fB\&.create_stubs()\fR
5369 .fi
5370 .if n \{\
5371 .RE
5372 .\}
5373 .sp
5374 Create stub repodatas from the information stored in the repodata meta area\&.
5375 .sp
5376 .if n \{\
5377 .RS 4
5378 .\}
5379 .nf
5380 \fBvoid extend_to_repo()\fR;
5381 \fI$data\fR\fB\->extend_to_repo()\fR;
5382 \fIdata\fR\fB\&.extend_to_repo()\fR
5383 \fIdata\fR\fB\&.extend_to_repo()\fR
5384 .fi
5385 .if n \{\
5386 .RE
5387 .\}
5388 .sp
5389 Extend the repodata so that it has the same size as the repo it belongs to\&. This method is only 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)\&.
5390 .sp
5391 .if n \{\
5392 .RS 4
5393 .\}
5394 .nf
5395 \fB<equality>\fR
5396 \fBif (\fR\fI$data1\fR \fB==\fR \fI$data2\fR\fB)\fR
5397 \fBif\fR \fIdata1\fR \fB==\fR \fIdata2\fR\fB:\fR
5398 \fBif\fR \fIdata1\fR \fB==\fR \fIdata2\fR
5399 .fi
5400 .if n \{\
5401 .RE
5402 .\}
5403 .sp
5404 Two repodata objects are equal if they belong to the same repository and have the same id\&.
5405 .SS "DATA RETRIEVAL METHODS"
5406 .sp
5407 .if n \{\
5408 .RS 4
5409 .\}
5410 .nf
5411 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5412 my \fI$string\fR \fB=\fR \fI$data\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5413 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5414 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5415 .fi
5416 .if n \{\
5417 .RE
5418 .\}
5419 .sp
5420 .if n \{\
5421 .RS 4
5422 .\}
5423 .nf
5424 \fBId *lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5425 my \fI@ids\fR \fB=\fR \fI$data\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5426 \fIids\fR \fB=\fR \fIdata\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5427 \fIids\fR \fB=\fR \fIdata\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5428 .fi
5429 .if n \{\
5430 .RE
5431 .\}
5432 .sp
5433 .if n \{\
5434 .RS 4
5435 .\}
5436 .nf
5437 \fBChksum lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5438 my \fI$chksum\fR \fB=\fR \fI$data\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5439 \fIchksum\fR \fB=\fR \fIdata\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5440 \fIchksum\fR \fB=\fR \fIdata\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5441 .fi
5442 .if n \{\
5443 .RE
5444 .\}
5445 .sp
5446 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\&.
5447 .SS "DATA STORAGE METHODS"
5448 .sp
5449 .if n \{\
5450 .RS 4
5451 .\}
5452 .nf
5453 \fBvoid set_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR;
5454 \fI$data\fR\fB\->set_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
5455 \fIdata\fR\fB\&.set_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5456 \fIdata\fR\fB\&.set_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5457 .fi
5458 .if n \{\
5459 .RE
5460 .\}
5461 .sp
5462 .if n \{\
5463 .RS 4
5464 .\}
5465 .nf
5466 \fBvoid set_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fIstr\fR\fB)\fR;
5467 \fI$data\fR\fB\->set_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$str\fR\fB)\fR;
5468 \fIdata\fR\fB\&.set_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5469 \fIdata\fR\fB\&.set_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5470 .fi
5471 .if n \{\
5472 .RE
5473 .\}
5474 .sp
5475 .if n \{\
5476 .RS 4
5477 .\}
5478 .nf
5479 \fBvoid set_poolstr(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fIstr\fR\fB)\fR;
5480 \fI$data\fR\fB\->set_poolstr(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$str\fR\fB)\fR;
5481 \fIdata\fR\fB\&.set_poolstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5482 \fIdata\fR\fB\&.set_poolstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5483 .fi
5484 .if n \{\
5485 .RE
5486 .\}
5487 .sp
5488 .if n \{\
5489 .RS 4
5490 .\}
5491 .nf
5492 \fBvoid set_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Chksum *\fR\fIchksum\fR\fB)\fR;
5493 \fI$data\fR\fB\->set_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$chksum\fR\fB)\fR;
5494 \fIdata\fR\fB\&.set_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIchksum\fR\fB)\fR
5495 \fIdata\fR\fB\&.set_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIchksum\fR\fB)\fR
5496 .fi
5497 .if n \{\
5498 .RE
5499 .\}
5500 .sp
5501 .if n \{\
5502 .RS 4
5503 .\}
5504 .nf
5505 \fBvoid add_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR;
5506 \fI$data\fR\fB\->add_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
5507 \fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5508 \fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5509 .fi
5510 .if n \{\
5511 .RE
5512 .\}
5513 .sp
5514 .if n \{\
5515 .RS 4
5516 .\}
5517 .nf
5518 \fBId new_handle()\fR;
5519 my \fI$handle\fR \fB=\fR \fI$data\fR\fB\->new_handle()\fR;
5520 \fIhandle\fR \fB=\fR \fIdata\fR\fB\&.new_handle()\fR
5521 \fIhandle\fR \fB=\fR \fIdata\fR\fB\&.new_handle()\fR
5522 .fi
5523 .if n \{\
5524 .RE
5525 .\}
5526 .sp
5527 .if n \{\
5528 .RS 4
5529 .\}
5530 .nf
5531 \fBvoid add_flexarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fIhandle\fR\fB)\fR;
5532 \fI$data\fR\fB\->add_flexarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$handle\fR\fB)\fR;
5533 \fIdata\fR\fB\&.add_flexarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIhandle\fR\fB)\fR
5534 \fIdata\fR\fB\&.add_flexarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIhandle\fR\fB)\fR
5535 .fi
5536 .if n \{\
5537 .RE
5538 .\}
5539 .sp
5540 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\&.
5541 .SH "THE DATAPOS CLASS"
5542 .sp
5543 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\&.
5544 .SS "ATTRIBUTES"
5545 .sp
5546 .if n \{\
5547 .RS 4
5548 .\}
5549 .nf
5550 \fBRepo *repo;\fR                     /* read only */
5551 \fI$data\fR\fB\->{repo}\fR
5552 \fIdata\fR\fB\&.repo\fR
5553 \fIdata\fR\fB\&.repo\fR
5554 .fi
5555 .if n \{\
5556 .RE
5557 .\}
5558 .sp
5559 Back pointer to repository object\&.
5560 .SS "METHODS"
5561 .sp
5562 .if n \{\
5563 .RS 4
5564 .\}
5565 .nf
5566 \fBDataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
5567 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;
5568 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
5569 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
5570 .fi
5571 .if n \{\
5572 .RE
5573 .\}
5574 .sp
5575 Create a Dataiterator at the position of the datapos object\&.
5576 .sp
5577 .if n \{\
5578 .RS 4
5579 .\}
5580 .nf
5581 \fBconst char *lookup_deltalocation(unsigned int *\fR\fIOUTPUT\fR\fB)\fR;
5582 my \fB(\fR\fI$location\fR\fB,\fR \fI$medianr\fR\fB) =\fR \fI$datapos\fR\fB\->lookup_deltalocation()\fR;
5583 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltalocation()\fR
5584 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltalocation()\fR
5585 .fi
5586 .if n \{\
5587 .RE
5588 .\}
5589 .sp
5590 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\&.
5591 .sp
5592 .if n \{\
5593 .RS 4
5594 .\}
5595 .nf
5596 \fBconst char *lookup_deltaseq()\fR;
5597 my \fI$seq\fR \fB=\fR \fI$datapos\fR\fB\->lookup_deltaseq()\fR;
5598 \fIseq\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltaseq()\fR;
5599 \fIseq\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltaseq()\fR;
5600 .fi
5601 .if n \{\
5602 .RE
5603 .\}
5604 .sp
5605 Return the delta rpm sequence from the structure describing a delta rpm\&.
5606 .SS "DATA RETRIEVAL METHODS"
5607 .sp
5608 .if n \{\
5609 .RS 4
5610 .\}
5611 .nf
5612 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
5613 my \fI$string\fR \fB=\fR \fI$datapos\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
5614 \fIstring\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
5615 \fIstring\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
5616 .fi
5617 .if n \{\
5618 .RE
5619 .\}
5620 .sp
5621 .if n \{\
5622 .RS 4
5623 .\}
5624 .nf
5625 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5626 my \fI$id\fR \fB=\fR \fI$datapos\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
5627 \fIid\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
5628 \fIid\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
5629 .fi
5630 .if n \{\
5631 .RE
5632 .\}
5633 .sp
5634 .if n \{\
5635 .RS 4
5636 .\}
5637 .nf
5638 \fBunsigned long long lookup_num(Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
5639 my \fI$num\fR \fB=\fR \fI$datapos\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
5640 \fInum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
5641 \fInum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
5642 .fi
5643 .if n \{\
5644 .RE
5645 .\}
5646 .sp
5647 .if n \{\
5648 .RS 4
5649 .\}
5650 .nf
5651 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
5652 my \fI$bool\fR \fB=\fR \fI$datapos\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
5653 \fIbool\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
5654 \fIbool\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
5655 .fi
5656 .if n \{\
5657 .RE
5658 .\}
5659 .sp
5660 .if n \{\
5661 .RS 4
5662 .\}
5663 .nf
5664 \fBId *lookup_idarray(Id\fR \fIkeyname\fR\fB)\fR
5665 my \fI@ids\fR \fB=\fR \fI$datapos\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
5666 \fIids\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
5667 \fIids\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
5668 .fi
5669 .if n \{\
5670 .RE
5671 .\}
5672 .sp
5673 .if n \{\
5674 .RS 4
5675 .\}
5676 .nf
5677 \fBChksum lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
5678 my \fI$chksum\fR \fB=\fR \fI$datapos\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
5679 \fIchksum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
5680 \fIchksum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
5681 .fi
5682 .if n \{\
5683 .RE
5684 .\}
5685 .sp
5686 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\&.
5687 .sp
5688 .if n \{\
5689 .RS 4
5690 .\}
5691 .nf
5692 \fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
5693 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;
5694 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
5695 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
5696 .fi
5697 .if n \{\
5698 .RE
5699 .\}
5700 .sp
5701 .if n \{\
5702 .RS 4
5703 .\}
5704 .nf
5705 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
5706 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
5707 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
5708 .fi
5709 .if n \{\
5710 .RE
5711 .\}
5712 .sp
5713 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
5714 .SH "AUTHOR"
5715 .sp
5716 Michael Schroeder <mls@suse\&.de>