update bindings documentation
[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/17/2013
6 .\"    Manual: LIBSOLV
7 .\"    Source: libsolv
8 .\"  Language: English
9 .\"
10 .TH "LIBSOLV\-BINDINGS" "3" "05/17/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 int lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned int\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 \fBChksum *lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
573 my \fI$chksum\fR \fB=\fR \fI$pool\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
574 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
575 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
576 .fi
577 .if n \{\
578 .RE
579 .\}
580 .sp
581 Lookup functions\&. Return the data element stored in the specified solvable\&. You should probably use the methods of the Solvable class instead\&.
582 .sp
583 .if n \{\
584 .RS 4
585 .\}
586 .nf
587 \fBDataiterator *Dataiterator(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
588 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;
589 \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
590 \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
591 .fi
592 .if n \{\
593 .RE
594 .\}
595 .sp
596 .if n \{\
597 .RS 4
598 .\}
599 .nf
600 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
601 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
602 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
603 .fi
604 .if n \{\
605 .RE
606 .\}
607 .sp
608 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
609 .SS "ID METHODS"
610 .sp
611 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\&.
612 .sp
613 .if n \{\
614 .RS 4
615 .\}
616 .nf
617 \fBRepo *id2repo(Id\fR \fIid\fR\fB)\fR
618 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->id2repo(\fR\fI$id\fR\fB)\fR;
619 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
620 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
621 .fi
622 .if n \{\
623 .RE
624 .\}
625 .sp
626 Lookup an existing Repository by id\&. You can also do this by using the \fBrepos\fR attribute\&.
627 .sp
628 .if n \{\
629 .RS 4
630 .\}
631 .nf
632 \fBSolvable *id2solvable(Id\fR \fIid\fR\fB)\fR
633 \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->id2solvable(\fR\fI$id\fR\fB)\fR;
634 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
635 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
636 .fi
637 .if n \{\
638 .RE
639 .\}
640 .sp
641 Lookup an existing Repository by id\&. You can also do this by using the \fBsolvables\fR attribute\&.
642 .sp
643 .if n \{\
644 .RS 4
645 .\}
646 .nf
647 \fBconst char *solvid2str(Id\fR \fIid\fR\fB)\fR
648 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvid2str(\fR\fI$id\fR\fB)\fR;
649 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
650 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
651 .fi
652 .if n \{\
653 .RE
654 .\}
655 .sp
656 Return a string describing the Solvable with the specified id\&. The string consists of the name, version, and architecture of the Solvable\&.
657 .sp
658 .if n \{\
659 .RS 4
660 .\}
661 .nf
662 \fBId str2id(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
663 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->str2id(\fR\fI$string\fR\fB)\fR;
664 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
665 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
666 .fi
667 .if n \{\
668 .RE
669 .\}
670 .sp
671 .if n \{\
672 .RS 4
673 .\}
674 .nf
675 \fBconst char *id2str(Id\fR \fIid\fR\fB)\fR
676 \fI$string\fR \fB=\fR \fIpool\fR\fB\->id2str(\fR\fI$id\fR\fB)\fR;
677 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
678 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
679 .fi
680 .if n \{\
681 .RE
682 .\}
683 .sp
684 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\&.
685 .sp
686 .if n \{\
687 .RS 4
688 .\}
689 .nf
690 \fBId rel2id(Id\fR \fIname\fR\fB, Id\fR \fIevr\fR\fB, int\fR \fIflags\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
691 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;
692 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
693 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
694 .fi
695 .if n \{\
696 .RE
697 .\}
698 .sp
699 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:
700 .sp
701 .if n \{\
702 .RS 4
703 .\}
704 .nf
705 \fB$solv::REL_EQ | $solv::REL_GT | $solv::REL_LT\fR
706 \fBsolv\&.REL_EQ | solv\&.REL_GT | solv\&.REL_LT\fR
707 \fBSolv::REL_EQ | Solv::REL_GT | Solv::REL_LT\fR
708 .fi
709 .if n \{\
710 .RE
711 .\}
712 .sp
713 Thus, if you want a \(lq<=\(rq relation, you would use \fBREL_LT | REL_EQ\fR\&.
714 .sp
715 .if n \{\
716 .RS 4
717 .\}
718 .nf
719 \fBId id2langid(Id\fR \fIid\fR\fB, const char *\fR\fIlang\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
720 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->id2langid(\fR\fI$id\fR\fB,\fR \fI$language\fR\fB)\fR;
721 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
722 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
723 .fi
724 .if n \{\
725 .RE
726 .\}
727 .sp
728 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\&.
729 .sp
730 .if n \{\
731 .RS 4
732 .\}
733 .nf
734 \fBconst char *dep2str(Id\fR \fIid\fR\fB)\fR
735 \fI$string\fR \fB=\fR \fIpool\fR\fB\->dep2str(\fR\fI$id\fR\fB)\fR;
736 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
737 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
738 .fi
739 .if n \{\
740 .RE
741 .\}
742 .sp
743 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\&.
744 .SH "THE DEPENDENCY CLASS"
745 .sp
746 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\&.
747 .SS "ATTRIBUTES"
748 .sp
749 .if n \{\
750 .RS 4
751 .\}
752 .nf
753 \fBPool *pool;\fR             /* read only */
754 \fI$dep\fR\fB\->{\*(Aqpool\*(Aq}\fR
755 \fIdep\fR\fB\&.pool\fR
756 \fIdep\fR\fB\&.pool\fR
757 .fi
758 .if n \{\
759 .RE
760 .\}
761 .sp
762 Back reference to the pool this dependency belongs to\&.
763 .sp
764 .if n \{\
765 .RS 4
766 .\}
767 .nf
768 \fBId id;\fR          /* read only */
769 \fI$dep\fR\fB\->{\*(Aqid\*(Aq}\fR
770 \fIdep\fR\fB\&.id\fR
771 \fIdep\fR\fB\&.id\fR
772 .fi
773 .if n \{\
774 .RE
775 .\}
776 .sp
777 The id of this dependency\&.
778 .SH "METHODS"
779 .sp
780 .if n \{\
781 .RS 4
782 .\}
783 .nf
784 \fBDep *Rel(int\fR \fIflags\fR\fB, DepId\fR \fIevrid\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
785 my \fI$reldep\fR \fB=\fR \fI$dep\fR\fB\->Rel(\fR\fI$flags\fR\fB,\fR \fI$evrdep\fR\fB)\fR;
786 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
787 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
788 .fi
789 .if n \{\
790 .RE
791 .\}
792 .sp
793 Create a relational dependency from to string dependencies and a flags argument\&. See the pool\(cqs rel2id method for a description of the flags\&.
794 .sp
795 .if n \{\
796 .RS 4
797 .\}
798 .nf
799 \fBSelection *Selection_name(int\fR \fIsetflags\fR \fB= 0)\fR
800 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_name()\fR;
801 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
802 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
803 .fi
804 .if n \{\
805 .RE
806 .\}
807 .sp
808 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\&.
809 .sp
810 .if n \{\
811 .RS 4
812 .\}
813 .nf
814 \fBSelection *Selection_provides(int\fR \fIsetflags\fR \fB= 0)\fR
815 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_provides()\fR;
816 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
817 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
818 .fi
819 .if n \{\
820 .RE
821 .\}
822 .sp
823 Create a Selection from a dependency\&. The selection consists of all packages that have at least one provides matching the dependency\&.
824 .sp
825 .if n \{\
826 .RS 4
827 .\}
828 .nf
829 \fBconst char *str()\fR
830 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str()\fR;
831 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
832 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
833 .fi
834 .if n \{\
835 .RE
836 .\}
837 .sp
838 Return a string describing the dependency\&.
839 .sp
840 .if n \{\
841 .RS 4
842 .\}
843 .nf
844 \fB<stringification>\fR
845 my \fI$str\fR \fB= "\fR\fI$dep\fR\fB"\fR;
846 \fIstr\fR \fB= str(\fR\fIdep\fR\fB)\fR
847 \fIstr\fR \fB=\fR \fIdep\fR\fB\&.to_s\fR
848 .fi
849 .if n \{\
850 .RE
851 .\}
852 .sp
853 Same as calling the str() method\&.
854 .sp
855 .if n \{\
856 .RS 4
857 .\}
858 .nf
859 \fB<equality>\fR
860 \fBif (\fR\fI$dep1\fR \fB==\fR \fI$dep2\fR\fB)\fR
861 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR\fB:\fR
862 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR
863 .fi
864 .if n \{\
865 .RE
866 .\}
867 .sp
868 The dependencies are equal if they are part of the same pool and have the same ids\&.
869 .SH "THE REPOSITORY CLASS"
870 .sp
871 A Repository describes a group of packages, normally comming from the same source\&. Repositories are created by the Pool\(cqs add_repo() method\&.
872 .SS "ATTRIBUTES"
873 .sp
874 .if n \{\
875 .RS 4
876 .\}
877 .nf
878 \fBPool *pool;\fR                     /* read only */
879 \fI$repo\fR\fB\->{\*(Aqpool\*(Aq}\fR
880 \fIrepo\fR\fB\&.pool\fR
881 \fIrepo\fR\fB\&.pool\fR
882 .fi
883 .if n \{\
884 .RE
885 .\}
886 .sp
887 Back reference to the pool this dependency belongs to\&.
888 .sp
889 .if n \{\
890 .RS 4
891 .\}
892 .nf
893 \fBId id;\fR                          /* read only */
894 \fI$repo\fR\fB\->{\*(Aqid\*(Aq}\fR
895 \fIrepo\fR\fB\&.id\fR
896 \fIrepo\fR\fB\&.id\fR
897 .fi
898 .if n \{\
899 .RE
900 .\}
901 .sp
902 Return the id of the repository\&.
903 .sp
904 .if n \{\
905 .RS 4
906 .\}
907 .nf
908 \fBconst char *name;\fR               /* read/write */
909 \fI$repo\fR\fB\->{\*(Aqname\*(Aq}\fR
910 \fIrepo\fR\fB\&.name\fR
911 \fIrepo\fR\fB\&.name\fR
912 .fi
913 .if n \{\
914 .RE
915 .\}
916 .sp
917 The repositories name\&. To libsolv, the name is just a string with no specific meaning\&.
918 .sp
919 .if n \{\
920 .RS 4
921 .\}
922 .nf
923 \fBint prioprity;\fR                  /* read/write */
924 \fI$repo\fR\fB\->{\*(Aqpriority\*(Aq}\fR
925 \fIrepo\fR\fB\&.priority\fR
926 \fIrepo\fR\fB\&.priority\fR
927 .fi
928 .if n \{\
929 .RE
930 .\}
931 .sp
932 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\&.
933 .sp
934 .if n \{\
935 .RS 4
936 .\}
937 .nf
938 \fBint subprioprity;\fR               /* read/write */
939 \fI$repo\fR\fB\->{\*(Aqsubpriority\*(Aq}\fR
940 \fIrepo\fR\fB\&.subpriority\fR
941 \fIrepo\fR\fB\&.subpriority\fR
942 .fi
943 .if n \{\
944 .RE
945 .\}
946 .sp
947 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\&.
948 .sp
949 .if n \{\
950 .RS 4
951 .\}
952 .nf
953 \fBint nsolvables;\fR                 /* read only */
954 \fI$repo\fR\fB\->{\*(Aqnsolvables\*(Aq}\fR
955 \fIrepo\fR\fB\&.nsolvables\fR
956 \fIrepo\fR\fB\&.nsolvables\fR
957 .fi
958 .if n \{\
959 .RE
960 .\}
961 .sp
962 The number of solvables in this repository\&.
963 .sp
964 .if n \{\
965 .RS 4
966 .\}
967 .nf
968 \fBvoid *appdata;\fR                  /* read/write */
969 \fI$repo\fR\fB\->{\*(Aqappdata\*(Aq}\fR
970 \fIrepo\fR\fB\&.appdata\fR
971 \fIrepo\fR\fB\&.appdata\fR
972 .fi
973 .if n \{\
974 .RE
975 .\}
976 .sp
977 Application specific data that may be used in any way by the code using the repository\&.
978 .sp
979 .if n \{\
980 .RS 4
981 .\}
982 .nf
983 \fBDatapos *meta;\fR                  /* read only */
984 \fI$repo\fR\fB\->{\*(Aqmeta\*(Aq}\fR
985 \fIrepo\fR\fB\&.meta\fR
986 \fIrepo\fR\fB\&.meta\fR
987 .fi
988 .if n \{\
989 .RE
990 .\}
991 .sp
992 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\&.
993 .SS "CONSTANTS"
994 .PP
995 \fBREPO_REUSE_REPODATA\fR
996 .RS 4
997 Reuse the last repository data aera (\(lqrepodata\(rq) instead of creating a new one\&.
998 .RE
999 .PP
1000 \fBREPO_NO_INTERNALIZE\fR
1001 .RS 4
1002 Do not internalize the added repository data\&. This is useful if you plan to add more data because internalization is a costly operation\&.
1003 .RE
1004 .PP
1005 \fBREPO_LOCALPOOL\fR
1006 .RS 4
1007 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\&.
1008 .RE
1009 .PP
1010 \fBREPO_USE_LOADING\fR
1011 .RS 4
1012 Use the repodata that is currently being loaded instead of creating a new one\&. This only makes sense if used in a load callback\&.
1013 .RE
1014 .PP
1015 \fBREPO_EXTEND_SOLVABLES\fR
1016 .RS 4
1017 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\&.
1018 .RE
1019 .PP
1020 \fBREPO_USE_ROOTDIR\fR
1021 .RS 4
1022 Prepend the pool\(cqs rootdir to the path when doing file operations\&.
1023 .RE
1024 .PP
1025 \fBREPO_NO_LOCATION\fR
1026 .RS 4
1027 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\&.
1028 .RE
1029 .PP
1030 \fBSOLV_ADD_NO_STUBS\fR
1031 .RS 4
1032 Do not create stubs for repository parts that can be downloaded on demand\&.
1033 .RE
1034 .PP
1035 \fBSUSETAGS_RECORD_SHARES\fR
1036 .RS 4
1037 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\&.
1038 .RE
1039 .SS "METHODS"
1040 .sp
1041 .if n \{\
1042 .RS 4
1043 .\}
1044 .nf
1045 \fBvoid free(bool\fR \fIreuseids\fR \fB= 0)\fR
1046 \fI$repo\fR\fB\->free()\fR;
1047 \fIrepo\fR\fB\&.free()\fR
1048 \fIrepo\fR\fB\&.free()\fR
1049 .fi
1050 .if n \{\
1051 .RE
1052 .\}
1053 .sp
1054 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\&.
1055 .sp
1056 .if n \{\
1057 .RS 4
1058 .\}
1059 .nf
1060 \fBvoid empty(bool\fR \fIreuseids\fR \fB= 0)\fR
1061 \fI$repo\fR\fB\->empty()\fR;
1062 \fIrepo\fR\fB\&.empty()\fR
1063 \fIrepo\fR\fB\&.empty()\fR
1064 .fi
1065 .if n \{\
1066 .RE
1067 .\}
1068 .sp
1069 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\&.
1070 .sp
1071 .if n \{\
1072 .RS 4
1073 .\}
1074 .nf
1075 \fBbool isempty()\fR
1076 \fI$repo\fR\fB\->isempty()\fR
1077 \fIrepo\fR\fB\&.empty()\fR
1078 \fIrepo\fR\fB\&.empty?\fR
1079 .fi
1080 .if n \{\
1081 .RE
1082 .\}
1083 .sp
1084 Return true if there are no solvables in this repository\&.
1085 .sp
1086 .if n \{\
1087 .RS 4
1088 .\}
1089 .nf
1090 \fBvoid internalize()\fR
1091 \fI$repo\fR\fB\->internalize()\fR;
1092 \fIrepo\fR\fB\&.internalize()\fR
1093 \fIrepo\fR\fB\&.internalize()\fR
1094 .fi
1095 .if n \{\
1096 .RE
1097 .\}
1098 .sp
1099 Internalize added data\&. Data must be internalized before it is available to the lookup and data iterator functions\&.
1100 .sp
1101 .if n \{\
1102 .RS 4
1103 .\}
1104 .nf
1105 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR
1106 \fI$repo\fR\fB\->write(\fR\fI$fp\fR\fB)\fR
1107 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1108 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1109 .fi
1110 .if n \{\
1111 .RE
1112 .\}
1113 .sp
1114 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\&.
1115 .sp
1116 .if n \{\
1117 .RS 4
1118 .\}
1119 .nf
1120 \fBSolvableiterator *solvables_iter()\fR
1121 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$repo\fR\fB\->solvables_iter()})\fR
1122 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter():\fR
1123 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter()\fR
1124 .fi
1125 .if n \{\
1126 .RE
1127 .\}
1128 .sp
1129 Iterate over all solvables in a repository\&.
1130 .sp
1131 .if n \{\
1132 .RS 4
1133 .\}
1134 .nf
1135 \fBRepodata *add_repodata(int\fR \fIflags\fR \fB= 0)\fR
1136 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->add_repodata()\fR;
1137 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1138 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1139 .fi
1140 .if n \{\
1141 .RE
1142 .\}
1143 .sp
1144 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\&.
1145 .sp
1146 .if n \{\
1147 .RS 4
1148 .\}
1149 .nf
1150 \fBvoid create_stubs()\fR
1151 \fI$repo\fR\fB\->create_stubs()\fR;
1152 \fIrepo\fR\fB\&.create_stubs()\fR
1153 \fIrepo\fR\fB\&.create_stubs()\fR
1154 .fi
1155 .if n \{\
1156 .RE
1157 .\}
1158 .sp
1159 Calls the create_stubs() repodata method for the last repodata of the repository\&.
1160 .sp
1161 .if n \{\
1162 .RS 4
1163 .\}
1164 .nf
1165 \fBbool iscontiguous()\fR
1166 \fI$repo\fR\fB\->iscontiguous()\fR
1167 \fIrepo\fR\fB\&.iscontiguous()\fR
1168 \fIrepo\fR\fB\&.iscontiguous?\fR
1169 .fi
1170 .if n \{\
1171 .RE
1172 .\}
1173 .sp
1174 Return true if the solvables of this repository are all in a single block with no holes, i\&.e\&. they have consecutive ids\&.
1175 .sp
1176 .if n \{\
1177 .RS 4
1178 .\}
1179 .nf
1180 \fBRepodata *first_repodata()\fR
1181 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->first_repodata()\fR;
1182 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1183 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1184 .fi
1185 .if n \{\
1186 .RE
1187 .\}
1188 .sp
1189 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\&.
1190 .sp
1191 .if n \{\
1192 .RS 4
1193 .\}
1194 .nf
1195 \fBSelection *Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1196 my \fI$sel\fR \fB=\fR \fI$repo\fR\fB\->Selection()\fR;
1197 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1198 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1199 .fi
1200 .if n \{\
1201 .RE
1202 .\}
1203 .sp
1204 Create a Selection consisting of all packages in the repository\&.
1205 .sp
1206 .if n \{\
1207 .RS 4
1208 .\}
1209 .nf
1210 \fBDataiterator *Dataiterator(Id\fR \fIp\fR\fB, Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
1211 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;
1212 \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
1213 \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
1214 .fi
1215 .if n \{\
1216 .RE
1217 .\}
1218 .sp
1219 .if n \{\
1220 .RS 4
1221 .\}
1222 .nf
1223 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1224 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1225 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1226 .fi
1227 .if n \{\
1228 .RE
1229 .\}
1230 .sp
1231 Iterate over the matching data elements in this repository\&. See the Dataiterator class for more information\&.
1232 .sp
1233 .if n \{\
1234 .RS 4
1235 .\}
1236 .nf
1237 \fB<stringification>\fR
1238 my \fI$str\fR \fB= "\fR\fI$repo\fR\fB"\fR;
1239 \fIstr\fR \fB= str(\fR\fIrepo\fR\fB)\fR
1240 \fIstr\fR \fB=\fR \fIrepo\fR\fB\&.to_s\fR
1241 .fi
1242 .if n \{\
1243 .RE
1244 .\}
1245 .sp
1246 Return the name of the repository, or "Repo#<id>" if no name is set\&.
1247 .sp
1248 .if n \{\
1249 .RS 4
1250 .\}
1251 .nf
1252 \fB<equality>\fR
1253 \fBif (\fR\fI$repo1\fR \fB==\fR \fI$repo2\fR\fB)\fR
1254 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR\fB:\fR
1255 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR
1256 .fi
1257 .if n \{\
1258 .RE
1259 .\}
1260 .sp
1261 Two repositories are equal if they belong to the same pool and have the same id\&.
1262 .SS "DATA ADD METHODS"
1263 .sp
1264 .if n \{\
1265 .RS 4
1266 .\}
1267 .nf
1268 \fBSolvable *add_solvable()\fR
1269 \fI$repo\fR\fB\->add_solvable()\fR;
1270 \fIrepo\fR\fB\&.add_solvable()\fR
1271 \fIrepo\fR\fB\&.add_solvable()\fR
1272 .fi
1273 .if n \{\
1274 .RE
1275 .\}
1276 .sp
1277 Add a single empty solvable to the repository\&. Returns a Solvable object, see the Solvable class for more information\&.
1278 .sp
1279 .if n \{\
1280 .RS 4
1281 .\}
1282 .nf
1283 \fBbool add_solv(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1284 \fI$repo\fR\fB\->add_solv(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1285 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1286 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1287 .fi
1288 .if n \{\
1289 .RE
1290 .\}
1291 .sp
1292 .if n \{\
1293 .RS 4
1294 .\}
1295 .nf
1296 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1297 \fI$repo\fR\fB\->add_solv(\fR\fI$fp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1298 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1299 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1300 .fi
1301 .if n \{\
1302 .RE
1303 .\}
1304 .sp
1305 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\&.
1306 .sp
1307 .if n \{\
1308 .RS 4
1309 .\}
1310 .nf
1311 \fBbool add_rpmdb(int\fR \fIflags\fR \fB= 0)\fR
1312 \fI$repo\fR\fB\->add_rpmdb(\fR\fI$flags\fR\fB)\fR;
1313 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1314 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1315 .fi
1316 .if n \{\
1317 .RE
1318 .\}
1319 .sp
1320 .if n \{\
1321 .RS 4
1322 .\}
1323 .nf
1324 \fBbool add_rpmdb_reffp(FILE *\fR\fIreffp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1325 \fI$repo\fR\fB\->add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1326 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1327 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1328 .fi
1329 .if n \{\
1330 .RE
1331 .\}
1332 .sp
1333 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\&.
1334 .sp
1335 .if n \{\
1336 .RS 4
1337 .\}
1338 .nf
1339 \fBbool add_rpm(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1340 \fI$repo\fR\fB\->add_rpm(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1341 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1342 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1343 .fi
1344 .if n \{\
1345 .RE
1346 .\}
1347 .sp
1348 Add the metadata of a single rpm package to the repository\&.
1349 .sp
1350 .if n \{\
1351 .RS 4
1352 .\}
1353 .nf
1354 \fBbool add_rpmdb_pubkeys(int\fR \fIflags\fR \fB= 0)\fR
1355 \fI$repo\fR\fB\->add_rpmdb_pubkeys()\fR;
1356 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1357 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1358 .fi
1359 .if n \{\
1360 .RE
1361 .\}
1362 .sp
1363 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\&.
1364 .sp
1365 .if n \{\
1366 .RS 4
1367 .\}
1368 .nf
1369 \fBbool add_pubkey(const char *\fR\fIkeyfile\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1370 \fI$repo\fR\fB\->add_pubkey(\fR\fI$keyfile\fR\fB)\fR;
1371 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1372 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1373 .fi
1374 .if n \{\
1375 .RE
1376 .\}
1377 .sp
1378 Add a pubkey from a file to the repository\&.
1379 .sp
1380 .if n \{\
1381 .RS 4
1382 .\}
1383 .nf
1384 \fBbool add_rpmmd(FILE *\fR\fIfp\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1385 \fI$repo\fR\fB\->add_rpmmd(\fR\fI$fp\fR\fB,\fR \fI$language\fR\fB)\fR;
1386 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1387 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1388 .fi
1389 .if n \{\
1390 .RE
1391 .\}
1392 .sp
1393 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\&.
1394 .sp
1395 .if n \{\
1396 .RS 4
1397 .\}
1398 .nf
1399 \fBbool add_repomdxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1400 \fI$repo\fR\fB\->add_repomdxml(\fR\fI$fp\fR\fB)\fR;
1401 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1402 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1403 .fi
1404 .if n \{\
1405 .RE
1406 .\}
1407 .sp
1408 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\&.
1409 .sp
1410 .if n \{\
1411 .RS 4
1412 .\}
1413 .nf
1414 \fBbool add_updateinfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1415 \fI$repo\fR\fB\->add_updateinfoxml(\fR\fI$fp\fR\fB)\fR;
1416 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1417 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1418 .fi
1419 .if n \{\
1420 .RE
1421 .\}
1422 .sp
1423 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\&.
1424 .sp
1425 .if n \{\
1426 .RS 4
1427 .\}
1428 .nf
1429 \fBbool add_deltainfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1430 \fI$repo\fR\fB\->add_deltainfoxml(\fR\fI$fp\fR\fB)\fR;
1431 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1432 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1433 .fi
1434 .if n \{\
1435 .RE
1436 .\}
1437 .sp
1438 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\&.
1439 .sp
1440 .if n \{\
1441 .RS 4
1442 .\}
1443 .nf
1444 \fBbool add_debdb(int\fR \fIflags\fR \fB= 0)\fR
1445 \fI$repo\fR\fB\->add_debdb()\fR;
1446 \fIrepo\fR\fB\&.add_debdb()\fR
1447 \fIrepo\fR\fB\&.add_debdb()\fR
1448 .fi
1449 .if n \{\
1450 .RE
1451 .\}
1452 .sp
1453 Add the contents of the debian installed package database to the repository\&.
1454 .sp
1455 .if n \{\
1456 .RS 4
1457 .\}
1458 .nf
1459 \fBbool add_debpackages(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1460 \fI$repo\fR\fB\->add_debpackages(\fR\fI$fp\fR\fB)\fR;
1461 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1462 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1463 .fi
1464 .if n \{\
1465 .RE
1466 .\}
1467 .sp
1468 Add the contents of the debian repository metadata (the "packages" file) to the repository\&.
1469 .sp
1470 .if n \{\
1471 .RS 4
1472 .\}
1473 .nf
1474 \fBbool add_deb(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1475 \fI$repo\fR\fB\->add_deb(\fR\fI$filename\fR\fB)\fR;
1476 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1477 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1478 .fi
1479 .if n \{\
1480 .RE
1481 .\}
1482 .sp
1483 Add the metadata of a single deb package to the repository\&.
1484 .sp
1485 .if n \{\
1486 .RS 4
1487 .\}
1488 .nf
1489 \fBbool add_mdk(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1490 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1491 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1492 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1493 .fi
1494 .if n \{\
1495 .RE
1496 .\}
1497 .sp
1498 Add the contents of the mageia/mandriva repository metadata (the "synthesis\&.hdlist" file) to the repository\&.
1499 .sp
1500 .if n \{\
1501 .RS 4
1502 .\}
1503 .nf
1504 \fBbool add_mdk_info(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1505 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1506 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1507 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1508 .fi
1509 .if n \{\
1510 .RE
1511 .\}
1512 .sp
1513 Extend the packages from the synthesis file with the info\&.xml and files\&.xml data\&. Do not forget to specify \fBREPO_EXTEND_SOLVABLES\fR\&.
1514 .sp
1515 .if n \{\
1516 .RS 4
1517 .\}
1518 .nf
1519 \fBbool add_arch_repo(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1520 \fI$repo\fR\fB\->add_arch_repo(\fR\fI$fp\fR\fB)\fR;
1521 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1522 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1523 .fi
1524 .if n \{\
1525 .RE
1526 .\}
1527 .sp
1528 Add the contents of the archlinux repository metadata (the "\&.db\&.tar" file) to the repository\&.
1529 .sp
1530 .if n \{\
1531 .RS 4
1532 .\}
1533 .nf
1534 \fBbool add_arch_local(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1535 \fI$repo\fR\fB\->add_arch_local(\fR\fI$dir\fR\fB)\fR;
1536 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1537 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1538 .fi
1539 .if n \{\
1540 .RE
1541 .\}
1542 .sp
1543 Add the contents of the archlinux installed package database to the repository\&. The \fIdir\fR parameter is usually set to "/var/lib/pacman/local"\&.
1544 .sp
1545 .if n \{\
1546 .RS 4
1547 .\}
1548 .nf
1549 \fBbool add_content(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1550 \fI$repo\fR\fB\->add_content(\fR\fI$fp\fR\fB)\fR;
1551 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1552 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1553 .fi
1554 .if n \{\
1555 .RE
1556 .\}
1557 .sp
1558 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\&.
1559 .sp
1560 .if n \{\
1561 .RS 4
1562 .\}
1563 .nf
1564 \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
1565 \fI$repo\fR\fB\->add_susetags(\fR\fI$fp\fR\fB,\fR \fI$defvendor\fR\fB,\fR \fI$language\fR\fB)\fR;
1566 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1567 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1568 .fi
1569 .if n \{\
1570 .RE
1571 .\}
1572 .sp
1573 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\&.
1574 .sp
1575 .if n \{\
1576 .RS 4
1577 .\}
1578 .nf
1579 \fBbool add_products(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1580 \fI$repo\fR\fB\->add_products(\fR\fI$dir\fR\fB)\fR;
1581 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1582 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1583 .fi
1584 .if n \{\
1585 .RE
1586 .\}
1587 .sp
1588 Add the installed SUSE products database to the repository\&. The \fIdir\fR parameter is usually "/etc/products\&.d"\&.
1589 .SH "THE SOLVABLE CLASS"
1590 .sp
1591 xxx
1592 .SH "THE DATAITERATOR CLASS"
1593 .sp
1594 xxx
1595 .SH "THE SELECTION CLASS"
1596 .sp
1597 xxx
1598 .SH "THE JOB CLASS"
1599 .sp
1600 xxx
1601 .SH "THE SOLVER CLASS"
1602 .sp
1603 xxx
1604 .SH "THE TRANSACTION CLASS"
1605 .sp
1606 xxx
1607 .SH "CHECKSUMS"
1608 .sp
1609 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\&.
1610 .SS "CLASS METHODS"
1611 .sp
1612 .if n \{\
1613 .RS 4
1614 .\}
1615 .nf
1616 \fBChksum *Chksum(Id\fR \fItype\fR\fB)\fR
1617 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB)\fR;
1618 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB)\fR
1619 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB)\fR
1620 .fi
1621 .if n \{\
1622 .RE
1623 .\}
1624 .sp
1625 Create a checksum object\&. Currently the following types are supported:
1626 .sp
1627 .if n \{\
1628 .RS 4
1629 .\}
1630 .nf
1631 \fBREPOKEY_TYPE_MD5\fR
1632 \fBREPOKEY_TYPE_SHA1\fR
1633 \fBREPOKEY_TYPE_SHA256\fR
1634 .fi
1635 .if n \{\
1636 .RE
1637 .\}
1638 .sp
1639 These keys are constants in the \fBsolv\fR class\&.
1640 .sp
1641 .if n \{\
1642 .RS 4
1643 .\}
1644 .nf
1645 \fBChksum *Chksum(Id\fR \fItype\fR\fB, const char *\fR\fIhex\fR\fB)\fR
1646 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB,\fR \fI$hex\fR\fB)\fR;
1647 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
1648 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
1649 .fi
1650 .if n \{\
1651 .RE
1652 .\}
1653 .sp
1654 Create an already finalized checksum object\&.
1655 .SS "ATTRIBUTES"
1656 .sp
1657 .if n \{\
1658 .RS 4
1659 .\}
1660 .nf
1661 \fBId type;\fR                        /* read only */
1662 \fI$chksum\fR\fB\->{\*(Aqtype\*(Aq}\fR
1663 \fIchksum\fR\fB\&.type\fR
1664 \fIchksum\fR\fB\&.type\fR
1665 .fi
1666 .if n \{\
1667 .RE
1668 .\}
1669 .sp
1670 Return the type of the checksum object\&.
1671 .SS "METHODS"
1672 .sp
1673 .if n \{\
1674 .RS 4
1675 .\}
1676 .nf
1677 \fBvoid add(const char *\fR\fIstr\fR\fB)\fR
1678 \fI$chksum\fR\fB\->add(\fR\fI$str\fR\fB)\fR;
1679 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
1680 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
1681 .fi
1682 .if n \{\
1683 .RE
1684 .\}
1685 .sp
1686 Add a string to the checksum\&.
1687 .sp
1688 .if n \{\
1689 .RS 4
1690 .\}
1691 .nf
1692 \fBvoid add_fp(FILE *\fR\fIfp\fR\fB)\fR
1693 \fI$chksum\fR\fB\->add_fp(\fR\fI$file\fR\fB)\fR;
1694 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
1695 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
1696 .fi
1697 .if n \{\
1698 .RE
1699 .\}
1700 .sp
1701 Add the contents of a file to the checksum\&.
1702 .sp
1703 .if n \{\
1704 .RS 4
1705 .\}
1706 .nf
1707 \fBvoid add_stat(const char *\fR\fIfilename\fR\fB)\fR
1708 \fI$chksum\fR\fB\->add_stat(\fR\fI$filename\fR\fB)\fR;
1709 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
1710 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
1711 .fi
1712 .if n \{\
1713 .RE
1714 .\}
1715 .sp
1716 Stat the file and add the dev/ino/size/mtime member to the checksum\&. If the stat fails, the members are zeroed\&.
1717 .sp
1718 .if n \{\
1719 .RS 4
1720 .\}
1721 .nf
1722 \fBvoid add_fstat(int\fR \fIfd\fR\fB)\fR
1723 \fI$chksum\fR\fB\->add_fstat(\fR\fI$fd\fR\fB)\fR;
1724 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
1725 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
1726 .fi
1727 .if n \{\
1728 .RE
1729 .\}
1730 .sp
1731 Same as add_stat, but instead of the filename a file descriptor is used\&.
1732 .sp
1733 .if n \{\
1734 .RS 4
1735 .\}
1736 .nf
1737 \fBunsigned char *raw()\fR
1738 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->raw()\fR;
1739 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
1740 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
1741 .fi
1742 .if n \{\
1743 .RE
1744 .\}
1745 .sp
1746 Finalize the checksum and return the result as raw bytes\&. This means that the result can contain zero bytes or unprintable characters\&.
1747 .sp
1748 .if n \{\
1749 .RS 4
1750 .\}
1751 .nf
1752 \fBunsigned char *hex()\fR
1753 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->hex()\fR;
1754 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
1755 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
1756 .fi
1757 .if n \{\
1758 .RE
1759 .\}
1760 .sp
1761 Finalize the checksum and return the result as hex string\&.
1762 .sp
1763 .if n \{\
1764 .RS 4
1765 .\}
1766 .nf
1767 \fB<equality>\fR
1768 \fBif (\fR\fI$chksum1\fR \fB==\fR \fI$chksum2\fR\fB)\fR
1769 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR\fB:\fR
1770 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR
1771 .fi
1772 .if n \{\
1773 .RE
1774 .\}
1775 .sp
1776 Checksums are equal if they are of the same type and the finalized results are the same\&.
1777 .sp
1778 .if n \{\
1779 .RS 4
1780 .\}
1781 .nf
1782 \fB<stringification>\fR
1783 my \fI$str\fR \fB= "\fR\fI$chksum\fR\fB"\fR;
1784 \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR
1785 \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR
1786 .fi
1787 .if n \{\
1788 .RE
1789 .\}
1790 .sp
1791 If the checksum is finished, the checksum is returned as "<type>:<hex>" string\&. Otherwise "<type>:unfinished" is returned\&.
1792 .SH "FILE MANAGEMENT"
1793 .sp
1794 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\&.
1795 .sp
1796 .if n \{\
1797 .RS 4
1798 .\}
1799 .nf
1800 \fBFILE *xfopen(char *\fR\fIfn\fR\fB, char *\fR\fImode\fR \fB= "r")\fR
1801 my \fI$file\fR \fB= solv::xfopen(\fR\fI$path\fR\fB)\fR;
1802 \fIfile\fR \fB= solv\&.xfopen(\fR\fIpath\fR\fB)\fR
1803 \fIfile\fR \fB= Solv::xfopen(\fR\fIpath\fR\fB)\fR
1804 .fi
1805 .if n \{\
1806 .RE
1807 .\}
1808 .sp
1809 Open a file at the specified path\&. The mode argument is passed on to the stdio library\&.
1810 .sp
1811 .if n \{\
1812 .RS 4
1813 .\}
1814 .nf
1815 \fBFILE *xfopen_fd(char *\fR\fIfn\fR\fB, int\fR \fIfileno\fR\fB)\fR
1816 my \fI$file\fR \fB= solv::xfopen_fd(\fR\fI$path\fR\fB,\fR \fI$fileno\fR\fB)\fR;
1817 \fIfile\fR \fB= solv\&.xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
1818 \fIfile\fR \fB= Solv::xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
1819 .fi
1820 .if n \{\
1821 .RE
1822 .\}
1823 .sp
1824 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\&.
1825 .SS "METHODS"
1826 .sp
1827 .if n \{\
1828 .RS 4
1829 .\}
1830 .nf
1831 \fBint fileno()\fR
1832 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->fileno()\fR;
1833 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
1834 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
1835 .fi
1836 .if n \{\
1837 .RE
1838 .\}
1839 .sp
1840 Return file file descriptor of the file\&. If the file is not open, \-1 is returned\&.
1841 .sp
1842 .if n \{\
1843 .RS 4
1844 .\}
1845 .nf
1846 \fBint dup()\fR
1847 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->dup()\fR;
1848 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
1849 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
1850 .fi
1851 .if n \{\
1852 .RE
1853 .\}
1854 .sp
1855 Return a copy of the descriptor of the file\&. If the file is not open, \-1 is returned\&.
1856 .sp
1857 .if n \{\
1858 .RS 4
1859 .\}
1860 .nf
1861 \fBbool flush()\fR
1862 \fI$file\fR\fB\->flush()\fR;
1863 \fIfile\fR\fB\&.flush()\fR
1864 \fIfile\fR\fB\&.flush()\fR
1865 .fi
1866 .if n \{\
1867 .RE
1868 .\}
1869 .sp
1870 Flush the file\&. Returns false if there was an error\&. Flushing a closed file always returns true\&.
1871 .sp
1872 .if n \{\
1873 .RS 4
1874 .\}
1875 .nf
1876 \fBbool close()\fR
1877 \fI$file\fR\fB\->close()\fR;
1878 \fIfile\fR\fB\&.close()\fR
1879 \fIfile\fR\fB\&.close()\fR
1880 .fi
1881 .if n \{\
1882 .RE
1883 .\}
1884 .sp
1885 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\&.
1886 .SH "THE REPODATACLASS"
1887 .sp
1888 xxx
1889 .SH "AUTHOR"
1890 .sp
1891 Michael Schroeder <mls@suse\&.de>