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