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