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