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