define and document the pool flags
[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: 05/27/2013
6 .\"    Manual: LIBSOLV
7 .\"    Source: libsolv
8 .\"  Language: English
9 .\"
10 .TH "LIBSOLV\-BINDINGS" "3" "05/27/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 .SS "METHODS"
157 .sp
158 .if n \{\
159 .RS 4
160 .\}
161 .nf
162 \fBvoid free()\fR
163 \fI$pool\fR\fB\->free()\fR;
164 \fIpool\fR\fB\&.free()\fR
165 \fIpool\fR\fB\&.free()\fR
166 .fi
167 .if n \{\
168 .RE
169 .\}
170 .sp
171 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\&.
172 .sp
173 .if n \{\
174 .RS 4
175 .\}
176 .nf
177 \fBvoid setdebuglevel(int\fR \fIlevel\fR\fB)\fR
178 \fI$pool\fR\fB\->setdebuglevel(\fR\fI$level\fR\fB)\fR;
179 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
180 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
181 .fi
182 .if n \{\
183 .RE
184 .\}
185 .sp
186 Set the debug level\&. A value of zero means no debug output, the higher the value, the more output is generated\&.
187 .sp
188 .if n \{\
189 .RS 4
190 .\}
191 .nf
192 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
193 my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
194 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
195 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
196 .fi
197 .if n \{\
198 .RE
199 .\}
200 .sp
201 .if n \{\
202 .RS 4
203 .\}
204 .nf
205 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
206 my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
207 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
208 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
209 .fi
210 .if n \{\
211 .RE
212 .\}
213 .sp
214 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\&.
215 .sp
216 .if n \{\
217 .RS 4
218 .\}
219 .nf
220 \fBvoid set_rootdir(const char *\fR\fIrootdir\fR\fB)\fR
221 \fI$pool\fR\fB\->set_rootdir(\fR\fIrootdir\fR\fB)\fR;
222 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
223 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
224 .fi
225 .if n \{\
226 .RE
227 .\}
228 .sp
229 .if n \{\
230 .RS 4
231 .\}
232 .nf
233 \fBconst char *get_rootdir()\fR
234 my \fI$rootdir\fR \fB=\fR \fI$pool\fR\fB\->get_rootdir()\fR;
235 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
236 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
237 .fi
238 .if n \{\
239 .RE
240 .\}
241 .sp
242 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\&.
243 .sp
244 .if n \{\
245 .RS 4
246 .\}
247 .nf
248 \fBvoid setarch(const char *\fR\fIarch\fR \fB= 0)\fR
249 \fI$pool\fR\fB\->setarch()\fR;
250 \fIpool\fR\fB\&.setarch()\fR
251 \fIpool\fR\fB\&.setarch()\fR
252 .fi
253 .if n \{\
254 .RE
255 .\}
256 .sp
257 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\&.
258 .sp
259 .if n \{\
260 .RS 4
261 .\}
262 .nf
263 \fBRepo *add_repo(const char *\fR\fIname\fR\fB)\fR
264 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->add_repo(\fR\fI$name\fR\fB)\fR;
265 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
266 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
267 .fi
268 .if n \{\
269 .RE
270 .\}
271 .sp
272 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\&.
273 .sp
274 .if n \{\
275 .RS 4
276 .\}
277 .nf
278 \fBRepoiterator *repos_iter()\fR
279 \fBfor my\fR \fI$repo\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->repos_iter()})\fR
280 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter():\fR
281 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter()\fR
282 .fi
283 .if n \{\
284 .RE
285 .\}
286 .sp
287 Iterate over the existing repositories\&.
288 .sp
289 .if n \{\
290 .RS 4
291 .\}
292 .nf
293 \fBSolvableiterator *solvables_iter()\fR
294 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->solvables_iter()})\fR
295 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter():\fR
296 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter()\fR
297 .fi
298 .if n \{\
299 .RE
300 .\}
301 .sp
302 Iterate over the existing solvables\&.
303 .sp
304 .if n \{\
305 .RS 4
306 .\}
307 .nf
308 \fBDep *Dep(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
309 my \fI$dep\fR \fB=\fR \fI$pool\fR\fB\->Dep(\fR\fI$string\fR\fB)\fR;
310 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
311 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
312 .fi
313 .if n \{\
314 .RE
315 .\}
316 .sp
317 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\&.
318 .sp
319 .if n \{\
320 .RS 4
321 .\}
322 .nf
323 \fBvoid addfileprovides()\fR
324 \fI$pool\fR\fB\->addfileprovides()\fR;
325 \fIpool\fR\fB\&.addfileprovides()\fR
326 \fIpool\fR\fB\&.addfileprovides()\fR
327 .fi
328 .if n \{\
329 .RE
330 .\}
331 .sp
332 .if n \{\
333 .RS 4
334 .\}
335 .nf
336 \fBQueue addfileprovides_queue()\fR
337 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->addfileprovides_queue()\fR;
338 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
339 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
340 .fi
341 .if n \{\
342 .RE
343 .\}
344 .sp
345 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\&.
346 .sp
347 .if n \{\
348 .RS 4
349 .\}
350 .nf
351 \fBvoid createwhatprovides()\fR
352 \fI$pool\fR\fB\->createwhatprovides()\fR;
353 \fIpool\fR\fB\&.createwhatprovides()\fR
354 \fIpool\fR\fB\&.createwhatprovides()\fR
355 .fi
356 .if n \{\
357 .RE
358 .\}
359 .sp
360 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()\&.
361 .sp
362 .if n \{\
363 .RS 4
364 .\}
365 .nf
366 \fBQueue whatprovides(DepId\fR \fIdep\fR\fB)\fR
367 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatprovides(\fR\fI$dep\fR\fB)\fR;
368 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
369 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
370 .fi
371 .if n \{\
372 .RE
373 .\}
374 .sp
375 Return all solvables that provide the specified dependency\&. You can use either a Dep object or an simple Id as argument\&.
376 .sp
377 .if n \{\
378 .RS 4
379 .\}
380 .nf
381 \fBQueue matchprovidingids(const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
382 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->matchprovidingids(\fR\fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
383 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
384 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
385 .fi
386 .if n \{\
387 .RE
388 .\}
389 .sp
390 Search the names of all provides and return the ones matching the specified string\&. See the Dataiterator class for the allowed flags\&.
391 .sp
392 .if n \{\
393 .RS 4
394 .\}
395 .nf
396 \fBId towhatprovides(Queue\fR \fIids\fR\fB)\fR
397 my \fI$offset\fR \fB=\fR \fI$pool\fR\fB\->towhatprovides(\e\fR\fI@ids\fR\fB)\fR;
398 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
399 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
400 .fi
401 .if n \{\
402 .RE
403 .\}
404 .sp
405 \(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\&.
406 .sp
407 .if n \{\
408 .RS 4
409 .\}
410 .nf
411 \fBbool isknownarch(DepId\fR \fIid\fR\fB)\fR
412 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->isknownarch(\fR\fI$id\fR\fB)\fR;
413 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch(\fR\fIid\fR\fB)\fR
414 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch?(\fR\fIid\fR\fB)\fR
415 .fi
416 .if n \{\
417 .RE
418 .\}
419 .sp
420 Return true if the specified Id describs a known architecture\&.
421 .sp
422 .if n \{\
423 .RS 4
424 .\}
425 .nf
426 \fBSolver *Solver()\fR
427 my \fI$solver\fR \fB=\fR \fI$pool\fR\fB\->Solver()\fR;
428 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
429 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
430 .fi
431 .if n \{\
432 .RE
433 .\}
434 .sp
435 Create a new solver object\&.
436 .sp
437 .if n \{\
438 .RS 4
439 .\}
440 .nf
441 \fBSolver *Job(int\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
442 my \fI$job\fR \fB=\fR \fI$pool\fR\fB\->Job(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
443 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
444 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
445 .fi
446 .if n \{\
447 .RE
448 .\}
449 .sp
450 Create a new Job object\&. Kind of low level, in most cases you would use a Selection or Dep job constructor instead\&.
451 .sp
452 .if n \{\
453 .RS 4
454 .\}
455 .nf
456 \fBSelection *Selection()\fR
457 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection()\fR;
458 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
459 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
460 .fi
461 .if n \{\
462 .RE
463 .\}
464 .sp
465 Create an empty selection\&. Useful as a starting point for merging other selections\&.
466 .sp
467 .if n \{\
468 .RS 4
469 .\}
470 .nf
471 \fBSelection *Selection_all()\fR
472 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection_all()\fR;
473 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
474 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
475 .fi
476 .if n \{\
477 .RE
478 .\}
479 .sp
480 Create a selection containing all packages\&. Useful as starting point for intersecting other selections or for update/distupgrade jobs\&.
481 .sp
482 .if n \{\
483 .RS 4
484 .\}
485 .nf
486 \fBSelection *select(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB)\fR
487 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->select(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
488 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
489 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
490 .fi
491 .if n \{\
492 .RE
493 .\}
494 .sp
495 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\&.
496 .sp
497 .if n \{\
498 .RS 4
499 .\}
500 .nf
501 \fBvoid setpooljobs(Jobs *\fR\fIjobs\fR\fB)\fR
502 \fI$pool\fR\fB\->setpooljobs(\e\fR\fI@jobs\fR\fB)\fR;
503 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
504 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
505 .fi
506 .if n \{\
507 .RE
508 .\}
509 .sp
510 .if n \{\
511 .RS 4
512 .\}
513 .nf
514 \fBJobs *getpooljobs()\fR
515 \fI@jobs\fR \fB=\fR \fI$pool\fR\fB\->getpooljobs()\fR;
516 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
517 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
518 .fi
519 .if n \{\
520 .RE
521 .\}
522 .sp
523 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\&.
524 .sp
525 .if n \{\
526 .RS 4
527 .\}
528 .nf
529 \fBvoid set_loadcallback(Callable *\fR\fIcallback\fR\fB)\fR
530 \fI$pool\fR\fB\->setloadcallback(\e\fR\fI&callbackfunction\fR\fB)\fR;
531 \fIpool\fR\fB\&.setloadcallback(\fR\fIcallbackfunction\fR\fB)\fR
532 \fIpool\fR\fB\&.setloadcallback { |\fR\fIrepodata\fR\fB| \&.\&.\&. }\fR
533 .fi
534 .if n \{\
535 .RE
536 .\}
537 .sp
538 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\&.
539 .SS "DATA RETRIEVAL METHODS"
540 .sp
541 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,
542 .sp
543 .if n \{\
544 .RS 4
545 .\}
546 .nf
547 \fB$solv::SOLVABLE_SUMMARY\fR
548 \fBsolv\&.SOLVABLE_SUMMARY\fR
549 \fBSolv::SOLVABLE_SUMMARY\fR
550 .fi
551 .if n \{\
552 .RE
553 .\}
554 .sp
555 selects the \(lqSummary\(rq entry of a solvable\&. The \fIsolvid\fR argument selects the desired solvable by Id\&.
556 .sp
557 .if n \{\
558 .RS 4
559 .\}
560 .nf
561 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
562 my \fI$string\fR \fB=\fR \fI$pool\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
563 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
564 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
565 .fi
566 .if n \{\
567 .RE
568 .\}
569 .sp
570 .if n \{\
571 .RS 4
572 .\}
573 .nf
574 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
575 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->lookup_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
576 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
577 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
578 .fi
579 .if n \{\
580 .RE
581 .\}
582 .sp
583 .if n \{\
584 .RS 4
585 .\}
586 .nf
587 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
588 my \fI$num\fR \fB=\fR \fI$pool\fR\fB\->lookup_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
589 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
590 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
591 .fi
592 .if n \{\
593 .RE
594 .\}
595 .sp
596 .if n \{\
597 .RS 4
598 .\}
599 .nf
600 \fBbool lookup_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
601 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->lookup_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
602 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
603 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
604 .fi
605 .if n \{\
606 .RE
607 .\}
608 .sp
609 .if n \{\
610 .RS 4
611 .\}
612 .nf
613 \fBQueue lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
614 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
615 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
616 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
617 .fi
618 .if n \{\
619 .RE
620 .\}
621 .sp
622 .if n \{\
623 .RS 4
624 .\}
625 .nf
626 \fBChksum *lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
627 my \fI$chksum\fR \fB=\fR \fI$pool\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
628 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
629 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
630 .fi
631 .if n \{\
632 .RE
633 .\}
634 .sp
635 Lookup functions\&. Return the data element stored in the specified solvable\&. You should probably use the methods of the Solvable class instead\&.
636 .sp
637 .if n \{\
638 .RS 4
639 .\}
640 .nf
641 \fBDataiterator *Dataiterator(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
642 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;
643 \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
644 \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
645 .fi
646 .if n \{\
647 .RE
648 .\}
649 .sp
650 .if n \{\
651 .RS 4
652 .\}
653 .nf
654 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
655 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
656 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
657 .fi
658 .if n \{\
659 .RE
660 .\}
661 .sp
662 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
663 .SS "ID METHODS"
664 .sp
665 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\&.
666 .sp
667 .if n \{\
668 .RS 4
669 .\}
670 .nf
671 \fBRepo *id2repo(Id\fR \fIid\fR\fB)\fR
672 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->id2repo(\fR\fI$id\fR\fB)\fR;
673 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
674 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
675 .fi
676 .if n \{\
677 .RE
678 .\}
679 .sp
680 Lookup an existing Repository by id\&. You can also do this by using the \fBrepos\fR attribute\&.
681 .sp
682 .if n \{\
683 .RS 4
684 .\}
685 .nf
686 \fBSolvable *id2solvable(Id\fR \fIid\fR\fB)\fR
687 \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->id2solvable(\fR\fI$id\fR\fB)\fR;
688 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
689 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
690 .fi
691 .if n \{\
692 .RE
693 .\}
694 .sp
695 Lookup an existing Repository by id\&. You can also do this by using the \fBsolvables\fR attribute\&.
696 .sp
697 .if n \{\
698 .RS 4
699 .\}
700 .nf
701 \fBconst char *solvid2str(Id\fR \fIid\fR\fB)\fR
702 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvid2str(\fR\fI$id\fR\fB)\fR;
703 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
704 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
705 .fi
706 .if n \{\
707 .RE
708 .\}
709 .sp
710 Return a string describing the Solvable with the specified id\&. The string consists of the name, version, and architecture of the Solvable\&.
711 .sp
712 .if n \{\
713 .RS 4
714 .\}
715 .nf
716 \fBId str2id(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
717 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->str2id(\fR\fI$string\fR\fB)\fR;
718 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
719 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
720 .fi
721 .if n \{\
722 .RE
723 .\}
724 .sp
725 .if n \{\
726 .RS 4
727 .\}
728 .nf
729 \fBconst char *id2str(Id\fR \fIid\fR\fB)\fR
730 \fI$string\fR \fB=\fR \fIpool\fR\fB\->id2str(\fR\fI$id\fR\fB)\fR;
731 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
732 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
733 .fi
734 .if n \{\
735 .RE
736 .\}
737 .sp
738 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\&.
739 .sp
740 .if n \{\
741 .RS 4
742 .\}
743 .nf
744 \fBId rel2id(Id\fR \fIname\fR\fB, Id\fR \fIevr\fR\fB, int\fR \fIflags\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
745 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;
746 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
747 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
748 .fi
749 .if n \{\
750 .RE
751 .\}
752 .sp
753 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:
754 .sp
755 .if n \{\
756 .RS 4
757 .\}
758 .nf
759 \fB$solv::REL_EQ | $solv::REL_GT | $solv::REL_LT\fR
760 \fBsolv\&.REL_EQ | solv\&.REL_GT | solv\&.REL_LT\fR
761 \fBSolv::REL_EQ | Solv::REL_GT | Solv::REL_LT\fR
762 .fi
763 .if n \{\
764 .RE
765 .\}
766 .sp
767 Thus, if you want a \(lq<=\(rq relation, you would use \fBREL_LT | REL_EQ\fR\&.
768 .sp
769 .if n \{\
770 .RS 4
771 .\}
772 .nf
773 \fBId id2langid(Id\fR \fIid\fR\fB, const char *\fR\fIlang\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
774 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->id2langid(\fR\fI$id\fR\fB,\fR \fI$language\fR\fB)\fR;
775 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
776 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
777 .fi
778 .if n \{\
779 .RE
780 .\}
781 .sp
782 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\&.
783 .sp
784 .if n \{\
785 .RS 4
786 .\}
787 .nf
788 \fBconst char *dep2str(Id\fR \fIid\fR\fB)\fR
789 \fI$string\fR \fB=\fR \fIpool\fR\fB\->dep2str(\fR\fI$id\fR\fB)\fR;
790 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
791 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
792 .fi
793 .if n \{\
794 .RE
795 .\}
796 .sp
797 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\&.
798 .SH "THE DEPENDENCY CLASS"
799 .sp
800 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\&.
801 .SS "ATTRIBUTES"
802 .sp
803 .if n \{\
804 .RS 4
805 .\}
806 .nf
807 \fBPool *pool;\fR             /* read only */
808 \fI$dep\fR\fB\->{\*(Aqpool\*(Aq}\fR
809 \fIdep\fR\fB\&.pool\fR
810 \fIdep\fR\fB\&.pool\fR
811 .fi
812 .if n \{\
813 .RE
814 .\}
815 .sp
816 Back reference to the pool this dependency belongs to\&.
817 .sp
818 .if n \{\
819 .RS 4
820 .\}
821 .nf
822 \fBId id;\fR          /* read only */
823 \fI$dep\fR\fB\->{\*(Aqid\*(Aq}\fR
824 \fIdep\fR\fB\&.id\fR
825 \fIdep\fR\fB\&.id\fR
826 .fi
827 .if n \{\
828 .RE
829 .\}
830 .sp
831 The id of this dependency\&.
832 .SH "METHODS"
833 .sp
834 .if n \{\
835 .RS 4
836 .\}
837 .nf
838 \fBDep *Rel(int\fR \fIflags\fR\fB, DepId\fR \fIevrid\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
839 my \fI$reldep\fR \fB=\fR \fI$dep\fR\fB\->Rel(\fR\fI$flags\fR\fB,\fR \fI$evrdep\fR\fB)\fR;
840 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
841 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
842 .fi
843 .if n \{\
844 .RE
845 .\}
846 .sp
847 Create a relational dependency from to string dependencies and a flags argument\&. See the pool\(cqs rel2id method for a description of the flags\&.
848 .sp
849 .if n \{\
850 .RS 4
851 .\}
852 .nf
853 \fBSelection *Selection_name(int\fR \fIsetflags\fR \fB= 0)\fR
854 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_name()\fR;
855 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
856 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
857 .fi
858 .if n \{\
859 .RE
860 .\}
861 .sp
862 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\&.
863 .sp
864 .if n \{\
865 .RS 4
866 .\}
867 .nf
868 \fBSelection *Selection_provides(int\fR \fIsetflags\fR \fB= 0)\fR
869 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_provides()\fR;
870 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
871 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
872 .fi
873 .if n \{\
874 .RE
875 .\}
876 .sp
877 Create a Selection from a dependency\&. The selection consists of all packages that have at least one provides matching the dependency\&.
878 .sp
879 .if n \{\
880 .RS 4
881 .\}
882 .nf
883 \fBconst char *str()\fR
884 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str()\fR;
885 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
886 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
887 .fi
888 .if n \{\
889 .RE
890 .\}
891 .sp
892 Return a string describing the dependency\&.
893 .sp
894 .if n \{\
895 .RS 4
896 .\}
897 .nf
898 \fB<stringification>\fR
899 my \fI$str\fR \fB= "\fR\fI$dep\fR\fB"\fR;
900 \fIstr\fR \fB= str(\fR\fIdep\fR\fB)\fR
901 \fIstr\fR \fB=\fR \fIdep\fR\fB\&.to_s\fR
902 .fi
903 .if n \{\
904 .RE
905 .\}
906 .sp
907 Same as calling the str() method\&.
908 .sp
909 .if n \{\
910 .RS 4
911 .\}
912 .nf
913 \fB<equality>\fR
914 \fBif (\fR\fI$dep1\fR \fB==\fR \fI$dep2\fR\fB)\fR
915 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR\fB:\fR
916 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR
917 .fi
918 .if n \{\
919 .RE
920 .\}
921 .sp
922 The dependencies are equal if they are part of the same pool and have the same ids\&.
923 .SH "THE REPOSITORY CLASS"
924 .sp
925 A Repository describes a group of packages, normally comming from the same source\&. Repositories are created by the Pool\(cqs add_repo() method\&.
926 .SS "ATTRIBUTES"
927 .sp
928 .if n \{\
929 .RS 4
930 .\}
931 .nf
932 \fBPool *pool;\fR                     /* read only */
933 \fI$repo\fR\fB\->{\*(Aqpool\*(Aq}\fR
934 \fIrepo\fR\fB\&.pool\fR
935 \fIrepo\fR\fB\&.pool\fR
936 .fi
937 .if n \{\
938 .RE
939 .\}
940 .sp
941 Back reference to the pool this dependency belongs to\&.
942 .sp
943 .if n \{\
944 .RS 4
945 .\}
946 .nf
947 \fBId id;\fR                          /* read only */
948 \fI$repo\fR\fB\->{\*(Aqid\*(Aq}\fR
949 \fIrepo\fR\fB\&.id\fR
950 \fIrepo\fR\fB\&.id\fR
951 .fi
952 .if n \{\
953 .RE
954 .\}
955 .sp
956 Return the id of the repository\&.
957 .sp
958 .if n \{\
959 .RS 4
960 .\}
961 .nf
962 \fBconst char *name;\fR               /* read/write */
963 \fI$repo\fR\fB\->{\*(Aqname\*(Aq}\fR
964 \fIrepo\fR\fB\&.name\fR
965 \fIrepo\fR\fB\&.name\fR
966 .fi
967 .if n \{\
968 .RE
969 .\}
970 .sp
971 The repositories name\&. To libsolv, the name is just a string with no specific meaning\&.
972 .sp
973 .if n \{\
974 .RS 4
975 .\}
976 .nf
977 \fBint prioprity;\fR                  /* read/write */
978 \fI$repo\fR\fB\->{\*(Aqpriority\*(Aq}\fR
979 \fIrepo\fR\fB\&.priority\fR
980 \fIrepo\fR\fB\&.priority\fR
981 .fi
982 .if n \{\
983 .RE
984 .\}
985 .sp
986 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\&.
987 .sp
988 .if n \{\
989 .RS 4
990 .\}
991 .nf
992 \fBint subprioprity;\fR               /* read/write */
993 \fI$repo\fR\fB\->{\*(Aqsubpriority\*(Aq}\fR
994 \fIrepo\fR\fB\&.subpriority\fR
995 \fIrepo\fR\fB\&.subpriority\fR
996 .fi
997 .if n \{\
998 .RE
999 .\}
1000 .sp
1001 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\&.
1002 .sp
1003 .if n \{\
1004 .RS 4
1005 .\}
1006 .nf
1007 \fBint nsolvables;\fR                 /* read only */
1008 \fI$repo\fR\fB\->{\*(Aqnsolvables\*(Aq}\fR
1009 \fIrepo\fR\fB\&.nsolvables\fR
1010 \fIrepo\fR\fB\&.nsolvables\fR
1011 .fi
1012 .if n \{\
1013 .RE
1014 .\}
1015 .sp
1016 The number of solvables in this repository\&.
1017 .sp
1018 .if n \{\
1019 .RS 4
1020 .\}
1021 .nf
1022 \fBvoid *appdata;\fR                  /* read/write */
1023 \fI$repo\fR\fB\->{\*(Aqappdata\*(Aq}\fR
1024 \fIrepo\fR\fB\&.appdata\fR
1025 \fIrepo\fR\fB\&.appdata\fR
1026 .fi
1027 .if n \{\
1028 .RE
1029 .\}
1030 .sp
1031 Application specific data that may be used in any way by the code using the repository\&.
1032 .sp
1033 .if n \{\
1034 .RS 4
1035 .\}
1036 .nf
1037 \fBDatapos *meta;\fR                  /* read only */
1038 \fI$repo\fR\fB\->{\*(Aqmeta\*(Aq}\fR
1039 \fIrepo\fR\fB\&.meta\fR
1040 \fIrepo\fR\fB\&.meta\fR
1041 .fi
1042 .if n \{\
1043 .RE
1044 .\}
1045 .sp
1046 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\&.
1047 .SS "CONSTANTS"
1048 .PP
1049 \fBREPO_REUSE_REPODATA\fR
1050 .RS 4
1051 Reuse the last repository data aera (\(lqrepodata\(rq) instead of creating a new one\&.
1052 .RE
1053 .PP
1054 \fBREPO_NO_INTERNALIZE\fR
1055 .RS 4
1056 Do not internalize the added repository data\&. This is useful if you plan to add more data because internalization is a costly operation\&.
1057 .RE
1058 .PP
1059 \fBREPO_LOCALPOOL\fR
1060 .RS 4
1061 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\&.
1062 .RE
1063 .PP
1064 \fBREPO_USE_LOADING\fR
1065 .RS 4
1066 Use the repodata that is currently being loaded instead of creating a new one\&. This only makes sense if used in a load callback\&.
1067 .RE
1068 .PP
1069 \fBREPO_EXTEND_SOLVABLES\fR
1070 .RS 4
1071 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\&.
1072 .RE
1073 .PP
1074 \fBREPO_USE_ROOTDIR\fR
1075 .RS 4
1076 Prepend the pool\(cqs rootdir to the path when doing file operations\&.
1077 .RE
1078 .PP
1079 \fBREPO_NO_LOCATION\fR
1080 .RS 4
1081 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\&.
1082 .RE
1083 .PP
1084 \fBSOLV_ADD_NO_STUBS\fR
1085 .RS 4
1086 Do not create stubs for repository parts that can be downloaded on demand\&.
1087 .RE
1088 .PP
1089 \fBSUSETAGS_RECORD_SHARES\fR
1090 .RS 4
1091 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\&.
1092 .RE
1093 .SS "METHODS"
1094 .sp
1095 .if n \{\
1096 .RS 4
1097 .\}
1098 .nf
1099 \fBvoid free(bool\fR \fIreuseids\fR \fB= 0)\fR
1100 \fI$repo\fR\fB\->free()\fR;
1101 \fIrepo\fR\fB\&.free()\fR
1102 \fIrepo\fR\fB\&.free()\fR
1103 .fi
1104 .if n \{\
1105 .RE
1106 .\}
1107 .sp
1108 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\&.
1109 .sp
1110 .if n \{\
1111 .RS 4
1112 .\}
1113 .nf
1114 \fBvoid empty(bool\fR \fIreuseids\fR \fB= 0)\fR
1115 \fI$repo\fR\fB\->empty()\fR;
1116 \fIrepo\fR\fB\&.empty()\fR
1117 \fIrepo\fR\fB\&.empty()\fR
1118 .fi
1119 .if n \{\
1120 .RE
1121 .\}
1122 .sp
1123 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\&.
1124 .sp
1125 .if n \{\
1126 .RS 4
1127 .\}
1128 .nf
1129 \fBbool isempty()\fR
1130 \fI$repo\fR\fB\->isempty()\fR
1131 \fIrepo\fR\fB\&.empty()\fR
1132 \fIrepo\fR\fB\&.empty?\fR
1133 .fi
1134 .if n \{\
1135 .RE
1136 .\}
1137 .sp
1138 Return true if there are no solvables in this repository\&.
1139 .sp
1140 .if n \{\
1141 .RS 4
1142 .\}
1143 .nf
1144 \fBvoid internalize()\fR
1145 \fI$repo\fR\fB\->internalize()\fR;
1146 \fIrepo\fR\fB\&.internalize()\fR
1147 \fIrepo\fR\fB\&.internalize()\fR
1148 .fi
1149 .if n \{\
1150 .RE
1151 .\}
1152 .sp
1153 Internalize added data\&. Data must be internalized before it is available to the lookup and data iterator functions\&.
1154 .sp
1155 .if n \{\
1156 .RS 4
1157 .\}
1158 .nf
1159 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR
1160 \fI$repo\fR\fB\->write(\fR\fI$fp\fR\fB)\fR
1161 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1162 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1163 .fi
1164 .if n \{\
1165 .RE
1166 .\}
1167 .sp
1168 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\&.
1169 .sp
1170 .if n \{\
1171 .RS 4
1172 .\}
1173 .nf
1174 \fBSolvableiterator *solvables_iter()\fR
1175 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$repo\fR\fB\->solvables_iter()})\fR
1176 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter():\fR
1177 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter()\fR
1178 .fi
1179 .if n \{\
1180 .RE
1181 .\}
1182 .sp
1183 Iterate over all solvables in a repository\&.
1184 .sp
1185 .if n \{\
1186 .RS 4
1187 .\}
1188 .nf
1189 \fBRepodata *add_repodata(int\fR \fIflags\fR \fB= 0)\fR
1190 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->add_repodata()\fR;
1191 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1192 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1193 .fi
1194 .if n \{\
1195 .RE
1196 .\}
1197 .sp
1198 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\&.
1199 .sp
1200 .if n \{\
1201 .RS 4
1202 .\}
1203 .nf
1204 \fBvoid create_stubs()\fR
1205 \fI$repo\fR\fB\->create_stubs()\fR;
1206 \fIrepo\fR\fB\&.create_stubs()\fR
1207 \fIrepo\fR\fB\&.create_stubs()\fR
1208 .fi
1209 .if n \{\
1210 .RE
1211 .\}
1212 .sp
1213 Calls the create_stubs() repodata method for the last repodata of the repository\&.
1214 .sp
1215 .if n \{\
1216 .RS 4
1217 .\}
1218 .nf
1219 \fBbool iscontiguous()\fR
1220 \fI$repo\fR\fB\->iscontiguous()\fR
1221 \fIrepo\fR\fB\&.iscontiguous()\fR
1222 \fIrepo\fR\fB\&.iscontiguous?\fR
1223 .fi
1224 .if n \{\
1225 .RE
1226 .\}
1227 .sp
1228 Return true if the solvables of this repository are all in a single block with no holes, i\&.e\&. they have consecutive ids\&.
1229 .sp
1230 .if n \{\
1231 .RS 4
1232 .\}
1233 .nf
1234 \fBRepodata *first_repodata()\fR
1235 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->first_repodata()\fR;
1236 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1237 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1238 .fi
1239 .if n \{\
1240 .RE
1241 .\}
1242 .sp
1243 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\&.
1244 .sp
1245 .if n \{\
1246 .RS 4
1247 .\}
1248 .nf
1249 \fBSelection *Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1250 my \fI$sel\fR \fB=\fR \fI$repo\fR\fB\->Selection()\fR;
1251 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1252 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1253 .fi
1254 .if n \{\
1255 .RE
1256 .\}
1257 .sp
1258 Create a Selection consisting of all packages in the repository\&.
1259 .sp
1260 .if n \{\
1261 .RS 4
1262 .\}
1263 .nf
1264 \fBDataiterator *Dataiterator(Id\fR \fIp\fR\fB, Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
1265 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;
1266 \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
1267 \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
1268 .fi
1269 .if n \{\
1270 .RE
1271 .\}
1272 .sp
1273 .if n \{\
1274 .RS 4
1275 .\}
1276 .nf
1277 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1278 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1279 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1280 .fi
1281 .if n \{\
1282 .RE
1283 .\}
1284 .sp
1285 Iterate over the matching data elements in this repository\&. See the Dataiterator class for more information\&.
1286 .sp
1287 .if n \{\
1288 .RS 4
1289 .\}
1290 .nf
1291 \fB<stringification>\fR
1292 my \fI$str\fR \fB= "\fR\fI$repo\fR\fB"\fR;
1293 \fIstr\fR \fB= str(\fR\fIrepo\fR\fB)\fR
1294 \fIstr\fR \fB=\fR \fIrepo\fR\fB\&.to_s\fR
1295 .fi
1296 .if n \{\
1297 .RE
1298 .\}
1299 .sp
1300 Return the name of the repository, or "Repo#<id>" if no name is set\&.
1301 .sp
1302 .if n \{\
1303 .RS 4
1304 .\}
1305 .nf
1306 \fB<equality>\fR
1307 \fBif (\fR\fI$repo1\fR \fB==\fR \fI$repo2\fR\fB)\fR
1308 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR\fB:\fR
1309 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR
1310 .fi
1311 .if n \{\
1312 .RE
1313 .\}
1314 .sp
1315 Two repositories are equal if they belong to the same pool and have the same id\&.
1316 .SS "DATA ADD METHODS"
1317 .sp
1318 .if n \{\
1319 .RS 4
1320 .\}
1321 .nf
1322 \fBSolvable *add_solvable()\fR
1323 \fI$repo\fR\fB\->add_solvable()\fR;
1324 \fIrepo\fR\fB\&.add_solvable()\fR
1325 \fIrepo\fR\fB\&.add_solvable()\fR
1326 .fi
1327 .if n \{\
1328 .RE
1329 .\}
1330 .sp
1331 Add a single empty solvable to the repository\&. Returns a Solvable object, see the Solvable class for more information\&.
1332 .sp
1333 .if n \{\
1334 .RS 4
1335 .\}
1336 .nf
1337 \fBbool add_solv(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1338 \fI$repo\fR\fB\->add_solv(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1339 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1340 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1341 .fi
1342 .if n \{\
1343 .RE
1344 .\}
1345 .sp
1346 .if n \{\
1347 .RS 4
1348 .\}
1349 .nf
1350 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1351 \fI$repo\fR\fB\->add_solv(\fR\fI$fp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1352 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1353 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1354 .fi
1355 .if n \{\
1356 .RE
1357 .\}
1358 .sp
1359 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\&.
1360 .sp
1361 .if n \{\
1362 .RS 4
1363 .\}
1364 .nf
1365 \fBbool add_rpmdb(int\fR \fIflags\fR \fB= 0)\fR
1366 \fI$repo\fR\fB\->add_rpmdb(\fR\fI$flags\fR\fB)\fR;
1367 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1368 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1369 .fi
1370 .if n \{\
1371 .RE
1372 .\}
1373 .sp
1374 .if n \{\
1375 .RS 4
1376 .\}
1377 .nf
1378 \fBbool add_rpmdb_reffp(FILE *\fR\fIreffp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1379 \fI$repo\fR\fB\->add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1380 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1381 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1382 .fi
1383 .if n \{\
1384 .RE
1385 .\}
1386 .sp
1387 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\&.
1388 .sp
1389 .if n \{\
1390 .RS 4
1391 .\}
1392 .nf
1393 \fBbool add_rpm(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1394 \fI$repo\fR\fB\->add_rpm(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1395 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1396 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1397 .fi
1398 .if n \{\
1399 .RE
1400 .\}
1401 .sp
1402 Add the metadata of a single rpm package to the repository\&.
1403 .sp
1404 .if n \{\
1405 .RS 4
1406 .\}
1407 .nf
1408 \fBbool add_rpmdb_pubkeys(int\fR \fIflags\fR \fB= 0)\fR
1409 \fI$repo\fR\fB\->add_rpmdb_pubkeys()\fR;
1410 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1411 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1412 .fi
1413 .if n \{\
1414 .RE
1415 .\}
1416 .sp
1417 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\&.
1418 .sp
1419 .if n \{\
1420 .RS 4
1421 .\}
1422 .nf
1423 \fBbool add_pubkey(const char *\fR\fIkeyfile\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1424 \fI$repo\fR\fB\->add_pubkey(\fR\fI$keyfile\fR\fB)\fR;
1425 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1426 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1427 .fi
1428 .if n \{\
1429 .RE
1430 .\}
1431 .sp
1432 Add a pubkey from a file to the repository\&.
1433 .sp
1434 .if n \{\
1435 .RS 4
1436 .\}
1437 .nf
1438 \fBbool add_rpmmd(FILE *\fR\fIfp\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1439 \fI$repo\fR\fB\->add_rpmmd(\fR\fI$fp\fR\fB,\fR \fI$language\fR\fB)\fR;
1440 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1441 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1442 .fi
1443 .if n \{\
1444 .RE
1445 .\}
1446 .sp
1447 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\&.
1448 .sp
1449 .if n \{\
1450 .RS 4
1451 .\}
1452 .nf
1453 \fBbool add_repomdxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1454 \fI$repo\fR\fB\->add_repomdxml(\fR\fI$fp\fR\fB)\fR;
1455 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1456 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1457 .fi
1458 .if n \{\
1459 .RE
1460 .\}
1461 .sp
1462 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\&.
1463 .sp
1464 .if n \{\
1465 .RS 4
1466 .\}
1467 .nf
1468 \fBbool add_updateinfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1469 \fI$repo\fR\fB\->add_updateinfoxml(\fR\fI$fp\fR\fB)\fR;
1470 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1471 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1472 .fi
1473 .if n \{\
1474 .RE
1475 .\}
1476 .sp
1477 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\&.
1478 .sp
1479 .if n \{\
1480 .RS 4
1481 .\}
1482 .nf
1483 \fBbool add_deltainfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1484 \fI$repo\fR\fB\->add_deltainfoxml(\fR\fI$fp\fR\fB)\fR;
1485 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1486 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1487 .fi
1488 .if n \{\
1489 .RE
1490 .\}
1491 .sp
1492 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\&.
1493 .sp
1494 .if n \{\
1495 .RS 4
1496 .\}
1497 .nf
1498 \fBbool add_debdb(int\fR \fIflags\fR \fB= 0)\fR
1499 \fI$repo\fR\fB\->add_debdb()\fR;
1500 \fIrepo\fR\fB\&.add_debdb()\fR
1501 \fIrepo\fR\fB\&.add_debdb()\fR
1502 .fi
1503 .if n \{\
1504 .RE
1505 .\}
1506 .sp
1507 Add the contents of the debian installed package database to the repository\&.
1508 .sp
1509 .if n \{\
1510 .RS 4
1511 .\}
1512 .nf
1513 \fBbool add_debpackages(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1514 \fI$repo\fR\fB\->add_debpackages(\fR\fI$fp\fR\fB)\fR;
1515 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1516 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1517 .fi
1518 .if n \{\
1519 .RE
1520 .\}
1521 .sp
1522 Add the contents of the debian repository metadata (the "packages" file) to the repository\&.
1523 .sp
1524 .if n \{\
1525 .RS 4
1526 .\}
1527 .nf
1528 \fBbool add_deb(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1529 \fI$repo\fR\fB\->add_deb(\fR\fI$filename\fR\fB)\fR;
1530 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1531 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1532 .fi
1533 .if n \{\
1534 .RE
1535 .\}
1536 .sp
1537 Add the metadata of a single deb package to the repository\&.
1538 .sp
1539 .if n \{\
1540 .RS 4
1541 .\}
1542 .nf
1543 \fBbool add_mdk(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1544 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1545 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1546 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1547 .fi
1548 .if n \{\
1549 .RE
1550 .\}
1551 .sp
1552 Add the contents of the mageia/mandriva repository metadata (the "synthesis\&.hdlist" file) to the repository\&.
1553 .sp
1554 .if n \{\
1555 .RS 4
1556 .\}
1557 .nf
1558 \fBbool add_mdk_info(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1559 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1560 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1561 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1562 .fi
1563 .if n \{\
1564 .RE
1565 .\}
1566 .sp
1567 Extend the packages from the synthesis file with the info\&.xml and files\&.xml data\&. Do not forget to specify \fBREPO_EXTEND_SOLVABLES\fR\&.
1568 .sp
1569 .if n \{\
1570 .RS 4
1571 .\}
1572 .nf
1573 \fBbool add_arch_repo(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1574 \fI$repo\fR\fB\->add_arch_repo(\fR\fI$fp\fR\fB)\fR;
1575 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1576 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1577 .fi
1578 .if n \{\
1579 .RE
1580 .\}
1581 .sp
1582 Add the contents of the archlinux repository metadata (the "\&.db\&.tar" file) to the repository\&.
1583 .sp
1584 .if n \{\
1585 .RS 4
1586 .\}
1587 .nf
1588 \fBbool add_arch_local(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1589 \fI$repo\fR\fB\->add_arch_local(\fR\fI$dir\fR\fB)\fR;
1590 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1591 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1592 .fi
1593 .if n \{\
1594 .RE
1595 .\}
1596 .sp
1597 Add the contents of the archlinux installed package database to the repository\&. The \fIdir\fR parameter is usually set to "/var/lib/pacman/local"\&.
1598 .sp
1599 .if n \{\
1600 .RS 4
1601 .\}
1602 .nf
1603 \fBbool add_content(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1604 \fI$repo\fR\fB\->add_content(\fR\fI$fp\fR\fB)\fR;
1605 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1606 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1607 .fi
1608 .if n \{\
1609 .RE
1610 .\}
1611 .sp
1612 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\&.
1613 .sp
1614 .if n \{\
1615 .RS 4
1616 .\}
1617 .nf
1618 \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
1619 \fI$repo\fR\fB\->add_susetags(\fR\fI$fp\fR\fB,\fR \fI$defvendor\fR\fB,\fR \fI$language\fR\fB)\fR;
1620 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1621 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1622 .fi
1623 .if n \{\
1624 .RE
1625 .\}
1626 .sp
1627 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\&.
1628 .sp
1629 .if n \{\
1630 .RS 4
1631 .\}
1632 .nf
1633 \fBbool add_products(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1634 \fI$repo\fR\fB\->add_products(\fR\fI$dir\fR\fB)\fR;
1635 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1636 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1637 .fi
1638 .if n \{\
1639 .RE
1640 .\}
1641 .sp
1642 Add the installed SUSE products database to the repository\&. The \fIdir\fR parameter is usually "/etc/products\&.d"\&.
1643 .SH "THE SOLVABLE CLASS"
1644 .sp
1645 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\&.
1646 .SS "ATTRIBUTES"
1647 .sp
1648 .if n \{\
1649 .RS 4
1650 .\}
1651 .nf
1652 \fBRepo *repo;\fR                     /* read only */
1653 \fI$solvable\fR\fB\->{\*(Aqrepo\*(Aq}\fR
1654 \fIsolvable\fR\fB\&.repo\fR
1655 \fIsolvable\fR\fB\&.repo\fR
1656 .fi
1657 .if n \{\
1658 .RE
1659 .\}
1660 .sp
1661 The repository this solvable belongs to\&.
1662 .sp
1663 .if n \{\
1664 .RS 4
1665 .\}
1666 .nf
1667 \fBPool *pool;\fR                     /* read only */
1668 \fI$solvable\fR\fB\->{\*(Aqpool\*(Aq}\fR
1669 \fIsolvable\fR\fB\&.pool\fR
1670 \fIsolvable\fR\fB\&.pool\fR
1671 .fi
1672 .if n \{\
1673 .RE
1674 .\}
1675 .sp
1676 The pool this solvable belongs to, same as the pool of the repo\&.
1677 .sp
1678 .if n \{\
1679 .RS 4
1680 .\}
1681 .nf
1682 \fBId id;\fR                          /* read only */
1683 \fI$solvable\fR\fB\->{\*(Aqid\*(Aq}\fR
1684 \fIsolvable\fR\fB\&.id\fR
1685 \fIsolvable\fR\fB\&.id\fR
1686 .fi
1687 .if n \{\
1688 .RE
1689 .\}
1690 .sp
1691 The specific id of the solvable\&.
1692 .sp
1693 .if n \{\
1694 .RS 4
1695 .\}
1696 .nf
1697 \fBchar *name;\fR                     /* read/write */
1698 \fI$solvable\fR\fB\->{\*(Aqname\*(Aq}\fR
1699 \fIsolvable\fR\fB\&.name\fR
1700 \fIsolvable\fR\fB\&.name\fR
1701 .fi
1702 .if n \{\
1703 .RE
1704 .\}
1705 .sp
1706 .if n \{\
1707 .RS 4
1708 .\}
1709 .nf
1710 \fBchar *evr;\fR                      /* read/write */
1711 \fI$solvable\fR\fB\->{\*(Aqevr\*(Aq}\fR
1712 \fIsolvable\fR\fB\&.evr\fR
1713 \fIsolvable\fR\fB\&.evr\fR
1714 .fi
1715 .if n \{\
1716 .RE
1717 .\}
1718 .sp
1719 .if n \{\
1720 .RS 4
1721 .\}
1722 .nf
1723 \fBchar *arch;\fR                     /* read/write */
1724 \fI$solvable\fR\fB\->{\*(Aqarch\*(Aq}\fR
1725 \fIsolvable\fR\fB\&.arch\fR
1726 \fIsolvable\fR\fB\&.arch\fR
1727 .fi
1728 .if n \{\
1729 .RE
1730 .\}
1731 .sp
1732 .if n \{\
1733 .RS 4
1734 .\}
1735 .nf
1736 \fBchar *vendor;\fR                   /* read/write */
1737 \fI$solvable\fR\fB\->{\*(Aqvendor\*(Aq}\fR
1738 \fIsolvable\fR\fB\&.vendor\fR
1739 \fIsolvable\fR\fB\&.vendor\fR
1740 .fi
1741 .if n \{\
1742 .RE
1743 .\}
1744 .sp
1745 Easy access to often used attributes of solvables\&. They are internally stored as Ids\&.
1746 .sp
1747 .if n \{\
1748 .RS 4
1749 .\}
1750 .nf
1751 \fBId nameid;\fR                      /* read/write */
1752 \fI$solvable\fR\fB\->{\*(Aqnameid\*(Aq}\fR
1753 \fIsolvable\fR\fB\&.nameid\fR
1754 \fIsolvable\fR\fB\&.nameid\fR
1755 .fi
1756 .if n \{\
1757 .RE
1758 .\}
1759 .sp
1760 .if n \{\
1761 .RS 4
1762 .\}
1763 .nf
1764 \fBId evrid;\fR                       /* read/write */
1765 \fI$solvable\fR\fB\->{\*(Aqevrid\*(Aq}\fR
1766 \fIsolvable\fR\fB\&.evrid\fR
1767 \fIsolvable\fR\fB\&.evrid\fR
1768 .fi
1769 .if n \{\
1770 .RE
1771 .\}
1772 .sp
1773 .if n \{\
1774 .RS 4
1775 .\}
1776 .nf
1777 \fBId archid;\fR                      /* read/write */
1778 \fI$solvable\fR\fB\->{\*(Aqarchid\*(Aq}\fR
1779 \fIsolvable\fR\fB\&.archid\fR
1780 \fIsolvable\fR\fB\&.archid\fR
1781 .fi
1782 .if n \{\
1783 .RE
1784 .\}
1785 .sp
1786 .if n \{\
1787 .RS 4
1788 .\}
1789 .nf
1790 \fBId vendorid;\fR                    /* read/write */
1791 \fI$solvable\fR\fB\->{\*(Aqvendorid\*(Aq}\fR
1792 \fIsolvable\fR\fB\&.vendorid\fR
1793 \fIsolvable\fR\fB\&.vendorid\fR
1794 .fi
1795 .if n \{\
1796 .RE
1797 .\}
1798 .sp
1799 Raw interface to the ids\&. Useful if you want to search for a specific id and want to avoid the string compare overhead\&.
1800 .SS "METHODS"
1801 .sp
1802 .if n \{\
1803 .RS 4
1804 .\}
1805 .nf
1806 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
1807 my \fI$string\fR \fB=\fR \fI$solvable\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
1808 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
1809 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
1810 .fi
1811 .if n \{\
1812 .RE
1813 .\}
1814 .sp
1815 .if n \{\
1816 .RS 4
1817 .\}
1818 .nf
1819 \fBId lookup_id(Id\fR \fIkeyname\fR\fB)\fR
1820 my \fI$id\fR \fB=\fR \fI$solvable\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
1821 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB)\fR
1822 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB)\fR
1823 .fi
1824 .if n \{\
1825 .RE
1826 .\}
1827 .sp
1828 .if n \{\
1829 .RS 4
1830 .\}
1831 .nf
1832 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
1833 my \fI$num\fR \fB=\fR \fI$solvable\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
1834 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
1835 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
1836 .fi
1837 .if n \{\
1838 .RE
1839 .\}
1840 .sp
1841 .if n \{\
1842 .RS 4
1843 .\}
1844 .nf
1845 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
1846 my \fI$bool\fR \fB=\fR \fI$solvable\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
1847 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
1848 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
1849 .fi
1850 .if n \{\
1851 .RE
1852 .\}
1853 .sp
1854 .if n \{\
1855 .RS 4
1856 .\}
1857 .nf
1858 \fBChksum *lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
1859 my \fI$chksum\fR \fB=\fR \fI$solvable\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
1860 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
1861 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
1862 .fi
1863 .if n \{\
1864 .RE
1865 .\}
1866 .sp
1867 .if n \{\
1868 .RS 4
1869 .\}
1870 .nf
1871 \fBQueue lookup_idarray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1872 my \fI@ids\fR \fB=\fR \fI$solvable\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
1873 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
1874 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
1875 .fi
1876 .if n \{\
1877 .RE
1878 .\}
1879 .sp
1880 .if n \{\
1881 .RS 4
1882 .\}
1883 .nf
1884 \fBQueue lookup_deparray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1885 my \fI@deps\fR \fB=\fR \fI$solvable\fR\fB\->lookup_deparray(\fR\fI$keyname\fR\fB)\fR;
1886 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
1887 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
1888 .fi
1889 .if n \{\
1890 .RE
1891 .\}
1892 .sp
1893 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\&.
1894 .sp
1895 .if n \{\
1896 .RS 4
1897 .\}
1898 .nf
1899 \fBconst char *lookup_location(unsigned int *\fR\fIOUTPUT\fR\fB)\fR;
1900 my \fB(\fR\fI$location\fR\fB,\fR \fI$medianr\fR\fB) =\fR \fI$solvable\fR\fB\->lookup_location()\fR;
1901 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
1902 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
1903 .fi
1904 .if n \{\
1905 .RE
1906 .\}
1907 .sp
1908 Return a tuple containing the on\-media location and an optional media number for multi\-part repositories (e\&.g\&. repositories spawning multiple DVDs)\&.
1909 .sp
1910 .if n \{\
1911 .RS 4
1912 .\}
1913 .nf
1914 \fBvoid add_deparray(Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR;
1915 \fI$solvable\fR\fB\->add_deparray(\fR\fI$keyname\fR\fB,\fR \fI$depid\fR\fB)\fR;
1916 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdepid\fR\fB)\fR
1917 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdepid\fR\fB)\fR
1918 .fi
1919 .if n \{\
1920 .RE
1921 .\}
1922 .sp
1923 Add a new dependency to the attributes stored in keyname\&.
1924 .sp
1925 .if n \{\
1926 .RS 4
1927 .\}
1928 .nf
1929 \fBbool installable()\fR;
1930 \fI$solvable\fR\fB\->installable()\fR
1931 \fIsolvable\fR\fB\&.installable()\fR
1932 \fIsolvable\fR\fB\&.installable?\fR
1933 .fi
1934 .if n \{\
1935 .RE
1936 .\}
1937 .sp
1938 Return true if the solvable is installable on the system\&. Solvables are not installable if the system does not support their architecture\&.
1939 .sp
1940 .if n \{\
1941 .RS 4
1942 .\}
1943 .nf
1944 \fBbool isinstalled()\fR;
1945 \fI$solvable\fR\fB\->isinstalled()\fR
1946 \fIsolvable\fR\fB\&.isinstalled()\fR
1947 \fIsolvable\fR\fB\&.isinstalled?\fR
1948 .fi
1949 .if n \{\
1950 .RE
1951 .\}
1952 .sp
1953 Return true if the solvable is installed on the system\&.
1954 .sp
1955 .if n \{\
1956 .RS 4
1957 .\}
1958 .nf
1959 \fBSelection *Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1960 my \fI$sel\fR \fB=\fR \fI$solvable\fR\fB\->Selection()\fR;
1961 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
1962 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
1963 .fi
1964 .if n \{\
1965 .RE
1966 .\}
1967 .sp
1968 Create a Selection containing just the single solvable\&.
1969 .sp
1970 .if n \{\
1971 .RS 4
1972 .\}
1973 .nf
1974 \fBconst char *str()\fR
1975 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str()\fR;
1976 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
1977 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
1978 .fi
1979 .if n \{\
1980 .RE
1981 .\}
1982 .sp
1983 Return a string describing the solvable\&. The string consists of the name, version, and architecture of the Solvable\&.
1984 .sp
1985 .if n \{\
1986 .RS 4
1987 .\}
1988 .nf
1989 \fB<stringification>\fR
1990 my \fI$str\fR \fB= "\fR\fI$solvable\fR\fB"\fR;
1991 \fIstr\fR \fB= str(\fR\fIsolvable\fR\fB)\fR
1992 \fIstr\fR \fB=\fR \fIsolvable\fR\fB\&.to_s\fR
1993 .fi
1994 .if n \{\
1995 .RE
1996 .\}
1997 .sp
1998 Same as calling the str() method\&.
1999 .sp
2000 .if n \{\
2001 .RS 4
2002 .\}
2003 .nf
2004 \fB<equality>\fR
2005 \fBif (\fR\fI$solvable1\fR \fB==\fR \fI$solvable2\fR\fB)\fR
2006 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR\fB:\fR
2007 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR
2008 .fi
2009 .if n \{\
2010 .RE
2011 .\}
2012 .sp
2013 Two solvables are equal if they are part of the same pool and have the same ids\&.
2014 .SH "THE DATAITERATOR CLASS"
2015 .sp
2016 xxx
2017 .SH "THE SELECTION CLASS"
2018 .sp
2019 xxx
2020 .SH "THE JOB CLASS"
2021 .sp
2022 xxx
2023 .SH "THE SOLVER CLASS"
2024 .sp
2025 xxx
2026 .SH "THE TRANSACTION CLASS"
2027 .sp
2028 xxx
2029 .SH "CHECKSUMS"
2030 .sp
2031 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\&.
2032 .SS "CLASS METHODS"
2033 .sp
2034 .if n \{\
2035 .RS 4
2036 .\}
2037 .nf
2038 \fBChksum *Chksum(Id\fR \fItype\fR\fB)\fR
2039 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB)\fR;
2040 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB)\fR
2041 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB)\fR
2042 .fi
2043 .if n \{\
2044 .RE
2045 .\}
2046 .sp
2047 Create a checksum object\&. Currently the following types are supported:
2048 .sp
2049 .if n \{\
2050 .RS 4
2051 .\}
2052 .nf
2053 \fBREPOKEY_TYPE_MD5\fR
2054 \fBREPOKEY_TYPE_SHA1\fR
2055 \fBREPOKEY_TYPE_SHA256\fR
2056 .fi
2057 .if n \{\
2058 .RE
2059 .\}
2060 .sp
2061 These keys are constants in the \fBsolv\fR class\&.
2062 .sp
2063 .if n \{\
2064 .RS 4
2065 .\}
2066 .nf
2067 \fBChksum *Chksum(Id\fR \fItype\fR\fB, const char *\fR\fIhex\fR\fB)\fR
2068 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB,\fR \fI$hex\fR\fB)\fR;
2069 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
2070 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
2071 .fi
2072 .if n \{\
2073 .RE
2074 .\}
2075 .sp
2076 Create an already finalized checksum object\&.
2077 .SS "ATTRIBUTES"
2078 .sp
2079 .if n \{\
2080 .RS 4
2081 .\}
2082 .nf
2083 \fBId type;\fR                        /* read only */
2084 \fI$chksum\fR\fB\->{\*(Aqtype\*(Aq}\fR
2085 \fIchksum\fR\fB\&.type\fR
2086 \fIchksum\fR\fB\&.type\fR
2087 .fi
2088 .if n \{\
2089 .RE
2090 .\}
2091 .sp
2092 Return the type of the checksum object\&.
2093 .SS "METHODS"
2094 .sp
2095 .if n \{\
2096 .RS 4
2097 .\}
2098 .nf
2099 \fBvoid add(const char *\fR\fIstr\fR\fB)\fR
2100 \fI$chksum\fR\fB\->add(\fR\fI$str\fR\fB)\fR;
2101 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
2102 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
2103 .fi
2104 .if n \{\
2105 .RE
2106 .\}
2107 .sp
2108 Add a string to the checksum\&.
2109 .sp
2110 .if n \{\
2111 .RS 4
2112 .\}
2113 .nf
2114 \fBvoid add_fp(FILE *\fR\fIfp\fR\fB)\fR
2115 \fI$chksum\fR\fB\->add_fp(\fR\fI$file\fR\fB)\fR;
2116 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
2117 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
2118 .fi
2119 .if n \{\
2120 .RE
2121 .\}
2122 .sp
2123 Add the contents of a file to the checksum\&.
2124 .sp
2125 .if n \{\
2126 .RS 4
2127 .\}
2128 .nf
2129 \fBvoid add_stat(const char *\fR\fIfilename\fR\fB)\fR
2130 \fI$chksum\fR\fB\->add_stat(\fR\fI$filename\fR\fB)\fR;
2131 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
2132 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
2133 .fi
2134 .if n \{\
2135 .RE
2136 .\}
2137 .sp
2138 Stat the file and add the dev/ino/size/mtime member to the checksum\&. If the stat fails, the members are zeroed\&.
2139 .sp
2140 .if n \{\
2141 .RS 4
2142 .\}
2143 .nf
2144 \fBvoid add_fstat(int\fR \fIfd\fR\fB)\fR
2145 \fI$chksum\fR\fB\->add_fstat(\fR\fI$fd\fR\fB)\fR;
2146 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
2147 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
2148 .fi
2149 .if n \{\
2150 .RE
2151 .\}
2152 .sp
2153 Same as add_stat, but instead of the filename a file descriptor is used\&.
2154 .sp
2155 .if n \{\
2156 .RS 4
2157 .\}
2158 .nf
2159 \fBunsigned char *raw()\fR
2160 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->raw()\fR;
2161 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
2162 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
2163 .fi
2164 .if n \{\
2165 .RE
2166 .\}
2167 .sp
2168 Finalize the checksum and return the result as raw bytes\&. This means that the result can contain zero bytes or unprintable characters\&.
2169 .sp
2170 .if n \{\
2171 .RS 4
2172 .\}
2173 .nf
2174 \fBunsigned char *hex()\fR
2175 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->hex()\fR;
2176 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
2177 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
2178 .fi
2179 .if n \{\
2180 .RE
2181 .\}
2182 .sp
2183 Finalize the checksum and return the result as hex string\&.
2184 .sp
2185 .if n \{\
2186 .RS 4
2187 .\}
2188 .nf
2189 \fB<equality>\fR
2190 \fBif (\fR\fI$chksum1\fR \fB==\fR \fI$chksum2\fR\fB)\fR
2191 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR\fB:\fR
2192 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR
2193 .fi
2194 .if n \{\
2195 .RE
2196 .\}
2197 .sp
2198 Checksums are equal if they are of the same type and the finalized results are the same\&.
2199 .sp
2200 .if n \{\
2201 .RS 4
2202 .\}
2203 .nf
2204 \fB<stringification>\fR
2205 my \fI$str\fR \fB= "\fR\fI$chksum\fR\fB"\fR;
2206 \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR
2207 \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR
2208 .fi
2209 .if n \{\
2210 .RE
2211 .\}
2212 .sp
2213 If the checksum is finished, the checksum is returned as "<type>:<hex>" string\&. Otherwise "<type>:unfinished" is returned\&.
2214 .SH "FILE MANAGEMENT"
2215 .sp
2216 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\&.
2217 .sp
2218 .if n \{\
2219 .RS 4
2220 .\}
2221 .nf
2222 \fBFILE *xfopen(char *\fR\fIfn\fR\fB, char *\fR\fImode\fR \fB= "r")\fR
2223 my \fI$file\fR \fB= solv::xfopen(\fR\fI$path\fR\fB)\fR;
2224 \fIfile\fR \fB= solv\&.xfopen(\fR\fIpath\fR\fB)\fR
2225 \fIfile\fR \fB= Solv::xfopen(\fR\fIpath\fR\fB)\fR
2226 .fi
2227 .if n \{\
2228 .RE
2229 .\}
2230 .sp
2231 Open a file at the specified path\&. The mode argument is passed on to the stdio library\&.
2232 .sp
2233 .if n \{\
2234 .RS 4
2235 .\}
2236 .nf
2237 \fBFILE *xfopen_fd(char *\fR\fIfn\fR\fB, int\fR \fIfileno\fR\fB)\fR
2238 my \fI$file\fR \fB= solv::xfopen_fd(\fR\fI$path\fR\fB,\fR \fI$fileno\fR\fB)\fR;
2239 \fIfile\fR \fB= solv\&.xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
2240 \fIfile\fR \fB= Solv::xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
2241 .fi
2242 .if n \{\
2243 .RE
2244 .\}
2245 .sp
2246 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\&.
2247 .SS "METHODS"
2248 .sp
2249 .if n \{\
2250 .RS 4
2251 .\}
2252 .nf
2253 \fBint fileno()\fR
2254 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->fileno()\fR;
2255 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
2256 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
2257 .fi
2258 .if n \{\
2259 .RE
2260 .\}
2261 .sp
2262 Return file file descriptor of the file\&. If the file is not open, \-1 is returned\&.
2263 .sp
2264 .if n \{\
2265 .RS 4
2266 .\}
2267 .nf
2268 \fBint dup()\fR
2269 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->dup()\fR;
2270 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
2271 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
2272 .fi
2273 .if n \{\
2274 .RE
2275 .\}
2276 .sp
2277 Return a copy of the descriptor of the file\&. If the file is not open, \-1 is returned\&.
2278 .sp
2279 .if n \{\
2280 .RS 4
2281 .\}
2282 .nf
2283 \fBbool flush()\fR
2284 \fI$file\fR\fB\->flush()\fR;
2285 \fIfile\fR\fB\&.flush()\fR
2286 \fIfile\fR\fB\&.flush()\fR
2287 .fi
2288 .if n \{\
2289 .RE
2290 .\}
2291 .sp
2292 Flush the file\&. Returns false if there was an error\&. Flushing a closed file always returns true\&.
2293 .sp
2294 .if n \{\
2295 .RS 4
2296 .\}
2297 .nf
2298 \fBbool close()\fR
2299 \fI$file\fR\fB\->close()\fR;
2300 \fIfile\fR\fB\&.close()\fR
2301 \fIfile\fR\fB\&.close()\fR
2302 .fi
2303 .if n \{\
2304 .RE
2305 .\}
2306 .sp
2307 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\&.
2308 .SH "THE REPODATACLASS"
2309 .sp
2310 xxx
2311 .SH "AUTHOR"
2312 .sp
2313 Michael Schroeder <mls@suse\&.de>