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