document Solver, Problem, Rule, Ruleinfo, Solution, Solutionelement classes
[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/03/2013
6 .\"    Manual: LIBSOLV
7 .\"    Source: libsolv
8 .\"  Language: English
9 .\"
10 .TH "LIBSOLV\-BINDINGS" "3" "06/03/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\&. This is also true for implicit obsoletes, thus you can install both the 32bit and the 64bit version of a package with the same name\&.
140 .RE
141 .PP
142 \fBPOOL_FLAG_NOINSTALLEDOBSOLETES\fR
143 .RS 4
144 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\&.
145 .RE
146 .PP
147 \fBPOOL_FLAG_HAVEDISTEPOCH\fR
148 .RS 4
149 Mandriva added a new field called distepoch that gets checked in version comparison if the epoch/version/release of two packages are the same\&.
150 .RE
151 .PP
152 \fBPOOL_FLAG_NOOBSOLETESMULTIVERSION\fR
153 .RS 4
154 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\&.
155 .RE
156 .PP
157 \fBPOOL_FLAG_ADDFILEPROVIDESFILTERED\fR
158 .RS 4
159 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\&.
160 .RE
161 .SS "METHODS"
162 .sp
163 .if n \{\
164 .RS 4
165 .\}
166 .nf
167 \fBvoid free()\fR
168 \fI$pool\fR\fB\->free()\fR;
169 \fIpool\fR\fB\&.free()\fR
170 \fIpool\fR\fB\&.free()\fR
171 .fi
172 .if n \{\
173 .RE
174 .\}
175 .sp
176 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\&.
177 .sp
178 .if n \{\
179 .RS 4
180 .\}
181 .nf
182 \fBvoid setdebuglevel(int\fR \fIlevel\fR\fB)\fR
183 \fI$pool\fR\fB\->setdebuglevel(\fR\fI$level\fR\fB)\fR;
184 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
185 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
186 .fi
187 .if n \{\
188 .RE
189 .\}
190 .sp
191 Set the debug level\&. A value of zero means no debug output, the higher the value, the more output is generated\&.
192 .sp
193 .if n \{\
194 .RS 4
195 .\}
196 .nf
197 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
198 my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
199 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
200 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
201 .fi
202 .if n \{\
203 .RE
204 .\}
205 .sp
206 .if n \{\
207 .RS 4
208 .\}
209 .nf
210 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
211 my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
212 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
213 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
214 .fi
215 .if n \{\
216 .RE
217 .\}
218 .sp
219 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\&.
220 .sp
221 .if n \{\
222 .RS 4
223 .\}
224 .nf
225 \fBvoid set_rootdir(const char *\fR\fIrootdir\fR\fB)\fR
226 \fI$pool\fR\fB\->set_rootdir(\fR\fIrootdir\fR\fB)\fR;
227 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
228 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
229 .fi
230 .if n \{\
231 .RE
232 .\}
233 .sp
234 .if n \{\
235 .RS 4
236 .\}
237 .nf
238 \fBconst char *get_rootdir()\fR
239 my \fI$rootdir\fR \fB=\fR \fI$pool\fR\fB\->get_rootdir()\fR;
240 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
241 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
242 .fi
243 .if n \{\
244 .RE
245 .\}
246 .sp
247 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\&.
248 .sp
249 .if n \{\
250 .RS 4
251 .\}
252 .nf
253 \fBvoid setarch(const char *\fR\fIarch\fR \fB= 0)\fR
254 \fI$pool\fR\fB\->setarch()\fR;
255 \fIpool\fR\fB\&.setarch()\fR
256 \fIpool\fR\fB\&.setarch()\fR
257 .fi
258 .if n \{\
259 .RE
260 .\}
261 .sp
262 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\&.
263 .sp
264 .if n \{\
265 .RS 4
266 .\}
267 .nf
268 \fBRepo *add_repo(const char *\fR\fIname\fR\fB)\fR
269 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->add_repo(\fR\fI$name\fR\fB)\fR;
270 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
271 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
272 .fi
273 .if n \{\
274 .RE
275 .\}
276 .sp
277 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\&.
278 .sp
279 .if n \{\
280 .RS 4
281 .\}
282 .nf
283 \fBRepoiterator *repos_iter()\fR
284 \fBfor my\fR \fI$repo\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->repos_iter()})\fR
285 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter():\fR
286 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter()\fR
287 .fi
288 .if n \{\
289 .RE
290 .\}
291 .sp
292 Iterate over the existing repositories\&.
293 .sp
294 .if n \{\
295 .RS 4
296 .\}
297 .nf
298 \fBSolvableiterator *solvables_iter()\fR
299 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->solvables_iter()})\fR
300 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter():\fR
301 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter()\fR
302 .fi
303 .if n \{\
304 .RE
305 .\}
306 .sp
307 Iterate over the existing solvables\&.
308 .sp
309 .if n \{\
310 .RS 4
311 .\}
312 .nf
313 \fBDep *Dep(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
314 my \fI$dep\fR \fB=\fR \fI$pool\fR\fB\->Dep(\fR\fI$string\fR\fB)\fR;
315 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
316 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
317 .fi
318 .if n \{\
319 .RE
320 .\}
321 .sp
322 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\&.
323 .sp
324 .if n \{\
325 .RS 4
326 .\}
327 .nf
328 \fBvoid addfileprovides()\fR
329 \fI$pool\fR\fB\->addfileprovides()\fR;
330 \fIpool\fR\fB\&.addfileprovides()\fR
331 \fIpool\fR\fB\&.addfileprovides()\fR
332 .fi
333 .if n \{\
334 .RE
335 .\}
336 .sp
337 .if n \{\
338 .RS 4
339 .\}
340 .nf
341 \fBQueue addfileprovides_queue()\fR
342 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->addfileprovides_queue()\fR;
343 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
344 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
345 .fi
346 .if n \{\
347 .RE
348 .\}
349 .sp
350 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\&.
351 .sp
352 .if n \{\
353 .RS 4
354 .\}
355 .nf
356 \fBvoid createwhatprovides()\fR
357 \fI$pool\fR\fB\->createwhatprovides()\fR;
358 \fIpool\fR\fB\&.createwhatprovides()\fR
359 \fIpool\fR\fB\&.createwhatprovides()\fR
360 .fi
361 .if n \{\
362 .RE
363 .\}
364 .sp
365 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()\&.
366 .sp
367 .if n \{\
368 .RS 4
369 .\}
370 .nf
371 \fBQueue whatprovides(DepId\fR \fIdep\fR\fB)\fR
372 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatprovides(\fR\fI$dep\fR\fB)\fR;
373 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
374 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
375 .fi
376 .if n \{\
377 .RE
378 .\}
379 .sp
380 Return all solvables that provide the specified dependency\&. You can use either a Dep object or an simple Id as argument\&.
381 .sp
382 .if n \{\
383 .RS 4
384 .\}
385 .nf
386 \fBQueue matchprovidingids(const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
387 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->matchprovidingids(\fR\fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
388 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
389 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
390 .fi
391 .if n \{\
392 .RE
393 .\}
394 .sp
395 Search the names of all provides and return the ones matching the specified string\&. See the Dataiterator class for the allowed flags\&.
396 .sp
397 .if n \{\
398 .RS 4
399 .\}
400 .nf
401 \fBId towhatprovides(Queue\fR \fIids\fR\fB)\fR
402 my \fI$offset\fR \fB=\fR \fI$pool\fR\fB\->towhatprovides(\e\fR\fI@ids\fR\fB)\fR;
403 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
404 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
405 .fi
406 .if n \{\
407 .RE
408 .\}
409 .sp
410 \(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\&.
411 .sp
412 .if n \{\
413 .RS 4
414 .\}
415 .nf
416 \fBbool isknownarch(DepId\fR \fIid\fR\fB)\fR
417 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->isknownarch(\fR\fI$id\fR\fB)\fR;
418 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch(\fR\fIid\fR\fB)\fR
419 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch?(\fR\fIid\fR\fB)\fR
420 .fi
421 .if n \{\
422 .RE
423 .\}
424 .sp
425 Return true if the specified Id describs a known architecture\&.
426 .sp
427 .if n \{\
428 .RS 4
429 .\}
430 .nf
431 \fBSolver *Solver()\fR
432 my \fI$solver\fR \fB=\fR \fI$pool\fR\fB\->Solver()\fR;
433 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
434 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
435 .fi
436 .if n \{\
437 .RE
438 .\}
439 .sp
440 Create a new solver object\&.
441 .sp
442 .if n \{\
443 .RS 4
444 .\}
445 .nf
446 \fBSolver *Job(int\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
447 my \fI$job\fR \fB=\fR \fI$pool\fR\fB\->Job(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
448 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
449 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
450 .fi
451 .if n \{\
452 .RE
453 .\}
454 .sp
455 Create a new Job object\&. Kind of low level, in most cases you would use a Selection or Dep job constructor instead\&.
456 .sp
457 .if n \{\
458 .RS 4
459 .\}
460 .nf
461 \fBSelection *Selection()\fR
462 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection()\fR;
463 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
464 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
465 .fi
466 .if n \{\
467 .RE
468 .\}
469 .sp
470 Create an empty selection\&. Useful as a starting point for merging other selections\&.
471 .sp
472 .if n \{\
473 .RS 4
474 .\}
475 .nf
476 \fBSelection *Selection_all()\fR
477 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection_all()\fR;
478 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
479 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
480 .fi
481 .if n \{\
482 .RE
483 .\}
484 .sp
485 Create a selection containing all packages\&. Useful as starting point for intersecting other selections or for update/distupgrade jobs\&.
486 .sp
487 .if n \{\
488 .RS 4
489 .\}
490 .nf
491 \fBSelection *select(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB)\fR
492 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->select(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
493 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
494 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
495 .fi
496 .if n \{\
497 .RE
498 .\}
499 .sp
500 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\&.
501 .sp
502 .if n \{\
503 .RS 4
504 .\}
505 .nf
506 \fBvoid setpooljobs(Jobs *\fR\fIjobs\fR\fB)\fR
507 \fI$pool\fR\fB\->setpooljobs(\e\fR\fI@jobs\fR\fB)\fR;
508 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
509 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
510 .fi
511 .if n \{\
512 .RE
513 .\}
514 .sp
515 .if n \{\
516 .RS 4
517 .\}
518 .nf
519 \fBJobs *getpooljobs()\fR
520 \fI@jobs\fR \fB=\fR \fI$pool\fR\fB\->getpooljobs()\fR;
521 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
522 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
523 .fi
524 .if n \{\
525 .RE
526 .\}
527 .sp
528 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\&.
529 .sp
530 .if n \{\
531 .RS 4
532 .\}
533 .nf
534 \fBvoid set_loadcallback(Callable *\fR\fIcallback\fR\fB)\fR
535 \fI$pool\fR\fB\->setloadcallback(\e\fR\fI&callbackfunction\fR\fB)\fR;
536 \fIpool\fR\fB\&.setloadcallback(\fR\fIcallbackfunction\fR\fB)\fR
537 \fIpool\fR\fB\&.setloadcallback { |\fR\fIrepodata\fR\fB| \&.\&.\&. }\fR
538 .fi
539 .if n \{\
540 .RE
541 .\}
542 .sp
543 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\&.
544 .SS "DATA RETRIEVAL METHODS"
545 .sp
546 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,
547 .sp
548 .if n \{\
549 .RS 4
550 .\}
551 .nf
552 \fB$solv::SOLVABLE_SUMMARY\fR
553 \fBsolv\&.SOLVABLE_SUMMARY\fR
554 \fBSolv::SOLVABLE_SUMMARY\fR
555 .fi
556 .if n \{\
557 .RE
558 .\}
559 .sp
560 selects the \(lqSummary\(rq entry of a solvable\&. The \fIsolvid\fR argument selects the desired solvable by Id\&.
561 .sp
562 .if n \{\
563 .RS 4
564 .\}
565 .nf
566 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
567 my \fI$string\fR \fB=\fR \fI$pool\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
568 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
569 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
570 .fi
571 .if n \{\
572 .RE
573 .\}
574 .sp
575 .if n \{\
576 .RS 4
577 .\}
578 .nf
579 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
580 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->lookup_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
581 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
582 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
583 .fi
584 .if n \{\
585 .RE
586 .\}
587 .sp
588 .if n \{\
589 .RS 4
590 .\}
591 .nf
592 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
593 my \fI$num\fR \fB=\fR \fI$pool\fR\fB\->lookup_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
594 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
595 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
596 .fi
597 .if n \{\
598 .RE
599 .\}
600 .sp
601 .if n \{\
602 .RS 4
603 .\}
604 .nf
605 \fBbool lookup_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
606 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->lookup_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
607 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
608 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
609 .fi
610 .if n \{\
611 .RE
612 .\}
613 .sp
614 .if n \{\
615 .RS 4
616 .\}
617 .nf
618 \fBQueue lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
619 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
620 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
621 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
622 .fi
623 .if n \{\
624 .RE
625 .\}
626 .sp
627 .if n \{\
628 .RS 4
629 .\}
630 .nf
631 \fBChksum *lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
632 my \fI$chksum\fR \fB=\fR \fI$pool\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
633 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
634 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
635 .fi
636 .if n \{\
637 .RE
638 .\}
639 .sp
640 Lookup functions\&. Return the data element stored in the specified solvable\&. You should probably use the methods of the Solvable class instead\&.
641 .sp
642 .if n \{\
643 .RS 4
644 .\}
645 .nf
646 \fBDataiterator *Dataiterator(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
647 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;
648 \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
649 \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
650 .fi
651 .if n \{\
652 .RE
653 .\}
654 .sp
655 .if n \{\
656 .RS 4
657 .\}
658 .nf
659 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
660 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
661 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
662 .fi
663 .if n \{\
664 .RE
665 .\}
666 .sp
667 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
668 .SS "ID METHODS"
669 .sp
670 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\&.
671 .sp
672 .if n \{\
673 .RS 4
674 .\}
675 .nf
676 \fBRepo *id2repo(Id\fR \fIid\fR\fB)\fR
677 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->id2repo(\fR\fI$id\fR\fB)\fR;
678 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
679 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
680 .fi
681 .if n \{\
682 .RE
683 .\}
684 .sp
685 Lookup an existing Repository by id\&. You can also do this by using the \fBrepos\fR attribute\&.
686 .sp
687 .if n \{\
688 .RS 4
689 .\}
690 .nf
691 \fBSolvable *id2solvable(Id\fR \fIid\fR\fB)\fR
692 \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->id2solvable(\fR\fI$id\fR\fB)\fR;
693 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
694 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
695 .fi
696 .if n \{\
697 .RE
698 .\}
699 .sp
700 Lookup an existing Repository by id\&. You can also do this by using the \fBsolvables\fR attribute\&.
701 .sp
702 .if n \{\
703 .RS 4
704 .\}
705 .nf
706 \fBconst char *solvid2str(Id\fR \fIid\fR\fB)\fR
707 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvid2str(\fR\fI$id\fR\fB)\fR;
708 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
709 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
710 .fi
711 .if n \{\
712 .RE
713 .\}
714 .sp
715 Return a string describing the Solvable with the specified id\&. The string consists of the name, version, and architecture of the Solvable\&.
716 .sp
717 .if n \{\
718 .RS 4
719 .\}
720 .nf
721 \fBId str2id(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
722 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->str2id(\fR\fI$string\fR\fB)\fR;
723 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
724 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
725 .fi
726 .if n \{\
727 .RE
728 .\}
729 .sp
730 .if n \{\
731 .RS 4
732 .\}
733 .nf
734 \fBconst char *id2str(Id\fR \fIid\fR\fB)\fR
735 \fI$string\fR \fB=\fR \fIpool\fR\fB\->id2str(\fR\fI$id\fR\fB)\fR;
736 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
737 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
738 .fi
739 .if n \{\
740 .RE
741 .\}
742 .sp
743 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\&.
744 .sp
745 .if n \{\
746 .RS 4
747 .\}
748 .nf
749 \fBId rel2id(Id\fR \fIname\fR\fB, Id\fR \fIevr\fR\fB, int\fR \fIflags\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
750 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;
751 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
752 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
753 .fi
754 .if n \{\
755 .RE
756 .\}
757 .sp
758 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:
759 .sp
760 .if n \{\
761 .RS 4
762 .\}
763 .nf
764 \fB$solv::REL_EQ | $solv::REL_GT | $solv::REL_LT\fR
765 \fBsolv\&.REL_EQ | solv\&.REL_GT | solv\&.REL_LT\fR
766 \fBSolv::REL_EQ | Solv::REL_GT | Solv::REL_LT\fR
767 .fi
768 .if n \{\
769 .RE
770 .\}
771 .sp
772 Thus, if you want a \(lq<=\(rq relation, you would use \fBREL_LT | REL_EQ\fR\&.
773 .sp
774 .if n \{\
775 .RS 4
776 .\}
777 .nf
778 \fBId id2langid(Id\fR \fIid\fR\fB, const char *\fR\fIlang\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
779 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->id2langid(\fR\fI$id\fR\fB,\fR \fI$language\fR\fB)\fR;
780 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
781 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
782 .fi
783 .if n \{\
784 .RE
785 .\}
786 .sp
787 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\&.
788 .sp
789 .if n \{\
790 .RS 4
791 .\}
792 .nf
793 \fBconst char *dep2str(Id\fR \fIid\fR\fB)\fR
794 \fI$string\fR \fB=\fR \fIpool\fR\fB\->dep2str(\fR\fI$id\fR\fB)\fR;
795 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
796 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
797 .fi
798 .if n \{\
799 .RE
800 .\}
801 .sp
802 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\&.
803 .SH "THE DEPENDENCY CLASS"
804 .sp
805 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\&.
806 .SS "ATTRIBUTES"
807 .sp
808 .if n \{\
809 .RS 4
810 .\}
811 .nf
812 \fBPool *pool;\fR             /* read only */
813 \fI$dep\fR\fB\->{\*(Aqpool\*(Aq}\fR
814 \fIdep\fR\fB\&.pool\fR
815 \fIdep\fR\fB\&.pool\fR
816 .fi
817 .if n \{\
818 .RE
819 .\}
820 .sp
821 Back reference to the pool this dependency belongs to\&.
822 .sp
823 .if n \{\
824 .RS 4
825 .\}
826 .nf
827 \fBId id;\fR          /* read only */
828 \fI$dep\fR\fB\->{\*(Aqid\*(Aq}\fR
829 \fIdep\fR\fB\&.id\fR
830 \fIdep\fR\fB\&.id\fR
831 .fi
832 .if n \{\
833 .RE
834 .\}
835 .sp
836 The id of this dependency\&.
837 .SH "METHODS"
838 .sp
839 .if n \{\
840 .RS 4
841 .\}
842 .nf
843 \fBDep *Rel(int\fR \fIflags\fR\fB, DepId\fR \fIevrid\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
844 my \fI$reldep\fR \fB=\fR \fI$dep\fR\fB\->Rel(\fR\fI$flags\fR\fB,\fR \fI$evrdep\fR\fB)\fR;
845 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
846 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
847 .fi
848 .if n \{\
849 .RE
850 .\}
851 .sp
852 Create a relational dependency from to string dependencies and a flags argument\&. See the pool\(cqs rel2id method for a description of the flags\&.
853 .sp
854 .if n \{\
855 .RS 4
856 .\}
857 .nf
858 \fBSelection *Selection_name(int\fR \fIsetflags\fR \fB= 0)\fR
859 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_name()\fR;
860 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
861 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
862 .fi
863 .if n \{\
864 .RE
865 .\}
866 .sp
867 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\&.
868 .sp
869 .if n \{\
870 .RS 4
871 .\}
872 .nf
873 \fBSelection *Selection_provides(int\fR \fIsetflags\fR \fB= 0)\fR
874 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_provides()\fR;
875 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
876 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
877 .fi
878 .if n \{\
879 .RE
880 .\}
881 .sp
882 Create a Selection from a dependency\&. The selection consists of all packages that have at least one provides matching the dependency\&.
883 .sp
884 .if n \{\
885 .RS 4
886 .\}
887 .nf
888 \fBconst char *str()\fR
889 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str()\fR;
890 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
891 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
892 .fi
893 .if n \{\
894 .RE
895 .\}
896 .sp
897 Return a string describing the dependency\&.
898 .sp
899 .if n \{\
900 .RS 4
901 .\}
902 .nf
903 \fB<stringification>\fR
904 my \fI$str\fR \fB= "\fR\fI$dep\fR\fB"\fR;
905 \fIstr\fR \fB= str(\fR\fIdep\fR\fB)\fR
906 \fIstr\fR \fB=\fR \fIdep\fR\fB\&.to_s\fR
907 .fi
908 .if n \{\
909 .RE
910 .\}
911 .sp
912 Same as calling the str() method\&.
913 .sp
914 .if n \{\
915 .RS 4
916 .\}
917 .nf
918 \fB<equality>\fR
919 \fBif (\fR\fI$dep1\fR \fB==\fR \fI$dep2\fR\fB)\fR
920 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR\fB:\fR
921 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR
922 .fi
923 .if n \{\
924 .RE
925 .\}
926 .sp
927 The dependencies are equal if they are part of the same pool and have the same ids\&.
928 .SH "THE REPOSITORY CLASS"
929 .sp
930 A Repository describes a group of packages, normally comming from the same source\&. Repositories are created by the Pool\(cqs add_repo() method\&.
931 .SS "ATTRIBUTES"
932 .sp
933 .if n \{\
934 .RS 4
935 .\}
936 .nf
937 \fBPool *pool;\fR                     /* read only */
938 \fI$repo\fR\fB\->{\*(Aqpool\*(Aq}\fR
939 \fIrepo\fR\fB\&.pool\fR
940 \fIrepo\fR\fB\&.pool\fR
941 .fi
942 .if n \{\
943 .RE
944 .\}
945 .sp
946 Back reference to the pool this dependency belongs to\&.
947 .sp
948 .if n \{\
949 .RS 4
950 .\}
951 .nf
952 \fBId id;\fR                          /* read only */
953 \fI$repo\fR\fB\->{\*(Aqid\*(Aq}\fR
954 \fIrepo\fR\fB\&.id\fR
955 \fIrepo\fR\fB\&.id\fR
956 .fi
957 .if n \{\
958 .RE
959 .\}
960 .sp
961 The id of the repository\&.
962 .sp
963 .if n \{\
964 .RS 4
965 .\}
966 .nf
967 \fBconst char *name;\fR               /* read/write */
968 \fI$repo\fR\fB\->{\*(Aqname\*(Aq}\fR
969 \fIrepo\fR\fB\&.name\fR
970 \fIrepo\fR\fB\&.name\fR
971 .fi
972 .if n \{\
973 .RE
974 .\}
975 .sp
976 The repositories name\&. To libsolv, the name is just a string with no specific meaning\&.
977 .sp
978 .if n \{\
979 .RS 4
980 .\}
981 .nf
982 \fBint prioprity;\fR                  /* read/write */
983 \fI$repo\fR\fB\->{\*(Aqpriority\*(Aq}\fR
984 \fIrepo\fR\fB\&.priority\fR
985 \fIrepo\fR\fB\&.priority\fR
986 .fi
987 .if n \{\
988 .RE
989 .\}
990 .sp
991 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\&.
992 .sp
993 .if n \{\
994 .RS 4
995 .\}
996 .nf
997 \fBint subprioprity;\fR               /* read/write */
998 \fI$repo\fR\fB\->{\*(Aqsubpriority\*(Aq}\fR
999 \fIrepo\fR\fB\&.subpriority\fR
1000 \fIrepo\fR\fB\&.subpriority\fR
1001 .fi
1002 .if n \{\
1003 .RE
1004 .\}
1005 .sp
1006 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\&.
1007 .sp
1008 .if n \{\
1009 .RS 4
1010 .\}
1011 .nf
1012 \fBint nsolvables;\fR                 /* read only */
1013 \fI$repo\fR\fB\->{\*(Aqnsolvables\*(Aq}\fR
1014 \fIrepo\fR\fB\&.nsolvables\fR
1015 \fIrepo\fR\fB\&.nsolvables\fR
1016 .fi
1017 .if n \{\
1018 .RE
1019 .\}
1020 .sp
1021 The number of solvables in this repository\&.
1022 .sp
1023 .if n \{\
1024 .RS 4
1025 .\}
1026 .nf
1027 \fBvoid *appdata;\fR                  /* read/write */
1028 \fI$repo\fR\fB\->{\*(Aqappdata\*(Aq}\fR
1029 \fIrepo\fR\fB\&.appdata\fR
1030 \fIrepo\fR\fB\&.appdata\fR
1031 .fi
1032 .if n \{\
1033 .RE
1034 .\}
1035 .sp
1036 Application specific data that may be used in any way by the code using the repository\&.
1037 .sp
1038 .if n \{\
1039 .RS 4
1040 .\}
1041 .nf
1042 \fBDatapos *meta;\fR                  /* read only */
1043 \fI$repo\fR\fB\->{\*(Aqmeta\*(Aq}\fR
1044 \fIrepo\fR\fB\&.meta\fR
1045 \fIrepo\fR\fB\&.meta\fR
1046 .fi
1047 .if n \{\
1048 .RE
1049 .\}
1050 .sp
1051 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\&.
1052 .SS "CONSTANTS"
1053 .PP
1054 \fBREPO_REUSE_REPODATA\fR
1055 .RS 4
1056 Reuse the last repository data aera (\(lqrepodata\(rq) instead of creating a new one\&.
1057 .RE
1058 .PP
1059 \fBREPO_NO_INTERNALIZE\fR
1060 .RS 4
1061 Do not internalize the added repository data\&. This is useful if you plan to add more data because internalization is a costly operation\&.
1062 .RE
1063 .PP
1064 \fBREPO_LOCALPOOL\fR
1065 .RS 4
1066 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\&.
1067 .RE
1068 .PP
1069 \fBREPO_USE_LOADING\fR
1070 .RS 4
1071 Use the repodata that is currently being loaded instead of creating a new one\&. This only makes sense if used in a load callback\&.
1072 .RE
1073 .PP
1074 \fBREPO_EXTEND_SOLVABLES\fR
1075 .RS 4
1076 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\&.
1077 .RE
1078 .PP
1079 \fBREPO_USE_ROOTDIR\fR
1080 .RS 4
1081 Prepend the pool\(cqs rootdir to the path when doing file operations\&.
1082 .RE
1083 .PP
1084 \fBREPO_NO_LOCATION\fR
1085 .RS 4
1086 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\&.
1087 .RE
1088 .PP
1089 \fBSOLV_ADD_NO_STUBS\fR
1090 .RS 4
1091 Do not create stubs for repository parts that can be downloaded on demand\&.
1092 .RE
1093 .PP
1094 \fBSUSETAGS_RECORD_SHARES\fR
1095 .RS 4
1096 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\&.
1097 .RE
1098 .SS "METHODS"
1099 .sp
1100 .if n \{\
1101 .RS 4
1102 .\}
1103 .nf
1104 \fBvoid free(bool\fR \fIreuseids\fR \fB= 0)\fR
1105 \fI$repo\fR\fB\->free()\fR;
1106 \fIrepo\fR\fB\&.free()\fR
1107 \fIrepo\fR\fB\&.free()\fR
1108 .fi
1109 .if n \{\
1110 .RE
1111 .\}
1112 .sp
1113 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\&.
1114 .sp
1115 .if n \{\
1116 .RS 4
1117 .\}
1118 .nf
1119 \fBvoid empty(bool\fR \fIreuseids\fR \fB= 0)\fR
1120 \fI$repo\fR\fB\->empty()\fR;
1121 \fIrepo\fR\fB\&.empty()\fR
1122 \fIrepo\fR\fB\&.empty()\fR
1123 .fi
1124 .if n \{\
1125 .RE
1126 .\}
1127 .sp
1128 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\&.
1129 .sp
1130 .if n \{\
1131 .RS 4
1132 .\}
1133 .nf
1134 \fBbool isempty()\fR
1135 \fI$repo\fR\fB\->isempty()\fR
1136 \fIrepo\fR\fB\&.empty()\fR
1137 \fIrepo\fR\fB\&.empty?\fR
1138 .fi
1139 .if n \{\
1140 .RE
1141 .\}
1142 .sp
1143 Return true if there are no solvables in this repository\&.
1144 .sp
1145 .if n \{\
1146 .RS 4
1147 .\}
1148 .nf
1149 \fBvoid internalize()\fR
1150 \fI$repo\fR\fB\->internalize()\fR;
1151 \fIrepo\fR\fB\&.internalize()\fR
1152 \fIrepo\fR\fB\&.internalize()\fR
1153 .fi
1154 .if n \{\
1155 .RE
1156 .\}
1157 .sp
1158 Internalize added data\&. Data must be internalized before it is available to the lookup and data iterator functions\&.
1159 .sp
1160 .if n \{\
1161 .RS 4
1162 .\}
1163 .nf
1164 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR
1165 \fI$repo\fR\fB\->write(\fR\fI$fp\fR\fB)\fR
1166 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1167 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1168 .fi
1169 .if n \{\
1170 .RE
1171 .\}
1172 .sp
1173 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\&.
1174 .sp
1175 .if n \{\
1176 .RS 4
1177 .\}
1178 .nf
1179 \fBSolvableiterator *solvables_iter()\fR
1180 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$repo\fR\fB\->solvables_iter()})\fR
1181 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter():\fR
1182 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter()\fR
1183 .fi
1184 .if n \{\
1185 .RE
1186 .\}
1187 .sp
1188 Iterate over all solvables in a repository\&.
1189 .sp
1190 .if n \{\
1191 .RS 4
1192 .\}
1193 .nf
1194 \fBRepodata *add_repodata(int\fR \fIflags\fR \fB= 0)\fR
1195 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->add_repodata()\fR;
1196 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1197 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1198 .fi
1199 .if n \{\
1200 .RE
1201 .\}
1202 .sp
1203 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\&.
1204 .sp
1205 .if n \{\
1206 .RS 4
1207 .\}
1208 .nf
1209 \fBvoid create_stubs()\fR
1210 \fI$repo\fR\fB\->create_stubs()\fR;
1211 \fIrepo\fR\fB\&.create_stubs()\fR
1212 \fIrepo\fR\fB\&.create_stubs()\fR
1213 .fi
1214 .if n \{\
1215 .RE
1216 .\}
1217 .sp
1218 Calls the create_stubs() repodata method for the last repodata of the repository\&.
1219 .sp
1220 .if n \{\
1221 .RS 4
1222 .\}
1223 .nf
1224 \fBbool iscontiguous()\fR
1225 \fI$repo\fR\fB\->iscontiguous()\fR
1226 \fIrepo\fR\fB\&.iscontiguous()\fR
1227 \fIrepo\fR\fB\&.iscontiguous?\fR
1228 .fi
1229 .if n \{\
1230 .RE
1231 .\}
1232 .sp
1233 Return true if the solvables of this repository are all in a single block with no holes, i\&.e\&. they have consecutive ids\&.
1234 .sp
1235 .if n \{\
1236 .RS 4
1237 .\}
1238 .nf
1239 \fBRepodata *first_repodata()\fR
1240 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->first_repodata()\fR;
1241 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1242 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1243 .fi
1244 .if n \{\
1245 .RE
1246 .\}
1247 .sp
1248 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\&.
1249 .sp
1250 .if n \{\
1251 .RS 4
1252 .\}
1253 .nf
1254 \fBSelection *Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1255 my \fI$sel\fR \fB=\fR \fI$repo\fR\fB\->Selection()\fR;
1256 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1257 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1258 .fi
1259 .if n \{\
1260 .RE
1261 .\}
1262 .sp
1263 Create a Selection consisting of all packages in the repository\&.
1264 .sp
1265 .if n \{\
1266 .RS 4
1267 .\}
1268 .nf
1269 \fBDataiterator *Dataiterator(Id\fR \fIp\fR\fB, Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
1270 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;
1271 \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
1272 \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
1273 .fi
1274 .if n \{\
1275 .RE
1276 .\}
1277 .sp
1278 .if n \{\
1279 .RS 4
1280 .\}
1281 .nf
1282 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1283 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1284 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1285 .fi
1286 .if n \{\
1287 .RE
1288 .\}
1289 .sp
1290 Iterate over the matching data elements in this repository\&. See the Dataiterator class for more information\&.
1291 .sp
1292 .if n \{\
1293 .RS 4
1294 .\}
1295 .nf
1296 \fB<stringification>\fR
1297 my \fI$str\fR \fB= "\fR\fI$repo\fR\fB"\fR;
1298 \fIstr\fR \fB= str(\fR\fIrepo\fR\fB)\fR
1299 \fIstr\fR \fB=\fR \fIrepo\fR\fB\&.to_s\fR
1300 .fi
1301 .if n \{\
1302 .RE
1303 .\}
1304 .sp
1305 Return the name of the repository, or "Repo#<id>" if no name is set\&.
1306 .sp
1307 .if n \{\
1308 .RS 4
1309 .\}
1310 .nf
1311 \fB<equality>\fR
1312 \fBif (\fR\fI$repo1\fR \fB==\fR \fI$repo2\fR\fB)\fR
1313 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR\fB:\fR
1314 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR
1315 .fi
1316 .if n \{\
1317 .RE
1318 .\}
1319 .sp
1320 Two repositories are equal if they belong to the same pool and have the same id\&.
1321 .SS "DATA ADD METHODS"
1322 .sp
1323 .if n \{\
1324 .RS 4
1325 .\}
1326 .nf
1327 \fBSolvable *add_solvable()\fR
1328 \fI$repo\fR\fB\->add_solvable()\fR;
1329 \fIrepo\fR\fB\&.add_solvable()\fR
1330 \fIrepo\fR\fB\&.add_solvable()\fR
1331 .fi
1332 .if n \{\
1333 .RE
1334 .\}
1335 .sp
1336 Add a single empty solvable to the repository\&. Returns a Solvable object, see the Solvable class for more information\&.
1337 .sp
1338 .if n \{\
1339 .RS 4
1340 .\}
1341 .nf
1342 \fBbool add_solv(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1343 \fI$repo\fR\fB\->add_solv(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1344 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1345 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1346 .fi
1347 .if n \{\
1348 .RE
1349 .\}
1350 .sp
1351 .if n \{\
1352 .RS 4
1353 .\}
1354 .nf
1355 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1356 \fI$repo\fR\fB\->add_solv(\fR\fI$fp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1357 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1358 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1359 .fi
1360 .if n \{\
1361 .RE
1362 .\}
1363 .sp
1364 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\&.
1365 .sp
1366 .if n \{\
1367 .RS 4
1368 .\}
1369 .nf
1370 \fBbool add_rpmdb(int\fR \fIflags\fR \fB= 0)\fR
1371 \fI$repo\fR\fB\->add_rpmdb(\fR\fI$flags\fR\fB)\fR;
1372 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1373 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1374 .fi
1375 .if n \{\
1376 .RE
1377 .\}
1378 .sp
1379 .if n \{\
1380 .RS 4
1381 .\}
1382 .nf
1383 \fBbool add_rpmdb_reffp(FILE *\fR\fIreffp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1384 \fI$repo\fR\fB\->add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1385 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1386 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1387 .fi
1388 .if n \{\
1389 .RE
1390 .\}
1391 .sp
1392 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\&.
1393 .sp
1394 .if n \{\
1395 .RS 4
1396 .\}
1397 .nf
1398 \fBbool add_rpm(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1399 \fI$repo\fR\fB\->add_rpm(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1400 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1401 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1402 .fi
1403 .if n \{\
1404 .RE
1405 .\}
1406 .sp
1407 Add the metadata of a single rpm package to the repository\&.
1408 .sp
1409 .if n \{\
1410 .RS 4
1411 .\}
1412 .nf
1413 \fBbool add_rpmdb_pubkeys(int\fR \fIflags\fR \fB= 0)\fR
1414 \fI$repo\fR\fB\->add_rpmdb_pubkeys()\fR;
1415 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1416 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1417 .fi
1418 .if n \{\
1419 .RE
1420 .\}
1421 .sp
1422 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\&.
1423 .sp
1424 .if n \{\
1425 .RS 4
1426 .\}
1427 .nf
1428 \fBbool add_pubkey(const char *\fR\fIkeyfile\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1429 \fI$repo\fR\fB\->add_pubkey(\fR\fI$keyfile\fR\fB)\fR;
1430 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1431 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1432 .fi
1433 .if n \{\
1434 .RE
1435 .\}
1436 .sp
1437 Add a pubkey from a file to the repository\&.
1438 .sp
1439 .if n \{\
1440 .RS 4
1441 .\}
1442 .nf
1443 \fBbool add_rpmmd(FILE *\fR\fIfp\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1444 \fI$repo\fR\fB\->add_rpmmd(\fR\fI$fp\fR\fB,\fR \fI$language\fR\fB)\fR;
1445 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1446 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1447 .fi
1448 .if n \{\
1449 .RE
1450 .\}
1451 .sp
1452 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\&.
1453 .sp
1454 .if n \{\
1455 .RS 4
1456 .\}
1457 .nf
1458 \fBbool add_repomdxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1459 \fI$repo\fR\fB\->add_repomdxml(\fR\fI$fp\fR\fB)\fR;
1460 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1461 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1462 .fi
1463 .if n \{\
1464 .RE
1465 .\}
1466 .sp
1467 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\&.
1468 .sp
1469 .if n \{\
1470 .RS 4
1471 .\}
1472 .nf
1473 \fBbool add_updateinfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1474 \fI$repo\fR\fB\->add_updateinfoxml(\fR\fI$fp\fR\fB)\fR;
1475 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1476 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1477 .fi
1478 .if n \{\
1479 .RE
1480 .\}
1481 .sp
1482 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\&.
1483 .sp
1484 .if n \{\
1485 .RS 4
1486 .\}
1487 .nf
1488 \fBbool add_deltainfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1489 \fI$repo\fR\fB\->add_deltainfoxml(\fR\fI$fp\fR\fB)\fR;
1490 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1491 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1492 .fi
1493 .if n \{\
1494 .RE
1495 .\}
1496 .sp
1497 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\&.
1498 .sp
1499 .if n \{\
1500 .RS 4
1501 .\}
1502 .nf
1503 \fBbool add_debdb(int\fR \fIflags\fR \fB= 0)\fR
1504 \fI$repo\fR\fB\->add_debdb()\fR;
1505 \fIrepo\fR\fB\&.add_debdb()\fR
1506 \fIrepo\fR\fB\&.add_debdb()\fR
1507 .fi
1508 .if n \{\
1509 .RE
1510 .\}
1511 .sp
1512 Add the contents of the debian installed package database to the repository\&.
1513 .sp
1514 .if n \{\
1515 .RS 4
1516 .\}
1517 .nf
1518 \fBbool add_debpackages(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1519 \fI$repo\fR\fB\->add_debpackages(\fR\fI$fp\fR\fB)\fR;
1520 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1521 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1522 .fi
1523 .if n \{\
1524 .RE
1525 .\}
1526 .sp
1527 Add the contents of the debian repository metadata (the "packages" file) to the repository\&.
1528 .sp
1529 .if n \{\
1530 .RS 4
1531 .\}
1532 .nf
1533 \fBbool add_deb(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1534 \fI$repo\fR\fB\->add_deb(\fR\fI$filename\fR\fB)\fR;
1535 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1536 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1537 .fi
1538 .if n \{\
1539 .RE
1540 .\}
1541 .sp
1542 Add the metadata of a single deb package to the repository\&.
1543 .sp
1544 .if n \{\
1545 .RS 4
1546 .\}
1547 .nf
1548 \fBbool add_mdk(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1549 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1550 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1551 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1552 .fi
1553 .if n \{\
1554 .RE
1555 .\}
1556 .sp
1557 Add the contents of the mageia/mandriva repository metadata (the "synthesis\&.hdlist" file) to the repository\&.
1558 .sp
1559 .if n \{\
1560 .RS 4
1561 .\}
1562 .nf
1563 \fBbool add_mdk_info(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1564 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1565 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1566 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1567 .fi
1568 .if n \{\
1569 .RE
1570 .\}
1571 .sp
1572 Extend the packages from the synthesis file with the info\&.xml and files\&.xml data\&. Do not forget to specify \fBREPO_EXTEND_SOLVABLES\fR\&.
1573 .sp
1574 .if n \{\
1575 .RS 4
1576 .\}
1577 .nf
1578 \fBbool add_arch_repo(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1579 \fI$repo\fR\fB\->add_arch_repo(\fR\fI$fp\fR\fB)\fR;
1580 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1581 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1582 .fi
1583 .if n \{\
1584 .RE
1585 .\}
1586 .sp
1587 Add the contents of the archlinux repository metadata (the "\&.db\&.tar" file) to the repository\&.
1588 .sp
1589 .if n \{\
1590 .RS 4
1591 .\}
1592 .nf
1593 \fBbool add_arch_local(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1594 \fI$repo\fR\fB\->add_arch_local(\fR\fI$dir\fR\fB)\fR;
1595 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1596 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1597 .fi
1598 .if n \{\
1599 .RE
1600 .\}
1601 .sp
1602 Add the contents of the archlinux installed package database to the repository\&. The \fIdir\fR parameter is usually set to "/var/lib/pacman/local"\&.
1603 .sp
1604 .if n \{\
1605 .RS 4
1606 .\}
1607 .nf
1608 \fBbool add_content(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1609 \fI$repo\fR\fB\->add_content(\fR\fI$fp\fR\fB)\fR;
1610 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1611 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1612 .fi
1613 .if n \{\
1614 .RE
1615 .\}
1616 .sp
1617 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\&.
1618 .sp
1619 .if n \{\
1620 .RS 4
1621 .\}
1622 .nf
1623 \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
1624 \fI$repo\fR\fB\->add_susetags(\fR\fI$fp\fR\fB,\fR \fI$defvendor\fR\fB,\fR \fI$language\fR\fB)\fR;
1625 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1626 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1627 .fi
1628 .if n \{\
1629 .RE
1630 .\}
1631 .sp
1632 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\&.
1633 .sp
1634 .if n \{\
1635 .RS 4
1636 .\}
1637 .nf
1638 \fBbool add_products(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1639 \fI$repo\fR\fB\->add_products(\fR\fI$dir\fR\fB)\fR;
1640 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1641 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1642 .fi
1643 .if n \{\
1644 .RE
1645 .\}
1646 .sp
1647 Add the installed SUSE products database to the repository\&. The \fIdir\fR parameter is usually "/etc/products\&.d"\&.
1648 .SH "THE SOLVABLE CLASS"
1649 .sp
1650 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\&.
1651 .SS "ATTRIBUTES"
1652 .sp
1653 .if n \{\
1654 .RS 4
1655 .\}
1656 .nf
1657 \fBRepo *repo;\fR                     /* read only */
1658 \fI$solvable\fR\fB\->{\*(Aqrepo\*(Aq}\fR
1659 \fIsolvable\fR\fB\&.repo\fR
1660 \fIsolvable\fR\fB\&.repo\fR
1661 .fi
1662 .if n \{\
1663 .RE
1664 .\}
1665 .sp
1666 The repository this solvable belongs to\&.
1667 .sp
1668 .if n \{\
1669 .RS 4
1670 .\}
1671 .nf
1672 \fBPool *pool;\fR                     /* read only */
1673 \fI$solvable\fR\fB\->{\*(Aqpool\*(Aq}\fR
1674 \fIsolvable\fR\fB\&.pool\fR
1675 \fIsolvable\fR\fB\&.pool\fR
1676 .fi
1677 .if n \{\
1678 .RE
1679 .\}
1680 .sp
1681 The pool this solvable belongs to, same as the pool of the repo\&.
1682 .sp
1683 .if n \{\
1684 .RS 4
1685 .\}
1686 .nf
1687 \fBId id;\fR                          /* read only */
1688 \fI$solvable\fR\fB\->{\*(Aqid\*(Aq}\fR
1689 \fIsolvable\fR\fB\&.id\fR
1690 \fIsolvable\fR\fB\&.id\fR
1691 .fi
1692 .if n \{\
1693 .RE
1694 .\}
1695 .sp
1696 The specific id of the solvable\&.
1697 .sp
1698 .if n \{\
1699 .RS 4
1700 .\}
1701 .nf
1702 \fBchar *name;\fR                     /* read/write */
1703 \fI$solvable\fR\fB\->{\*(Aqname\*(Aq}\fR
1704 \fIsolvable\fR\fB\&.name\fR
1705 \fIsolvable\fR\fB\&.name\fR
1706 .fi
1707 .if n \{\
1708 .RE
1709 .\}
1710 .sp
1711 .if n \{\
1712 .RS 4
1713 .\}
1714 .nf
1715 \fBchar *evr;\fR                      /* read/write */
1716 \fI$solvable\fR\fB\->{\*(Aqevr\*(Aq}\fR
1717 \fIsolvable\fR\fB\&.evr\fR
1718 \fIsolvable\fR\fB\&.evr\fR
1719 .fi
1720 .if n \{\
1721 .RE
1722 .\}
1723 .sp
1724 .if n \{\
1725 .RS 4
1726 .\}
1727 .nf
1728 \fBchar *arch;\fR                     /* read/write */
1729 \fI$solvable\fR\fB\->{\*(Aqarch\*(Aq}\fR
1730 \fIsolvable\fR\fB\&.arch\fR
1731 \fIsolvable\fR\fB\&.arch\fR
1732 .fi
1733 .if n \{\
1734 .RE
1735 .\}
1736 .sp
1737 .if n \{\
1738 .RS 4
1739 .\}
1740 .nf
1741 \fBchar *vendor;\fR                   /* read/write */
1742 \fI$solvable\fR\fB\->{\*(Aqvendor\*(Aq}\fR
1743 \fIsolvable\fR\fB\&.vendor\fR
1744 \fIsolvable\fR\fB\&.vendor\fR
1745 .fi
1746 .if n \{\
1747 .RE
1748 .\}
1749 .sp
1750 Easy access to often used attributes of solvables\&. They are internally stored as Ids\&.
1751 .sp
1752 .if n \{\
1753 .RS 4
1754 .\}
1755 .nf
1756 \fBId nameid;\fR                      /* read/write */
1757 \fI$solvable\fR\fB\->{\*(Aqnameid\*(Aq}\fR
1758 \fIsolvable\fR\fB\&.nameid\fR
1759 \fIsolvable\fR\fB\&.nameid\fR
1760 .fi
1761 .if n \{\
1762 .RE
1763 .\}
1764 .sp
1765 .if n \{\
1766 .RS 4
1767 .\}
1768 .nf
1769 \fBId evrid;\fR                       /* read/write */
1770 \fI$solvable\fR\fB\->{\*(Aqevrid\*(Aq}\fR
1771 \fIsolvable\fR\fB\&.evrid\fR
1772 \fIsolvable\fR\fB\&.evrid\fR
1773 .fi
1774 .if n \{\
1775 .RE
1776 .\}
1777 .sp
1778 .if n \{\
1779 .RS 4
1780 .\}
1781 .nf
1782 \fBId archid;\fR                      /* read/write */
1783 \fI$solvable\fR\fB\->{\*(Aqarchid\*(Aq}\fR
1784 \fIsolvable\fR\fB\&.archid\fR
1785 \fIsolvable\fR\fB\&.archid\fR
1786 .fi
1787 .if n \{\
1788 .RE
1789 .\}
1790 .sp
1791 .if n \{\
1792 .RS 4
1793 .\}
1794 .nf
1795 \fBId vendorid;\fR                    /* read/write */
1796 \fI$solvable\fR\fB\->{\*(Aqvendorid\*(Aq}\fR
1797 \fIsolvable\fR\fB\&.vendorid\fR
1798 \fIsolvable\fR\fB\&.vendorid\fR
1799 .fi
1800 .if n \{\
1801 .RE
1802 .\}
1803 .sp
1804 Raw interface to the ids\&. Useful if you want to search for a specific id and want to avoid the string compare overhead\&.
1805 .SS "METHODS"
1806 .sp
1807 .if n \{\
1808 .RS 4
1809 .\}
1810 .nf
1811 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
1812 my \fI$string\fR \fB=\fR \fI$solvable\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
1813 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
1814 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
1815 .fi
1816 .if n \{\
1817 .RE
1818 .\}
1819 .sp
1820 .if n \{\
1821 .RS 4
1822 .\}
1823 .nf
1824 \fBId lookup_id(Id\fR \fIkeyname\fR\fB)\fR
1825 my \fI$id\fR \fB=\fR \fI$solvable\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
1826 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB)\fR
1827 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB)\fR
1828 .fi
1829 .if n \{\
1830 .RE
1831 .\}
1832 .sp
1833 .if n \{\
1834 .RS 4
1835 .\}
1836 .nf
1837 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
1838 my \fI$num\fR \fB=\fR \fI$solvable\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
1839 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
1840 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
1841 .fi
1842 .if n \{\
1843 .RE
1844 .\}
1845 .sp
1846 .if n \{\
1847 .RS 4
1848 .\}
1849 .nf
1850 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
1851 my \fI$bool\fR \fB=\fR \fI$solvable\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
1852 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
1853 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
1854 .fi
1855 .if n \{\
1856 .RE
1857 .\}
1858 .sp
1859 .if n \{\
1860 .RS 4
1861 .\}
1862 .nf
1863 \fBChksum *lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
1864 my \fI$chksum\fR \fB=\fR \fI$solvable\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
1865 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
1866 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
1867 .fi
1868 .if n \{\
1869 .RE
1870 .\}
1871 .sp
1872 .if n \{\
1873 .RS 4
1874 .\}
1875 .nf
1876 \fBQueue lookup_idarray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1877 my \fI@ids\fR \fB=\fR \fI$solvable\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
1878 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
1879 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
1880 .fi
1881 .if n \{\
1882 .RE
1883 .\}
1884 .sp
1885 .if n \{\
1886 .RS 4
1887 .\}
1888 .nf
1889 \fBQueue lookup_deparray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1890 my \fI@deps\fR \fB=\fR \fI$solvable\fR\fB\->lookup_deparray(\fR\fI$keyname\fR\fB)\fR;
1891 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
1892 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
1893 .fi
1894 .if n \{\
1895 .RE
1896 .\}
1897 .sp
1898 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\&.
1899 .sp
1900 .if n \{\
1901 .RS 4
1902 .\}
1903 .nf
1904 \fBconst char *lookup_location(unsigned int *\fR\fIOUTPUT\fR\fB)\fR;
1905 my \fB(\fR\fI$location\fR\fB,\fR \fI$medianr\fR\fB) =\fR \fI$solvable\fR\fB\->lookup_location()\fR;
1906 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
1907 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
1908 .fi
1909 .if n \{\
1910 .RE
1911 .\}
1912 .sp
1913 Return a tuple containing the on\-media location and an optional media number for multi\-part repositories (e\&.g\&. repositories spawning multiple DVDs)\&.
1914 .sp
1915 .if n \{\
1916 .RS 4
1917 .\}
1918 .nf
1919 \fBvoid add_deparray(Id\fR \fIkeyname\fR\fB, DepId\fR \fIdep\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR;
1920 \fI$solvable\fR\fB\->add_deparray(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR;
1921 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
1922 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
1923 .fi
1924 .if n \{\
1925 .RE
1926 .\}
1927 .sp
1928 Add a new dependency to the attributes stored in keyname\&.
1929 .sp
1930 .if n \{\
1931 .RS 4
1932 .\}
1933 .nf
1934 \fBbool installable()\fR;
1935 \fI$solvable\fR\fB\->installable()\fR
1936 \fIsolvable\fR\fB\&.installable()\fR
1937 \fIsolvable\fR\fB\&.installable?\fR
1938 .fi
1939 .if n \{\
1940 .RE
1941 .\}
1942 .sp
1943 Return true if the solvable is installable on the system\&. Solvables are not installable if the system does not support their architecture\&.
1944 .sp
1945 .if n \{\
1946 .RS 4
1947 .\}
1948 .nf
1949 \fBbool isinstalled()\fR;
1950 \fI$solvable\fR\fB\->isinstalled()\fR
1951 \fIsolvable\fR\fB\&.isinstalled()\fR
1952 \fIsolvable\fR\fB\&.isinstalled?\fR
1953 .fi
1954 .if n \{\
1955 .RE
1956 .\}
1957 .sp
1958 Return true if the solvable is installed on the system\&.
1959 .sp
1960 .if n \{\
1961 .RS 4
1962 .\}
1963 .nf
1964 \fBSelection *Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1965 my \fI$sel\fR \fB=\fR \fI$solvable\fR\fB\->Selection()\fR;
1966 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
1967 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
1968 .fi
1969 .if n \{\
1970 .RE
1971 .\}
1972 .sp
1973 Create a Selection containing just the single solvable\&.
1974 .sp
1975 .if n \{\
1976 .RS 4
1977 .\}
1978 .nf
1979 \fBconst char *str()\fR
1980 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str()\fR;
1981 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
1982 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
1983 .fi
1984 .if n \{\
1985 .RE
1986 .\}
1987 .sp
1988 Return a string describing the solvable\&. The string consists of the name, version, and architecture of the Solvable\&.
1989 .sp
1990 .if n \{\
1991 .RS 4
1992 .\}
1993 .nf
1994 \fB<stringification>\fR
1995 my \fI$str\fR \fB= "\fR\fI$solvable\fR\fB"\fR;
1996 \fIstr\fR \fB= str(\fR\fIsolvable\fR\fB)\fR
1997 \fIstr\fR \fB=\fR \fIsolvable\fR\fB\&.to_s\fR
1998 .fi
1999 .if n \{\
2000 .RE
2001 .\}
2002 .sp
2003 Same as calling the str() method\&.
2004 .sp
2005 .if n \{\
2006 .RS 4
2007 .\}
2008 .nf
2009 \fB<equality>\fR
2010 \fBif (\fR\fI$solvable1\fR \fB==\fR \fI$solvable2\fR\fB)\fR
2011 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR\fB:\fR
2012 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR
2013 .fi
2014 .if n \{\
2015 .RE
2016 .\}
2017 .sp
2018 Two solvables are equal if they are part of the same pool and have the same ids\&.
2019 .SH "THE DATAITERATOR CLASS"
2020 .sp
2021 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\&.
2022 .SS "CONSTANTS"
2023 .PP
2024 \fBSEARCH_STRING\fR
2025 .RS 4
2026 Return a match if the search string matches the value\&.
2027 .RE
2028 .PP
2029 \fBSEARCH_STRINGSTART\fR
2030 .RS 4
2031 Return a match if the value starts with the search string\&.
2032 .RE
2033 .PP
2034 \fBSEARCH_STRINGEND\fR
2035 .RS 4
2036 Return a match if the value ends with the search string\&.
2037 .RE
2038 .PP
2039 \fBSEARCH_SUBSTRING\fR
2040 .RS 4
2041 Return a match if the search string can be matched somewhere in the value\&.
2042 .RE
2043 .PP
2044 \fBSEARCH_GLOB\fR
2045 .RS 4
2046 Do a glob match of the search string against the value\&.
2047 .RE
2048 .PP
2049 \fBSEARCH_REGEX\fR
2050 .RS 4
2051 Do a regular expression match of the search string against the value\&.
2052 .RE
2053 .PP
2054 \fBSEARCH_NOCASE\fR
2055 .RS 4
2056 Ignore case when matching strings\&. Works for all the above match types\&.
2057 .RE
2058 .PP
2059 \fBSEARCH_FILES\fR
2060 .RS 4
2061 Match the complete filenames of the file list, not just the base name\&.
2062 .RE
2063 .PP
2064 \fBSEARCH_COMPLETE_FILELIST\fR
2065 .RS 4
2066 When matching the file list, check every file of the package not just the subset from the primary metadata\&.
2067 .RE
2068 .PP
2069 \fBSEARCH_CHECKSUMS\fR
2070 .RS 4
2071 Allow the matching of checksum entries\&.
2072 .RE
2073 .SS "METHODS"
2074 .sp
2075 .if n \{\
2076 .RS 4
2077 .\}
2078 .nf
2079 \fBvoid prepend_keyname(Id\fR \fIkeyname\fR\fB)\fR;
2080 \fI$di\fR\fB\->prepend_keyname(\fR\fI$keyname\fR\fB)\fR;
2081 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2082 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2083 .fi
2084 .if n \{\
2085 .RE
2086 .\}
2087 .sp
2088 Do a sub\-search in the array stored in keyname\&.
2089 .sp
2090 .if n \{\
2091 .RS 4
2092 .\}
2093 .nf
2094 \fBvoid skip_solvable()\fR;
2095 \fI$di\fR\fB\->kip_solvable()\fR;
2096 \fIdi\fR\fB\&.skip_solvable()\fR
2097 \fIdi\fR\fB\&.skip_solvable()\fR
2098 .fi
2099 .if n \{\
2100 .RE
2101 .\}
2102 .sp
2103 Stop matching the current solvable and advance to the next one\&.
2104 .sp
2105 .if n \{\
2106 .RS 4
2107 .\}
2108 .nf
2109 \fB<iteration>\fR
2110 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2111 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2112 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2113 .fi
2114 .if n \{\
2115 .RE
2116 .\}
2117 .sp
2118 Iterate through the matches\&. If there is a match, the object in d will be of type Datamatch\&.
2119 .SH "THE DATAMATCH CLASS"
2120 .sp
2121 Objects of this type will be created for every value matched by a dataiterator\&.
2122 .SS "ATTRIBUTES"
2123 .sp
2124 .if n \{\
2125 .RS 4
2126 .\}
2127 .nf
2128 \fBPool *pool;\fR                             /* read only */
2129 \fI$d\fR\fB\->{\*(Aqpool\*(Aq}\fR
2130 \fId\fR\fB\&.pool\fR
2131 \fId\fR\fB\&.pool\fR
2132 .fi
2133 .if n \{\
2134 .RE
2135 .\}
2136 .sp
2137 Back pointer to pool\&.
2138 .sp
2139 .if n \{\
2140 .RS 4
2141 .\}
2142 .nf
2143 \fBRepo *repo;\fR                             /* read only */
2144 \fI$d\fR\fB\->{\*(Aqrepo\*(Aq}\fR
2145 \fId\fR\fB\&.repo\fR
2146 \fId\fR\fB\&.repo\fR
2147 .fi
2148 .if n \{\
2149 .RE
2150 .\}
2151 .sp
2152 The repository containing the matched object\&.
2153 .sp
2154 .if n \{\
2155 .RS 4
2156 .\}
2157 .nf
2158 \fBSolvable *solvable;\fR                     /* read only */
2159 \fI$d\fR\fB\->{\*(Aqsolvable\*(Aq}\fR
2160 \fId\fR\fB\&.solvable\fR
2161 \fId\fR\fB\&.solvable\fR
2162 .fi
2163 .if n \{\
2164 .RE
2165 .\}
2166 .sp
2167 The solvable containing the value that was matched\&.
2168 .sp
2169 .if n \{\
2170 .RS 4
2171 .\}
2172 .nf
2173 \fBId solvid;\fR                              /* read only */
2174 \fI$d\fR\fB\->{\*(Aqsolvid\*(Aq}\fR
2175 \fId\fR\fB\&.solvid\fR
2176 \fId\fR\fB\&.solvid\fR
2177 .fi
2178 .if n \{\
2179 .RE
2180 .\}
2181 .sp
2182 The id of the solvable that matched\&.
2183 .SS "METHODS"
2184 .sp
2185 .if n \{\
2186 .RS 4
2187 .\}
2188 .nf
2189 \fBId key_id()\fR;
2190 \fI$d\fR\fB\->key_id()\fR
2191 \fId\fR\fB\&.key_id()\fR
2192 \fId\fR\fB\&.key_id()\fR
2193 .fi
2194 .if n \{\
2195 .RE
2196 .\}
2197 .sp
2198 .if n \{\
2199 .RS 4
2200 .\}
2201 .nf
2202 \fBconst char *key_idstr()\fR;
2203 \fI$d\fR\fB\->key_idstr()\fR
2204 \fId\fR\fB\&.key_idstr()\fR
2205 \fId\fR\fB\&.key_idstr()\fR
2206 .fi
2207 .if n \{\
2208 .RE
2209 .\}
2210 .sp
2211 The keyname that matched, either as id or string\&.
2212 .sp
2213 .if n \{\
2214 .RS 4
2215 .\}
2216 .nf
2217 \fBId type_id()\fR;
2218 \fI$d\fR\fB\->type_id()\fR
2219 \fId\fR\fB\&.type_id()\fR
2220 \fId\fR\fB\&.type_id()\fR
2221 .fi
2222 .if n \{\
2223 .RE
2224 .\}
2225 .sp
2226 .if n \{\
2227 .RS 4
2228 .\}
2229 .nf
2230 \fBconst char *type_idstr()\fR;
2231 \fI$d\fR\fB\->type_idstr()\fR;
2232 \fId\fR\fB\&.type_idstr()\fR
2233 \fId\fR\fB\&.type_idstr()\fR
2234 .fi
2235 .if n \{\
2236 .RE
2237 .\}
2238 .sp
2239 The key type of the value that was matched, either as id or string\&.
2240 .sp
2241 .if n \{\
2242 .RS 4
2243 .\}
2244 .nf
2245 \fBId id()\fR;
2246 \fI$d\fR\fB\->id()\fR
2247 \fId\fR\fB\&.id()\fR
2248 \fId\fR\fB\&.id()\fR
2249 .fi
2250 .if n \{\
2251 .RE
2252 .\}
2253 .sp
2254 .if n \{\
2255 .RS 4
2256 .\}
2257 .nf
2258 \fBId idstr()\fR;
2259 \fI$d\fR\fB\->idstr()\fR
2260 \fId\fR\fB\&.idstr()\fR
2261 \fId\fR\fB\&.idstr()\fR
2262 .fi
2263 .if n \{\
2264 .RE
2265 .\}
2266 .sp
2267 The Id of the value that was matched (only valid for id types), either as id or string\&.
2268 .sp
2269 .if n \{\
2270 .RS 4
2271 .\}
2272 .nf
2273 \fBconst char *str()\fR;
2274 \fI$d\fR\fB\->str()\fR
2275 \fId\fR\fB\&.str()\fR
2276 \fId\fR\fB\&.str()\fR
2277 .fi
2278 .if n \{\
2279 .RE
2280 .\}
2281 .sp
2282 The string value that was matched (only valid for string types)\&.
2283 .sp
2284 .if n \{\
2285 .RS 4
2286 .\}
2287 .nf
2288 \fBunsigned long long num()\fR;
2289 \fI$d\fR\fB\->num()\fR
2290 \fId\fR\fB\&.num()\fR
2291 \fId\fR\fB\&.num()\fR
2292 .fi
2293 .if n \{\
2294 .RE
2295 .\}
2296 .sp
2297 The numeric value that was matched (only valid for numeric types)\&.
2298 .sp
2299 .if n \{\
2300 .RS 4
2301 .\}
2302 .nf
2303 \fBunsigned int num2()\fR;
2304 \fI$d\fR\fB\->num2()\fR
2305 \fId\fR\fB\&.num2()\fR
2306 \fId\fR\fB\&.num2()\fR
2307 .fi
2308 .if n \{\
2309 .RE
2310 .\}
2311 .sp
2312 The secondary numeric value that was matched (only valid for types containing two values)\&.
2313 .sp
2314 .if n \{\
2315 .RS 4
2316 .\}
2317 .nf
2318 \fBDatapos *pos()\fR;
2319 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->pos()\fR;
2320 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
2321 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
2322 .fi
2323 .if n \{\
2324 .RE
2325 .\}
2326 .sp
2327 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\&.
2328 .sp
2329 .if n \{\
2330 .RS 4
2331 .\}
2332 .nf
2333 \fBDatapos *parentpos()\fR;
2334 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->parentpos()\fR;
2335 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
2336 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
2337 .fi
2338 .if n \{\
2339 .RE
2340 .\}
2341 .sp
2342 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\&.
2343 .sp
2344 .if n \{\
2345 .RS 4
2346 .\}
2347 .nf
2348 \fB<stringification>\fR
2349 my \fI$str\fR \fB= "\fR\fI$d\fR\fB"\fR;
2350 \fIstr\fR \fB= str(\fR\fId\fR\fB)\fR
2351 \fIstr\fR \fB=\fR \fId\fR\fB\&.to_s\fR
2352 .fi
2353 .if n \{\
2354 .RE
2355 .\}
2356 .sp
2357 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\&.
2358 .SH "THE SELECTION CLASS"
2359 .sp
2360 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\&.
2361 .SS "CONSTANTS"
2362 .PP
2363 \fBSELECTION_NAME\fR
2364 .RS 4
2365 Create the selection by matching package names
2366 .RE
2367 .PP
2368 \fBSELECTION_PROVIDES\fR
2369 .RS 4
2370 Create the selection by matching package provides
2371 .RE
2372 .PP
2373 \fBSELECTION_FILELIST\fR
2374 .RS 4
2375 Create the selection by matching package files
2376 .RE
2377 .PP
2378 \fBSELECTION_CANON\fR
2379 .RS 4
2380 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\&.
2381 .RE
2382 .PP
2383 \fBSELECTION_DOTARCH\fR
2384 .RS 4
2385 Allow an \(lq\&.<architecture>\(rq suffix when matching names or provides\&.
2386 .RE
2387 .PP
2388 \fBSELECTION_REL\fR
2389 .RS 4
2390 Allow the specification of a relation when matching names or provides, e\&.g\&. "name >= 1\&.2"\&.
2391 .RE
2392 .PP
2393 \fBSELECTION_INSTALLED_ONLY\fR
2394 .RS 4
2395 Limit the package search to installed packages\&.
2396 .RE
2397 .PP
2398 \fBSELECTION_SOURCE_ONLY\fR
2399 .RS 4
2400 Limit the package search to source packages only\&.
2401 .RE
2402 .PP
2403 \fBSELECTION_WITH_SOURCE\fR
2404 .RS 4
2405 Extend the package search to also match source packages\&. The default is only to match binary packages\&.
2406 .RE
2407 .PP
2408 \fBSELECTION_GLOB\fR
2409 .RS 4
2410 Allow glob matching for package names, package provides, and file names\&.
2411 .RE
2412 .PP
2413 \fBSELECTION_NOCASE\fR
2414 .RS 4
2415 Ignore case when matching package names, package provides, and file names\&.
2416 .RE
2417 .PP
2418 \fBSELECTION_FLAT\fR
2419 .RS 4
2420 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\&.
2421 .RE
2422 .SS "ATTRIBUTES"
2423 .sp
2424 .if n \{\
2425 .RS 4
2426 .\}
2427 .nf
2428 \fBPool *pool;\fR                             /* read only */
2429 \fI$d\fR\fB\->{\*(Aqpool\*(Aq}\fR
2430 \fId\fR\fB\&.pool\fR
2431 \fId\fR\fB\&.pool\fR
2432 .fi
2433 .if n \{\
2434 .RE
2435 .\}
2436 .sp
2437 Back pointer to pool\&.
2438 .SS "METHODS"
2439 .sp
2440 .if n \{\
2441 .RS 4
2442 .\}
2443 .nf
2444 \fBint flags()\fR;
2445 my \fI$flags\fR \fB=\fR \fI$sel\fR\fB\->flags()\fR;
2446 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
2447 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
2448 .fi
2449 .if n \{\
2450 .RE
2451 .\}
2452 .sp
2453 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\&.
2454 .sp
2455 .if n \{\
2456 .RS 4
2457 .\}
2458 .nf
2459 \fBbool isempty()\fR;
2460 \fI$sel\fR\fB\->isempty()\fR
2461 \fIsel\fR\fB\&.isempty()\fR
2462 \fIsel\fR\fB\&.isempty?\fR
2463 .fi
2464 .if n \{\
2465 .RE
2466 .\}
2467 .sp
2468 Return true if the selection is empty, i\&.e\&. no package could be matched\&.
2469 .sp
2470 .if n \{\
2471 .RS 4
2472 .\}
2473 .nf
2474 \fBvoid filter(Selection *\fR\fIother\fR\fB)\fR
2475 \fI$sel\fR\fB\->filter(\fR\fI$other\fR\fB)\fR;
2476 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
2477 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
2478 .fi
2479 .if n \{\
2480 .RE
2481 .\}
2482 .sp
2483 Intersect two selections\&. Packages will only stay in the selection if there are also included in the other selecting\&. Does an in\-place modification\&.
2484 .sp
2485 .if n \{\
2486 .RS 4
2487 .\}
2488 .nf
2489 \fBvoid add(Selection *\fR\fIother\fR\fB)\fR
2490 \fI$sel\fR\fB\->add(\fR\fI$other\fR\fB)\fR;
2491 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
2492 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
2493 .fi
2494 .if n \{\
2495 .RE
2496 .\}
2497 .sp
2498 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\&.
2499 .sp
2500 .if n \{\
2501 .RS 4
2502 .\}
2503 .nf
2504 \fBvoid add_raw(Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
2505 \fI$sel\fR\fB\->add_raw(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
2506 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
2507 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
2508 .fi
2509 .if n \{\
2510 .RE
2511 .\}
2512 .sp
2513 Add a raw element to the selection\&. Check the Job class for information about the how and what parameters\&.
2514 .sp
2515 .if n \{\
2516 .RS 4
2517 .\}
2518 .nf
2519 \fBJob **jobs(int\fR \fIaction\fR\fB)\fR
2520 my \fI@jobs\fR \fB=\fR \fI$sel\fR\fB\->jobs(\fR\fI$action\fR\fB)\fR;
2521 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
2522 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
2523 .fi
2524 .if n \{\
2525 .RE
2526 .\}
2527 .sp
2528 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\&.
2529 .sp
2530 .if n \{\
2531 .RS 4
2532 .\}
2533 .nf
2534 \fBSolvable **solvables()\fR
2535 my \fI@solvables\fR \fB=\fR \fI$sel\fR\fB\->solvables()\fR;
2536 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
2537 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
2538 .fi
2539 .if n \{\
2540 .RE
2541 .\}
2542 .sp
2543 Convert a selection into an array of Solvable objects\&.
2544 .sp
2545 .if n \{\
2546 .RS 4
2547 .\}
2548 .nf
2549 \fB<stringification>\fR
2550 my \fI$str\fR \fB= "\fR\fI$sel\fR\fB"\fR;
2551 \fIstr\fR \fB= str(\fR\fIsel\fR\fB)\fR
2552 \fIstr\fR \fB=\fR \fIsel\fR\fB\&.to_s\fR
2553 .fi
2554 .if n \{\
2555 .RE
2556 .\}
2557 .sp
2558 Return a string describing the selection\&.
2559 .SH "THE JOB CLASS"
2560 .sp
2561 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\&.
2562 .SS "CONSTANTS"
2563 .sp
2564 Selection constants:
2565 .PP
2566 \fBSOLVER_SOLVABLE\fR
2567 .RS 4
2568 The \(lqwhat\(rq part is the id of a solvable\&.
2569 .RE
2570 .PP
2571 \fBSOLVER_SOLVABLE_NAME\fR
2572 .RS 4
2573 The \(lqwhat\(rq part is the id of a package name\&.
2574 .RE
2575 .PP
2576 \fBSOLVER_SOLVABLE_PROVIDES\fR
2577 .RS 4
2578 The \(lqwhat\(rq part is the id of a package provides\&.
2579 .RE
2580 .PP
2581 \fBSOLVER_SOLVABLE_ONE_OF\fR
2582 .RS 4
2583 The \(lqwhat\(rq part is an offset into the \(lqwhatprovides\(rq data, created by calling the towhatprovides() pool method\&.
2584 .RE
2585 .PP
2586 \fBSOLVER_SOLVABLE_REPO\fR
2587 .RS 4
2588 The \(lqwhat\(rq part is the id of a repository\&.
2589 .RE
2590 .PP
2591 \fBSOLVER_SOLVABLE_ALL\fR
2592 .RS 4
2593 The \(lqwhat\(rq part is ignored, all packages are selected\&.
2594 .RE
2595 .PP
2596 \fBSOLVER_SOLVABLE_SELECTMASK\fR
2597 .RS 4
2598 A mask containing all the above selection bits\&.
2599 .RE
2600 .sp
2601 Action constants:
2602 .PP
2603 \fBSOLVER_NOOP\fR
2604 .RS 4
2605 Do nothing\&.
2606 .RE
2607 .PP
2608 \fBSOLVER_INSTALL\fR
2609 .RS 4
2610 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)\&.
2611 .RE
2612 .PP
2613 \fBSOLVER_ERASE\fR
2614 .RS 4
2615 Erase all of the packages from the specified set\&. If a package is not installed, erasing it will keep it from getting installed\&.
2616 .RE
2617 .PP
2618 \fBSOLVER_UPDATE\fR
2619 .RS 4
2620 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\&.
2621 .RE
2622 .PP
2623 \fBSOLVER_WEAKENDEPS\fR
2624 .RS 4
2625 Allow to break the dependencies of the matching packages\&. Handle with care\&.
2626 .RE
2627 .PP
2628 \fBSOLVER_MULTIVERSION\fR
2629 .RS 4
2630 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)\&.
2631 .RE
2632 .PP
2633 \fBSOLVER_LOCK\fR
2634 .RS 4
2635 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\&.
2636 .RE
2637 .PP
2638 \fBSOLVER_DISTUPGRADE\fR
2639 .RS 4
2640 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\&.
2641 .RE
2642 .PP
2643 \fBSOLVER_DROP_ORPHANED\fR
2644 .RS 4
2645 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\&.
2646 .RE
2647 .PP
2648 \fBSOLVER_VERIFY\fR
2649 .RS 4
2650 Fix dependency problems of matching installed packages\&. The default is to ignore dependency problems for installed packages\&.
2651 .RE
2652 .PP
2653 \fBSOLVER_USERINSTALLED\fR
2654 .RS 4
2655 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\&.
2656 .RE
2657 .PP
2658 \fBSOLVER_JOBMASK\fR
2659 .RS 4
2660 A mask containing all the above action bits\&.
2661 .RE
2662 .sp
2663 Action modifier constants:
2664 .PP
2665 \fBSOLVER_WEAK\fR
2666 .RS 4
2667 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\&.
2668 .RE
2669 .PP
2670 \fBSOLVER_ESSENTIAL\fR
2671 .RS 4
2672 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)\&.
2673 .RE
2674 .PP
2675 \fBSOLVER_CLEANDEPS\fR
2676 .RS 4
2677 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\&.
2678 .RE
2679 .PP
2680 \fBSOLVER_FORCEBEST\fR
2681 .RS 4
2682 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\&.
2683 .RE
2684 .PP
2685 \fBSOLVER_TARGETED\fR
2686 .RS 4
2687 Forces targeted operation update and distupgrade jobs\&. See the section about targeted updates about more information\&.
2688 .RE
2689 .sp
2690 Set constants\&.
2691 .PP
2692 \fBSOLVER_SETEV\fR
2693 .RS 4
2694 The job specified the exact epoch and version of the package set\&.
2695 .RE
2696 .PP
2697 \fBSOLVER_SETEVR\fR
2698 .RS 4
2699 The job specified the exact epoch, version, and release of the package set\&.
2700 .RE
2701 .PP
2702 \fBSOLVER_SETARCH\fR
2703 .RS 4
2704 The job specified the exact architecture of the packages from the set\&.
2705 .RE
2706 .PP
2707 \fBSOLVER_SETVENDOR\fR
2708 .RS 4
2709 The job specified the exact vendor of the packages from the set\&.
2710 .RE
2711 .PP
2712 \fBSOLVER_SETREPO\fR
2713 .RS 4
2714 The job specified the exact repository of the packages from the set\&.
2715 .RE
2716 .PP
2717 \fBSOLVER_SETNAME\fR
2718 .RS 4
2719 The job specified the exact name of the packages from the set\&.
2720 .RE
2721 .PP
2722 \fBSOLVER_NOAUTOSET\fR
2723 .RS 4
2724 Turn of automatic set flag generation for SOLVER_SOLVABLE jobs\&.
2725 .RE
2726 .PP
2727 \fBSOLVER_SETMASK\fR
2728 .RS 4
2729 A mask containing all the above set bits\&.
2730 .RE
2731 .sp
2732 See the section about set bits for more information\&.
2733 .SS "ATTRIBUTES"
2734 .sp
2735 .if n \{\
2736 .RS 4
2737 .\}
2738 .nf
2739 \fBPool *pool;\fR                             /* read only */
2740 \fI$job\fR\fB\->{\*(Aqpool\*(Aq}\fR
2741 \fId\fR\fB\&.pool\fR
2742 \fId\fR\fB\&.pool\fR
2743 .fi
2744 .if n \{\
2745 .RE
2746 .\}
2747 .sp
2748 Back pointer to pool\&.
2749 .sp
2750 .if n \{\
2751 .RS 4
2752 .\}
2753 .nf
2754 \fBId how;\fR                                 /* read/write */
2755 \fI$job\fR\fB\->{\*(Aqhow\*(Aq}\fR
2756 \fId\fR\fB\&.how\fR
2757 \fId\fR\fB\&.how\fR
2758 .fi
2759 .if n \{\
2760 .RE
2761 .\}
2762 .sp
2763 Union of the selection, action, action modifier, and set flags\&. The selection part describes the semantics of the \(lqwhat\(rq Id\&.
2764 .sp
2765 .if n \{\
2766 .RS 4
2767 .\}
2768 .nf
2769 \fBId what;\fR                                /* read/write */
2770 \fI$job\fR\fB\->{\*(Aqwhat\*(Aq}\fR
2771 \fId\fR\fB\&.what\fR
2772 \fId\fR\fB\&.what\fR
2773 .fi
2774 .if n \{\
2775 .RE
2776 .\}
2777 .sp
2778 Id describing the set of packages, the meaning depends on the selection part of the \(lqhow\(rq attribute\&.
2779 .SS "METHODS"
2780 .sp
2781 .if n \{\
2782 .RS 4
2783 .\}
2784 .nf
2785 \fBSolvable **solvables()\fR
2786 my \fI@solvables\fR \fB=\fR \fI$job\fR\fB\->solvables()\fR;
2787 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
2788 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
2789 .fi
2790 .if n \{\
2791 .RE
2792 .\}
2793 .sp
2794 Return the set of solvables of the job as an array of Solvable objects\&.
2795 .sp
2796 .if n \{\
2797 .RS 4
2798 .\}
2799 .nf
2800 \fBbool isemptyupdate()\fR;
2801 \fI$job\fR\fB\->isemptyupdate()\fR
2802 \fIjob\fR\fB\&.isemptyupdate()\fR
2803 \fIjob\fR\fB\&.isemptyupdate?\fR
2804 .fi
2805 .if n \{\
2806 .RE
2807 .\}
2808 .sp
2809 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\&.
2810 .sp
2811 .if n \{\
2812 .RS 4
2813 .\}
2814 .nf
2815 \fB<stringification>\fR
2816 my \fI$str\fR \fB= "\fR\fI$job\fR\fB"\fR;
2817 \fIstr\fR \fB= str(\fR\fIjob\fR\fB)\fR
2818 \fIstr\fR \fB=\fR \fIjob\fR\fB\&.to_s\fR
2819 .fi
2820 .if n \{\
2821 .RE
2822 .\}
2823 .sp
2824 Return a string describing the job\&.
2825 .sp
2826 .if n \{\
2827 .RS 4
2828 .\}
2829 .nf
2830 \fB<equality>\fR
2831 \fBif (\fR\fI$job1\fR \fB==\fR \fI$job2\fR\fB)\fR
2832 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR\fB:\fR
2833 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR
2834 .fi
2835 .if n \{\
2836 .RE
2837 .\}
2838 .sp
2839 Two jobs are equal if they belong to the same pool and both the \(lqhow\(rq and the \(lqwhat\(rq attributes are the same\&.
2840 .SS "TARGETED UPDATES"
2841 .sp
2842 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\&.
2843 .sp
2844 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\&.
2845 .sp
2846 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)\&.
2847 .sp
2848 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\&.
2849 .sp
2850 An untargeted update of "B" will do nothing, as "B" is not installed\&.
2851 .sp
2852 An targeted update of "B" will update "A\-1\&.1" to "B"\&.
2853 .sp
2854 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\&.
2855 .sp
2856 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\&.
2857 .sp
2858 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\&.
2859 .SS "SET BITS"
2860 .sp
2861 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\&.
2862 .sp
2863 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\&.
2864 .SH "THE SOLVER CLASS"
2865 .SS "CONSTANTS"
2866 .sp
2867 Flags to modify some of the solver\(cqs behaviour:
2868 .PP
2869 \fBSOLVER_FLAG_ALLOW_DOWNGRADE\fR
2870 .RS 4
2871 Allow the solver to downgrade packages without asking for confirmation (i\&.e\&. reporting a problem)\&.
2872 .RE
2873 .PP
2874 \fBSOLVER_FLAG_ALLOW_ARCHCHANGE\fR
2875 .RS 4
2876 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\&.
2877 .RE
2878 .PP
2879 \fBSOLVER_FLAG_ALLOW_VENDORCHANGE\fR
2880 .RS 4
2881 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\&.
2882 .RE
2883 .PP
2884 \fBSOLVER_FLAG_ALLOW_NAMECHANGE\fR
2885 .RS 4
2886 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\&.
2887 .RE
2888 .PP
2889 \fBSOLVER_FLAG_ALLOW_UNINSTALL\fR
2890 .RS 4
2891 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\&.
2892 .RE
2893 .PP
2894 \fBSOLVER_FLAG_NO_UPDATEPROVIDE\fR
2895 .RS 4
2896 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\&.
2897 .RE
2898 .PP
2899 \fBSOLVER_FLAG_SPLITPROVIDES\fR
2900 .RS 4
2901 Make the solver aware of special provides of the form \(lq<packagename>:<path>\(rq used in SUSE systems to support package splits\&.
2902 .RE
2903 .PP
2904 \fBSOLVER_FLAG_IGNORE_RECOMMENDED\fR
2905 .RS 4
2906 Do not process optional (aka weak) dependencies\&.
2907 .RE
2908 .PP
2909 \fBSOLVER_FLAG_ADD_ALREADY_RECOMMENDED\fR
2910 .RS 4
2911 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\&.
2912 .RE
2913 .PP
2914 \fBSOLVER_FLAG_NO_INFARCHCHECK\fR
2915 .RS 4
2916 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\&.
2917 .RE
2918 .PP
2919 \fBSOLVER_FLAG_BEST_OBEY_POLICY\fR
2920 .RS 4
2921 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\&.
2922 .RE
2923 .PP
2924 \fBSOLVER_FLAG_NO_AUTOTARGET\fR
2925 .RS 4
2926 Do not enable auto\-targeting up update and distupgrade jobs\&. See the section on targeted updates for more information\&.
2927 .RE
2928 .sp
2929 Basic rule types:
2930 .PP
2931 \fBSOLVER_RULE_UNKNOWN\fR
2932 .RS 4
2933 A rule of an unknown class\&. You should never encounter those\&.
2934 .RE
2935 .PP
2936 \fBSOLVER_RULE_RPM\fR
2937 .RS 4
2938 A package dependency rule, called rpm rule for historical reasons\&.
2939 .RE
2940 .PP
2941 \fBSOLVER_RULE_UPDATE\fR
2942 .RS 4
2943 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\&.
2944 .RE
2945 .PP
2946 \fBSOLVER_RULE_FEATURE\fR
2947 .RS 4
2948 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\&.
2949 .RE
2950 .PP
2951 \fBSOLVER_RULE_JOB\fR
2952 .RS 4
2953 Job rules implement the job given to the solver\&.
2954 .RE
2955 .PP
2956 \fBSOLVER_RULE_DISTUPGRADE\fR
2957 .RS 4
2958 This are simple negative assertions that make sure that only packages are kept that are also available in one of the repositories\&.
2959 .RE
2960 .PP
2961 \fBSOLVER_RULE_INFARCH\fR
2962 .RS 4
2963 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\&.
2964 .RE
2965 .PP
2966 \fBSOLVER_RULE_CHOICE\fR
2967 .RS 4
2968 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\&.
2969 .RE
2970 .PP
2971 \fBSOLVER_RULE_LEARNT\fR
2972 .RS 4
2973 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\&.
2974 .RE
2975 .sp
2976 Special dependency rule types:
2977 .PP
2978 \fBSOLVER_RULE_RPM_NOT_INSTALLABLE\fR
2979 .RS 4
2980 This rule was added to prevent the installation of a package of an architecture that does not work on the system\&.
2981 .RE
2982 .PP
2983 \fBSOLVER_RULE_RPM_NOTHING_PROVIDES_DEP\fR
2984 .RS 4
2985 The package contanis a required dependency which was not provided by any package\&.
2986 .RE
2987 .PP
2988 \fBSOLVER_RULE_RPM_PACKAGE_REQUIRES\fR
2989 .RS 4
2990 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\&.
2991 .RE
2992 .PP
2993 \fBSOLVER_RULE_RPM_SELF_CONFLICT\fR
2994 .RS 4
2995 The package conflicts with itself\&. This is not allowed by older rpm versions\&.
2996 .RE
2997 .PP
2998 \fBSOLVER_RULE_RPM_PACKAGE_CONFLICT\fR
2999 .RS 4
3000 To fulfill the dependencies two packages need to be installed, but one of the packages contains a conflict with the other one\&.
3001 .RE
3002 .PP
3003 \fBSOLVER_RULE_RPM_SAME_NAME\fR
3004 .RS 4
3005 The dependencies can only be fulfilled by multiple versions of a package, but installing multiple versions of the same package is not allowed\&.
3006 .RE
3007 .PP
3008 \fBSOLVER_RULE_RPM_PACKAGE_OBSOLETES\fR
3009 .RS 4
3010 To fulfill the dependencies two packages need to be installed, but one of the packages obsoletes the other one\&.
3011 .RE
3012 .PP
3013 \fBSOLVER_RULE_RPM_IMPLICIT_OBSOLETES\fR
3014 .RS 4
3015 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\&.
3016 .RE
3017 .PP
3018 \fBSOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES\fR
3019 .RS 4
3020 To fulfill the dependencies a package needs to be installed that is obsoleted by an installed package\&. See the POOL_FLAG_NOINSTALLEDOBSOLETES flag\&.
3021 .RE
3022 .PP
3023 \fBSOLVER_RULE_JOB_NOTHING_PROVIDES_DEP\fR
3024 .RS 4
3025 The user asked for installation of a package providing a specific dependency, but no available package provides it\&.
3026 .RE
3027 .PP
3028 \fBSOLVER_RULE_JOB_UNKNOWN_PACKAGE\fR
3029 .RS 4
3030 The user asked for installation of a package with a specific name, but no available package has that name\&.
3031 .RE
3032 .PP
3033 \fBSOLVER_RULE_JOB_PROVIDED_BY_SYSTEM\fR
3034 .RS 4
3035 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\&.
3036 .RE
3037 .PP
3038 \fBSOLVER_RULE_JOB_UNSUPPORTED\fR
3039 .RS 4
3040 The user asked for something that is not yet implemented, e\&.g\&. the installation of all packages at once\&.
3041 .RE
3042 .sp
3043 Policy error constants
3044 .PP
3045 \fBPOLICY_ILLEGAL_DOWNGRADE\fR
3046 .RS 4
3047 The solver ask for permission before downgrading packages\&.
3048 .RE
3049 .PP
3050 \fBPOLICY_ILLEGAL_ARCHCHANGE\fR
3051 .RS 4
3052 The solver ask for permission before changing the architecture of installed packages\&.
3053 .RE
3054 .PP
3055 \fBPOLICY_ILLEGAL_VENDORCHANGE\fR
3056 .RS 4
3057 The solver ask for permission before changing the vendor of installed packages\&.
3058 .RE
3059 .PP
3060 \fBPOLICY_ILLEGAL_NAMECHANGE\fR
3061 .RS 4
3062 The solver ask for permission before replacing an installed packages with a packge that has a different name\&.
3063 .RE
3064 .sp
3065 Solution element type constants
3066 .PP
3067 \fBSOLVER_SOLUTION_JOB\fR
3068 .RS 4
3069 The problem can be solved by removing the specified job\&.
3070 .RE
3071 .PP
3072 \fBSOLVER_SOLUTION_POOLJOB\fR
3073 .RS 4
3074 The problem can be solved by removing the specified job that is defined in the pool\&.
3075 .RE
3076 .PP
3077 \fBSOLVER_SOLUTION_INFARCH\fR
3078 .RS 4
3079 The problem can be solved by allowing the installation of the specified package with an inferior architecture\&.
3080 .RE
3081 .PP
3082 \fBSOLVER_SOLUTION_DISTUPGRADE\fR
3083 .RS 4
3084 The problem can be solved by allowing to keep the specified package installed\&.
3085 .RE
3086 .PP
3087 \fBSOLVER_SOLUTION_BEST\fR
3088 .RS 4
3089 The problem can be solved by allowing to install the specified package that is not the best available package\&.
3090 .RE
3091 .PP
3092 \fBSOLVER_SOLUTION_ERASE\fR
3093 .RS 4
3094 The problem can be solved by allowing to erase the specified package\&.
3095 .RE
3096 .PP
3097 \fBSOLVER_SOLUTION_REPLACE\fR
3098 .RS 4
3099 The problem can be solved by allowing to replace the package with some other package\&.
3100 .RE
3101 .PP
3102 \fBSOLVER_SOLUTION_REPLACE_DOWNGRADE\fR
3103 .RS 4
3104 The problem can be solved by allowing to replace the package with some other package that has a lower version\&.
3105 .RE
3106 .PP
3107 \fBSOLVER_SOLUTION_REPLACE_ARCHCHANGE\fR
3108 .RS 4
3109 The problem can be solved by allowing to replace the package with some other package that has a different architecture\&.
3110 .RE
3111 .PP
3112 \fBSOLVER_SOLUTION_REPLACE_VENDORCHANGE\fR
3113 .RS 4
3114 The problem can be solved by allowing to replace the package with some other package that has a different vendor\&.
3115 .RE
3116 .PP
3117 \fBSOLVER_SOLUTION_REPLACE_NAMECHANGE\fR
3118 .RS 4
3119 The problem can be solved by allowing to replace the package with some other package that has a different name\&.
3120 .RE
3121 .SS "ATTRIBUTES"
3122 .sp
3123 .if n \{\
3124 .RS 4
3125 .\}
3126 .nf
3127 \fBPool *pool;\fR                             /* read only */
3128 \fI$job\fR\fB\->{\*(Aqpool\*(Aq}\fR
3129 \fId\fR\fB\&.pool\fR
3130 \fId\fR\fB\&.pool\fR
3131 .fi
3132 .if n \{\
3133 .RE
3134 .\}
3135 .sp
3136 Back pointer to pool\&.
3137 .SS "METHODS"
3138 .sp
3139 .if n \{\
3140 .RS 4
3141 .\}
3142 .nf
3143 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
3144 my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
3145 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
3146 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
3147 .fi
3148 .if n \{\
3149 .RE
3150 .\}
3151 .sp
3152 .if n \{\
3153 .RS 4
3154 .\}
3155 .nf
3156 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
3157 my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
3158 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
3159 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
3160 .fi
3161 .if n \{\
3162 .RE
3163 .\}
3164 .sp
3165 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\&.
3166 .sp
3167 .if n \{\
3168 .RS 4
3169 .\}
3170 .nf
3171 \fBProblem **solve(Job *\fR\fIjobs\fR\fB)\fR
3172 my \fI@problems\fR \fB=\fR \fI$solver\fR\fB\->solve(\e\fR\fI@jobs\fR\fB)\fR;
3173 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
3174 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
3175 .fi
3176 .if n \{\
3177 .RE
3178 .\}
3179 .sp
3180 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\&.
3181 .sp
3182 .if n \{\
3183 .RS 4
3184 .\}
3185 .nf
3186 \fBTransaction *transaction()\fR
3187 my \fI$trans\fR \fB=\fR \fI$solver\fR\fB\->transaction()\fR;
3188 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
3189 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
3190 .fi
3191 .if n \{\
3192 .RE
3193 .\}
3194 .sp
3195 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\&.
3196 .SH "THE PROBLEM CLASS"
3197 .sp
3198 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\&.
3199 .SS "ATTRIBUTES"
3200 .sp
3201 .if n \{\
3202 .RS 4
3203 .\}
3204 .nf
3205 \fBSolver *solv;\fR                           /* read only */
3206 \fI$problem\fR\fB\->{\*(Aqsolv\*(Aq}\fR
3207 \fIproblem\fR\fB\&.solv\fR
3208 \fIproblem\fR\fB\&.solv\fR
3209 .fi
3210 .if n \{\
3211 .RE
3212 .\}
3213 .sp
3214 Back pointer to solver object\&.
3215 .sp
3216 .if n \{\
3217 .RS 4
3218 .\}
3219 .nf
3220 \fBId id;\fR                                  /* read only */
3221 \fI$problem\fR\fB\->{\*(Aqid\*(Aq}\fR
3222 \fIproblem\fR\fB\&.id\fR
3223 \fIproblem\fR\fB\&.id\fR
3224 .fi
3225 .if n \{\
3226 .RE
3227 .\}
3228 .sp
3229 Id of the problem\&. The first problem has Id 1, they are numbered consecutively\&.
3230 .SS "METHODS"
3231 .sp
3232 .if n \{\
3233 .RS 4
3234 .\}
3235 .nf
3236 \fBRule *findproblemrule()\fR
3237 my \fI$probrule\fR \fB=\fR \fI$problem\fR\fB\->findproblemrule()\fR;
3238 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
3239 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
3240 .fi
3241 .if n \{\
3242 .RE
3243 .\}
3244 .sp
3245 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\&.
3246 .sp
3247 .if n \{\
3248 .RS 4
3249 .\}
3250 .nf
3251 \fBRule **findallproblemrules(bool\fR \fIunfiltered\fR \fB= 0)\fR
3252 my \fI@probrules\fR \fB=\fR \fI$problem\fR\fB\->findallproblemrules()\fR;
3253 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrule()\fR
3254 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrule()\fR
3255 .fi
3256 .if n \{\
3257 .RE
3258 .\}
3259 .sp
3260 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)\&.
3261 .sp
3262 .if n \{\
3263 .RS 4
3264 .\}
3265 .nf
3266 \fBSolutions **solutions()\fR
3267 my \fI@solutions\fR \fB=\fR \fI$problem\fR\fB\->solutions()\fR;
3268 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
3269 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
3270 .fi
3271 .if n \{\
3272 .RE
3273 .\}
3274 .sp
3275 Return an array containing multiple possible solutions to fix the problem\&. See the solution class for more information\&.
3276 .sp
3277 .if n \{\
3278 .RS 4
3279 .\}
3280 .nf
3281 \fBint solution_count()\fR
3282 my \fI$cnt\fR \fB=\fR \fI$problem\fR\fB\->solution_count()\fR;
3283 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
3284 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
3285 .fi
3286 .if n \{\
3287 .RE
3288 .\}
3289 .sp
3290 Return the number of solutions without creating solution objects\&.
3291 .SH "THE RULE CLASS"
3292 .sp
3293 Rules are the basic block of sat solving\&. Each package dependency gets translated into one or multiple rules\&.
3294 .SS "ATTRIBUTES"
3295 .sp
3296 .if n \{\
3297 .RS 4
3298 .\}
3299 .nf
3300 \fBSolver *solv;\fR                           /* read only */
3301 \fI$rule\fR\fB\->{\*(Aqsolv\*(Aq}\fR
3302 \fIrule\fR\fB\&.solv\fR
3303 \fIrule\fR\fB\&.solv\fR
3304 .fi
3305 .if n \{\
3306 .RE
3307 .\}
3308 .sp
3309 Back pointer to solver object\&.
3310 .sp
3311 .if n \{\
3312 .RS 4
3313 .\}
3314 .nf
3315 \fBId id;\fR                                  /* read only */
3316 \fI$rule\fR\fB\->{\*(Aqid\*(Aq}\fR
3317 \fIrule\fR\fB\&.id\fR
3318 \fIrule\fR\fB\&.id\fR
3319 .fi
3320 .if n \{\
3321 .RE
3322 .\}
3323 .sp
3324 The id of the rule\&.
3325 .sp
3326 .if n \{\
3327 .RS 4
3328 .\}
3329 .nf
3330 \fBint type;\fR                               /* read only */
3331 \fI$rule\fR\fB\->{\*(Aqtype\*(Aq}\fR
3332 \fIrule\fR\fB\&.type\fR
3333 \fIrule\fR\fB\&.type\fR
3334 .fi
3335 .if n \{\
3336 .RE
3337 .\}
3338 .sp
3339 The basic type of the rule\&. See the constant section of the solver class for the type list\&.
3340 .SS "METHODS"
3341 .sp
3342 .if n \{\
3343 .RS 4
3344 .\}
3345 .nf
3346 \fBRuleinfo *info()\fR
3347 my \fI$ruleinfo\fR \fB=\fR \fI$rule\fR\fB\->info()\fR;
3348 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
3349 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
3350 .fi
3351 .if n \{\
3352 .RE
3353 .\}
3354 .sp
3355 Return a Ruleinfo object that contains information about why the rule was created\&. But see the allinfos() method below\&.
3356 .sp
3357 .if n \{\
3358 .RS 4
3359 .\}
3360 .nf
3361 \fBRuleinfo **allinfos()\fR
3362 my \fI@ruleinfos\fR \fB=\fR \fI$rule\fR\fB\->allinfos()\fR;
3363 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
3364 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
3365 .fi
3366 .if n \{\
3367 .RE
3368 .\}
3369 .sp
3370 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\&.
3371 .sp
3372 .if n \{\
3373 .RS 4
3374 .\}
3375 .nf
3376 \fB<equality>\fR
3377 \fBif (\fR\fI$rule1\fR \fB==\fR \fI$rule2\fR\fB)\fR
3378 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR\fB:\fR
3379 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR
3380 .fi
3381 .if n \{\
3382 .RE
3383 .\}
3384 .sp
3385 Two rules are equal if they belong to the same solver and have the same id\&.
3386 .SH "THE RULEINFO CLASS"
3387 .sp
3388 A Ruleinfo describes one reason why a rule was created\&.
3389 .SS "ATTRIBUTES"
3390 .sp
3391 .if n \{\
3392 .RS 4
3393 .\}
3394 .nf
3395 \fBSolver *solv;\fR                           /* read only */
3396 \fI$ruleinfo\fR\fB\->{\*(Aqsolv\*(Aq}\fR
3397 \fIruleinfo\fR\fB\&.solv\fR
3398 \fIruleinfo\fR\fB\&.solv\fR
3399 .fi
3400 .if n \{\
3401 .RE
3402 .\}
3403 .sp
3404 Back pointer to solver object\&.
3405 .sp
3406 .if n \{\
3407 .RS 4
3408 .\}
3409 .nf
3410 \fBint type;\fR                               /* read only */
3411 \fI$ruleinfo\fR\fB\->{\*(Aqtype\*(Aq}\fR
3412 \fIruleinfo\fR\fB\&.type\fR
3413 \fIruleinfo\fR\fB\&.type\fR
3414 .fi
3415 .if n \{\
3416 .RE
3417 .\}
3418 .sp
3419 The type of the ruleinfo\&. See the constant section of the solver class for the rule type list and the special type list\&.
3420 .sp
3421 .if n \{\
3422 .RS 4
3423 .\}
3424 .nf
3425 \fBId dep;\fR                                 /* read only */
3426 \fI$ruleinfo\fR\fB\->{\*(Aqdep\*(Aq}\fR
3427 \fIruleinfo\fR\fB\&.dep\fR
3428 \fIruleinfo\fR\fB\&.dep\fR
3429 .fi
3430 .if n \{\
3431 .RE
3432 .\}
3433 .sp
3434 The id of the dependency leading to the creation of the rule, or zero\&.
3435 .sp
3436 .if n \{\
3437 .RS 4
3438 .\}
3439 .nf
3440 \fBSolvable *solvable;\fR                     /* read only */
3441 \fI$ruleinfo\fR\fB\->{\*(Aqsolvable\*(Aq}\fR
3442 \fIruleinfo\fR\fB\&.solvable\fR
3443 \fIruleinfo\fR\fB\&.solvable\fR
3444 .fi
3445 .if n \{\
3446 .RE
3447 .\}
3448 .sp
3449 The involved Solvable, e\&.g\&. the one containing the dependency\&.
3450 .sp
3451 .if n \{\
3452 .RS 4
3453 .\}
3454 .nf
3455 \fBSolvable *othersolvable;\fR                /* read only */
3456 \fI$ruleinfo\fR\fB\->{\*(Aqothersolvable\*(Aq}\fR
3457 \fIruleinfo\fR\fB\&.othersolvable\fR
3458 \fIruleinfo\fR\fB\&.othersolvable\fR
3459 .fi
3460 .if n \{\
3461 .RE
3462 .\}
3463 .sp
3464 The other involved Solvable (if any), e\&.g\&. the one containing providing the dependency for conflicts\&.
3465 .sp
3466 .if n \{\
3467 .RS 4
3468 .\}
3469 .nf
3470 \fBconst char *problemstr()\fR;
3471 my \fI$str\fR \fB=\fR \fI$ruleinfo\fR\fB\->problemstr()\fR;
3472 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
3473 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
3474 .fi
3475 .if n \{\
3476 .RE
3477 .\}
3478 .sp
3479 A string describing the ruleinfo from a problem perspective\&. This probably only makes sense if the rule is part of a problem\&.
3480 .SH "THE SOLUTION CLASS"
3481 .sp
3482 A solution solves one specific problem\&. It consists of multiple solution elements that all need to be executed\&.
3483 .SS "ATTRIBUTES"
3484 .sp
3485 .if n \{\
3486 .RS 4
3487 .\}
3488 .nf
3489 \fBSolver *solv;\fR                           /* read only */
3490 \fI$solution\fR\fB\->{\*(Aqsolv\*(Aq}\fR
3491 \fIsolution\fR\fB\&.solv\fR
3492 \fIsolution\fR\fB\&.solv\fR
3493 .fi
3494 .if n \{\
3495 .RE
3496 .\}
3497 .sp
3498 Back pointer to solver object\&.
3499 .sp
3500 .if n \{\
3501 .RS 4
3502 .\}
3503 .nf
3504 \fBId problemid;\fR                           /* read only */
3505 \fI$solution\fR\fB\->{\*(Aqproblemid\*(Aq}\fR
3506 \fIsolution\fR\fB\&.problemid\fR
3507 \fIsolution\fR\fB\&.problemid\fR
3508 .fi
3509 .if n \{\
3510 .RE
3511 .\}
3512 .sp
3513 Id of the problem the solution solves\&.
3514 .sp
3515 .if n \{\
3516 .RS 4
3517 .\}
3518 .nf
3519 \fBId id;\fR                                  /* read only */
3520 \fI$solution\fR\fB\->{\*(Aqid\*(Aq}\fR
3521 \fIsolution\fR\fB\&.id\fR
3522 \fIsolution\fR\fB\&.id\fR
3523 .fi
3524 .if n \{\
3525 .RE
3526 .\}
3527 .sp
3528 Id of the solution\&. The first solution has Id 1, they are numbered consecutively\&.
3529 .SS "METHODS"
3530 .sp
3531 .if n \{\
3532 .RS 4
3533 .\}
3534 .nf
3535 \fBSolutionelement **elements(bool\fR \fIexpandreplaces\fR \fB= 0)\fR
3536 my \fI@solutionelements\fR \fB=\fR \fI$solution\fR\fB\->elements()\fR;
3537 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
3538 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
3539 .fi
3540 .if n \{\
3541 .RE
3542 .\}
3543 .sp
3544 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\&.
3545 .sp
3546 .if n \{\
3547 .RS 4
3548 .\}
3549 .nf
3550 \fBint element_count()\fR
3551 my \fI$cnt\fR \fB=\fR \fI$solution\fR\fB\->solution_count()\fR;
3552 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
3553 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
3554 .fi
3555 .if n \{\
3556 .RE
3557 .\}
3558 .sp
3559 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\&.
3560 .SH "THE SOLUTIONELEMENT CLASS"
3561 .sp
3562 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\&.
3563 .SS "ATTRIBUTES"
3564 .sp
3565 .if n \{\
3566 .RS 4
3567 .\}
3568 .nf
3569 \fBSolver *solv;\fR                           /* read only */
3570 \fI$solutionelement\fR\fB\->{\*(Aqsolv\*(Aq}\fR
3571 \fIsolutionelement\fR\fB\&.solv\fR
3572 \fIsolutionelement\fR\fB\&.solv\fR
3573 .fi
3574 .if n \{\
3575 .RE
3576 .\}
3577 .sp
3578 Back pointer to solver object\&.
3579 .sp
3580 .if n \{\
3581 .RS 4
3582 .\}
3583 .nf
3584 \fBId problemid;\fR                           /* read only */
3585 \fI$solutionelement\fR\fB\->{\*(Aqproblemid\*(Aq}\fR
3586 \fIsolutionelement\fR\fB\&.problemid\fR
3587 \fIsolutionelement\fR\fB\&.problemid\fR
3588 .fi
3589 .if n \{\
3590 .RE
3591 .\}
3592 .sp
3593 Id of the problem the element (partly) solves\&.
3594 .sp
3595 .if n \{\
3596 .RS 4
3597 .\}
3598 .nf
3599 \fBId solutionid;\fR                          /* read only */
3600 \fI$solutionelement\fR\fB\->{\*(Aqsolutionid\*(Aq}\fR
3601 \fIsolutionelement\fR\fB\&.solutionid\fR
3602 \fIsolutionelement\fR\fB\&.solutionid\fR
3603 .fi
3604 .if n \{\
3605 .RE
3606 .\}
3607 .sp
3608 Id of the solution the element is a part of\&.
3609 .sp
3610 .if n \{\
3611 .RS 4
3612 .\}
3613 .nf
3614 \fBId id;\fR                                  /* read only */
3615 \fI$solutionelement\fR\fB\->{\*(Aqid\*(Aq}\fR
3616 \fIsolutionelement\fR\fB\&.id\fR
3617 \fIsolutionelement\fR\fB\&.id\fR
3618 .fi
3619 .if n \{\
3620 .RE
3621 .\}
3622 .sp
3623 Id of the solution element\&. The first element has Id 1, they are numbered consecutively\&.
3624 .sp
3625 .if n \{\
3626 .RS 4
3627 .\}
3628 .nf
3629 \fBId type;\fR                                /* read only */
3630 \fI$solutionelement\fR\fB\->{\*(Aqtype\*(Aq}\fR
3631 \fIsolutionelement\fR\fB\&.type\fR
3632 \fIsolutionelement\fR\fB\&.type\fR
3633 .fi
3634 .if n \{\
3635 .RE
3636 .\}
3637 .sp
3638 Type of the solution element\&. See the constant section of the solver class for the existing types\&.
3639 .sp
3640 .if n \{\
3641 .RS 4
3642 .\}
3643 .nf
3644 \fBSolvable *solvable;\fR                     /* read only */
3645 \fI$solutionelement\fR\fB\->{\*(Aqsolvable\*(Aq}\fR
3646 \fIsolutionelement\fR\fB\&.solvable\fR
3647 \fIsolutionelement\fR\fB\&.solvable\fR
3648 .fi
3649 .if n \{\
3650 .RE
3651 .\}
3652 .sp
3653 The installed solvable that needs to be replaced for replacement elements\&.
3654 .sp
3655 .if n \{\
3656 .RS 4
3657 .\}
3658 .nf
3659 \fBSolvable *replacement;\fR                  /* read only */
3660 \fI$solutionelement\fR\fB\->{\*(Aqreplacement\*(Aq}\fR
3661 \fIsolutionelement\fR\fB\&.replacement\fR
3662 \fIsolutionelement\fR\fB\&.replacement\fR
3663 .fi
3664 .if n \{\
3665 .RE
3666 .\}
3667 .sp
3668 The solvable that needs to be installed to fix the problem\&.
3669 .sp
3670 .if n \{\
3671 .RS 4
3672 .\}
3673 .nf
3674 \fBint jobidx;\fR                             /* read only */
3675 \fI$solutionelement\fR\fB\->{\*(Aqjobidx\*(Aq}\fR
3676 \fIsolutionelement\fR\fB\&.jobidx\fR
3677 \fIsolutionelement\fR\fB\&.jobidx\fR
3678 .fi
3679 .if n \{\
3680 .RE
3681 .\}
3682 .sp
3683 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\&.
3684 .SS "METHODS"
3685 .sp
3686 .if n \{\
3687 .RS 4
3688 .\}
3689 .nf
3690 \fBSolutionelement **replaceelements()\fR
3691 my \fI@solutionelements\fR \fB=\fR \fI$solutionelement\fR\fB\->replaceelements()\fR;
3692 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
3693 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
3694 .fi
3695 .if n \{\
3696 .RE
3697 .\}
3698 .sp
3699 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\&.
3700 .sp
3701 .if n \{\
3702 .RS 4
3703 .\}
3704 .nf
3705 \fBint illegalreplace()\fR
3706 my \fI$illegal\fR \fB=\fR \fI$solutionelement\fR\fB\->illegalreplace()\fR;
3707 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
3708 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
3709 .fi
3710 .if n \{\
3711 .RE
3712 .\}
3713 .sp
3714 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\&.
3715 .sp
3716 .if n \{\
3717 .RS 4
3718 .\}
3719 .nf
3720 \fBJob *Job()\fR
3721 my \fI$job\fR \fB=\fR \fI$solutionelement\fR\fB\->Job()\fR;
3722 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
3723 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
3724 .fi
3725 .if n \{\
3726 .RE
3727 .\}
3728 .sp
3729 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\&.
3730 .sp
3731 .if n \{\
3732 .RS 4
3733 .\}
3734 .nf
3735 \fBconst char *str()\fR
3736 my \fI$str\fR \fB=\fR \fI$solutionelement\fR\fB\->str()\fR;
3737 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
3738 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
3739 .fi
3740 .if n \{\
3741 .RE
3742 .\}
3743 .sp
3744 A string describing the change the solution element consists of\&.
3745 .SH "THE TRANSACTION CLASS"
3746 .sp
3747 xxx
3748 .SH "CHECKSUMS"
3749 .sp
3750 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\&.
3751 .SS "CLASS METHODS"
3752 .sp
3753 .if n \{\
3754 .RS 4
3755 .\}
3756 .nf
3757 \fBChksum *Chksum(Id\fR \fItype\fR\fB)\fR
3758 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB)\fR;
3759 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB)\fR
3760 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB)\fR
3761 .fi
3762 .if n \{\
3763 .RE
3764 .\}
3765 .sp
3766 Create a checksum object\&. Currently the following types are supported:
3767 .sp
3768 .if n \{\
3769 .RS 4
3770 .\}
3771 .nf
3772 \fBREPOKEY_TYPE_MD5\fR
3773 \fBREPOKEY_TYPE_SHA1\fR
3774 \fBREPOKEY_TYPE_SHA256\fR
3775 .fi
3776 .if n \{\
3777 .RE
3778 .\}
3779 .sp
3780 These keys are constants in the \fBsolv\fR class\&.
3781 .sp
3782 .if n \{\
3783 .RS 4
3784 .\}
3785 .nf
3786 \fBChksum *Chksum(Id\fR \fItype\fR\fB, const char *\fR\fIhex\fR\fB)\fR
3787 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB,\fR \fI$hex\fR\fB)\fR;
3788 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
3789 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
3790 .fi
3791 .if n \{\
3792 .RE
3793 .\}
3794 .sp
3795 Create an already finalized checksum object\&.
3796 .SS "ATTRIBUTES"
3797 .sp
3798 .if n \{\
3799 .RS 4
3800 .\}
3801 .nf
3802 \fBId type;\fR                        /* read only */
3803 \fI$chksum\fR\fB\->{\*(Aqtype\*(Aq}\fR
3804 \fIchksum\fR\fB\&.type\fR
3805 \fIchksum\fR\fB\&.type\fR
3806 .fi
3807 .if n \{\
3808 .RE
3809 .\}
3810 .sp
3811 Return the type of the checksum object\&.
3812 .SS "METHODS"
3813 .sp
3814 .if n \{\
3815 .RS 4
3816 .\}
3817 .nf
3818 \fBvoid add(const char *\fR\fIstr\fR\fB)\fR
3819 \fI$chksum\fR\fB\->add(\fR\fI$str\fR\fB)\fR;
3820 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
3821 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
3822 .fi
3823 .if n \{\
3824 .RE
3825 .\}
3826 .sp
3827 Add a string to the checksum\&.
3828 .sp
3829 .if n \{\
3830 .RS 4
3831 .\}
3832 .nf
3833 \fBvoid add_fp(FILE *\fR\fIfp\fR\fB)\fR
3834 \fI$chksum\fR\fB\->add_fp(\fR\fI$file\fR\fB)\fR;
3835 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
3836 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
3837 .fi
3838 .if n \{\
3839 .RE
3840 .\}
3841 .sp
3842 Add the contents of a file to the checksum\&.
3843 .sp
3844 .if n \{\
3845 .RS 4
3846 .\}
3847 .nf
3848 \fBvoid add_stat(const char *\fR\fIfilename\fR\fB)\fR
3849 \fI$chksum\fR\fB\->add_stat(\fR\fI$filename\fR\fB)\fR;
3850 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
3851 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
3852 .fi
3853 .if n \{\
3854 .RE
3855 .\}
3856 .sp
3857 Stat the file and add the dev/ino/size/mtime member to the checksum\&. If the stat fails, the members are zeroed\&.
3858 .sp
3859 .if n \{\
3860 .RS 4
3861 .\}
3862 .nf
3863 \fBvoid add_fstat(int\fR \fIfd\fR\fB)\fR
3864 \fI$chksum\fR\fB\->add_fstat(\fR\fI$fd\fR\fB)\fR;
3865 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
3866 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
3867 .fi
3868 .if n \{\
3869 .RE
3870 .\}
3871 .sp
3872 Same as add_stat, but instead of the filename a file descriptor is used\&.
3873 .sp
3874 .if n \{\
3875 .RS 4
3876 .\}
3877 .nf
3878 \fBunsigned char *raw()\fR
3879 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->raw()\fR;
3880 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
3881 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
3882 .fi
3883 .if n \{\
3884 .RE
3885 .\}
3886 .sp
3887 Finalize the checksum and return the result as raw bytes\&. This means that the result can contain NUL bytes or unprintable characters\&.
3888 .sp
3889 .if n \{\
3890 .RS 4
3891 .\}
3892 .nf
3893 \fBconst char *hex()\fR
3894 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->hex()\fR;
3895 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
3896 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
3897 .fi
3898 .if n \{\
3899 .RE
3900 .\}
3901 .sp
3902 Finalize the checksum and return the result as hex string\&.
3903 .sp
3904 .if n \{\
3905 .RS 4
3906 .\}
3907 .nf
3908 \fB<equality>\fR
3909 \fBif (\fR\fI$chksum1\fR \fB==\fR \fI$chksum2\fR\fB)\fR
3910 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR\fB:\fR
3911 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR
3912 .fi
3913 .if n \{\
3914 .RE
3915 .\}
3916 .sp
3917 Checksums are equal if they are of the same type and the finalized results are the same\&.
3918 .sp
3919 .if n \{\
3920 .RS 4
3921 .\}
3922 .nf
3923 \fB<stringification>\fR
3924 my \fI$str\fR \fB= "\fR\fI$chksum\fR\fB"\fR;
3925 \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR
3926 \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR
3927 .fi
3928 .if n \{\
3929 .RE
3930 .\}
3931 .sp
3932 If the checksum is finished, the checksum is returned as "<type>:<hex>" string\&. Otherwise "<type>:unfinished" is returned\&.
3933 .SH "FILE MANAGEMENT"
3934 .sp
3935 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\&.
3936 .sp
3937 .if n \{\
3938 .RS 4
3939 .\}
3940 .nf
3941 \fBFILE *xfopen(char *\fR\fIfn\fR\fB, char *\fR\fImode\fR \fB= "r")\fR
3942 my \fI$file\fR \fB= solv::xfopen(\fR\fI$path\fR\fB)\fR;
3943 \fIfile\fR \fB= solv\&.xfopen(\fR\fIpath\fR\fB)\fR
3944 \fIfile\fR \fB= Solv::xfopen(\fR\fIpath\fR\fB)\fR
3945 .fi
3946 .if n \{\
3947 .RE
3948 .\}
3949 .sp
3950 Open a file at the specified path\&. The mode argument is passed on to the stdio library\&.
3951 .sp
3952 .if n \{\
3953 .RS 4
3954 .\}
3955 .nf
3956 \fBFILE *xfopen_fd(char *\fR\fIfn\fR\fB, int\fR \fIfileno\fR\fB)\fR
3957 my \fI$file\fR \fB= solv::xfopen_fd(\fR\fI$path\fR\fB,\fR \fI$fileno\fR\fB)\fR;
3958 \fIfile\fR \fB= solv\&.xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
3959 \fIfile\fR \fB= Solv::xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
3960 .fi
3961 .if n \{\
3962 .RE
3963 .\}
3964 .sp
3965 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\&.
3966 .SS "METHODS"
3967 .sp
3968 .if n \{\
3969 .RS 4
3970 .\}
3971 .nf
3972 \fBint fileno()\fR
3973 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->fileno()\fR;
3974 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
3975 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
3976 .fi
3977 .if n \{\
3978 .RE
3979 .\}
3980 .sp
3981 Return file file descriptor of the file\&. If the file is not open, \-1 is returned\&.
3982 .sp
3983 .if n \{\
3984 .RS 4
3985 .\}
3986 .nf
3987 \fBint dup()\fR
3988 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->dup()\fR;
3989 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
3990 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
3991 .fi
3992 .if n \{\
3993 .RE
3994 .\}
3995 .sp
3996 Return a copy of the descriptor of the file\&. If the file is not open, \-1 is returned\&.
3997 .sp
3998 .if n \{\
3999 .RS 4
4000 .\}
4001 .nf
4002 \fBbool flush()\fR
4003 \fI$file\fR\fB\->flush()\fR;
4004 \fIfile\fR\fB\&.flush()\fR
4005 \fIfile\fR\fB\&.flush()\fR
4006 .fi
4007 .if n \{\
4008 .RE
4009 .\}
4010 .sp
4011 Flush the file\&. Returns false if there was an error\&. Flushing a closed file always returns true\&.
4012 .sp
4013 .if n \{\
4014 .RS 4
4015 .\}
4016 .nf
4017 \fBbool close()\fR
4018 \fI$file\fR\fB\->close()\fR;
4019 \fIfile\fR\fB\&.close()\fR
4020 \fIfile\fR\fB\&.close()\fR
4021 .fi
4022 .if n \{\
4023 .RE
4024 .\}
4025 .sp
4026 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\&.
4027 .SH "THE REPODATACLASS"
4028 .sp
4029 xxx
4030 .SH "AUTHOR"
4031 .sp
4032 Michael Schroeder <mls@suse\&.de>