document POOL_FLAG_ADDFILEPROVIDESFILTERED
[platform/upstream/libsolv.git] / doc / libsolv-bindings.3
1 '\" t
2 .\"     Title: libsolv-bindings
3 .\"    Author: [see the "Author" section]
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5 .\"      Date: 06/03/2013
6 .\"    Manual: LIBSOLV
7 .\"    Source: libsolv
8 .\"  Language: English
9 .\"
10 .TH "LIBSOLV\-BINDINGS" "3" "06/03/2013" "libsolv" "LIBSOLV"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 libsolv-bindings \- access libsolv from perl/python/ruby
32 .SH "DESCRIPTION"
33 .sp
34 bla bla bla
35 .SH "THE POOL"
36 .sp
37 The pool is libsolv\(cqs central resource manager\&. A pool consists of Solvables, Repositories, Dependencies, each indexed by Ids\&.
38 .SS "CLASS METHODS"
39 .sp
40 .if n \{\
41 .RS 4
42 .\}
43 .nf
44 \fBPool *Pool()\fR
45 my \fI$pool\fR \fB= solv::Pool\->new()\fR;
46 \fIpool\fR \fB= solv\&.Pool()\fR
47 \fIpool\fR \fB= Solv::Pool\&.new()\fR
48 .fi
49 .if n \{\
50 .RE
51 .\}
52 .sp
53 Create a new pool instance\&. In most cases you just need one pool\&.
54 .SS "ATTRIBUTES"
55 .sp
56 .if n \{\
57 .RS 4
58 .\}
59 .nf
60 \fBvoid *appdata;\fR                  /* read/write */
61 \fI$pool\fR\fB\->{\*(Aqappdata\*(Aq}\fR
62 \fIpool\fR\fB\&.appdata\fR
63 \fIpool\fR\fB\&.appdata\fR
64 .fi
65 .if n \{\
66 .RE
67 .\}
68 .sp
69 Application specific data that may be used in any way by the code using the pool\&.
70 .sp
71 .if n \{\
72 .RS 4
73 .\}
74 .nf
75 \fBSolvable solvables[];\fR           /* read only */
76 my \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->{\*(Aqsolvables\*(Aq}\->[\fR\fI$solvid\fR\fB]\fR;
77 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.solvables[\fR\fIsolvid\fR\fB]\fR
78 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.solvables[\fR\fIsolvid\fR\fB]\fR
79 .fi
80 .if n \{\
81 .RE
82 .\}
83 .sp
84 Look up a Solvable by its id\&.
85 .sp
86 .if n \{\
87 .RS 4
88 .\}
89 .nf
90 \fBRepo repos[];\fR                   /* read only */
91 my \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->{\*(Aqrepos\*(Aq}\->[\fR\fI$repoid\fR\fB]\fR;
92 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.repos[\fR\fIrepoid\fR\fB]\fR
93 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.repos[\fR\fIrepoid\fR\fB]\fR
94 .fi
95 .if n \{\
96 .RE
97 .\}
98 .sp
99 Look up a Repository by its id\&.
100 .sp
101 .if n \{\
102 .RS 4
103 .\}
104 .nf
105 \fBRepo *installed;\fR                /* read/write */
106 \fI$pool\fR\fB\->{\*(Aqinstalled\*(Aq} =\fR \fI$repo\fR;
107 \fIpool\fR\fB\&.installed =\fR \fIrepo\fR
108 \fIpool\fR\fB\&.installed =\fR \fIrepo\fR
109 .fi
110 .if n \{\
111 .RE
112 .\}
113 .sp
114 Define which repository contains all the installed packages\&.
115 .SS "CONSTANTS"
116 .PP
117 \fBPOOL_FLAG_PROMOTEEPOCH\fR
118 .RS 4
119 Promote the epoch of the providing dependency to the requesting dependency if it does not contain an epoch\&. Used at some time in old rpm versions, modern systems should never need this\&.
120 .RE
121 .PP
122 \fBPOOL_FLAG_FORBIDSELFCONFLICTS\fR
123 .RS 4
124 Disallow the installation of packages that conflict with themselfs\&. Debian always allowd self\-conflicting packages, rpm used to forbid them but switched to also allowing them recently\&.
125 .RE
126 .PP
127 \fBPOOL_FLAG_OBSOLETEUSESPROVIDES\fR
128 .RS 4
129 Make obsolete type dependency match against provides instead of just the name and version of packages\&. Very old versions of rpm used the name/version, then it got switched to provides and later switched back again to just name/version\&.
130 .RE
131 .PP
132 \fBPOOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES\fR
133 .RS 4
134 An implicit obsoletes is the internal mechanism to remove the old package on an update\&. The default is to remove all packages with the same name, rpm\-5 switched to also removing packages providing the same name\&.
135 .RE
136 .PP
137 \fBPOOL_FLAG_OBSOLETEUSESCOLORS\fR
138 .RS 4
139 Rpm\(cqs multilib implementation (used in RedHat and Fedora) distinguishes between 32bit and 64bit packages (the terminology is that they have a different color)\&. If obsolteusescolors is set, packages with different colors will not obsolete each other\&. This is also true for implicit obsoletes, thus you can install both the 32bit and the 64bit version of a package with the same name\&.
140 .RE
141 .PP
142 \fBPOOL_FLAG_NOINSTALLEDOBSOLETES\fR
143 .RS 4
144 New versions of rpm consider the obsoletes of installed packages when checking for dependency, thus you may not install a package that is obsoleted by some other installed package, unless you also deinstall the other package\&.
145 .RE
146 .PP
147 \fBPOOL_FLAG_HAVEDISTEPOCH\fR
148 .RS 4
149 Mandriva added a new field called distepoch that gets checked in version comparison if the epoch/version/release of two packages are the same\&.
150 .RE
151 .PP
152 \fBPOOL_FLAG_NOOBSOLETESMULTIVERSION\fR
153 .RS 4
154 If a package is installed in multiversionmode, rpm used to ignore both the implicit obsoletes and the obsolete dependency of a package\&. This was changed to ignoring just the implicit obsoletes, thus you may install multiple versions of the same name, but obsoleted packages still get removed\&.
155 .RE
156 .PP
157 \fBPOOL_FLAG_ADDFILEPROVIDESFILTERED\fR
158 .RS 4
159 Make the addfileprovides method only add files from the standard locations (i\&.e\&. the \(lqbin\(rq and \(lqetc\(rq directories)\&. This is useful if you have only few packages that use non\-standard file dependencies, but you still wand the fast speed that addfileprovides() generates\&.
160 .RE
161 .SS "METHODS"
162 .sp
163 .if n \{\
164 .RS 4
165 .\}
166 .nf
167 \fBvoid free()\fR
168 \fI$pool\fR\fB\->free()\fR;
169 \fIpool\fR\fB\&.free()\fR
170 \fIpool\fR\fB\&.free()\fR
171 .fi
172 .if n \{\
173 .RE
174 .\}
175 .sp
176 Free a pool\&. This is currently done with a method instead of relying on reference counting or garbage collection because it\(cqs hard to track every reference to a pool\&.
177 .sp
178 .if n \{\
179 .RS 4
180 .\}
181 .nf
182 \fBvoid setdebuglevel(int\fR \fIlevel\fR\fB)\fR
183 \fI$pool\fR\fB\->setdebuglevel(\fR\fI$level\fR\fB)\fR;
184 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
185 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
186 .fi
187 .if n \{\
188 .RE
189 .\}
190 .sp
191 Set the debug level\&. A value of zero means no debug output, the higher the value, the more output is generated\&.
192 .sp
193 .if n \{\
194 .RS 4
195 .\}
196 .nf
197 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
198 my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
199 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
200 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
201 .fi
202 .if n \{\
203 .RE
204 .\}
205 .sp
206 .if n \{\
207 .RS 4
208 .\}
209 .nf
210 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
211 my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
212 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
213 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
214 .fi
215 .if n \{\
216 .RE
217 .\}
218 .sp
219 Set/get a pool specific flag\&. The flags define how the system works, e\&.g\&. how the package manager treats obsoletes\&. The default flags should be sane for most applications, but in some cases you may want to tweak a flag, for example if you want to solv package dependencies for some other system than yours\&.
220 .sp
221 .if n \{\
222 .RS 4
223 .\}
224 .nf
225 \fBvoid set_rootdir(const char *\fR\fIrootdir\fR\fB)\fR
226 \fI$pool\fR\fB\->set_rootdir(\fR\fIrootdir\fR\fB)\fR;
227 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
228 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
229 .fi
230 .if n \{\
231 .RE
232 .\}
233 .sp
234 .if n \{\
235 .RS 4
236 .\}
237 .nf
238 \fBconst char *get_rootdir()\fR
239 my \fI$rootdir\fR \fB=\fR \fI$pool\fR\fB\->get_rootdir()\fR;
240 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
241 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
242 .fi
243 .if n \{\
244 .RE
245 .\}
246 .sp
247 Set/get the rootdir to use\&. This is useful if you want package management to work only in some directory, for example if you want to setup a chroot jail\&. Note that the rootdir will only be prepended to file paths if the \fBREPO_USE_ROOTDIR\fR flag is used\&.
248 .sp
249 .if n \{\
250 .RS 4
251 .\}
252 .nf
253 \fBvoid setarch(const char *\fR\fIarch\fR \fB= 0)\fR
254 \fI$pool\fR\fB\->setarch()\fR;
255 \fIpool\fR\fB\&.setarch()\fR
256 \fIpool\fR\fB\&.setarch()\fR
257 .fi
258 .if n \{\
259 .RE
260 .\}
261 .sp
262 Set the architecture for your system\&. The architecture is used to determine which packages are installable\&. It defaults to the result of \(lquname \-m\(rq\&.
263 .sp
264 .if n \{\
265 .RS 4
266 .\}
267 .nf
268 \fBRepo *add_repo(const char *\fR\fIname\fR\fB)\fR
269 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->add_repo(\fR\fI$name\fR\fB)\fR;
270 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
271 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
272 .fi
273 .if n \{\
274 .RE
275 .\}
276 .sp
277 Add a Repository with the specified name to the pool\&. The reposiory is empty on creation, use the repository methods to populate it with packages\&.
278 .sp
279 .if n \{\
280 .RS 4
281 .\}
282 .nf
283 \fBRepoiterator *repos_iter()\fR
284 \fBfor my\fR \fI$repo\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->repos_iter()})\fR
285 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter():\fR
286 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter()\fR
287 .fi
288 .if n \{\
289 .RE
290 .\}
291 .sp
292 Iterate over the existing repositories\&.
293 .sp
294 .if n \{\
295 .RS 4
296 .\}
297 .nf
298 \fBSolvableiterator *solvables_iter()\fR
299 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->solvables_iter()})\fR
300 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter():\fR
301 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter()\fR
302 .fi
303 .if n \{\
304 .RE
305 .\}
306 .sp
307 Iterate over the existing solvables\&.
308 .sp
309 .if n \{\
310 .RS 4
311 .\}
312 .nf
313 \fBDep *Dep(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
314 my \fI$dep\fR \fB=\fR \fI$pool\fR\fB\->Dep(\fR\fI$string\fR\fB)\fR;
315 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
316 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
317 .fi
318 .if n \{\
319 .RE
320 .\}
321 .sp
322 Create an object describing a string or dependency\&. If the string is currently not in the pool and \fIcreate\fR is false, \fBundef\fR/\fBNone\fR/\fBnil\fR is returned\&.
323 .sp
324 .if n \{\
325 .RS 4
326 .\}
327 .nf
328 \fBvoid addfileprovides()\fR
329 \fI$pool\fR\fB\->addfileprovides()\fR;
330 \fIpool\fR\fB\&.addfileprovides()\fR
331 \fIpool\fR\fB\&.addfileprovides()\fR
332 .fi
333 .if n \{\
334 .RE
335 .\}
336 .sp
337 .if n \{\
338 .RS 4
339 .\}
340 .nf
341 \fBQueue addfileprovides_queue()\fR
342 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->addfileprovides_queue()\fR;
343 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
344 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
345 .fi
346 .if n \{\
347 .RE
348 .\}
349 .sp
350 Some package managers like rpm allow dependencies on files contained in other packages\&. To allow libsolv to deal with those dependencies in an efficient way, you need to call the addfileprovides method after creating and reading all repositories\&. This method will scan all dependency for file names and than scan all packages for matching files\&. If a filename has been matched, it will be added to the provides list of the corresponding package\&. The addfileprovides_queue variant works the same way but returns an array containing all file dependencies\&. This information can be stored with the repository to speed up the next usage of the repository\&.
351 .sp
352 .if n \{\
353 .RS 4
354 .\}
355 .nf
356 \fBvoid createwhatprovides()\fR
357 \fI$pool\fR\fB\->createwhatprovides()\fR;
358 \fIpool\fR\fB\&.createwhatprovides()\fR
359 \fIpool\fR\fB\&.createwhatprovides()\fR
360 .fi
361 .if n \{\
362 .RE
363 .\}
364 .sp
365 Create the internal \(lqwhatprovides\(rq hash over all of the provides of all packages\&. This method must be called before doing any lookups on provides\&. It\(cqs encuraged to do it right after all repos are set up, usually right after the call to addfileprovides()\&.
366 .sp
367 .if n \{\
368 .RS 4
369 .\}
370 .nf
371 \fBQueue whatprovides(DepId\fR \fIdep\fR\fB)\fR
372 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatprovides(\fR\fI$dep\fR\fB)\fR;
373 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
374 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
375 .fi
376 .if n \{\
377 .RE
378 .\}
379 .sp
380 Return all solvables that provide the specified dependency\&. You can use either a Dep object or an simple Id as argument\&.
381 .sp
382 .if n \{\
383 .RS 4
384 .\}
385 .nf
386 \fBQueue matchprovidingids(const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
387 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->matchprovidingids(\fR\fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
388 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
389 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
390 .fi
391 .if n \{\
392 .RE
393 .\}
394 .sp
395 Search the names of all provides and return the ones matching the specified string\&. See the Dataiterator class for the allowed flags\&.
396 .sp
397 .if n \{\
398 .RS 4
399 .\}
400 .nf
401 \fBId towhatprovides(Queue\fR \fIids\fR\fB)\fR
402 my \fI$offset\fR \fB=\fR \fI$pool\fR\fB\->towhatprovides(\e\fR\fI@ids\fR\fB)\fR;
403 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
404 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
405 .fi
406 .if n \{\
407 .RE
408 .\}
409 .sp
410 \(lqInternalize\(rq an array containing Ids\&. The returned value can be used to create solver jobs working on a specific set of packages\&. See the Solver class for more information\&.
411 .sp
412 .if n \{\
413 .RS 4
414 .\}
415 .nf
416 \fBbool isknownarch(DepId\fR \fIid\fR\fB)\fR
417 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->isknownarch(\fR\fI$id\fR\fB)\fR;
418 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch(\fR\fIid\fR\fB)\fR
419 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch?(\fR\fIid\fR\fB)\fR
420 .fi
421 .if n \{\
422 .RE
423 .\}
424 .sp
425 Return true if the specified Id describs a known architecture\&.
426 .sp
427 .if n \{\
428 .RS 4
429 .\}
430 .nf
431 \fBSolver *Solver()\fR
432 my \fI$solver\fR \fB=\fR \fI$pool\fR\fB\->Solver()\fR;
433 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
434 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
435 .fi
436 .if n \{\
437 .RE
438 .\}
439 .sp
440 Create a new solver object\&.
441 .sp
442 .if n \{\
443 .RS 4
444 .\}
445 .nf
446 \fBSolver *Job(int\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
447 my \fI$job\fR \fB=\fR \fI$pool\fR\fB\->Job(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
448 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
449 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
450 .fi
451 .if n \{\
452 .RE
453 .\}
454 .sp
455 Create a new Job object\&. Kind of low level, in most cases you would use a Selection or Dep job constructor instead\&.
456 .sp
457 .if n \{\
458 .RS 4
459 .\}
460 .nf
461 \fBSelection *Selection()\fR
462 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection()\fR;
463 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
464 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
465 .fi
466 .if n \{\
467 .RE
468 .\}
469 .sp
470 Create an empty selection\&. Useful as a starting point for merging other selections\&.
471 .sp
472 .if n \{\
473 .RS 4
474 .\}
475 .nf
476 \fBSelection *Selection_all()\fR
477 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection_all()\fR;
478 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
479 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
480 .fi
481 .if n \{\
482 .RE
483 .\}
484 .sp
485 Create a selection containing all packages\&. Useful as starting point for intersecting other selections or for update/distupgrade jobs\&.
486 .sp
487 .if n \{\
488 .RS 4
489 .\}
490 .nf
491 \fBSelection *select(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB)\fR
492 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->select(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
493 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
494 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
495 .fi
496 .if n \{\
497 .RE
498 .\}
499 .sp
500 Create a selection by matching packages against the specified string\&. See the Selection class for a list of flags and how to create solver jobs from a selection\&.
501 .sp
502 .if n \{\
503 .RS 4
504 .\}
505 .nf
506 \fBvoid setpooljobs(Jobs *\fR\fIjobs\fR\fB)\fR
507 \fI$pool\fR\fB\->setpooljobs(\e\fR\fI@jobs\fR\fB)\fR;
508 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
509 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
510 .fi
511 .if n \{\
512 .RE
513 .\}
514 .sp
515 .if n \{\
516 .RS 4
517 .\}
518 .nf
519 \fBJobs *getpooljobs()\fR
520 \fI@jobs\fR \fB=\fR \fI$pool\fR\fB\->getpooljobs()\fR;
521 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
522 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
523 .fi
524 .if n \{\
525 .RE
526 .\}
527 .sp
528 Get/Set fixed jobs stored in the pool\&. Those jobs are automatically appended to all solver jobs, they are meant for fixed configurations like which packages can be multiversion installed, which packages were userinstalled or must not be erased\&.
529 .sp
530 .if n \{\
531 .RS 4
532 .\}
533 .nf
534 \fBvoid set_loadcallback(Callable *\fR\fIcallback\fR\fB)\fR
535 \fI$pool\fR\fB\->setloadcallback(\e\fR\fI&callbackfunction\fR\fB)\fR;
536 \fIpool\fR\fB\&.setloadcallback(\fR\fIcallbackfunction\fR\fB)\fR
537 \fIpool\fR\fB\&.setloadcallback { |\fR\fIrepodata\fR\fB| \&.\&.\&. }\fR
538 .fi
539 .if n \{\
540 .RE
541 .\}
542 .sp
543 Set the callback function called when repository metadata needs to be loaded on demand\&. To make use of this feature, you need to create repodata stubs that tell the library which data is available but not loaded\&. If later on the data needs to be accessed, the callback function is called with a repodata argument\&. You can then load the data (maybe fetching it first from an remote server)\&. The callback should return true if the data has been made available\&.
544 .SS "DATA RETRIEVAL METHODS"
545 .sp
546 In the following functions, the \fIkeyname\fR argument describes what to retrive\&. For the standard cases you can use the available Id constants\&. For example,
547 .sp
548 .if n \{\
549 .RS 4
550 .\}
551 .nf
552 \fB$solv::SOLVABLE_SUMMARY\fR
553 \fBsolv\&.SOLVABLE_SUMMARY\fR
554 \fBSolv::SOLVABLE_SUMMARY\fR
555 .fi
556 .if n \{\
557 .RE
558 .\}
559 .sp
560 selects the \(lqSummary\(rq entry of a solvable\&. The \fIsolvid\fR argument selects the desired solvable by Id\&.
561 .sp
562 .if n \{\
563 .RS 4
564 .\}
565 .nf
566 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
567 my \fI$string\fR \fB=\fR \fI$pool\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
568 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
569 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
570 .fi
571 .if n \{\
572 .RE
573 .\}
574 .sp
575 .if n \{\
576 .RS 4
577 .\}
578 .nf
579 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
580 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->lookup_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
581 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
582 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
583 .fi
584 .if n \{\
585 .RE
586 .\}
587 .sp
588 .if n \{\
589 .RS 4
590 .\}
591 .nf
592 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
593 my \fI$num\fR \fB=\fR \fI$pool\fR\fB\->lookup_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
594 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
595 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
596 .fi
597 .if n \{\
598 .RE
599 .\}
600 .sp
601 .if n \{\
602 .RS 4
603 .\}
604 .nf
605 \fBbool lookup_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
606 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->lookup_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
607 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
608 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
609 .fi
610 .if n \{\
611 .RE
612 .\}
613 .sp
614 .if n \{\
615 .RS 4
616 .\}
617 .nf
618 \fBQueue lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
619 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
620 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
621 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
622 .fi
623 .if n \{\
624 .RE
625 .\}
626 .sp
627 .if n \{\
628 .RS 4
629 .\}
630 .nf
631 \fBChksum *lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
632 my \fI$chksum\fR \fB=\fR \fI$pool\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
633 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
634 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
635 .fi
636 .if n \{\
637 .RE
638 .\}
639 .sp
640 Lookup functions\&. Return the data element stored in the specified solvable\&. You should probably use the methods of the Solvable class instead\&.
641 .sp
642 .if n \{\
643 .RS 4
644 .\}
645 .nf
646 \fBDataiterator *Dataiterator(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
647 my \fI$di\fR \fB=\fR \fI$pool\fR\fB\->Dataiterator(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
648 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
649 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
650 .fi
651 .if n \{\
652 .RE
653 .\}
654 .sp
655 .if n \{\
656 .RS 4
657 .\}
658 .nf
659 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
660 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
661 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
662 .fi
663 .if n \{\
664 .RE
665 .\}
666 .sp
667 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
668 .SS "ID METHODS"
669 .sp
670 The following methods deal with Ids, i\&.e\&. integers representing objects in the pool\&. They are considered \(lqlow level\(rq, in most cases you would not use them but instead the object orientated methods\&.
671 .sp
672 .if n \{\
673 .RS 4
674 .\}
675 .nf
676 \fBRepo *id2repo(Id\fR \fIid\fR\fB)\fR
677 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->id2repo(\fR\fI$id\fR\fB)\fR;
678 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
679 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
680 .fi
681 .if n \{\
682 .RE
683 .\}
684 .sp
685 Lookup an existing Repository by id\&. You can also do this by using the \fBrepos\fR attribute\&.
686 .sp
687 .if n \{\
688 .RS 4
689 .\}
690 .nf
691 \fBSolvable *id2solvable(Id\fR \fIid\fR\fB)\fR
692 \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->id2solvable(\fR\fI$id\fR\fB)\fR;
693 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
694 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
695 .fi
696 .if n \{\
697 .RE
698 .\}
699 .sp
700 Lookup an existing Repository by id\&. You can also do this by using the \fBsolvables\fR attribute\&.
701 .sp
702 .if n \{\
703 .RS 4
704 .\}
705 .nf
706 \fBconst char *solvid2str(Id\fR \fIid\fR\fB)\fR
707 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvid2str(\fR\fI$id\fR\fB)\fR;
708 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
709 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
710 .fi
711 .if n \{\
712 .RE
713 .\}
714 .sp
715 Return a string describing the Solvable with the specified id\&. The string consists of the name, version, and architecture of the Solvable\&.
716 .sp
717 .if n \{\
718 .RS 4
719 .\}
720 .nf
721 \fBId str2id(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
722 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->str2id(\fR\fI$string\fR\fB)\fR;
723 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
724 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
725 .fi
726 .if n \{\
727 .RE
728 .\}
729 .sp
730 .if n \{\
731 .RS 4
732 .\}
733 .nf
734 \fBconst char *id2str(Id\fR \fIid\fR\fB)\fR
735 \fI$string\fR \fB=\fR \fIpool\fR\fB\->id2str(\fR\fI$id\fR\fB)\fR;
736 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
737 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
738 .fi
739 .if n \{\
740 .RE
741 .\}
742 .sp
743 Convert a string into an Id and back\&. If the string is currently not in the pool and \fIcreate\fR is false, zero is returned\&.
744 .sp
745 .if n \{\
746 .RS 4
747 .\}
748 .nf
749 \fBId rel2id(Id\fR \fIname\fR\fB, Id\fR \fIevr\fR\fB, int\fR \fIflags\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
750 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->rel2id(\fR\fI$nameid\fR\fB,\fR \fI$evrid\fR\fB,\fR \fI$flags\fR\fB)\fR;
751 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
752 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
753 .fi
754 .if n \{\
755 .RE
756 .\}
757 .sp
758 Create a \(lqrelational\(rq dependency\&. Such dependencies consist of a name part, the \fIflags\fR describing the relation, and a version part\&. The flags are:
759 .sp
760 .if n \{\
761 .RS 4
762 .\}
763 .nf
764 \fB$solv::REL_EQ | $solv::REL_GT | $solv::REL_LT\fR
765 \fBsolv\&.REL_EQ | solv\&.REL_GT | solv\&.REL_LT\fR
766 \fBSolv::REL_EQ | Solv::REL_GT | Solv::REL_LT\fR
767 .fi
768 .if n \{\
769 .RE
770 .\}
771 .sp
772 Thus, if you want a \(lq<=\(rq relation, you would use \fBREL_LT | REL_EQ\fR\&.
773 .sp
774 .if n \{\
775 .RS 4
776 .\}
777 .nf
778 \fBId id2langid(Id\fR \fIid\fR\fB, const char *\fR\fIlang\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
779 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->id2langid(\fR\fI$id\fR\fB,\fR \fI$language\fR\fB)\fR;
780 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
781 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
782 .fi
783 .if n \{\
784 .RE
785 .\}
786 .sp
787 Create a language specific Id from some other id\&. This function simply converts the id into a string, appends a dot and the specified language to the string and converts the result back into an Id\&.
788 .sp
789 .if n \{\
790 .RS 4
791 .\}
792 .nf
793 \fBconst char *dep2str(Id\fR \fIid\fR\fB)\fR
794 \fI$string\fR \fB=\fR \fIpool\fR\fB\->dep2str(\fR\fI$id\fR\fB)\fR;
795 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
796 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
797 .fi
798 .if n \{\
799 .RE
800 .\}
801 .sp
802 Convert a dependency id into a string\&. If the id is just a string, this function has the same effect as id2str()\&. For relational dependencies, the result is the correct \(lqname relation evr\(rq string\&.
803 .SH "THE DEPENDENCY CLASS"
804 .sp
805 The dependency class is an object orientated way to work with strings and dependencies\&. Internally, dependencies are represented as Ids, i\&.e\&. simple numbers\&. Dependency objects can be constructed by using the Pool\(cqs Dep() method\&.
806 .SS "ATTRIBUTES"
807 .sp
808 .if n \{\
809 .RS 4
810 .\}
811 .nf
812 \fBPool *pool;\fR             /* read only */
813 \fI$dep\fR\fB\->{\*(Aqpool\*(Aq}\fR
814 \fIdep\fR\fB\&.pool\fR
815 \fIdep\fR\fB\&.pool\fR
816 .fi
817 .if n \{\
818 .RE
819 .\}
820 .sp
821 Back reference to the pool this dependency belongs to\&.
822 .sp
823 .if n \{\
824 .RS 4
825 .\}
826 .nf
827 \fBId id;\fR          /* read only */
828 \fI$dep\fR\fB\->{\*(Aqid\*(Aq}\fR
829 \fIdep\fR\fB\&.id\fR
830 \fIdep\fR\fB\&.id\fR
831 .fi
832 .if n \{\
833 .RE
834 .\}
835 .sp
836 The id of this dependency\&.
837 .SH "METHODS"
838 .sp
839 .if n \{\
840 .RS 4
841 .\}
842 .nf
843 \fBDep *Rel(int\fR \fIflags\fR\fB, DepId\fR \fIevrid\fR\fB, bool\fR \fIcreate\fR\fB=1)\fR
844 my \fI$reldep\fR \fB=\fR \fI$dep\fR\fB\->Rel(\fR\fI$flags\fR\fB,\fR \fI$evrdep\fR\fB)\fR;
845 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
846 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
847 .fi
848 .if n \{\
849 .RE
850 .\}
851 .sp
852 Create a relational dependency from to string dependencies and a flags argument\&. See the pool\(cqs rel2id method for a description of the flags\&.
853 .sp
854 .if n \{\
855 .RS 4
856 .\}
857 .nf
858 \fBSelection *Selection_name(int\fR \fIsetflags\fR \fB= 0)\fR
859 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_name()\fR;
860 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
861 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
862 .fi
863 .if n \{\
864 .RE
865 .\}
866 .sp
867 Create a Selection from a dependency\&. The selection consists of all packages that have a name equal to the dependency\&. If the dependency is of a relational type, the packages version must also fulfill the dependency\&.
868 .sp
869 .if n \{\
870 .RS 4
871 .\}
872 .nf
873 \fBSelection *Selection_provides(int\fR \fIsetflags\fR \fB= 0)\fR
874 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_provides()\fR;
875 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
876 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
877 .fi
878 .if n \{\
879 .RE
880 .\}
881 .sp
882 Create a Selection from a dependency\&. The selection consists of all packages that have at least one provides matching the dependency\&.
883 .sp
884 .if n \{\
885 .RS 4
886 .\}
887 .nf
888 \fBconst char *str()\fR
889 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str()\fR;
890 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
891 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
892 .fi
893 .if n \{\
894 .RE
895 .\}
896 .sp
897 Return a string describing the dependency\&.
898 .sp
899 .if n \{\
900 .RS 4
901 .\}
902 .nf
903 \fB<stringification>\fR
904 my \fI$str\fR \fB= "\fR\fI$dep\fR\fB"\fR;
905 \fIstr\fR \fB= str(\fR\fIdep\fR\fB)\fR
906 \fIstr\fR \fB=\fR \fIdep\fR\fB\&.to_s\fR
907 .fi
908 .if n \{\
909 .RE
910 .\}
911 .sp
912 Same as calling the str() method\&.
913 .sp
914 .if n \{\
915 .RS 4
916 .\}
917 .nf
918 \fB<equality>\fR
919 \fBif (\fR\fI$dep1\fR \fB==\fR \fI$dep2\fR\fB)\fR
920 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR\fB:\fR
921 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR
922 .fi
923 .if n \{\
924 .RE
925 .\}
926 .sp
927 The dependencies are equal if they are part of the same pool and have the same ids\&.
928 .SH "THE REPOSITORY CLASS"
929 .sp
930 A Repository describes a group of packages, normally comming from the same source\&. Repositories are created by the Pool\(cqs add_repo() method\&.
931 .SS "ATTRIBUTES"
932 .sp
933 .if n \{\
934 .RS 4
935 .\}
936 .nf
937 \fBPool *pool;\fR                     /* read only */
938 \fI$repo\fR\fB\->{\*(Aqpool\*(Aq}\fR
939 \fIrepo\fR\fB\&.pool\fR
940 \fIrepo\fR\fB\&.pool\fR
941 .fi
942 .if n \{\
943 .RE
944 .\}
945 .sp
946 Back reference to the pool this dependency belongs to\&.
947 .sp
948 .if n \{\
949 .RS 4
950 .\}
951 .nf
952 \fBId id;\fR                          /* read only */
953 \fI$repo\fR\fB\->{\*(Aqid\*(Aq}\fR
954 \fIrepo\fR\fB\&.id\fR
955 \fIrepo\fR\fB\&.id\fR
956 .fi
957 .if n \{\
958 .RE
959 .\}
960 .sp
961 The id of the repository\&.
962 .sp
963 .if n \{\
964 .RS 4
965 .\}
966 .nf
967 \fBconst char *name;\fR               /* read/write */
968 \fI$repo\fR\fB\->{\*(Aqname\*(Aq}\fR
969 \fIrepo\fR\fB\&.name\fR
970 \fIrepo\fR\fB\&.name\fR
971 .fi
972 .if n \{\
973 .RE
974 .\}
975 .sp
976 The repositories name\&. To libsolv, the name is just a string with no specific meaning\&.
977 .sp
978 .if n \{\
979 .RS 4
980 .\}
981 .nf
982 \fBint prioprity;\fR                  /* read/write */
983 \fI$repo\fR\fB\->{\*(Aqpriority\*(Aq}\fR
984 \fIrepo\fR\fB\&.priority\fR
985 \fIrepo\fR\fB\&.priority\fR
986 .fi
987 .if n \{\
988 .RE
989 .\}
990 .sp
991 The priority of the repository\&. A higher number means that packages of this repository will be chosen over other repositories, even if they have a greater package version\&.
992 .sp
993 .if n \{\
994 .RS 4
995 .\}
996 .nf
997 \fBint subprioprity;\fR               /* read/write */
998 \fI$repo\fR\fB\->{\*(Aqsubpriority\*(Aq}\fR
999 \fIrepo\fR\fB\&.subpriority\fR
1000 \fIrepo\fR\fB\&.subpriority\fR
1001 .fi
1002 .if n \{\
1003 .RE
1004 .\}
1005 .sp
1006 The sub\-priority of the repository\&. This value is compared when the priorities of two repositories are the same\&. It is useful to make the library prefer on\-disk repositories to remote ones\&.
1007 .sp
1008 .if n \{\
1009 .RS 4
1010 .\}
1011 .nf
1012 \fBint nsolvables;\fR                 /* read only */
1013 \fI$repo\fR\fB\->{\*(Aqnsolvables\*(Aq}\fR
1014 \fIrepo\fR\fB\&.nsolvables\fR
1015 \fIrepo\fR\fB\&.nsolvables\fR
1016 .fi
1017 .if n \{\
1018 .RE
1019 .\}
1020 .sp
1021 The number of solvables in this repository\&.
1022 .sp
1023 .if n \{\
1024 .RS 4
1025 .\}
1026 .nf
1027 \fBvoid *appdata;\fR                  /* read/write */
1028 \fI$repo\fR\fB\->{\*(Aqappdata\*(Aq}\fR
1029 \fIrepo\fR\fB\&.appdata\fR
1030 \fIrepo\fR\fB\&.appdata\fR
1031 .fi
1032 .if n \{\
1033 .RE
1034 .\}
1035 .sp
1036 Application specific data that may be used in any way by the code using the repository\&.
1037 .sp
1038 .if n \{\
1039 .RS 4
1040 .\}
1041 .nf
1042 \fBDatapos *meta;\fR                  /* read only */
1043 \fI$repo\fR\fB\->{\*(Aqmeta\*(Aq}\fR
1044 \fIrepo\fR\fB\&.meta\fR
1045 \fIrepo\fR\fB\&.meta\fR
1046 .fi
1047 .if n \{\
1048 .RE
1049 .\}
1050 .sp
1051 Return a Datapos object of the repodata\(cqs metadata\&. You can use the lookup methods of the Datapos class to lookup metadata attributes, like the repository timestamp\&.
1052 .SS "CONSTANTS"
1053 .PP
1054 \fBREPO_REUSE_REPODATA\fR
1055 .RS 4
1056 Reuse the last repository data aera (\(lqrepodata\(rq) instead of creating a new one\&.
1057 .RE
1058 .PP
1059 \fBREPO_NO_INTERNALIZE\fR
1060 .RS 4
1061 Do not internalize the added repository data\&. This is useful if you plan to add more data because internalization is a costly operation\&.
1062 .RE
1063 .PP
1064 \fBREPO_LOCALPOOL\fR
1065 .RS 4
1066 Use the repodata\(cqs pool for Id storage instead of the global pool\&. Useful if you don\(cqt want to pollute the global pool with many unneeded ids, like when storing the filelist\&.
1067 .RE
1068 .PP
1069 \fBREPO_USE_LOADING\fR
1070 .RS 4
1071 Use the repodata that is currently being loaded instead of creating a new one\&. This only makes sense if used in a load callback\&.
1072 .RE
1073 .PP
1074 \fBREPO_EXTEND_SOLVABLES\fR
1075 .RS 4
1076 Do not create new solvables for the new data, but match existing solvables and add the data to them\&. Repository metadata is often split into multiple parts, with one primary file describing all packages and other parts holding information that is normally not needed, like the changelog\&.
1077 .RE
1078 .PP
1079 \fBREPO_USE_ROOTDIR\fR
1080 .RS 4
1081 Prepend the pool\(cqs rootdir to the path when doing file operations\&.
1082 .RE
1083 .PP
1084 \fBREPO_NO_LOCATION\fR
1085 .RS 4
1086 Do not add a location element to the solvables\&. Useful if the solvables are not in the final position, so you can add the correct location later in your code\&.
1087 .RE
1088 .PP
1089 \fBSOLV_ADD_NO_STUBS\fR
1090 .RS 4
1091 Do not create stubs for repository parts that can be downloaded on demand\&.
1092 .RE
1093 .PP
1094 \fBSUSETAGS_RECORD_SHARES\fR
1095 .RS 4
1096 This is specific to the add_susetags() method\&. Susetags allows to refer to already read packages to save disk space\&. If this data sharing needs to work over multiple calls to add_susetags, you need to specify this flag so that the share information is made available to subsequent calls\&.
1097 .RE
1098 .SS "METHODS"
1099 .sp
1100 .if n \{\
1101 .RS 4
1102 .\}
1103 .nf
1104 \fBvoid free(bool\fR \fIreuseids\fR \fB= 0)\fR
1105 \fI$repo\fR\fB\->free()\fR;
1106 \fIrepo\fR\fB\&.free()\fR
1107 \fIrepo\fR\fB\&.free()\fR
1108 .fi
1109 .if n \{\
1110 .RE
1111 .\}
1112 .sp
1113 Free the repository and all solvables it contains\&. If \fIreuseids\fR is set to true, the solvable ids and the repository id may be reused by the library when added new solvables\&. Thus you should leave it false if you are not sure that somebody holds a reference\&.
1114 .sp
1115 .if n \{\
1116 .RS 4
1117 .\}
1118 .nf
1119 \fBvoid empty(bool\fR \fIreuseids\fR \fB= 0)\fR
1120 \fI$repo\fR\fB\->empty()\fR;
1121 \fIrepo\fR\fB\&.empty()\fR
1122 \fIrepo\fR\fB\&.empty()\fR
1123 .fi
1124 .if n \{\
1125 .RE
1126 .\}
1127 .sp
1128 Free all the solvables in a repository\&. The repository will be empty after this call\&. See the free() method for the meaning of \fIreuseids\fR\&.
1129 .sp
1130 .if n \{\
1131 .RS 4
1132 .\}
1133 .nf
1134 \fBbool isempty()\fR
1135 \fI$repo\fR\fB\->isempty()\fR
1136 \fIrepo\fR\fB\&.empty()\fR
1137 \fIrepo\fR\fB\&.empty?\fR
1138 .fi
1139 .if n \{\
1140 .RE
1141 .\}
1142 .sp
1143 Return true if there are no solvables in this repository\&.
1144 .sp
1145 .if n \{\
1146 .RS 4
1147 .\}
1148 .nf
1149 \fBvoid internalize()\fR
1150 \fI$repo\fR\fB\->internalize()\fR;
1151 \fIrepo\fR\fB\&.internalize()\fR
1152 \fIrepo\fR\fB\&.internalize()\fR
1153 .fi
1154 .if n \{\
1155 .RE
1156 .\}
1157 .sp
1158 Internalize added data\&. Data must be internalized before it is available to the lookup and data iterator functions\&.
1159 .sp
1160 .if n \{\
1161 .RS 4
1162 .\}
1163 .nf
1164 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR
1165 \fI$repo\fR\fB\->write(\fR\fI$fp\fR\fB)\fR
1166 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1167 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1168 .fi
1169 .if n \{\
1170 .RE
1171 .\}
1172 .sp
1173 Write a repo as a \(lqsolv\(rq file\&. These files can be read very fast and thus are a good way to cache repository data\&. Returns false if there was some error writing the file\&.
1174 .sp
1175 .if n \{\
1176 .RS 4
1177 .\}
1178 .nf
1179 \fBSolvableiterator *solvables_iter()\fR
1180 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$repo\fR\fB\->solvables_iter()})\fR
1181 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter():\fR
1182 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter()\fR
1183 .fi
1184 .if n \{\
1185 .RE
1186 .\}
1187 .sp
1188 Iterate over all solvables in a repository\&.
1189 .sp
1190 .if n \{\
1191 .RS 4
1192 .\}
1193 .nf
1194 \fBRepodata *add_repodata(int\fR \fIflags\fR \fB= 0)\fR
1195 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->add_repodata()\fR;
1196 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1197 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1198 .fi
1199 .if n \{\
1200 .RE
1201 .\}
1202 .sp
1203 Add a new repodata area to the repository\&. This is normally automatically done by the repo_add methods, so you need this method only in very rare circumstances\&.
1204 .sp
1205 .if n \{\
1206 .RS 4
1207 .\}
1208 .nf
1209 \fBvoid create_stubs()\fR
1210 \fI$repo\fR\fB\->create_stubs()\fR;
1211 \fIrepo\fR\fB\&.create_stubs()\fR
1212 \fIrepo\fR\fB\&.create_stubs()\fR
1213 .fi
1214 .if n \{\
1215 .RE
1216 .\}
1217 .sp
1218 Calls the create_stubs() repodata method for the last repodata of the repository\&.
1219 .sp
1220 .if n \{\
1221 .RS 4
1222 .\}
1223 .nf
1224 \fBbool iscontiguous()\fR
1225 \fI$repo\fR\fB\->iscontiguous()\fR
1226 \fIrepo\fR\fB\&.iscontiguous()\fR
1227 \fIrepo\fR\fB\&.iscontiguous?\fR
1228 .fi
1229 .if n \{\
1230 .RE
1231 .\}
1232 .sp
1233 Return true if the solvables of this repository are all in a single block with no holes, i\&.e\&. they have consecutive ids\&.
1234 .sp
1235 .if n \{\
1236 .RS 4
1237 .\}
1238 .nf
1239 \fBRepodata *first_repodata()\fR
1240 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->first_repodata()\fR;
1241 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1242 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1243 .fi
1244 .if n \{\
1245 .RE
1246 .\}
1247 .sp
1248 Checks if all repodatas but the first repodata are extensions, and return the first repodata if this is the case\&. Useful if you want to do a store/retrive sequence on the repository to reduce the memory using and enable paging, as this does not work if the rpository contains multiple non\-extension repodata areas\&.
1249 .sp
1250 .if n \{\
1251 .RS 4
1252 .\}
1253 .nf
1254 \fBSelection *Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1255 my \fI$sel\fR \fB=\fR \fI$repo\fR\fB\->Selection()\fR;
1256 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1257 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1258 .fi
1259 .if n \{\
1260 .RE
1261 .\}
1262 .sp
1263 Create a Selection consisting of all packages in the repository\&.
1264 .sp
1265 .if n \{\
1266 .RS 4
1267 .\}
1268 .nf
1269 \fBDataiterator *Dataiterator(Id\fR \fIp\fR\fB, Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
1270 my \fI$di\fR \fB=\fR \fI$repo\fR\fB\->Dataiterator(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
1271 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1272 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1273 .fi
1274 .if n \{\
1275 .RE
1276 .\}
1277 .sp
1278 .if n \{\
1279 .RS 4
1280 .\}
1281 .nf
1282 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1283 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1284 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1285 .fi
1286 .if n \{\
1287 .RE
1288 .\}
1289 .sp
1290 Iterate over the matching data elements in this repository\&. See the Dataiterator class for more information\&.
1291 .sp
1292 .if n \{\
1293 .RS 4
1294 .\}
1295 .nf
1296 \fB<stringification>\fR
1297 my \fI$str\fR \fB= "\fR\fI$repo\fR\fB"\fR;
1298 \fIstr\fR \fB= str(\fR\fIrepo\fR\fB)\fR
1299 \fIstr\fR \fB=\fR \fIrepo\fR\fB\&.to_s\fR
1300 .fi
1301 .if n \{\
1302 .RE
1303 .\}
1304 .sp
1305 Return the name of the repository, or "Repo#<id>" if no name is set\&.
1306 .sp
1307 .if n \{\
1308 .RS 4
1309 .\}
1310 .nf
1311 \fB<equality>\fR
1312 \fBif (\fR\fI$repo1\fR \fB==\fR \fI$repo2\fR\fB)\fR
1313 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR\fB:\fR
1314 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR
1315 .fi
1316 .if n \{\
1317 .RE
1318 .\}
1319 .sp
1320 Two repositories are equal if they belong to the same pool and have the same id\&.
1321 .SS "DATA ADD METHODS"
1322 .sp
1323 .if n \{\
1324 .RS 4
1325 .\}
1326 .nf
1327 \fBSolvable *add_solvable()\fR
1328 \fI$repo\fR\fB\->add_solvable()\fR;
1329 \fIrepo\fR\fB\&.add_solvable()\fR
1330 \fIrepo\fR\fB\&.add_solvable()\fR
1331 .fi
1332 .if n \{\
1333 .RE
1334 .\}
1335 .sp
1336 Add a single empty solvable to the repository\&. Returns a Solvable object, see the Solvable class for more information\&.
1337 .sp
1338 .if n \{\
1339 .RS 4
1340 .\}
1341 .nf
1342 \fBbool add_solv(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1343 \fI$repo\fR\fB\->add_solv(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1344 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1345 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1346 .fi
1347 .if n \{\
1348 .RE
1349 .\}
1350 .sp
1351 .if n \{\
1352 .RS 4
1353 .\}
1354 .nf
1355 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1356 \fI$repo\fR\fB\->add_solv(\fR\fI$fp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1357 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1358 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1359 .fi
1360 .if n \{\
1361 .RE
1362 .\}
1363 .sp
1364 Read a \(lqsolv\(rq file and add its contents to the repository\&. These files can be written with the write() method and are normally used as fast cache for repository metadata\&.
1365 .sp
1366 .if n \{\
1367 .RS 4
1368 .\}
1369 .nf
1370 \fBbool add_rpmdb(int\fR \fIflags\fR \fB= 0)\fR
1371 \fI$repo\fR\fB\->add_rpmdb(\fR\fI$flags\fR\fB)\fR;
1372 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1373 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1374 .fi
1375 .if n \{\
1376 .RE
1377 .\}
1378 .sp
1379 .if n \{\
1380 .RS 4
1381 .\}
1382 .nf
1383 \fBbool add_rpmdb_reffp(FILE *\fR\fIreffp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1384 \fI$repo\fR\fB\->add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1385 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1386 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1387 .fi
1388 .if n \{\
1389 .RE
1390 .\}
1391 .sp
1392 Add the contents of the rpm database to the repository\&. If a solv file containing an old version of the database is available, it can be passed as reffp to speed up reading\&.
1393 .sp
1394 .if n \{\
1395 .RS 4
1396 .\}
1397 .nf
1398 \fBbool add_rpm(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1399 \fI$repo\fR\fB\->add_rpm(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1400 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1401 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1402 .fi
1403 .if n \{\
1404 .RE
1405 .\}
1406 .sp
1407 Add the metadata of a single rpm package to the repository\&.
1408 .sp
1409 .if n \{\
1410 .RS 4
1411 .\}
1412 .nf
1413 \fBbool add_rpmdb_pubkeys(int\fR \fIflags\fR \fB= 0)\fR
1414 \fI$repo\fR\fB\->add_rpmdb_pubkeys()\fR;
1415 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1416 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1417 .fi
1418 .if n \{\
1419 .RE
1420 .\}
1421 .sp
1422 Add all pubkeys contained in the rpm database to the repository\&. Note that newer rpm versions also allow to store the pubkeys in some directory instead of the rpm database\&.
1423 .sp
1424 .if n \{\
1425 .RS 4
1426 .\}
1427 .nf
1428 \fBbool add_pubkey(const char *\fR\fIkeyfile\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1429 \fI$repo\fR\fB\->add_pubkey(\fR\fI$keyfile\fR\fB)\fR;
1430 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1431 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1432 .fi
1433 .if n \{\
1434 .RE
1435 .\}
1436 .sp
1437 Add a pubkey from a file to the repository\&.
1438 .sp
1439 .if n \{\
1440 .RS 4
1441 .\}
1442 .nf
1443 \fBbool add_rpmmd(FILE *\fR\fIfp\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1444 \fI$repo\fR\fB\->add_rpmmd(\fR\fI$fp\fR\fB,\fR \fI$language\fR\fB)\fR;
1445 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1446 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1447 .fi
1448 .if n \{\
1449 .RE
1450 .\}
1451 .sp
1452 Add metadata stored in the "rpm\-md" format (i\&.e\&. from files in the \(lqrepodata\(rq directory) to a repository\&. Supported files are "primary", "filelists", "other", "suseinfo"\&. Do not forget to specify the \fBREPO_EXTEND_SOLVABLES\fR for extension files like "filelists" and "other"\&. Use the \fIlanguage\fR parameter if you have language extension files, otherwise simply use a \fBundef\fR/\fBNone\fR/\fBnil\fR parameter\&.
1453 .sp
1454 .if n \{\
1455 .RS 4
1456 .\}
1457 .nf
1458 \fBbool add_repomdxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1459 \fI$repo\fR\fB\->add_repomdxml(\fR\fI$fp\fR\fB)\fR;
1460 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1461 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1462 .fi
1463 .if n \{\
1464 .RE
1465 .\}
1466 .sp
1467 Add the repomd\&.xml meta description from the "rpm\-md" format to the repository\&. This file contains information about the repository like keywords, and also a list of all database files with checksums\&. The data is added the the "meta" section of the repository, i\&.e\&. no package gets created\&.
1468 .sp
1469 .if n \{\
1470 .RS 4
1471 .\}
1472 .nf
1473 \fBbool add_updateinfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1474 \fI$repo\fR\fB\->add_updateinfoxml(\fR\fI$fp\fR\fB)\fR;
1475 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1476 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1477 .fi
1478 .if n \{\
1479 .RE
1480 .\}
1481 .sp
1482 Add the updateinfo\&.xml file containing available maintenance updates to the repository\&. All updates are created as special packages that have a "patch:" prefix in their name\&.
1483 .sp
1484 .if n \{\
1485 .RS 4
1486 .\}
1487 .nf
1488 \fBbool add_deltainfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1489 \fI$repo\fR\fB\->add_deltainfoxml(\fR\fI$fp\fR\fB)\fR;
1490 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1491 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1492 .fi
1493 .if n \{\
1494 .RE
1495 .\}
1496 .sp
1497 Add the deltainfo\&.xml file (also called prestodelta\&.xml) containing available delta\-rpms to the repository\&. The data is added to the "meta" section, i\&.e\&. no package gets created\&.
1498 .sp
1499 .if n \{\
1500 .RS 4
1501 .\}
1502 .nf
1503 \fBbool add_debdb(int\fR \fIflags\fR \fB= 0)\fR
1504 \fI$repo\fR\fB\->add_debdb()\fR;
1505 \fIrepo\fR\fB\&.add_debdb()\fR
1506 \fIrepo\fR\fB\&.add_debdb()\fR
1507 .fi
1508 .if n \{\
1509 .RE
1510 .\}
1511 .sp
1512 Add the contents of the debian installed package database to the repository\&.
1513 .sp
1514 .if n \{\
1515 .RS 4
1516 .\}
1517 .nf
1518 \fBbool add_debpackages(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1519 \fI$repo\fR\fB\->add_debpackages(\fR\fI$fp\fR\fB)\fR;
1520 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1521 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1522 .fi
1523 .if n \{\
1524 .RE
1525 .\}
1526 .sp
1527 Add the contents of the debian repository metadata (the "packages" file) to the repository\&.
1528 .sp
1529 .if n \{\
1530 .RS 4
1531 .\}
1532 .nf
1533 \fBbool add_deb(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1534 \fI$repo\fR\fB\->add_deb(\fR\fI$filename\fR\fB)\fR;
1535 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1536 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1537 .fi
1538 .if n \{\
1539 .RE
1540 .\}
1541 .sp
1542 Add the metadata of a single deb package to the repository\&.
1543 .sp
1544 .if n \{\
1545 .RS 4
1546 .\}
1547 .nf
1548 \fBbool add_mdk(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1549 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1550 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1551 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1552 .fi
1553 .if n \{\
1554 .RE
1555 .\}
1556 .sp
1557 Add the contents of the mageia/mandriva repository metadata (the "synthesis\&.hdlist" file) to the repository\&.
1558 .sp
1559 .if n \{\
1560 .RS 4
1561 .\}
1562 .nf
1563 \fBbool add_mdk_info(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1564 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1565 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1566 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1567 .fi
1568 .if n \{\
1569 .RE
1570 .\}
1571 .sp
1572 Extend the packages from the synthesis file with the info\&.xml and files\&.xml data\&. Do not forget to specify \fBREPO_EXTEND_SOLVABLES\fR\&.
1573 .sp
1574 .if n \{\
1575 .RS 4
1576 .\}
1577 .nf
1578 \fBbool add_arch_repo(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1579 \fI$repo\fR\fB\->add_arch_repo(\fR\fI$fp\fR\fB)\fR;
1580 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1581 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1582 .fi
1583 .if n \{\
1584 .RE
1585 .\}
1586 .sp
1587 Add the contents of the archlinux repository metadata (the "\&.db\&.tar" file) to the repository\&.
1588 .sp
1589 .if n \{\
1590 .RS 4
1591 .\}
1592 .nf
1593 \fBbool add_arch_local(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1594 \fI$repo\fR\fB\->add_arch_local(\fR\fI$dir\fR\fB)\fR;
1595 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1596 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1597 .fi
1598 .if n \{\
1599 .RE
1600 .\}
1601 .sp
1602 Add the contents of the archlinux installed package database to the repository\&. The \fIdir\fR parameter is usually set to "/var/lib/pacman/local"\&.
1603 .sp
1604 .if n \{\
1605 .RS 4
1606 .\}
1607 .nf
1608 \fBbool add_content(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1609 \fI$repo\fR\fB\->add_content(\fR\fI$fp\fR\fB)\fR;
1610 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1611 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1612 .fi
1613 .if n \{\
1614 .RE
1615 .\}
1616 .sp
1617 Add the \(lqcontent\(rq meta description from the susetags format to the repository\&. This file contains information about the repository like keywords, and also a list of all database files with checksums\&. The data is added the the "meta" section of the repository, i\&.e\&. no package gets created\&.
1618 .sp
1619 .if n \{\
1620 .RS 4
1621 .\}
1622 .nf
1623 \fBbool add_susetags(FILE *\fR\fIfp\fR\fB, Id\fR \fIdefvendor\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1624 \fI$repo\fR\fB\->add_susetags(\fR\fI$fp\fR\fB,\fR \fI$defvendor\fR\fB,\fR \fI$language\fR\fB)\fR;
1625 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1626 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1627 .fi
1628 .if n \{\
1629 .RE
1630 .\}
1631 .sp
1632 Add repository metadata in the susetags format to the repository\&. Like with add_rpmmd, you can specify a language if you have language extension files\&. The \fIdefvendor\fR parameter provides a default vendor for packages with missing vendors, it is usually provided in the content file\&.
1633 .sp
1634 .if n \{\
1635 .RS 4
1636 .\}
1637 .nf
1638 \fBbool add_products(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1639 \fI$repo\fR\fB\->add_products(\fR\fI$dir\fR\fB)\fR;
1640 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1641 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1642 .fi
1643 .if n \{\
1644 .RE
1645 .\}
1646 .sp
1647 Add the installed SUSE products database to the repository\&. The \fIdir\fR parameter is usually "/etc/products\&.d"\&.
1648 .SH "THE SOLVABLE CLASS"
1649 .sp
1650 A solvable describes all the information of one package\&. Each solvable belongs to one repository, it can be added and filled manually but in most cases solvables will get created by the repo_add methods\&.
1651 .SS "ATTRIBUTES"
1652 .sp
1653 .if n \{\
1654 .RS 4
1655 .\}
1656 .nf
1657 \fBRepo *repo;\fR                     /* read only */
1658 \fI$solvable\fR\fB\->{\*(Aqrepo\*(Aq}\fR
1659 \fIsolvable\fR\fB\&.repo\fR
1660 \fIsolvable\fR\fB\&.repo\fR
1661 .fi
1662 .if n \{\
1663 .RE
1664 .\}
1665 .sp
1666 The repository this solvable belongs to\&.
1667 .sp
1668 .if n \{\
1669 .RS 4
1670 .\}
1671 .nf
1672 \fBPool *pool;\fR                     /* read only */
1673 \fI$solvable\fR\fB\->{\*(Aqpool\*(Aq}\fR
1674 \fIsolvable\fR\fB\&.pool\fR
1675 \fIsolvable\fR\fB\&.pool\fR
1676 .fi
1677 .if n \{\
1678 .RE
1679 .\}
1680 .sp
1681 The pool this solvable belongs to, same as the pool of the repo\&.
1682 .sp
1683 .if n \{\
1684 .RS 4
1685 .\}
1686 .nf
1687 \fBId id;\fR                          /* read only */
1688 \fI$solvable\fR\fB\->{\*(Aqid\*(Aq}\fR
1689 \fIsolvable\fR\fB\&.id\fR
1690 \fIsolvable\fR\fB\&.id\fR
1691 .fi
1692 .if n \{\
1693 .RE
1694 .\}
1695 .sp
1696 The specific id of the solvable\&.
1697 .sp
1698 .if n \{\
1699 .RS 4
1700 .\}
1701 .nf
1702 \fBchar *name;\fR                     /* read/write */
1703 \fI$solvable\fR\fB\->{\*(Aqname\*(Aq}\fR
1704 \fIsolvable\fR\fB\&.name\fR
1705 \fIsolvable\fR\fB\&.name\fR
1706 .fi
1707 .if n \{\
1708 .RE
1709 .\}
1710 .sp
1711 .if n \{\
1712 .RS 4
1713 .\}
1714 .nf
1715 \fBchar *evr;\fR                      /* read/write */
1716 \fI$solvable\fR\fB\->{\*(Aqevr\*(Aq}\fR
1717 \fIsolvable\fR\fB\&.evr\fR
1718 \fIsolvable\fR\fB\&.evr\fR
1719 .fi
1720 .if n \{\
1721 .RE
1722 .\}
1723 .sp
1724 .if n \{\
1725 .RS 4
1726 .\}
1727 .nf
1728 \fBchar *arch;\fR                     /* read/write */
1729 \fI$solvable\fR\fB\->{\*(Aqarch\*(Aq}\fR
1730 \fIsolvable\fR\fB\&.arch\fR
1731 \fIsolvable\fR\fB\&.arch\fR
1732 .fi
1733 .if n \{\
1734 .RE
1735 .\}
1736 .sp
1737 .if n \{\
1738 .RS 4
1739 .\}
1740 .nf
1741 \fBchar *vendor;\fR                   /* read/write */
1742 \fI$solvable\fR\fB\->{\*(Aqvendor\*(Aq}\fR
1743 \fIsolvable\fR\fB\&.vendor\fR
1744 \fIsolvable\fR\fB\&.vendor\fR
1745 .fi
1746 .if n \{\
1747 .RE
1748 .\}
1749 .sp
1750 Easy access to often used attributes of solvables\&. They are internally stored as Ids\&.
1751 .sp
1752 .if n \{\
1753 .RS 4
1754 .\}
1755 .nf
1756 \fBId nameid;\fR                      /* read/write */
1757 \fI$solvable\fR\fB\->{\*(Aqnameid\*(Aq}\fR
1758 \fIsolvable\fR\fB\&.nameid\fR
1759 \fIsolvable\fR\fB\&.nameid\fR
1760 .fi
1761 .if n \{\
1762 .RE
1763 .\}
1764 .sp
1765 .if n \{\
1766 .RS 4
1767 .\}
1768 .nf
1769 \fBId evrid;\fR                       /* read/write */
1770 \fI$solvable\fR\fB\->{\*(Aqevrid\*(Aq}\fR
1771 \fIsolvable\fR\fB\&.evrid\fR
1772 \fIsolvable\fR\fB\&.evrid\fR
1773 .fi
1774 .if n \{\
1775 .RE
1776 .\}
1777 .sp
1778 .if n \{\
1779 .RS 4
1780 .\}
1781 .nf
1782 \fBId archid;\fR                      /* read/write */
1783 \fI$solvable\fR\fB\->{\*(Aqarchid\*(Aq}\fR
1784 \fIsolvable\fR\fB\&.archid\fR
1785 \fIsolvable\fR\fB\&.archid\fR
1786 .fi
1787 .if n \{\
1788 .RE
1789 .\}
1790 .sp
1791 .if n \{\
1792 .RS 4
1793 .\}
1794 .nf
1795 \fBId vendorid;\fR                    /* read/write */
1796 \fI$solvable\fR\fB\->{\*(Aqvendorid\*(Aq}\fR
1797 \fIsolvable\fR\fB\&.vendorid\fR
1798 \fIsolvable\fR\fB\&.vendorid\fR
1799 .fi
1800 .if n \{\
1801 .RE
1802 .\}
1803 .sp
1804 Raw interface to the ids\&. Useful if you want to search for a specific id and want to avoid the string compare overhead\&.
1805 .SS "METHODS"
1806 .sp
1807 .if n \{\
1808 .RS 4
1809 .\}
1810 .nf
1811 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
1812 my \fI$string\fR \fB=\fR \fI$solvable\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
1813 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
1814 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
1815 .fi
1816 .if n \{\
1817 .RE
1818 .\}
1819 .sp
1820 .if n \{\
1821 .RS 4
1822 .\}
1823 .nf
1824 \fBId lookup_id(Id\fR \fIkeyname\fR\fB)\fR
1825 my \fI$id\fR \fB=\fR \fI$solvable\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
1826 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB)\fR
1827 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB)\fR
1828 .fi
1829 .if n \{\
1830 .RE
1831 .\}
1832 .sp
1833 .if n \{\
1834 .RS 4
1835 .\}
1836 .nf
1837 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
1838 my \fI$num\fR \fB=\fR \fI$solvable\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
1839 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
1840 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
1841 .fi
1842 .if n \{\
1843 .RE
1844 .\}
1845 .sp
1846 .if n \{\
1847 .RS 4
1848 .\}
1849 .nf
1850 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
1851 my \fI$bool\fR \fB=\fR \fI$solvable\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
1852 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
1853 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
1854 .fi
1855 .if n \{\
1856 .RE
1857 .\}
1858 .sp
1859 .if n \{\
1860 .RS 4
1861 .\}
1862 .nf
1863 \fBChksum *lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
1864 my \fI$chksum\fR \fB=\fR \fI$solvable\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
1865 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
1866 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
1867 .fi
1868 .if n \{\
1869 .RE
1870 .\}
1871 .sp
1872 .if n \{\
1873 .RS 4
1874 .\}
1875 .nf
1876 \fBQueue lookup_idarray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1877 my \fI@ids\fR \fB=\fR \fI$solvable\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
1878 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
1879 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
1880 .fi
1881 .if n \{\
1882 .RE
1883 .\}
1884 .sp
1885 .if n \{\
1886 .RS 4
1887 .\}
1888 .nf
1889 \fBQueue lookup_deparray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
1890 my \fI@deps\fR \fB=\fR \fI$solvable\fR\fB\->lookup_deparray(\fR\fI$keyname\fR\fB)\fR;
1891 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
1892 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
1893 .fi
1894 .if n \{\
1895 .RE
1896 .\}
1897 .sp
1898 Generic lookup methods\&. Retrieve data stored for the specific keyname\&. The lookup_idarray() method will return an array of Ids, use lookup_deparray if you want an array of Dependency objects instead\&. Some Id arrays contain two parts of data divided by a specific marker, for example the provides array uses the SOLVABLE_FILEMARKER id to store both the ids provided by the package and the ids added by the addfileprovides method\&. The default, \-1, translates to the correct marker for the keyname and returns the first part of the array, use 1 to select the second part or 0 to retrive all ids including the marker\&.
1899 .sp
1900 .if n \{\
1901 .RS 4
1902 .\}
1903 .nf
1904 \fBconst char *lookup_location(unsigned int *\fR\fIOUTPUT\fR\fB)\fR;
1905 my \fB(\fR\fI$location\fR\fB,\fR \fI$medianr\fR\fB) =\fR \fI$solvable\fR\fB\->lookup_location()\fR;
1906 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
1907 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
1908 .fi
1909 .if n \{\
1910 .RE
1911 .\}
1912 .sp
1913 Return a tuple containing the on\-media location and an optional media number for multi\-part repositories (e\&.g\&. repositories spawning multiple DVDs)\&.
1914 .sp
1915 .if n \{\
1916 .RS 4
1917 .\}
1918 .nf
1919 \fBvoid add_deparray(Id\fR \fIkeyname\fR\fB, DepId\fR \fIdep\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR;
1920 \fI$solvable\fR\fB\->add_deparray(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR;
1921 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
1922 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
1923 .fi
1924 .if n \{\
1925 .RE
1926 .\}
1927 .sp
1928 Add a new dependency to the attributes stored in keyname\&.
1929 .sp
1930 .if n \{\
1931 .RS 4
1932 .\}
1933 .nf
1934 \fBbool installable()\fR;
1935 \fI$solvable\fR\fB\->installable()\fR
1936 \fIsolvable\fR\fB\&.installable()\fR
1937 \fIsolvable\fR\fB\&.installable?\fR
1938 .fi
1939 .if n \{\
1940 .RE
1941 .\}
1942 .sp
1943 Return true if the solvable is installable on the system\&. Solvables are not installable if the system does not support their architecture\&.
1944 .sp
1945 .if n \{\
1946 .RS 4
1947 .\}
1948 .nf
1949 \fBbool isinstalled()\fR;
1950 \fI$solvable\fR\fB\->isinstalled()\fR
1951 \fIsolvable\fR\fB\&.isinstalled()\fR
1952 \fIsolvable\fR\fB\&.isinstalled?\fR
1953 .fi
1954 .if n \{\
1955 .RE
1956 .\}
1957 .sp
1958 Return true if the solvable is installed on the system\&.
1959 .sp
1960 .if n \{\
1961 .RS 4
1962 .\}
1963 .nf
1964 \fBSelection *Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1965 my \fI$sel\fR \fB=\fR \fI$solvable\fR\fB\->Selection()\fR;
1966 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
1967 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
1968 .fi
1969 .if n \{\
1970 .RE
1971 .\}
1972 .sp
1973 Create a Selection containing just the single solvable\&.
1974 .sp
1975 .if n \{\
1976 .RS 4
1977 .\}
1978 .nf
1979 \fBconst char *str()\fR
1980 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str()\fR;
1981 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
1982 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
1983 .fi
1984 .if n \{\
1985 .RE
1986 .\}
1987 .sp
1988 Return a string describing the solvable\&. The string consists of the name, version, and architecture of the Solvable\&.
1989 .sp
1990 .if n \{\
1991 .RS 4
1992 .\}
1993 .nf
1994 \fB<stringification>\fR
1995 my \fI$str\fR \fB= "\fR\fI$solvable\fR\fB"\fR;
1996 \fIstr\fR \fB= str(\fR\fIsolvable\fR\fB)\fR
1997 \fIstr\fR \fB=\fR \fIsolvable\fR\fB\&.to_s\fR
1998 .fi
1999 .if n \{\
2000 .RE
2001 .\}
2002 .sp
2003 Same as calling the str() method\&.
2004 .sp
2005 .if n \{\
2006 .RS 4
2007 .\}
2008 .nf
2009 \fB<equality>\fR
2010 \fBif (\fR\fI$solvable1\fR \fB==\fR \fI$solvable2\fR\fB)\fR
2011 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR\fB:\fR
2012 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR
2013 .fi
2014 .if n \{\
2015 .RE
2016 .\}
2017 .sp
2018 Two solvables are equal if they are part of the same pool and have the same ids\&.
2019 .SH "THE DATAITERATOR CLASS"
2020 .sp
2021 Dataiterators can be used to do complex string searches or to iterate over arrays\&. They can be created via the constructors in the Pool, Repo, and Solvable classes\&. The Repo and Solvable constructors will limit the search to the repository or the specific package\&.
2022 .SS "CONSTANTS"
2023 .PP
2024 \fBSEARCH_STRING\fR
2025 .RS 4
2026 Return a match if the search string matches the value\&.
2027 .RE
2028 .PP
2029 \fBSEARCH_STRINGSTART\fR
2030 .RS 4
2031 Return a match if the value starts with the search string\&.
2032 .RE
2033 .PP
2034 \fBSEARCH_STRINGEND\fR
2035 .RS 4
2036 Return a match if the value ends with the search string\&.
2037 .RE
2038 .PP
2039 \fBSEARCH_SUBSTRING\fR
2040 .RS 4
2041 Return a match if the search string can be matched somewhere in the value\&.
2042 .RE
2043 .PP
2044 \fBSEARCH_GLOB\fR
2045 .RS 4
2046 Do a glob match of the search string against the value\&.
2047 .RE
2048 .PP
2049 \fBSEARCH_REGEX\fR
2050 .RS 4
2051 Do a regular expression match of the search string against the value\&.
2052 .RE
2053 .PP
2054 \fBSEARCH_NOCASE\fR
2055 .RS 4
2056 Ignore case when matching strings\&. Works for all the above match types\&.
2057 .RE
2058 .PP
2059 \fBSEARCH_FILES\fR
2060 .RS 4
2061 Match the complete filenames of the file list, not just the base name\&.
2062 .RE
2063 .PP
2064 \fBSEARCH_COMPLETE_FILELIST\fR
2065 .RS 4
2066 When matching the file list, check every file of the package not just the subset from the primary metadata\&.
2067 .RE
2068 .PP
2069 \fBSEARCH_CHECKSUMS\fR
2070 .RS 4
2071 Allow the matching of checksum entries\&.
2072 .RE
2073 .SS "METHODS"
2074 .sp
2075 .if n \{\
2076 .RS 4
2077 .\}
2078 .nf
2079 \fBvoid prepend_keyname(Id\fR \fIkeyname\fR\fB)\fR;
2080 \fI$di\fR\fB\->prepend_keyname(\fR\fI$keyname\fR\fB)\fR;
2081 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2082 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2083 .fi
2084 .if n \{\
2085 .RE
2086 .\}
2087 .sp
2088 Do a sub\-search in the array stored in keyname\&.
2089 .sp
2090 .if n \{\
2091 .RS 4
2092 .\}
2093 .nf
2094 \fBvoid skip_solvable()\fR;
2095 \fI$di\fR\fB\->kip_solvable()\fR;
2096 \fIdi\fR\fB\&.skip_solvable()\fR
2097 \fIdi\fR\fB\&.skip_solvable()\fR
2098 .fi
2099 .if n \{\
2100 .RE
2101 .\}
2102 .sp
2103 Stop matching the current solvable and advance to the next one\&.
2104 .sp
2105 .if n \{\
2106 .RS 4
2107 .\}
2108 .nf
2109 \fB<iteration>\fR
2110 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2111 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2112 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2113 .fi
2114 .if n \{\
2115 .RE
2116 .\}
2117 .sp
2118 Iterate through the matches\&. If there is a match, the object in d will be of type Datamatch\&.
2119 .SH "THE DATAMATCH CLASS"
2120 .sp
2121 Objects of this type will be created for every value matched by a dataiterator\&.
2122 .SS "ATTRIBUTES"
2123 .sp
2124 .if n \{\
2125 .RS 4
2126 .\}
2127 .nf
2128 \fBPool *pool;\fR                             /* read only */
2129 \fI$d\fR\fB\->{\*(Aqpool\*(Aq}\fR
2130 \fId\fR\fB\&.pool\fR
2131 \fId\fR\fB\&.pool\fR
2132 .fi
2133 .if n \{\
2134 .RE
2135 .\}
2136 .sp
2137 Back pointer to pool\&.
2138 .sp
2139 .if n \{\
2140 .RS 4
2141 .\}
2142 .nf
2143 \fBRepo *repo;\fR                             /* read only */
2144 \fI$d\fR\fB\->{\*(Aqrepo\*(Aq}\fR
2145 \fId\fR\fB\&.repo\fR
2146 \fId\fR\fB\&.repo\fR
2147 .fi
2148 .if n \{\
2149 .RE
2150 .\}
2151 .sp
2152 The repository containing the matched object\&.
2153 .sp
2154 .if n \{\
2155 .RS 4
2156 .\}
2157 .nf
2158 \fBSolvable *solvable;\fR                     /* read only */
2159 \fI$d\fR\fB\->{\*(Aqsolvable\*(Aq}\fR
2160 \fId\fR\fB\&.solvable\fR
2161 \fId\fR\fB\&.solvable\fR
2162 .fi
2163 .if n \{\
2164 .RE
2165 .\}
2166 .sp
2167 The solvable containing the value that was matched\&.
2168 .sp
2169 .if n \{\
2170 .RS 4
2171 .\}
2172 .nf
2173 \fBId solvid;\fR                              /* read only */
2174 \fI$d\fR\fB\->{\*(Aqsolvid\*(Aq}\fR
2175 \fId\fR\fB\&.solvid\fR
2176 \fId\fR\fB\&.solvid\fR
2177 .fi
2178 .if n \{\
2179 .RE
2180 .\}
2181 .sp
2182 The id of the solvable that matched\&.
2183 .SS "METHODS"
2184 .sp
2185 .if n \{\
2186 .RS 4
2187 .\}
2188 .nf
2189 \fBId key_id()\fR;
2190 \fI$d\fR\fB\->key_id()\fR
2191 \fId\fR\fB\&.key_id()\fR
2192 \fId\fR\fB\&.key_id()\fR
2193 .fi
2194 .if n \{\
2195 .RE
2196 .\}
2197 .sp
2198 .if n \{\
2199 .RS 4
2200 .\}
2201 .nf
2202 \fBconst char *key_idstr()\fR;
2203 \fI$d\fR\fB\->key_idstr()\fR
2204 \fId\fR\fB\&.key_idstr()\fR
2205 \fId\fR\fB\&.key_idstr()\fR
2206 .fi
2207 .if n \{\
2208 .RE
2209 .\}
2210 .sp
2211 The keyname that matched, either as id or string\&.
2212 .sp
2213 .if n \{\
2214 .RS 4
2215 .\}
2216 .nf
2217 \fBId type_id()\fR;
2218 \fI$d\fR\fB\->type_id()\fR
2219 \fId\fR\fB\&.type_id()\fR
2220 \fId\fR\fB\&.type_id()\fR
2221 .fi
2222 .if n \{\
2223 .RE
2224 .\}
2225 .sp
2226 .if n \{\
2227 .RS 4
2228 .\}
2229 .nf
2230 \fBconst char *type_idstr()\fR;
2231 \fI$d\fR\fB\->type_idstr()\fR;
2232 \fId\fR\fB\&.type_idstr()\fR
2233 \fId\fR\fB\&.type_idstr()\fR
2234 .fi
2235 .if n \{\
2236 .RE
2237 .\}
2238 .sp
2239 The key type of the value that was matched, either as id or string\&.
2240 .sp
2241 .if n \{\
2242 .RS 4
2243 .\}
2244 .nf
2245 \fBId id()\fR;
2246 \fI$d\fR\fB\->id()\fR
2247 \fId\fR\fB\&.id()\fR
2248 \fId\fR\fB\&.id()\fR
2249 .fi
2250 .if n \{\
2251 .RE
2252 .\}
2253 .sp
2254 .if n \{\
2255 .RS 4
2256 .\}
2257 .nf
2258 \fBId idstr()\fR;
2259 \fI$d\fR\fB\->idstr()\fR
2260 \fId\fR\fB\&.idstr()\fR
2261 \fId\fR\fB\&.idstr()\fR
2262 .fi
2263 .if n \{\
2264 .RE
2265 .\}
2266 .sp
2267 The Id of the value that was matched (only valid for id types), either as id or string\&.
2268 .sp
2269 .if n \{\
2270 .RS 4
2271 .\}
2272 .nf
2273 \fBconst char *str()\fR;
2274 \fI$d\fR\fB\->str()\fR
2275 \fId\fR\fB\&.str()\fR
2276 \fId\fR\fB\&.str()\fR
2277 .fi
2278 .if n \{\
2279 .RE
2280 .\}
2281 .sp
2282 The string value that was matched (only valid for string types)\&.
2283 .sp
2284 .if n \{\
2285 .RS 4
2286 .\}
2287 .nf
2288 \fBunsigned long long num()\fR;
2289 \fI$d\fR\fB\->num()\fR
2290 \fId\fR\fB\&.num()\fR
2291 \fId\fR\fB\&.num()\fR
2292 .fi
2293 .if n \{\
2294 .RE
2295 .\}
2296 .sp
2297 The numeric value that was matched (only valid for numeric types)\&.
2298 .sp
2299 .if n \{\
2300 .RS 4
2301 .\}
2302 .nf
2303 \fBunsigned int num2()\fR;
2304 \fI$d\fR\fB\->num2()\fR
2305 \fId\fR\fB\&.num2()\fR
2306 \fId\fR\fB\&.num2()\fR
2307 .fi
2308 .if n \{\
2309 .RE
2310 .\}
2311 .sp
2312 The secondary numeric value that was matched (only valid for types containing two values)\&.
2313 .sp
2314 .if n \{\
2315 .RS 4
2316 .\}
2317 .nf
2318 \fBDatapos *pos()\fR;
2319 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->pos()\fR;
2320 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
2321 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
2322 .fi
2323 .if n \{\
2324 .RE
2325 .\}
2326 .sp
2327 The position object of the current match\&. It can be used to do sub\-searches starting at the match (if it is of an array type)\&. See the Datapos class for more information\&.
2328 .sp
2329 .if n \{\
2330 .RS 4
2331 .\}
2332 .nf
2333 \fBDatapos *parentpos()\fR;
2334 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->parentpos()\fR;
2335 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
2336 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
2337 .fi
2338 .if n \{\
2339 .RE
2340 .\}
2341 .sp
2342 The position object of the array containing the current match\&. It can be used to do sub\-searches, see the Datapos class for more information\&.
2343 .sp
2344 .if n \{\
2345 .RS 4
2346 .\}
2347 .nf
2348 \fB<stringification>\fR
2349 my \fI$str\fR \fB= "\fR\fI$d\fR\fB"\fR;
2350 \fIstr\fR \fB= str(\fR\fId\fR\fB)\fR
2351 \fIstr\fR \fB=\fR \fId\fR\fB\&.to_s\fR
2352 .fi
2353 .if n \{\
2354 .RE
2355 .\}
2356 .sp
2357 Return the stringification of the matched value\&. Stringification depends on the search flags, for file list entries it will return just the base name unless SEARCH_FILES is used, for checksums it will return an empty string unless SEARCH_CHECKSUMS is used\&. Numeric values are currently stringified to an empty string\&.
2358 .SH "THE SELECTION CLASS"
2359 .sp
2360 Selections are a way to easily deal with sets of packages\&. There are multiple constructors to create them, the most useful is probably the select() method in the Pool class\&.
2361 .SS "CONSTANTS"
2362 .PP
2363 \fBSELECTION_NAME\fR
2364 .RS 4
2365 Create the selection by matching package names
2366 .RE
2367 .PP
2368 \fBSELECTION_PROVIDES\fR
2369 .RS 4
2370 Create the selection by matching package provides
2371 .RE
2372 .PP
2373 \fBSELECTION_FILELIST\fR
2374 .RS 4
2375 Create the selection by matching package files
2376 .RE
2377 .PP
2378 \fBSELECTION_CANON\fR
2379 .RS 4
2380 Create the selection by matching the canonical representation of the package\&. This is normally a combination of the name, the version, and the architecture of a package\&.
2381 .RE
2382 .PP
2383 \fBSELECTION_DOTARCH\fR
2384 .RS 4
2385 Allow an \(lq\&.<architecture>\(rq suffix when matching names or provides\&.
2386 .RE
2387 .PP
2388 \fBSELECTION_REL\fR
2389 .RS 4
2390 Allow the specification of a relation when matching names or provides, e\&.g\&. "name >= 1\&.2"\&.
2391 .RE
2392 .PP
2393 \fBSELECTION_INSTALLED_ONLY\fR
2394 .RS 4
2395 Limit the package search to installed packages\&.
2396 .RE
2397 .PP
2398 \fBSELECTION_SOURCE_ONLY\fR
2399 .RS 4
2400 Limit the package search to source packages only\&.
2401 .RE
2402 .PP
2403 \fBSELECTION_WITH_SOURCE\fR
2404 .RS 4
2405 Extend the package search to also match source packages\&. The default is only to match binary packages\&.
2406 .RE
2407 .PP
2408 \fBSELECTION_GLOB\fR
2409 .RS 4
2410 Allow glob matching for package names, package provides, and file names\&.
2411 .RE
2412 .PP
2413 \fBSELECTION_NOCASE\fR
2414 .RS 4
2415 Ignore case when matching package names, package provides, and file names\&.
2416 .RE
2417 .PP
2418 \fBSELECTION_FLAT\fR
2419 .RS 4
2420 Return only one selection element describing the selected packages\&. The default is to create multiple elements for all globbed packages\&. Multiple elements are useful if you want to turn the selection into an install job, in that case you want an install job for every globbed package\&.
2421 .RE
2422 .SS "ATTRIBUTES"
2423 .sp
2424 .if n \{\
2425 .RS 4
2426 .\}
2427 .nf
2428 \fBPool *pool;\fR                             /* read only */
2429 \fI$d\fR\fB\->{\*(Aqpool\*(Aq}\fR
2430 \fId\fR\fB\&.pool\fR
2431 \fId\fR\fB\&.pool\fR
2432 .fi
2433 .if n \{\
2434 .RE
2435 .\}
2436 .sp
2437 Back pointer to pool\&.
2438 .SS "METHODS"
2439 .sp
2440 .if n \{\
2441 .RS 4
2442 .\}
2443 .nf
2444 \fBint flags()\fR;
2445 my \fI$flags\fR \fB=\fR \fI$sel\fR\fB\->flags()\fR;
2446 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
2447 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
2448 .fi
2449 .if n \{\
2450 .RE
2451 .\}
2452 .sp
2453 Return the result flags of the selection\&. The flags are a subset of the ones used when creating the selection, they describe which method was used to get the result\&. For example, if you create the selection with \(lqSELECTION_NAME | SELECTION_PROVIDES\(rq, the resulting flags will either be SELECTION_NAME or SELECTION_PROVIDES depending if there was a package that matched the name or not\&. If there was no match at all, the flags will be zero\&.
2454 .sp
2455 .if n \{\
2456 .RS 4
2457 .\}
2458 .nf
2459 \fBbool isempty()\fR;
2460 \fI$sel\fR\fB\->isempty()\fR
2461 \fIsel\fR\fB\&.isempty()\fR
2462 \fIsel\fR\fB\&.isempty?\fR
2463 .fi
2464 .if n \{\
2465 .RE
2466 .\}
2467 .sp
2468 Return true if the selection is empty, i\&.e\&. no package could be matched\&.
2469 .sp
2470 .if n \{\
2471 .RS 4
2472 .\}
2473 .nf
2474 \fBvoid filter(Selection *\fR\fIother\fR\fB)\fR
2475 \fI$sel\fR\fB\->filter(\fR\fI$other\fR\fB)\fR;
2476 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
2477 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
2478 .fi
2479 .if n \{\
2480 .RE
2481 .\}
2482 .sp
2483 Intersect two selections\&. Packages will only stay in the selection if there are also included in the other selecting\&. Does an in\-place modification\&.
2484 .sp
2485 .if n \{\
2486 .RS 4
2487 .\}
2488 .nf
2489 \fBvoid add(Selection *\fR\fIother\fR\fB)\fR
2490 \fI$sel\fR\fB\->add(\fR\fI$other\fR\fB)\fR;
2491 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
2492 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
2493 .fi
2494 .if n \{\
2495 .RE
2496 .\}
2497 .sp
2498 Build the union of two selections\&. All packages of the other selection will be added to the set of packages of the selection object\&. Does an in\-place modification\&. Note that the selection flags are no longer meaningful after the add operation\&.
2499 .sp
2500 .if n \{\
2501 .RS 4
2502 .\}
2503 .nf
2504 \fBvoid add_raw(Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
2505 \fI$sel\fR\fB\->add_raw(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
2506 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
2507 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
2508 .fi
2509 .if n \{\
2510 .RE
2511 .\}
2512 .sp
2513 Add a raw element to the selection\&. Check the Job class for information about the how and what parameters\&.
2514 .sp
2515 .if n \{\
2516 .RS 4
2517 .\}
2518 .nf
2519 \fBJob *jobs(int\fR \fIaction\fR\fB)\fR
2520 my \fI@jobs\fR \fB=\fR \fI$sel\fR\fB\->jobs(\fR\fI$action\fR\fB)\fR;
2521 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
2522 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
2523 .fi
2524 .if n \{\
2525 .RE
2526 .\}
2527 .sp
2528 Convert a selection into an array of Job objects\&. The action parameter is or\-ed to the \(lqhow\(rq part of the job, it describes the type of job (e\&.g\&. install, erase)\&. See the Job class for the action and action modifier constants\&.
2529 .sp
2530 .if n \{\
2531 .RS 4
2532 .\}
2533 .nf
2534 \fBSolvable *solvables()\fR
2535 my \fI@solvables\fR \fB=\fR \fI$sel\fR\fB\->solvables()\fR;
2536 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
2537 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
2538 .fi
2539 .if n \{\
2540 .RE
2541 .\}
2542 .sp
2543 Convert a selection into an array of Solvable objects\&.
2544 .sp
2545 .if n \{\
2546 .RS 4
2547 .\}
2548 .nf
2549 \fB<stringification>\fR
2550 my \fI$str\fR \fB= "\fR\fI$sel\fR\fB"\fR;
2551 \fIstr\fR \fB= str(\fR\fIsel\fR\fB)\fR
2552 \fIstr\fR \fB=\fR \fIsel\fR\fB\&.to_s\fR
2553 .fi
2554 .if n \{\
2555 .RE
2556 .\}
2557 .sp
2558 Return a string describing the selection\&.
2559 .SH "THE JOB CLASS"
2560 .sp
2561 Jobs are the way to specify to the dependency solver what to do\&. Most of the times jobs will get created by calling the jobs() method on a Selection object, but there is also a Job() constructor in the Pool class\&.
2562 .SS "CONSTANTS"
2563 .sp
2564 Selection constants:
2565 .PP
2566 \fBSOLVER_SOLVABLE\fR
2567 .RS 4
2568 The \(lqwhat\(rq part is the id of a solvable\&.
2569 .RE
2570 .PP
2571 \fBSOLVER_SOLVABLE_NAME\fR
2572 .RS 4
2573 The \(lqwhat\(rq part is the id of a package name\&.
2574 .RE
2575 .PP
2576 \fBSOLVER_SOLVABLE_PROVIDES\fR
2577 .RS 4
2578 The \(lqwhat\(rq part is the id of a package provides\&.
2579 .RE
2580 .PP
2581 \fBSOLVER_SOLVABLE_ONE_OF\fR
2582 .RS 4
2583 The \(lqwhat\(rq part is an offset into the \(lqwhatprovides\(rq data, created by calling the towhatprovides() pool method\&.
2584 .RE
2585 .PP
2586 \fBSOLVER_SOLVABLE_REPO\fR
2587 .RS 4
2588 The \(lqwhat\(rq part is the id of a repository\&.
2589 .RE
2590 .PP
2591 \fBSOLVER_SOLVABLE_ALL\fR
2592 .RS 4
2593 The \(lqwhat\(rq part is ignored, all packages are selected\&.
2594 .RE
2595 .PP
2596 \fBSOLVER_SOLVABLE_SELECTMASK\fR
2597 .RS 4
2598 A mask containing all the above selection bits\&.
2599 .RE
2600 .sp
2601 Action constants:
2602 .PP
2603 \fBSOLVER_NOOP\fR
2604 .RS 4
2605 Do nothing\&.
2606 .RE
2607 .PP
2608 \fBSOLVER_INSTALL\fR
2609 .RS 4
2610 Install a package of the specified set of packages\&. It tries to install the best matching package (i\&.e\&. the highest version of the packages from the repositories with the highest priority)\&.
2611 .RE
2612 .PP
2613 \fBSOLVER_ERASE\fR
2614 .RS 4
2615 Erase all of the packages from the specified set\&. If a package is not installed, erasing it will keep it from getting installed\&.
2616 .RE
2617 .PP
2618 \fBSOLVER_UPDATE\fR
2619 .RS 4
2620 Update the matching installed packages to their best version\&. If none of the specified packages are installed, try to update the installed packages to the specified versions\&. See the section about targeted updates about more information\&.
2621 .RE
2622 .PP
2623 \fBSOLVER_WEAKENDEPS\fR
2624 .RS 4
2625 Allow to break the dependencies of the matching packages\&. Handle with care\&.
2626 .RE
2627 .PP
2628 \fBSOLVER_MULTIVERSION\fR
2629 .RS 4
2630 Mark the matched packages for multiversion install\&. If they get to be installed because of some other job, the installation will keep the old version of the package installed (for rpm by using \(oq`\-i\*(Aq\*(Aq instead of ``\-U\(cq\*(Aq)\&.
2631 .RE
2632 .PP
2633 \fBSOLVER_LOCK\fR
2634 .RS 4
2635 Do not change the state of the matched packages, i\&.e\&. when they are installed they stay installed, if not they are not selected for installation\&.
2636 .RE
2637 .PP
2638 \fBSOLVER_DISTUPGRADE\fR
2639 .RS 4
2640 Update the matching installed packages to the best version included in one of the repositories\&. After this operation, all come from one of the available repositories except orphaned packages\&. Orphaned packages are packages that have no relation to the packages in the repositories, i\&.e\&. no package in the repositories have the same name or obsolete the orphaned package\&. This action brings the installed packages in sync with the ones in the repository\&. It also turns of arch/vendor/version locking for the affected packages to simulate a fresh installation\&. This means that distupgrade can actually downgrade packages if only lower versions of a package are available in the repositories\&.
2641 .RE
2642 .PP
2643 \fBSOLVER_DROP_ORPHANED\fR
2644 .RS 4
2645 Erase all the matching installed packages if they are orphaned\&. This only makes sense if there is a \(lqdistupgrade all packages\(rq job\&. The default is to erase orphaned packages only if they block the installation of other packages\&.
2646 .RE
2647 .PP
2648 \fBSOLVER_VERIFY\fR
2649 .RS 4
2650 Fix dependency problems of matching installed packages\&. The default is to ignore dependency problems for installed packages\&.
2651 .RE
2652 .PP
2653 \fBSOLVER_USERINSTALLED\fR
2654 .RS 4
2655 The matching installed packages are considered to be installed by a user, thus not installed to fulfil some dependency\&. This is needed input for the calculation of unneeded packages for jobs that have the SOLVER_CLEANDEPS flag set\&.
2656 .RE
2657 .PP
2658 \fBSOLVER_JOBMASK\fR
2659 .RS 4
2660 A mask containing all the above action bits\&.
2661 .RE
2662 .sp
2663 Action modifier constants:
2664 .PP
2665 \fBSOLVER_WEAK\fR
2666 .RS 4
2667 Makes the job a weak job\&. The solver tries to fulfil weak jobs, but does not report a problem if it is not possible to do so\&.
2668 .RE
2669 .PP
2670 \fBSOLVER_ESSENTIAL\fR
2671 .RS 4
2672 Makes the job an essential job\&. If there is a problem with the job, the solver will not propose to remove the job as one solution (unless all other solutions are also to remove essential jobs)\&.
2673 .RE
2674 .PP
2675 \fBSOLVER_CLEANDEPS\fR
2676 .RS 4
2677 The solver will try to also erase all packages dragged in through dependencies when erasing the package\&. This needs SOLVER_USERINSTALLED jobs to maximize user satisfaction\&.
2678 .RE
2679 .PP
2680 \fBSOLVER_FORCEBEST\fR
2681 .RS 4
2682 Insist on the best package for install, update, and distupgrade jobs\&. If this flag is not used, the solver will use the second\-best package if the best package cannot be installed for some reason\&. When this flag is used, the solver will generate a problem instead\&.
2683 .RE
2684 .PP
2685 \fBSOLVER_TARGETED\fR
2686 .RS 4
2687 Forces targeted operation update and distupgrade jobs\&. See the section about targeted updates about more information\&.
2688 .RE
2689 .sp
2690 Set constants\&.
2691 .PP
2692 \fBSOLVER_SETEV\fR
2693 .RS 4
2694 The job specified the exact epoch and version of the package set\&.
2695 .RE
2696 .PP
2697 \fBSOLVER_SETEVR\fR
2698 .RS 4
2699 The job specified the exact epoch, version, and release of the package set\&.
2700 .RE
2701 .PP
2702 \fBSOLVER_SETARCH\fR
2703 .RS 4
2704 The job specified the exact architecture of the packages from the set\&.
2705 .RE
2706 .PP
2707 \fBSOLVER_SETVENDOR\fR
2708 .RS 4
2709 The job specified the exact vendor of the packages from the set\&.
2710 .RE
2711 .PP
2712 \fBSOLVER_SETREPO\fR
2713 .RS 4
2714 The job specified the exact repository of the packages from the set\&.
2715 .RE
2716 .PP
2717 \fBSOLVER_SETNAME\fR
2718 .RS 4
2719 The job specified the exact name of the packages from the set\&.
2720 .RE
2721 .PP
2722 \fBSOLVER_NOAUTOSET\fR
2723 .RS 4
2724 Turn of automatic set flag generation for SOLVER_SOLVABLE jobs\&.
2725 .RE
2726 .PP
2727 \fBSOLVER_SETMASK\fR
2728 .RS 4
2729 A mask containing all the above set bits\&.
2730 .RE
2731 .sp
2732 See the section about set bits for more information\&.
2733 .SS "ATTRIBUTES"
2734 .sp
2735 .if n \{\
2736 .RS 4
2737 .\}
2738 .nf
2739 \fBPool *pool;\fR                             /* read only */
2740 \fI$job\fR\fB\->{\*(Aqpool\*(Aq}\fR
2741 \fId\fR\fB\&.pool\fR
2742 \fId\fR\fB\&.pool\fR
2743 .fi
2744 .if n \{\
2745 .RE
2746 .\}
2747 .sp
2748 Back pointer to pool\&.
2749 .sp
2750 .if n \{\
2751 .RS 4
2752 .\}
2753 .nf
2754 \fBId how;\fR                                 /* read/write */
2755 \fI$job\fR\fB\->{\*(Aqhow\*(Aq}\fR
2756 \fId\fR\fB\&.how\fR
2757 \fId\fR\fB\&.how\fR
2758 .fi
2759 .if n \{\
2760 .RE
2761 .\}
2762 .sp
2763 Union of the selection, action, action modifier, and set flags\&. The selection part describes the semantics of the \(lqwhat\(rq Id\&.
2764 .sp
2765 .if n \{\
2766 .RS 4
2767 .\}
2768 .nf
2769 \fBId what;\fR                                /* read/write */
2770 \fI$job\fR\fB\->{\*(Aqwhat\*(Aq}\fR
2771 \fId\fR\fB\&.what\fR
2772 \fId\fR\fB\&.what\fR
2773 .fi
2774 .if n \{\
2775 .RE
2776 .\}
2777 .sp
2778 Id describing the set of packages, the meaning depends on the selection part of the \(lqhow\(rq attribute\&.
2779 .SS "METHODS"
2780 .sp
2781 .if n \{\
2782 .RS 4
2783 .\}
2784 .nf
2785 \fBSolvable *solvables()\fR
2786 my \fI@solvables\fR \fB=\fR \fI$job\fR\fB\->solvables()\fR;
2787 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
2788 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
2789 .fi
2790 .if n \{\
2791 .RE
2792 .\}
2793 .sp
2794 Return the set of solvables of the job as an array of Solvable objects\&.
2795 .sp
2796 .if n \{\
2797 .RS 4
2798 .\}
2799 .nf
2800 \fBbool isemptyupdate()\fR;
2801 \fI$job\fR\fB\->isemptyupdate()\fR
2802 \fIjob\fR\fB\&.isemptyupdate()\fR
2803 \fIjob\fR\fB\&.isemptyupdate?\fR
2804 .fi
2805 .if n \{\
2806 .RE
2807 .\}
2808 .sp
2809 Convenience function to find out if the job describes an update job with no matching packages, i\&.e\&. a job that does nothing\&. Some package managers like \(lqzypper\(rq like to turn those jobs into install jobs, i\&.e\&. an update of a not\-installed package will result into the installation of the package\&.
2810 .sp
2811 .if n \{\
2812 .RS 4
2813 .\}
2814 .nf
2815 \fB<stringification>\fR
2816 my \fI$str\fR \fB= "\fR\fI$job\fR\fB"\fR;
2817 \fIstr\fR \fB= str(\fR\fIjob\fR\fB)\fR
2818 \fIstr\fR \fB=\fR \fIjob\fR\fB\&.to_s\fR
2819 .fi
2820 .if n \{\
2821 .RE
2822 .\}
2823 .sp
2824 Return a string describing the job\&.
2825 .sp
2826 .if n \{\
2827 .RS 4
2828 .\}
2829 .nf
2830 \fB<equality>\fR
2831 \fBif (\fR\fI$job1\fR \fB==\fR \fI$job2\fR\fB)\fR
2832 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR\fB:\fR
2833 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR
2834 .fi
2835 .if n \{\
2836 .RE
2837 .\}
2838 .sp
2839 Two jobs are equal if they belong to the same pool and both the \(lqhow\(rq and the \(lqwhat\(rq attributes are the same\&.
2840 .SS "TARGETED UPDATES"
2841 .sp
2842 Libsolv has two modes for upgrades and distupgrade: targeted and untargeted\&. Untargeted mode means that the installed packages from the specified set will be updated to the best version\&. Targeted means that packages that can be updated to a package in the specified set will be updated to the best package of the set\&.
2843 .sp
2844 Here\(cqs an example to explain the subtle difference\&. Suppose that you have package A installed in version "1\&.1", "A\-1\&.2" is available in one of the repositories and there is also package "B" that obsoletes package A\&.
2845 .sp
2846 An untargeted update of "A" will update the installed "A\-1\&.1" to package "B", because that is the newest version (B obsoletes A and is thus newer)\&.
2847 .sp
2848 A targeted update of "A" will update "A\-1\&.1" to "A\-1\&.2", as the set of packages contains both "A\-1\&.1" and "A\-1\&.2", and "A\-1\&.2" is the newer one\&.
2849 .sp
2850 An untargeted update of "B" will do nothing, as "B" is not installed\&.
2851 .sp
2852 An targeted update of "B" will update "A\-1\&.1" to "B"\&.
2853 .sp
2854 Note that the default is to do "auto\-targeting", thus if the specified set of packages does not include an installed package, the solver will assume targeted operation even if SOLVER_TARGETED is not used\&.
2855 .sp
2856 This mostly matches the intent of the user, with one exception: In the example above, an update of "A\-1\&.2" will update "A\-1\&.1" to "A\-1\&.2" (targeted mode), but a second update of "A\-1\&.2" will suddenly update to "B", as untargeted mode is chosen because "A\-1\&.2" is now installed\&.
2857 .sp
2858 If you want to have full control over when targeting mode is chosen, turn off auto\-targeting with the SOLVER_FLAG_NO_AUTOTARGET solver option\&. In that case, all updates are considered to be untargeted unless they include the SOLVER_TARGETED flag\&.
2859 .SS "SET BITS"
2860 .sp
2861 Set bits specify which parts of the specified packages where specified by the user\&. It is used by the solver when checking if an operation is allowed or not\&. For example, the solver will normally not allow the downgrade of an installed package\&. But it will not report a problem if the SOLVER_SETEVR flag is used, as it then assumes that the user specified the exact version and thus knows what he is doing\&.
2862 .sp
2863 So if a package "screen\-1\-1" is installed for the x86_64 architecture and version "2\-1" is only available for the i586 architecture, installing package "screen\-2\&.1" will ask the user for confirmation because of the different architecture\&. When using the Selection class to create jobs the set bits are automatically added, e\&.g\&. selecting \(lqscreen\&.i586\(rq will automatically add SOLVER_SETARCH, and thus no problem will be reported\&.
2864 .SH "THE SOLVER CLASS"
2865 .sp
2866 xxx
2867 .SH "THE TRANSACTION CLASS"
2868 .sp
2869 xxx
2870 .SH "CHECKSUMS"
2871 .sp
2872 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\&.
2873 .SS "CLASS METHODS"
2874 .sp
2875 .if n \{\
2876 .RS 4
2877 .\}
2878 .nf
2879 \fBChksum *Chksum(Id\fR \fItype\fR\fB)\fR
2880 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB)\fR;
2881 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB)\fR
2882 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB)\fR
2883 .fi
2884 .if n \{\
2885 .RE
2886 .\}
2887 .sp
2888 Create a checksum object\&. Currently the following types are supported:
2889 .sp
2890 .if n \{\
2891 .RS 4
2892 .\}
2893 .nf
2894 \fBREPOKEY_TYPE_MD5\fR
2895 \fBREPOKEY_TYPE_SHA1\fR
2896 \fBREPOKEY_TYPE_SHA256\fR
2897 .fi
2898 .if n \{\
2899 .RE
2900 .\}
2901 .sp
2902 These keys are constants in the \fBsolv\fR class\&.
2903 .sp
2904 .if n \{\
2905 .RS 4
2906 .\}
2907 .nf
2908 \fBChksum *Chksum(Id\fR \fItype\fR\fB, const char *\fR\fIhex\fR\fB)\fR
2909 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB,\fR \fI$hex\fR\fB)\fR;
2910 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
2911 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
2912 .fi
2913 .if n \{\
2914 .RE
2915 .\}
2916 .sp
2917 Create an already finalized checksum object\&.
2918 .SS "ATTRIBUTES"
2919 .sp
2920 .if n \{\
2921 .RS 4
2922 .\}
2923 .nf
2924 \fBId type;\fR                        /* read only */
2925 \fI$chksum\fR\fB\->{\*(Aqtype\*(Aq}\fR
2926 \fIchksum\fR\fB\&.type\fR
2927 \fIchksum\fR\fB\&.type\fR
2928 .fi
2929 .if n \{\
2930 .RE
2931 .\}
2932 .sp
2933 Return the type of the checksum object\&.
2934 .SS "METHODS"
2935 .sp
2936 .if n \{\
2937 .RS 4
2938 .\}
2939 .nf
2940 \fBvoid add(const char *\fR\fIstr\fR\fB)\fR
2941 \fI$chksum\fR\fB\->add(\fR\fI$str\fR\fB)\fR;
2942 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
2943 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
2944 .fi
2945 .if n \{\
2946 .RE
2947 .\}
2948 .sp
2949 Add a string to the checksum\&.
2950 .sp
2951 .if n \{\
2952 .RS 4
2953 .\}
2954 .nf
2955 \fBvoid add_fp(FILE *\fR\fIfp\fR\fB)\fR
2956 \fI$chksum\fR\fB\->add_fp(\fR\fI$file\fR\fB)\fR;
2957 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
2958 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
2959 .fi
2960 .if n \{\
2961 .RE
2962 .\}
2963 .sp
2964 Add the contents of a file to the checksum\&.
2965 .sp
2966 .if n \{\
2967 .RS 4
2968 .\}
2969 .nf
2970 \fBvoid add_stat(const char *\fR\fIfilename\fR\fB)\fR
2971 \fI$chksum\fR\fB\->add_stat(\fR\fI$filename\fR\fB)\fR;
2972 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
2973 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
2974 .fi
2975 .if n \{\
2976 .RE
2977 .\}
2978 .sp
2979 Stat the file and add the dev/ino/size/mtime member to the checksum\&. If the stat fails, the members are zeroed\&.
2980 .sp
2981 .if n \{\
2982 .RS 4
2983 .\}
2984 .nf
2985 \fBvoid add_fstat(int\fR \fIfd\fR\fB)\fR
2986 \fI$chksum\fR\fB\->add_fstat(\fR\fI$fd\fR\fB)\fR;
2987 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
2988 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
2989 .fi
2990 .if n \{\
2991 .RE
2992 .\}
2993 .sp
2994 Same as add_stat, but instead of the filename a file descriptor is used\&.
2995 .sp
2996 .if n \{\
2997 .RS 4
2998 .\}
2999 .nf
3000 \fBunsigned char *raw()\fR
3001 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->raw()\fR;
3002 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
3003 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
3004 .fi
3005 .if n \{\
3006 .RE
3007 .\}
3008 .sp
3009 Finalize the checksum and return the result as raw bytes\&. This means that the result can contain NUL bytes or unprintable characters\&.
3010 .sp
3011 .if n \{\
3012 .RS 4
3013 .\}
3014 .nf
3015 \fBconst char *hex()\fR
3016 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->hex()\fR;
3017 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
3018 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
3019 .fi
3020 .if n \{\
3021 .RE
3022 .\}
3023 .sp
3024 Finalize the checksum and return the result as hex string\&.
3025 .sp
3026 .if n \{\
3027 .RS 4
3028 .\}
3029 .nf
3030 \fB<equality>\fR
3031 \fBif (\fR\fI$chksum1\fR \fB==\fR \fI$chksum2\fR\fB)\fR
3032 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR\fB:\fR
3033 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR
3034 .fi
3035 .if n \{\
3036 .RE
3037 .\}
3038 .sp
3039 Checksums are equal if they are of the same type and the finalized results are the same\&.
3040 .sp
3041 .if n \{\
3042 .RS 4
3043 .\}
3044 .nf
3045 \fB<stringification>\fR
3046 my \fI$str\fR \fB= "\fR\fI$chksum\fR\fB"\fR;
3047 \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR
3048 \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR
3049 .fi
3050 .if n \{\
3051 .RE
3052 .\}
3053 .sp
3054 If the checksum is finished, the checksum is returned as "<type>:<hex>" string\&. Otherwise "<type>:unfinished" is returned\&.
3055 .SH "FILE MANAGEMENT"
3056 .sp
3057 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\&.
3058 .sp
3059 .if n \{\
3060 .RS 4
3061 .\}
3062 .nf
3063 \fBFILE *xfopen(char *\fR\fIfn\fR\fB, char *\fR\fImode\fR \fB= "r")\fR
3064 my \fI$file\fR \fB= solv::xfopen(\fR\fI$path\fR\fB)\fR;
3065 \fIfile\fR \fB= solv\&.xfopen(\fR\fIpath\fR\fB)\fR
3066 \fIfile\fR \fB= Solv::xfopen(\fR\fIpath\fR\fB)\fR
3067 .fi
3068 .if n \{\
3069 .RE
3070 .\}
3071 .sp
3072 Open a file at the specified path\&. The mode argument is passed on to the stdio library\&.
3073 .sp
3074 .if n \{\
3075 .RS 4
3076 .\}
3077 .nf
3078 \fBFILE *xfopen_fd(char *\fR\fIfn\fR\fB, int\fR \fIfileno\fR\fB)\fR
3079 my \fI$file\fR \fB= solv::xfopen_fd(\fR\fI$path\fR\fB,\fR \fI$fileno\fR\fB)\fR;
3080 \fIfile\fR \fB= solv\&.xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
3081 \fIfile\fR \fB= Solv::xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
3082 .fi
3083 .if n \{\
3084 .RE
3085 .\}
3086 .sp
3087 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\&.
3088 .SS "METHODS"
3089 .sp
3090 .if n \{\
3091 .RS 4
3092 .\}
3093 .nf
3094 \fBint fileno()\fR
3095 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->fileno()\fR;
3096 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
3097 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
3098 .fi
3099 .if n \{\
3100 .RE
3101 .\}
3102 .sp
3103 Return file file descriptor of the file\&. If the file is not open, \-1 is returned\&.
3104 .sp
3105 .if n \{\
3106 .RS 4
3107 .\}
3108 .nf
3109 \fBint dup()\fR
3110 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->dup()\fR;
3111 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
3112 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
3113 .fi
3114 .if n \{\
3115 .RE
3116 .\}
3117 .sp
3118 Return a copy of the descriptor of the file\&. If the file is not open, \-1 is returned\&.
3119 .sp
3120 .if n \{\
3121 .RS 4
3122 .\}
3123 .nf
3124 \fBbool flush()\fR
3125 \fI$file\fR\fB\->flush()\fR;
3126 \fIfile\fR\fB\&.flush()\fR
3127 \fIfile\fR\fB\&.flush()\fR
3128 .fi
3129 .if n \{\
3130 .RE
3131 .\}
3132 .sp
3133 Flush the file\&. Returns false if there was an error\&. Flushing a closed file always returns true\&.
3134 .sp
3135 .if n \{\
3136 .RS 4
3137 .\}
3138 .nf
3139 \fBbool close()\fR
3140 \fI$file\fR\fB\->close()\fR;
3141 \fIfile\fR\fB\&.close()\fR
3142 \fIfile\fR\fB\&.close()\fR
3143 .fi
3144 .if n \{\
3145 .RE
3146 .\}
3147 .sp
3148 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\&.
3149 .SH "THE REPODATACLASS"
3150 .sp
3151 xxx
3152 .SH "AUTHOR"
3153 .sp
3154 Michael Schroeder <mls@suse\&.de>