Imported Upstream version 0.6.29
[platform/upstream/libsolv.git] / doc / libsolv-bindings.txt
1 Libsolv-Bindings(3)
2 ===================
3 :man manual: LIBSOLV
4 :man source: libsolv
5
6
7 Name
8 ----
9 libsolv-bindings - access libsolv from perl/python/ruby
10
11
12 Description
13 -----------
14 Libsolv's language bindings offer an abstract, object orientated interface
15 to the library. The supported languages are currently perl, python, and ruby.
16 All example code (except in the specifics sections, of course) lists first
17 the ``C-ish'' interface, then the syntax for perl, python, and ruby (in that
18 order).
19
20
21 Perl Specifics
22 --------------
23 Libsolv's perl bindings can be loaded with the following statement:
24
25         use solv;
26
27 Objects are either created by calling the new() method on a class or they
28 are returned by calling methods on other objects.
29
30         my $pool = solv::Pool->new();
31         my $repo = $pool->add_repo("my_first_repo");
32
33 Swig encapsulates all objects as tied hashes, thus the attributes can be
34 accessed by treating the object as standard hash reference:
35
36         $pool->{appdata} = 42;
37         printf "appdata is %d\n", $pool->{appdata};
38
39 A special exception to this are iterator objects, they are encapsulated as
40 tied arrays so that it is possible to iterate with a for() statement:
41
42         my $iter = $pool->solvables_iter();
43         for my $solvable (@$iter) { ... };
44
45 As a downside of this approach, iterator objects cannot have attributes.
46
47 If an array needs to be passed to a method it is usually done by reference,
48 if a method returns an array it returns it on the stack:
49
50         my @problems = $solver->solve(\@jobs);
51
52 Due to a bug in swig, stringification does not work for libsolv's objects.
53 Instead, you have to call the object's str() method.
54
55         print $dep->str() . "\n";
56
57 Swig implements all constants as numeric variables (instead of the more
58 natural constant subs), so don't forget the leading ``$'' when accessing a
59 constant. Also do not forget to prepend the namespace of the constant:
60
61         $pool->set_flag($solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1);
62         
63
64 Python Specifics
65 ----------------
66 The python bindings can be loaded with:
67
68         import solv
69
70 Objects are either created by calling the constructor method for a class or they
71 are returned by calling methods on other objects.
72
73         pool = solv.Pool()
74         repo = pool.add_repo("my_first_repo")
75
76 Attributes can be accessed as usual:
77
78         pool.appdata = 42
79         print "appdata is %d" % (pool.appdata)
80
81 Iterators also work as expected:
82
83         for solvable in pool.solvables_iter():
84
85 Arrays are passed and returned as list objects:
86
87         jobs = []
88         problems = solver.solve(jobs)
89
90 The bindings define stringification for many classes, some also have a
91 __repr__ method to ease debugging.
92
93         print dep
94         print repr(repo)
95
96 Constants are attributes of the classes:
97
98         pool.set_flag(solv.Pool.POOL_FLAG_OBSOLETEUSESCOLORS, 1);
99
100
101 Ruby Specifics
102 --------------
103 The ruby bindings can be loaded with:
104
105         require 'solv'
106
107 Objects are either created by calling the new method on a class or they
108 are returned by calling methods on other objects. Note that all classes start
109 with an uppercase letter in ruby, so the class is called ``Solv''.
110
111         pool = Solv::Pool.new
112         repo = pool.add_repo("my_first_repo")
113
114 Attributes can be accessed as usual:
115
116         pool.appdata = 42
117         puts "appdata is #{pool.appdata}"
118
119 Iterators also work as expected:
120
121         for solvable in pool.solvables_iter() do ...
122
123 Arrays are passed and returned as array objects:
124
125         jobs = []
126         problems = solver.solve(jobs)
127
128 Most classes define a to_s method, so objects can be easily stringified.
129 Many also define an inspect() method.
130
131         puts dep
132         puts repo.inspect
133
134 Constants live in the namespace of the class they belong to:
135
136         pool.set_flag(Solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1);
137
138 Note that boolean methods have an added trailing ``?'', to be consistent with
139 other ruby modules:
140
141         puts "empty" if repo.isempty?
142
143
144 Tcl Specifics
145 -------------
146 Libsolv's tcl bindings can be loaded with the following statement:
147
148         TCL package require solv
149
150 Objects are either created by calling class name prefixed with ``new_'',
151 or they are returned by calling methods on other objects.
152
153         TCL set pool [solv::new_Pool]
154         TCL set repo [$pool add_repo "my_first_repo"]
155
156 Swig provides a ``cget'' method to read object attributes, and a
157 ``configure'' method to write them:
158
159         TCL $pool configure -appdata 42
160         TCL puts "appdata is [$pool cget -appdata]"
161
162 The tcl bindings provide a little helper to work with iterators in
163 a foreach style:
164
165         TCL set iter [$pool solvables_iter]
166         TCL solv::iter s $iter { ... }
167
168 libsolv's arrays are mapped to tcl's lists:
169
170         TCL set jobs [list $job1 $job2]
171         TCL set problems [$solver solve $jobs]
172         TCL puts "We have [llength $problems] problems..."
173
174 Stringification is done by calling the object's ``str'' method.
175
176         TCL puts [$dep str]
177
178 There is one exception: you have to use ``stringify'' for Datamatch
179 objects, as swig reports a clash with the ``str'' attribute.
180 Some objects also support a ``=='' method for equality tests, and a
181 ``!='' method.
182
183 Swig implements all constants as numeric variables, constants belonging
184 to a libsolv class are prefixed with the class name:
185
186         TCL $pool set_flag $solv::Pool_POOL_FLAG_OBSOLETEUSESCOLORS  1
187         TCL puts [$solvable lookup_str $solv::SOLVABLE_SUMMARY]
188         
189
190 The Solv Class
191 --------------
192 This is the main namespace of the library, you cannot create objects of this
193 type but it contains some useful constants.
194
195 === CONSTANTS ===
196
197 Relational flag constants, the first three can be or-ed together
198
199 *REL_LT*::
200 the ``less than'' bit
201
202 *REL_EQ*::
203 the ``equals to'' bit
204
205 *REL_GT*::
206 the ``greater than'' bit
207
208 *REL_ARCH*::
209 used for relations that describe an extra architecture filter, the
210 version part of the relation is interpreted as architecture.
211
212 Special Solvable Ids
213
214 *SOLVID_META*::
215 Access the meta section of a repository or repodata area. This is
216 like an extra Solvable that has the Id SOLVID_META.
217
218 *SOLVID_POS*::
219 Use the data position stored inside of the pool instead of accessing
220 some solvable by Id. The bindings have the Datapos objects as an
221 abstraction mechanism, so you do not need this constant.
222
223 Constant string Ids
224   
225 *ID_NULL*::
226 Always zero
227
228 *ID_EMPTY*::
229 Always one, describes the empty string
230
231 *SOLVABLE_NAME*::
232 The keyname Id of the name of the solvable.
233
234 *...*::
235 see the libsolv-constantids manpage for a list of fixed Ids.
236
237
238 The Pool Class
239 --------------
240 The pool is libsolv's central resource manager. A pool consists of Solvables,
241 Repositories, Dependencies, each indexed by Ids.
242
243 === CLASS METHODS ===
244
245         Pool *Pool()
246         my $pool = solv::Pool->new();
247         pool = solv.Pool()
248         pool = Solv::Pool.new()
249
250 Create a new pool instance. In most cases you just need one pool.
251 Note that the returned object "owns" the pool, i.e. if the object is 
252 freed, the pool is also freed. You can use the disown method to
253 break this ownership relation.
254
255 === ATTRIBUTES ===
256
257         void *appdata;                  /* read/write */
258         $pool->{appdata}
259         pool.appdata
260         pool.appdata
261
262 Application specific data that may be used in any way by the code using the
263 pool.
264
265         Solvable solvables[];           /* read only */
266         my $solvable = $pool->{solvables}->[$solvid];
267         solvable = pool.solvables[solvid]
268         solvable = pool.solvables[solvid]
269
270 Look up a Solvable by its id.
271
272         Repo repos[];                   /* read only */
273         my $repo = $pool->{repos}->[$repoid];
274         repo = pool.repos[repoid]
275         repo = pool.repos[repoid]
276
277 Look up a Repository by its id.
278
279         Repo *installed;                /* read/write */
280         $pool->{installed} = $repo;
281         pool.installed = repo
282         pool.installed = repo
283
284 Define which repository contains all the installed packages.
285
286         const char *errstr;             /* read only */
287         my $err = $pool->{errstr};
288         err = pool.errstr
289         err = pool.errstr
290
291 Return the last error string that was stored in the pool.
292
293 === CONSTANTS ===
294
295 *POOL_FLAG_PROMOTEEPOCH*::
296 Promote the epoch of the providing dependency to the requesting
297 dependency if it does not contain an epoch. Used at some time
298 in old rpm versions, modern systems should never need this.
299
300 *POOL_FLAG_FORBIDSELFCONFLICTS*::
301 Disallow the installation of packages that conflict with themselves.
302 Debian always allows self-conflicting packages, rpm used to forbid
303 them but switched to also allowing them recently.
304
305 *POOL_FLAG_OBSOLETEUSESPROVIDES*::
306 Make obsolete type dependency match against provides instead of
307 just the name and version of packages. Very old versions of rpm
308 used the name/version, then it got switched to provides and later
309 switched back again to just name/version.
310
311 *POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES*::
312 An implicit obsoletes is the internal mechanism to remove the
313 old package on an update. The default is to remove all packages
314 with the same name, rpm-5 switched to also removing packages
315 providing the same name.
316
317 *POOL_FLAG_OBSOLETEUSESCOLORS*::
318 Rpm's multilib implementation (used in RedHat and Fedora)
319 distinguishes between 32bit and 64bit packages (the terminology
320 is that they have a different color). If obsoleteusescolors is
321 set, packages with different colors will not obsolete each other.
322
323 *POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS*::
324 Same as POOL_FLAG_OBSOLETEUSESCOLORS, but used to find out if
325 packages of the same name can be installed in parallel. For
326 current Fedora systems, POOL_FLAG_OBSOLETEUSESCOLORS should be
327 false and POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS should be true
328 (this is the default if FEDORA is defined when libsolv is compiled).
329
330 *POOL_FLAG_NOINSTALLEDOBSOLETES*::
331 New versions of rpm consider the obsoletes of installed packages
332 when checking for dependency, thus you may not install a package
333 that is obsoleted by some other installed package, unless you
334 also erase the other package.
335
336 *POOL_FLAG_HAVEDISTEPOCH*::
337 Mandriva added a new field called distepoch that gets checked in
338 version comparison if the epoch/version/release of two packages
339 are the same.
340
341 *POOL_FLAG_NOOBSOLETESMULTIVERSION*::
342 If a package is installed in multiversionmode, rpm used to ignore
343 both the implicit obsoletes and the obsolete dependency of a
344 package. This was changed to ignoring just the implicit obsoletes,
345 thus you may install multiple versions of the same name, but
346 obsoleted packages still get removed.
347
348 *POOL_FLAG_ADDFILEPROVIDESFILTERED*::
349 Make the addfileprovides method only add files from the standard
350 locations (i.e. the ``bin'' and ``etc'' directories). This is
351 useful if you have only few packages that use non-standard file
352 dependencies, but you still want the fast speed that addfileprovides()
353 generates.
354
355 === METHODS ===
356
357         void free()
358         $pool->free();
359         pool.free()
360         pool.free()
361
362 Force a free of the pool. After this call, you must not access any object
363 that still references the pool.
364
365         void disown()
366         $pool->disown();
367         pool.disown()
368         pool.disown()
369
370 Break the ownership relation between the binding object and the pool. After
371 this call, the pool will not get freed even if the object goes out of
372 scope. This also means that you must manually call the free method to free
373 the pool data.
374
375         void setdebuglevel(int level)
376         $pool->setdebuglevel($level);
377         pool.setdebuglevel(level)
378         pool.setdebuglevel(level)
379
380 Set the debug level. A value of zero means no debug output, the higher the
381 value, the more output is generated.
382
383         int set_flag(int flag, int value)
384         my $oldvalue = $pool->set_flag($flag, $value);
385         oldvalue = pool.set_flag(flag, value)
386         oldvalue = pool.set_flag(flag, value)
387
388         int get_flag(int flag)
389         my $value = $pool->get_flag($flag);
390         value = pool.get_flag(flag)
391         value = pool.get_flag(flag)
392
393 Set/get a pool specific flag. The flags define how the system works, e.g. how
394 the package manager treats obsoletes. The default flags should be sane for most
395 applications, but in some cases you may want to tweak a flag, for example if
396 you want to solv package dependencies for some other system than yours.
397
398         void set_rootdir(const char *rootdir)
399         $pool->set_rootdir(rootdir);
400         pool.set_rootdir(rootdir)
401         pool.set_rootdir(rootdir)
402
403         const char *get_rootdir()
404         my $rootdir = $pool->get_rootdir();
405         rootdir = pool.get_rootdir()
406         rootdir = pool.get_rootdir()
407
408 Set/get the rootdir to use. This is useful if you want package management
409 to work only in some directory, for example if you want to setup a chroot
410 jail. Note that the rootdir will only be prepended to file paths if the
411 *REPO_USE_ROOTDIR* flag is used.
412
413         void setarch(const char *arch = 0)
414         $pool->setarch();
415         pool.setarch()
416         pool.setarch()
417
418 Set the architecture for your system. The architecture is used to determine
419 which packages are installable. It defaults to the result of ``uname -m''.
420
421         Repo add_repo(const char *name)
422         $repo = $pool->add_repo($name);
423         repo = pool.add_repo(name)
424         repo = pool.add_repo(name)
425
426 Add a Repository with the specified name to the pool. The repository is empty
427 on creation, use the repository methods to populate it with packages.
428
429         Repoiterator repos_iter()
430         for my $repo (@{$pool->repos_iter()})
431         for repo in pool.repos_iter():
432         for repo in pool.repos_iter()
433
434 Iterate over the existing repositories.
435
436         Solvableiterator solvables_iter()
437         for my $solvable (@{$pool->solvables_iter()})
438         for solvable in pool.solvables_iter():
439         for solvable in pool.solvables_iter()
440
441 Iterate over the existing solvables.
442
443         Dep Dep(const char *str, bool create = 1)
444         my $dep = $pool->Dep($string);
445         dep = pool.Dep(string)
446         dep = pool.Dep(string)
447
448 Create an object describing a string or dependency. If the string is currently
449 not in the pool and _create_ is false, *undef*/*None*/*nil* is returned.
450
451         void addfileprovides()
452         $pool->addfileprovides();
453         pool.addfileprovides()
454         pool.addfileprovides()
455
456         Id *addfileprovides_queue()
457         my @ids = $pool->addfileprovides_queue();
458         ids = pool.addfileprovides_queue()
459         ids = pool.addfileprovides_queue()
460
461 Some package managers like rpm allow dependencies on files contained in other
462 packages. To allow libsolv to deal with those dependencies in an efficient way,
463 you need to call the addfileprovides method after creating and reading all
464 repositories. This method will scan all dependency for file names and then scan
465 all packages for matching files. If a filename has been matched, it will be
466 added to the provides list of the corresponding package. The
467 addfileprovides_queue variant works the same way but returns an array
468 containing all file dependencies. This information can be stored in the
469 meta section of the repositories to speed up the next time the
470 repository is loaded and addfileprovides is called.
471
472         void createwhatprovides()
473         $pool->createwhatprovides();
474         pool.createwhatprovides()
475         pool.createwhatprovides()
476
477 Create the internal ``whatprovides'' hash over all of the provides of all
478 packages. This method must be called before doing any lookups on provides.
479 It's encouraged to do it right after all repos are set up, usually right after
480 the call to addfileprovides().
481
482         Solvable *whatprovides(DepId dep)
483         my @solvables = $pool->whatprovides($dep);
484         solvables = pool.whatprovides(dep)
485         solvables = pool.whatprovides(dep)
486
487 Return all solvables that provide the specified dependency. You can use either
488 a Dep object or a simple Id as argument.
489
490         Id *matchprovidingids(const char *match, int flags)
491         my @ids = $pool->matchprovidingids($match, $flags);
492         ids = pool.matchprovidingids(match, flags)
493         ids = pool.matchprovidingids(match, flags)
494
495 Search the names of all provides and return the ones matching the specified
496 string. See the Dataiterator class for the allowed flags.
497
498         Id towhatprovides(Id *ids)
499         my $offset = $pool->towhatprovides(\@ids);
500         offset = pool.towhatprovides(ids)
501         offset = pool.towhatprovides(ids)
502
503 ``Internalize'' an array containing Ids. The returned value can be used to
504 create solver jobs working on a specific set of packages. See the Solver class
505 for more information.
506
507         bool isknownarch(DepId id)
508         my $bool = $pool->isknownarch($id);
509         bool = pool.isknownarch(id)
510         bool = pool.isknownarch?(id)
511
512 Return true if the specified Id describes a known architecture.
513
514         Solver Solver()
515         my $solver = $pool->Solver();
516         solver = pool.Solver()
517         solver = pool.Solver()
518
519 Create a new solver object.
520
521         Job Job(int how, Id what)
522         my $job = $pool->Job($how, $what);
523         job = pool.Job(how, what)
524         job = pool.Job(how, what)
525
526 Create a new Job object. Kind of low level, in most cases you would use a
527 Selection or Dep job constructor instead.
528
529         Selection Selection()
530         my $sel = $pool->Selection();
531         sel = pool.Selection()
532         sel = pool.Selection()
533
534 Create an empty selection. Useful as a starting point for merging other
535 selections.
536
537         Selection Selection_all()
538         my $sel = $pool->Selection_all();
539         sel = pool.Selection_all()
540         sel = pool.Selection_all()
541         
542 Create a selection containing all packages. Useful as starting point for
543 intersecting other selections or for update/distupgrade jobs.
544
545         Selection select(const char *name, int flags)
546         my $sel = $pool->select($name, $flags);
547         sel = pool.select(name, flags)
548         sel = pool.select(name, flags)
549
550 Create a selection by matching packages against the specified string. See the
551 Selection class for a list of flags and how to create solver jobs from a
552 selection.
553
554         void setpooljobs(Jobs *jobs)
555         $pool->setpooljobs(\@jobs);
556         pool.setpooljobs(jobs)
557         pool.setpooljobs(jobs)
558
559         Job *getpooljobs()
560         @jobs = $pool->getpooljobs();
561         jobs = pool.getpooljobs()
562         jobs = pool.getpooljobs()
563
564 Get/Set fixed jobs stored in the pool. Those jobs are automatically appended to
565 all solver jobs, they are meant for fixed configurations like which packages
566 can be multiversion installed, which packages were userinstalled or must not be
567 erased.
568
569         void set_loadcallback(Callable *callback)
570         $pool->setloadcallback(\&callbackfunction);
571         pool.setloadcallback(callbackfunction)
572         pool.setloadcallback { |repodata| ... }
573
574 Set the callback function called when repository metadata needs to be loaded on
575 demand. To make use of this feature, you need to create repodata stubs that
576 tell the library which data is available but not loaded. If later on the data
577 needs to be accessed, the callback function is called with a repodata argument.
578 You can then load the data (maybe fetching it first from a remote server).
579 The callback should return true if the data has been made available.
580
581         /* bindings only */
582         $pool->appdata_disown()
583         pool.appdata_disown()
584         pool.appdata_disown()
585
586 Decrement the reference count of the appdata object. This can be used to break
587 circular references (e.g. if the pool's appdata value points to some meta data
588 structure that contains a pool handle). If used incorrectly, this method can
589 lead to application crashes, so beware. (This method is a no-op for ruby and tcl.)
590
591 === DATA RETRIEVAL METHODS ===
592
593 In the following functions, the _keyname_ argument describes what to retrieve.
594 For the standard cases you can use the available Id constants. For example,
595
596         $solv::SOLVABLE_SUMMARY
597         solv.SOLVABLE_SUMMARY
598         Solv::SOLVABLE_SUMMARY
599
600 selects the ``Summary'' entry of a solvable. The _solvid_ argument selects the
601 desired solvable by Id.
602
603         const char *lookup_str(Id solvid, Id keyname)
604         my $string = $pool->lookup_str($solvid, $keyname);
605         string = pool.lookup_str(solvid, keyname)
606         string = pool.lookup_str(solvid, keyname)
607
608         Id lookup_id(Id solvid, Id keyname)
609         my $id = $pool->lookup_id($solvid, $keyname);
610         id = pool.lookup_id(solvid, keyname)
611         id = pool.lookup_id(solvid, keyname)
612
613         unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
614         my $num = $pool->lookup_num($solvid, $keyname);
615         num = pool.lookup_num(solvid, keyname)
616         num = pool.lookup_num(solvid, keyname)
617
618         bool lookup_void(Id solvid, Id keyname)
619         my $bool = $pool->lookup_void($solvid, $keyname);
620         bool = pool.lookup_void(solvid, keyname)
621         bool = pool.lookup_void(solvid, keyname)
622
623         Id *lookup_idarray(Id solvid, Id keyname)
624         my @ids = $pool->lookup_idarray($solvid, $keyname);
625         ids = pool.lookup_idarray(solvid, keyname)
626         ids = pool.lookup_idarray(solvid, keyname)
627
628         Chksum lookup_checksum(Id solvid, Id keyname)
629         my $chksum = $pool->lookup_checksum($solvid, $keyname);
630         chksum = pool.lookup_checksum(solvid, keyname)
631         chksum = pool.lookup_checksum(solvid, keyname)
632
633 Lookup functions. Return the data element stored in the specified solvable.
634 You should probably use the methods of the Solvable class instead.
635
636         Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
637         my $di = $pool->Dataiterator($keyname, $match, $flags);
638         di = pool.Dataiterator(keyname, match, flags)
639         di = pool.Dataiterator(keyname, match, flags)
640
641         Dataiterator Dataiterator_solvid(Id solvid, Id keyname, const char *match = 0, int flags = 0)
642         my $di = $pool->Dataiterator($solvid, $keyname, $match, $flags);
643         di = pool.Dataiterator(solvid, keyname, match, flags)
644         di = pool.Dataiterator(solvid, keyname, match, flags)
645
646         for my $d (@$di)
647         for d in di:
648         for d in di
649
650 Iterate over the matching data elements. See the Dataiterator class for more
651 information. The Dataiterator method iterates over all solvables in the pool,
652 whereas the Dataiterator_solvid only iterates over the specified solvable.
653
654 === ID METHODS ===
655
656 The following methods deal with Ids, i.e. integers representing objects in the
657 pool. They are considered ``low level'', in most cases you would not use them
658 but instead the object orientated methods.
659
660         Repo id2repo(Id id)
661         $repo = $pool->id2repo($id);
662         repo = pool.id2repo(id)
663         repo = pool.id2repo(id)
664
665 Lookup an existing Repository by id. You can also do this by using the *repos*
666 attribute.
667
668         Solvable id2solvable(Id id)
669         $solvable = $pool->id2solvable($id);
670         solvable = pool.id2solvable(id)
671         solvable = pool.id2solvable(id)
672
673 Lookup an existing Repository by id. You can also do this by using the
674 *solvables* attribute.
675
676         const char *solvid2str(Id id)
677         my $str = $pool->solvid2str($id);
678         str = pool.solvid2str(id)
679         str = pool.solvid2str(id)
680
681 Return a string describing the Solvable with the specified id. The string
682 consists of the name, version, and architecture of the Solvable.
683
684         Id str2id(const char *str, bool create = 1)
685         my $id = pool->str2id($string);
686         id = pool.str2id(string)
687         id = pool.str2id(string)
688
689         const char *id2str(Id id)
690         $string = pool->id2str($id);
691         string = pool.id2str(id)
692         string = pool.id2str(id)
693
694 Convert a string into an Id and back. If the string is currently not in the
695 pool and _create_ is false, zero is returned.
696
697         Id rel2id(Id name, Id evr, int flags, bool create = 1)
698         my $id = pool->rel2id($nameid, $evrid, $flags);
699         id = pool.rel2id(nameid, evrid, flags)
700         id = pool.rel2id(nameid, evrid, flags)
701
702 Create a ``relational'' dependency. Such dependencies consist of a name part,
703 the _flags_ describing the relation, and a version part. The flags are:
704
705         $solv::REL_EQ | $solv::REL_GT | $solv::REL_LT
706         solv.REL_EQ | solv.REL_GT | solv.REL_LT
707         Solv::REL_EQ | Solv::REL_GT | Solv::REL_LT
708
709 Thus, if you want a ``\<='' relation, you would use *REL_LT | REL_EQ*.
710
711         Id id2langid(Id id, const char *lang, bool create = 1)
712         my $id = $pool->id2langid($id, $language);
713         id = pool.id2langid(id, language)
714         id = pool.id2langid(id, language)
715
716 Create a language specific Id from some other id. This function simply converts
717 the id into a string, appends a dot and the specified language to the string
718 and converts the result back into an Id.
719
720         const char *dep2str(Id id)
721         $string = pool->dep2str($id);
722         string = pool.dep2str(id)
723         string = pool.dep2str(id)
724
725 Convert a dependency id into a string. If the id is just a string, this
726 function has the same effect as id2str(). For relational dependencies, the
727 result is the correct ``name relation evr'' string.
728
729
730 The Dependency Class
731 --------------------
732 The dependency class is an object orientated way to work with strings and
733 dependencies. Internally, dependencies are represented as Ids, i.e. simple
734 numbers. Dependency objects can be constructed by using the Pool's Dep()
735 method.
736
737 === ATTRIBUTES ===
738
739         Pool *pool;             /* read only */
740         $dep->{pool}
741         dep.pool
742         dep.pool
743
744 Back reference to the pool this dependency belongs to.
745
746         Id id;          /* read only */
747         $dep->{id}
748         dep.id
749         dep.id
750
751 The id of this dependency.
752
753 == Methods ==
754
755         Dep Rel(int flags, DepId evrid, bool create = 1)
756         my $reldep = $dep->Rel($flags, $evrdep);
757         reldep = dep.Rel(flags, evrdep)
758         reldep = dep.Rel(flags, evrdep)
759
760 Create a relational dependency from to string dependencies and a flags
761 argument. See the pool's rel2id method for a description of the flags.
762
763         Selection Selection_name(int setflags = 0)
764         my $sel = $dep->Selection_name();
765         sel = dep.Selection_name()
766         sel = dep.Selection_name()
767
768 Create a Selection from a dependency. The selection consists of all packages
769 that have a name equal to the dependency. If the dependency is of a relational
770 type, the packages version must also fulfill the dependency.
771
772         Selection Selection_provides(int setflags = 0)
773         my $sel = $dep->Selection_provides();
774         sel = dep.Selection_provides()
775         sel = dep.Selection_provides()
776
777 Create a Selection from a dependency. The selection consists of all packages
778 that have at least one provides matching the dependency.
779
780         const char *str()
781         my $str = $dep->str();
782         str = $dep.str()
783         str = $dep.str()
784
785 Return a string describing the dependency.
786
787         <stringification>
788         my $str = $dep->str;
789         str = str(dep)
790         str = dep.to_s
791
792 Same as calling the str() method.
793
794         <equality>
795         if ($dep1 == $dep2)
796         if dep1 == dep2:
797         if dep1 == dep2
798
799 The dependencies are equal if they are part of the same pool and have the same
800 ids.
801
802
803 The Repository Class
804 --------------------
805 A Repository describes a group of packages, normally coming from the same
806 source. Repositories are created by the Pool's add_repo() method.
807
808 === ATTRIBUTES ===
809
810         Pool *pool;                     /* read only */
811         $repo->{pool}
812         repo.pool
813         repo.pool
814
815 Back reference to the pool this dependency belongs to.
816
817         Id id;                          /* read only */
818         $repo->{id}
819         repo.id
820         repo.id
821
822 The id of the repository.
823
824         const char *name;               /* read/write */
825         $repo->{name}
826         repo.name
827         repo.name
828         
829 The repositories name. To libsolv, the name is just a string with no specific
830 meaning.
831
832         int priority;                   /* read/write */
833         $repo->{priority}
834         repo.priority
835         repo.priority
836
837 The priority of the repository. A higher number means that packages of this
838 repository will be chosen over other repositories, even if they have a greater
839 package version.
840
841         int subpriority;                /* read/write */
842         $repo->{subpriority}
843         repo.subpriority
844         repo.subpriority
845
846 The sub-priority of the repository. This value is compared when the priorities
847 of two repositories are the same. It is useful to make the library prefer
848 on-disk repositories to remote ones.
849
850         int nsolvables;                 /* read only */
851         $repo->{nsolvables}
852         repo.nsolvables
853         repo.nsolvables
854
855 The number of solvables in this repository.
856
857         void *appdata;                  /* read/write */
858         $repo->{appdata}
859         repo.appdata
860         repo.appdata
861
862 Application specific data that may be used in any way by the code using the
863 repository.
864
865         Datapos *meta;                  /* read only */
866         $repo->{meta}
867         repo.meta
868         repo.meta
869
870 Return a Datapos object of the repodata's metadata. You can use the lookup
871 methods of the Datapos class to lookup metadata attributes, like the repository
872 timestamp.
873
874 === CONSTANTS ===
875
876 *REPO_REUSE_REPODATA*::
877 Reuse the last repository data area (``repodata'') instead of creating a
878 new one.
879
880 *REPO_NO_INTERNALIZE*::
881 Do not internalize the added repository data. This is useful if
882 you plan to add more data because internalization is a costly
883 operation.
884
885 *REPO_LOCALPOOL*::
886 Use the repodata's pool for Id storage instead of the global pool. Useful
887 if you don't want to pollute the global pool with many unneeded ids, like
888 when storing the filelist.
889
890 *REPO_USE_LOADING*::
891 Use the repodata that is currently being loaded instead of creating a new
892 one. This only makes sense if used in a load callback.
893
894 *REPO_EXTEND_SOLVABLES*::
895 Do not create new solvables for the new data, but match existing solvables
896 and add the data to them. Repository metadata is often split into multiple
897 parts, with one primary file describing all packages and other parts
898 holding information that is normally not needed, like the changelog.
899
900 *REPO_USE_ROOTDIR*::
901 Prepend the pool's rootdir to the path when doing file operations.
902
903 *REPO_NO_LOCATION*::
904 Do not add a location element to the solvables. Useful if the solvables
905 are not in the final position, so you can add the correct location later
906 in your code.
907
908 *SOLV_ADD_NO_STUBS*::
909 Do not create stubs for repository parts that can be downloaded on demand.
910
911 *SUSETAGS_RECORD_SHARES*::
912 This is specific to the add_susetags() method. Susetags allows one to refer to
913 already read packages to save disk space. If this data sharing needs to
914 work over multiple calls to add_susetags, you need to specify this flag so
915 that the share information is made available to subsequent calls.
916
917 === METHODS ===
918
919         void free(bool reuseids = 0)
920         $repo->free();
921         repo.free()
922         repo.free()
923
924 Free the repository and all solvables it contains. If _reuseids_ is set to
925 true, the solvable ids and the repository id may be reused by the library when
926 added new solvables. Thus you should leave it false if you are not sure that
927 somebody holds a reference.
928
929         void empty(bool reuseids = 0)
930         $repo->empty();
931         repo.empty()
932         repo.empty()
933
934 Free all the solvables in a repository. The repository will be empty after this
935 call. See the free() method for the meaning of _reuseids_.
936
937         bool isempty()
938         $repo->isempty()
939         repo.empty()
940         repo.empty?
941
942 Return true if there are no solvables in this repository.
943
944         void internalize()
945         $repo->internalize();
946         repo.internalize()
947         repo.internalize()
948
949 Internalize added data. Data must be internalized before it is available to the
950 lookup and data iterator functions.
951
952         bool write(FILE *fp)
953         $repo->write($fp)
954         repo.write(fp)
955         repo.write(fp)
956
957 Write a repo as a ``solv'' file. These files can be read very fast and thus are
958 a good way to cache repository data. Returns false if there was some error
959 writing the file.
960
961         Solvableiterator solvables_iter()
962         for my $solvable (@{$repo->solvables_iter()})
963         for solvable in repo.solvables_iter():
964         for solvable in repo.solvables_iter()
965
966 Iterate over all solvables in a repository.
967
968         Repodata add_repodata(int flags = 0)
969         my $repodata = $repo->add_repodata();
970         repodata = repo.add_repodata()
971         repodata = repo.add_repodata()
972
973 Add a new repodata area to the repository. This is normally automatically
974 done by the repo_add methods, so you need this method only in very
975 rare circumstances.
976
977         void create_stubs()
978         $repo->create_stubs();
979         repo.create_stubs()
980         repo.create_stubs()
981
982 Calls the create_stubs() repodata method for the last repodata of the
983 repository.
984
985         bool iscontiguous()
986         $repo->iscontiguous()
987         repo.iscontiguous()
988         repo.iscontiguous?
989
990 Return true if the solvables of this repository are all in a single block with
991 no holes, i.e. they have consecutive ids.
992
993         Repodata first_repodata()
994         my $repodata = $repo->first_repodata();
995         repodata = repo.first_repodata()
996         repodata = repo.first_repodata()
997
998 Checks if all repodatas but the first repodata are extensions, and return the
999 first repodata if this is the case. Useful if you want to do a store/retrieve
1000 sequence on the repository to reduce the memory using and enable paging, as
1001 this does not work if the repository contains multiple non-extension repodata
1002 areas.
1003
1004         Selection Selection(int setflags = 0)
1005         my $sel = $repo->Selection();
1006         sel = repo.Selection()
1007         sel = repo.Selection()
1008
1009 Create a Selection consisting of all packages in the repository.
1010
1011         Dataiterator Dataiterator(Id key, const char *match = 0, int flags = 0)
1012         my $di = $repo->Dataiterator($keyname, $match, $flags);
1013         di = repo.Dataiterator(keyname, match, flags)
1014         di = repo.Dataiterator(keyname, match, flags)
1015
1016         Dataiterator Dataiterator_meta(Id key, const char *match = 0, int flags = 0)
1017         my $di = $repo->Dataiterator_meta($keyname, $match, $flags);
1018         di = repo.Dataiterator_meta(keyname, match, flags)
1019         di = repo.Dataiterator_meta(keyname, match, flags)
1020
1021         for my $d (@$di)
1022         for d in di:
1023         for d in di
1024
1025 Iterate over the matching data elements in this repository. See the
1026 Dataiterator class for more information. The Dataiterator() method
1027 iterates over all solvables in a repository, whereas the Dataiterator_meta
1028 method only iterates over the repository's meta data.
1029
1030         <stringification>
1031         my $str = $repo->str;
1032         str = str(repo)
1033         str = repo.to_s
1034
1035 Return the name of the repository, or "Repo#<id>" if no name is set.
1036
1037         <equality>
1038         if ($repo1 == $repo2)
1039         if repo1 == repo2:
1040         if repo1 == repo2
1041
1042 Two repositories are equal if they belong to the same pool and have the same id.
1043
1044 === DATA ADD METHODS ===
1045
1046         Solvable add_solvable()
1047         $repo->add_solvable();
1048         repo.add_solvable()
1049         repo.add_solvable()
1050
1051 Add a single empty solvable to the repository. Returns a Solvable object, see
1052 the Solvable class for more information.
1053
1054         bool add_solv(const char *name, int flags = 0)
1055         $repo->add_solv($name);
1056         repo.add_solv(name)
1057         repo.add_solv(name)
1058
1059         bool add_solv(FILE *fp, int flags = 0)
1060         $repo->add_solv($fp);
1061         repo.add_solv(fp)
1062         repo.add_solv(fp)
1063
1064 Read a ``solv'' file and add its contents to the repository. These files can be
1065 written with the write() method and are normally used as fast cache for
1066 repository metadata.
1067
1068         bool add_rpmdb(int flags = 0)
1069         $repo->add_rpmdb();
1070         repo.add_rpmdb()
1071         repo.add_rpmdb()
1072
1073         bool add_rpmdb_reffp(FILE *reffp, int flags = 0)
1074         $repo->add_rpmdb_reffp($reffp);
1075         repo.add_rpmdb_reffp(reffp)
1076         repo.add_rpmdb_reffp(reffp)
1077
1078 Add the contents of the rpm database to the repository. If a solv file
1079 containing an old version of the database is available, it can be passed as
1080 reffp to speed up reading.
1081
1082         Solvable add_rpm(const char *filename, int flags = 0)
1083         my $solvable = $repo->add_rpm($filename);
1084         solvable = repo.add_rpm(filename)
1085         solvable = repo.add_rpm(filename)
1086
1087 Add the metadata of a single rpm package to the repository.
1088
1089         bool add_rpmdb_pubkeys(int flags = 0)
1090         $repo->add_rpmdb_pubkeys();
1091         repo.add_rpmdb_pubkeys()
1092         repo.add_rpmdb_pubkeys()
1093
1094 Add all pubkeys contained in the rpm database to the repository. Note that
1095 newer rpm versions also allow to store the pubkeys in some directory instead
1096 of the rpm database.
1097
1098         Solvable add_pubkey(const char *keyfile, int flags = 0)
1099         my $solvable = $repo->add_pubkey($keyfile);
1100         solvable = repo.add_pubkey(keyfile)
1101         solvable = repo.add_pubkey(keyfile)
1102
1103 Add a pubkey from a file to the repository.
1104
1105         bool add_rpmmd(FILE *fp, const char *language, int flags = 0)
1106         $repo->add_rpmmd($fp, undef);
1107         repo.add_rpmmd(fp, None)
1108         repo.add_rpmmd(fp, nil)
1109
1110 Add metadata stored in the "rpm-md" format (i.e. from files in the ``repodata''
1111 directory) to a repository. Supported files are "primary", "filelists",
1112 "other", "suseinfo". Do not forget to specify the *REPO_EXTEND_SOLVABLES* for
1113 extension files like "filelists" and "other". Use the _language_ parameter if
1114 you have language extension files, otherwise simply use a *undef*/*None*/*nil*
1115 parameter.
1116
1117         bool add_repomdxml(FILE *fp, int flags = 0)
1118         $repo->add_repomdxml($fp);
1119         repo.add_repomdxml(fp)
1120         repo.add_repomdxml(fp)
1121
1122 Add the repomd.xml meta description from the "rpm-md" format to the repository.
1123 This file contains information about the repository like keywords, and also a
1124 list of all database files with checksums. The data is added to the "meta"
1125 section of the repository, i.e. no package gets created.
1126
1127         bool add_updateinfoxml(FILE *fp, int flags = 0)
1128         $repo->add_updateinfoxml($fp);
1129         repo.add_updateinfoxml(fp)
1130         repo.add_updateinfoxml(fp)
1131
1132 Add the updateinfo.xml file containing available maintenance updates to the
1133 repository. All updates are created as special packages that have a "patch:"
1134 prefix in their name.
1135
1136         bool add_deltainfoxml(FILE *fp, int flags = 0)
1137         $repo->add_deltainfoxml($fp);
1138         repo.add_deltainfoxml(fp)
1139         repo.add_deltainfoxml(fp)
1140
1141 Add the deltainfo.xml file (also called prestodelta.xml) containing available
1142 delta-rpms to the repository. The data is added to the "meta" section, i.e. no
1143 package gets created.
1144
1145         bool add_debdb(int flags = 0)
1146         $repo->add_debdb();
1147         repo.add_debdb()
1148         repo.add_debdb()
1149
1150 Add the contents of the debian installed package database to the repository.
1151
1152         bool add_debpackages(FILE *fp, int flags = 0)
1153         $repo->add_debpackages($fp);
1154         repo.add_debpackages($fp)
1155         repo.add_debpackages($fp)
1156
1157 Add the contents of the debian repository metadata (the "packages" file)
1158 to the repository.
1159
1160         Solvable add_deb(const char *filename, int flags = 0)
1161         my $solvable = $repo->add_deb($filename);
1162         solvable = repo.add_deb(filename)
1163         solvable = repo.add_deb(filename)
1164
1165 Add the metadata of a single deb package to the repository.
1166
1167         bool add_mdk(FILE *fp, int flags = 0)
1168         $repo->add_mdk($fp);
1169         repo.add_mdk(fp)
1170         repo.add_mdk(fp)
1171
1172 Add the contents of the mageia/mandriva repository metadata (the
1173 "synthesis.hdlist" file) to the repository.
1174
1175         bool add_mdk_info(FILE *fp, int flags = 0)
1176         $repo->add_mdk_info($fp);
1177         repo.add_mdk_info(fp)
1178         repo.add_mdk_info(fp)
1179
1180 Extend the packages from the synthesis file with the info.xml and files.xml
1181 data. Do not forget to specify *REPO_EXTEND_SOLVABLES*.
1182
1183         bool add_arch_repo(FILE *fp, int flags = 0)
1184         $repo->add_arch_repo($fp);
1185         repo.add_arch_repo(fp)
1186         repo.add_arch_repo(fp)
1187
1188 Add the contents of the archlinux repository metadata (the ".db.tar" file) to
1189 the repository.
1190
1191         bool add_arch_local(const char *dir, int flags = 0)
1192         $repo->add_arch_local($dir);
1193         repo.add_arch_local(dir)
1194         repo.add_arch_local(dir)
1195
1196 Add the contents of the archlinux installed package database to the repository.
1197 The _dir_ parameter is usually set to "/var/lib/pacman/local".
1198
1199         bool add_content(FILE *fp, int flags = 0)
1200         $repo->add_content($fp);
1201         repo.add_content(fp)
1202         repo.add_content(fp)
1203
1204 Add the ``content'' meta description from the susetags format to the repository.
1205 This file contains information about the repository like keywords, and also
1206 a list of all database files with checksums. The data is added to the "meta"
1207 section of the repository, i.e. no package gets created.
1208
1209         bool add_susetags(FILE *fp, Id defvendor, const char *language, int flags = 0)
1210         $repo->add_susetags($fp, $defvendor, $language);
1211         repo.add_susetags(fp, defvendor, language)
1212         repo.add_susetags(fp, defvendor, language)
1213
1214 Add repository metadata in the susetags format to the repository. Like with
1215 add_rpmmd, you can specify a language if you have language extension files. The
1216 _defvendor_ parameter provides a default vendor for packages with missing
1217 vendors, it is usually provided in the content file.
1218
1219         bool add_products(const char *dir, int flags = 0)
1220         $repo->add_products($dir);
1221         repo.add_products(dir)
1222         repo.add_products(dir)
1223
1224 Add the installed SUSE products database to the repository. The _dir_ parameter
1225 is usually "/etc/products.d".
1226
1227
1228 The Solvable Class
1229 ------------------
1230 A solvable describes all the information of one package. Each solvable
1231 belongs to one repository, it can be added and filled manually but in
1232 most cases solvables will get created by the repo_add methods.
1233
1234 === ATTRIBUTES ===
1235
1236         Repo *repo;                     /* read only */
1237         $solvable->{repo}
1238         solvable.repo
1239         solvable.repo
1240
1241 The repository this solvable belongs to.
1242
1243         Pool *pool;                     /* read only */
1244         $solvable->{pool}
1245         solvable.pool
1246         solvable.pool
1247
1248 The pool this solvable belongs to, same as the pool of the repo.
1249
1250         Id id;                          /* read only */
1251         $solvable->{id}
1252         solvable.id
1253         solvable.id
1254
1255 The specific id of the solvable.
1256
1257         char *name;                     /* read/write */
1258         $solvable->{name}
1259         solvable.name
1260         solvable.name
1261
1262         char *evr;                      /* read/write */
1263         $solvable->{evr}
1264         solvable.evr
1265         solvable.evr
1266
1267         char *arch;                     /* read/write */
1268         $solvable->{arch}
1269         solvable.arch
1270         solvable.arch
1271
1272         char *vendor;                   /* read/write */
1273         $solvable->{vendor}
1274         solvable.vendor
1275         solvable.vendor
1276
1277 Easy access to often used attributes of solvables. They are
1278 internally stored as Ids.
1279
1280         Id nameid;                      /* read/write */
1281         $solvable->{nameid}
1282         solvable.nameid
1283         solvable.nameid
1284
1285         Id evrid;                       /* read/write */
1286         $solvable->{evrid}
1287         solvable.evrid
1288         solvable.evrid
1289
1290         Id archid;                      /* read/write */
1291         $solvable->{archid}
1292         solvable.archid
1293         solvable.archid
1294
1295         Id vendorid;                    /* read/write */
1296         $solvable->{vendorid}
1297         solvable.vendorid
1298         solvable.vendorid
1299
1300 Raw interface to the ids. Useful if you want to search for
1301 a specific id and want to avoid the string compare overhead.
1302
1303 === METHODS ===
1304
1305         const char *lookup_str(Id keyname)
1306         my $string = $solvable->lookup_str($keyname);
1307         string = solvable.lookup_str(keyname)
1308         string = solvable.lookup_str(keyname)
1309
1310         Id lookup_id(Id keyname)
1311         my $id = $solvable->lookup_id($keyname);
1312         id = solvable.lookup_id(solvid)
1313         id = solvable.lookup_id(solvid)
1314
1315         unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
1316         my $num = $solvable->lookup_num($keyname);
1317         num = solvable.lookup_num(keyname)
1318         num = solvable.lookup_num(keyname)
1319
1320         bool lookup_void(Id keyname)
1321         my $bool = $solvable->lookup_void($keyname);
1322         bool = solvable.lookup_void(keyname)
1323         bool = solvable.lookup_void(keyname)
1324
1325         Chksum lookup_checksum(Id keyname)
1326         my $chksum = $solvable->lookup_checksum($keyname);
1327         chksum = solvable.lookup_checksum(keyname)
1328         chksum = solvable.lookup_checksum(keyname)
1329
1330         Id *lookup_idarray(Id keyname, Id marker = -1)
1331         my @ids = $solvable->lookup_idarray($keyname);
1332         ids = solvable.lookup_idarray(keyname)
1333         ids = solvable.lookup_idarray(keyname)
1334
1335         Dep *lookup_deparray(Id keyname, Id marker = -1)
1336         my @deps = $solvable->lookup_deparray($keyname);
1337         deps = solvable.lookup_deparray(keyname)
1338         deps = solvable.lookup_deparray(keyname)
1339         
1340 Generic lookup methods. Retrieve data stored for the specific keyname.
1341 The lookup_idarray() method will return an array of Ids, use
1342 lookup_deparray if you want an array of Dependency objects instead.
1343 Some Id arrays contain two parts of data divided by a specific marker,
1344 for example the provides array uses the SOLVABLE_FILEMARKER id to
1345 store both the ids provided by the package and the ids added by
1346 the addfileprovides method. The default, -1, translates to the
1347 correct marker for the keyname and returns the first part of the
1348 array, use 1 to select the second part or 0 to retrieve all ids
1349 including the marker.
1350
1351         const char *lookup_location(unsigned int *OUTPUT);
1352         my ($location, $medianr) = $solvable->lookup_location();
1353         location, medianr = solvable.lookup_location()
1354         location, medianr = solvable.lookup_location()
1355
1356 Return a tuple containing the on-media location and an optional
1357 media number for multi-part repositories (e.g. repositories
1358 spawning multiple DVDs).
1359
1360         const char *lookup_sourcepkg();
1361         my $sourcepkg = $solvable->lookup_sourcepkg();
1362         sourcepkg = solvable.lookup_sourcepkg()
1363         sourcepkg = solvable.lookup_sourcepkg()
1364
1365 Return a sourcepkg name associated with solvable.
1366
1367         Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
1368         my $di = $solvable->Dataiterator($keyname, $match, $flags);
1369         di = solvable.Dataiterator(keyname, match, flags)
1370         di = solvable.Dataiterator(keyname, match, flags)
1371
1372         for my $d (@$di)
1373         for d in di:
1374         for d in di
1375
1376 Iterate over the matching data elements. See the Dataiterator class for more
1377 information.
1378
1379         void add_deparray(Id keyname, DepId dep, Id marker = -1);
1380         $solvable->add_deparray($keyname, $dep);
1381         solvable.add_deparray(keyname, dep)
1382         solvable.add_deparray(keyname, dep)
1383
1384 Add a new dependency to the attributes stored in keyname.
1385
1386         void unset(Id keyname);
1387         $solvable->unset($keyname);
1388         solvable.unset(keyname)
1389         solvable.unset(keyname)
1390
1391 Delete data stored for the specific keyname.
1392
1393         bool installable();
1394         $solvable->installable()
1395         solvable.installable()
1396         solvable.installable?
1397
1398 Return true if the solvable is installable on the system. Solvables
1399 are not installable if the system does not support their architecture.
1400
1401         bool isinstalled();
1402         $solvable->isinstalled()
1403         solvable.isinstalled()
1404         solvable.isinstalled?
1405
1406 Return true if the solvable is installed on the system.
1407
1408         bool identical(Solvable *other)
1409         $solvable->identical($other)
1410         solvable.identical(other)
1411         solvable.identical?(other)
1412
1413 Return true if the two solvables are identical.
1414
1415         int evrcmp(Solvable *other)
1416         $solvable->evrcmp($other)
1417         solvable.evrcmp(other)
1418         solvable.evrcmp(other)
1419
1420 Returns -1 if the epoch/version/release of the solvable is less than the
1421 one from the other solvable, 1 if it is greater, and 0 if they are equal.
1422 Note that "equal" does not mean that the evr is identical.
1423
1424         int matchesdep(Id keyname, DepId id, Id marker = -1)
1425         $solvable->matchesdep($keyname, $dep)
1426         solvable.matchesdep(keyname, dep)
1427         solvable.matchesdep?(keyname, dep)
1428
1429 Return true if the dependencies stored in keyname match the specified dependency.
1430
1431         Selection Selection(int setflags = 0)
1432         my $sel = $solvable->Selection();
1433         sel = solvable.Selection()
1434         sel = solvable.Selection()
1435
1436 Create a Selection containing just the single solvable.
1437
1438         const char *str()
1439         my $str = $solvable->str();
1440         str = $solvable.str()
1441         str = $solvable.str()
1442
1443 Return a string describing the solvable. The string consists of the name,
1444 version, and architecture of the Solvable.
1445
1446         <stringification>
1447         my $str = $solvable->str;
1448         str = str(solvable)
1449         str = solvable.to_s
1450
1451 Same as calling the str() method.
1452
1453         <equality>
1454         if ($solvable1 == $solvable2)
1455         if solvable1 == solvable2:
1456         if solvable1 == solvable2
1457
1458 Two solvables are equal if they are part of the same pool and have the same
1459 ids.
1460
1461
1462 The Dataiterator Class
1463 ----------------------
1464 Dataiterators can be used to do complex string searches or
1465 to iterate over arrays. They can be created via the
1466 constructors in the Pool, Repo, and Solvable classes. The
1467 Repo and Solvable constructors will limit the search to
1468 the repository or the specific package.
1469
1470 === CONSTANTS ===
1471
1472 *SEARCH_STRING*::
1473 Return a match if the search string matches the value.
1474
1475 *SEARCH_STRINGSTART*::
1476 Return a match if the value starts with the search string.
1477
1478 *SEARCH_STRINGEND*::
1479 Return a match if the value ends with the search string.
1480
1481 *SEARCH_SUBSTRING*::
1482 Return a match if the search string can be matched somewhere in the value.
1483
1484 *SEARCH_GLOB*::
1485 Do a glob match of the search string against the value.
1486
1487 *SEARCH_REGEX*::
1488 Do a regular expression match of the search string against the value.
1489
1490 *SEARCH_NOCASE*::
1491 Ignore case when matching strings. Works for all the above match types.
1492
1493 *SEARCH_FILES*::
1494 Match the complete filenames of the file list, not just the base name.
1495
1496 *SEARCH_COMPLETE_FILELIST*::
1497 When matching the file list, check every file of the package not just the
1498 subset from the primary metadata.
1499
1500 *SEARCH_CHECKSUMS*::
1501 Allow the matching of checksum entries.
1502
1503 === METHODS ===
1504
1505         void prepend_keyname(Id keyname);
1506         $di->prepend_keyname($keyname);
1507         di.prepend_keyname(keyname)
1508         di.prepend_keyname(keyname)
1509
1510 Do a sub-search in the array stored in keyname.
1511
1512         void skip_solvable();
1513         $di->kip_solvable();
1514         di.skip_solvable()
1515         di.skip_solvable()
1516
1517 Stop matching the current solvable and advance to the next
1518 one.
1519
1520         <iteration>
1521         for my $d (@$di)
1522         for d in di:
1523         for d in di
1524
1525 Iterate through the matches. If there is a match, the object
1526 in d will be of type Datamatch.
1527
1528 The Datamatch Class
1529 -------------------
1530 Objects of this type will be created for every value matched
1531 by a dataiterator.
1532
1533 === ATTRIBUTES ===
1534
1535         Pool *pool;                             /* read only */
1536         $d->{pool}
1537         d.pool
1538         d.pool
1539
1540 Back pointer to pool.
1541
1542         Repo *repo;                             /* read only */
1543         $d->{repo}
1544         d.repo
1545         d.repo
1546
1547 The repository containing the matched object.
1548
1549         Solvable *solvable;                     /* read only */
1550         $d->{solvable}
1551         d.solvable
1552         d.solvable
1553
1554 The solvable containing the value that was matched.
1555
1556         Id solvid;                              /* read only */
1557         $d->{solvid}
1558         d.solvid
1559         d.solvid
1560
1561 The id of the solvable that matched.
1562
1563         Id key_id;
1564         $d->{key_id}
1565         d.key_id
1566         d.key_id
1567
1568         const char *key_idstr;
1569         $d->{key_idstr}
1570         d.key_idstr
1571         d.key_idstr
1572
1573 The keyname that matched, either as id or string.
1574
1575         Id type_id;
1576         $d->{type_id}
1577         d.type_id
1578         d.type_id
1579
1580         const char *type_idstr;
1581         $d->{type_idstr};
1582         d.type_idstr
1583         d.type_idstr
1584
1585 The key type of the value that was matched, either as id or string.
1586
1587         Id id;
1588         $d->{id}
1589         d.id
1590         d.id
1591
1592         Id idstr;
1593         $d->{idstr}
1594         d.idstr
1595         d.idstr
1596
1597 The Id of the value that was matched (only valid for id types),
1598 either as id or string.
1599
1600         const char *str;
1601         $d->{str}
1602         d.str
1603         d.str
1604
1605 The string value that was matched (only valid for string types).
1606
1607         unsigned long long num;
1608         $d->{num}
1609         d.num
1610         d.num
1611
1612 The numeric value that was matched (only valid for numeric types).
1613
1614         unsigned int num2;
1615         $d->{num2}
1616         d.num2
1617         d.num2
1618
1619 The secondary numeric value that was matched (only valid for types
1620 containing two values).
1621
1622         unsigned int binary;
1623         $d->{binary}
1624         d.binary
1625         d.binary
1626
1627 The value in binary form, useful for checksums and other data
1628 that cannot be represented as a string.
1629
1630 === METHODS ===
1631
1632         Datapos pos();
1633         my $pos = $d->pos();
1634         pos = d.pos()
1635         pos = d.pos()
1636
1637 The position object of the current match. It can be used to do
1638 sub-searches starting at the match (if it is of an array type).
1639 See the Datapos class for more information.
1640
1641         Datapos parentpos();
1642         my $pos = $d->parentpos();
1643         pos = d.parentpos()
1644         pos = d.parentpos()
1645
1646 The position object of the array containing the current match.
1647 It can be used to do sub-searches, see the Datapos class for more
1648 information.
1649
1650         <stringification>
1651         my $str = $d->str;
1652         str = str(d)
1653         str = d.to_s
1654
1655 Return the stringification of the matched value. Stringification
1656 depends on the search flags, for file list entries it will return
1657 just the base name unless SEARCH_FILES is used, for checksums
1658 it will return an empty string unless SEARCH_CHECKSUMS is used.
1659 Numeric values are currently stringified to an empty string.
1660
1661
1662 The Selection Class
1663 -------------------
1664 Selections are a way to easily deal with sets of packages.
1665 There are multiple constructors to create them, the most useful
1666 is probably the select() method in the Pool class.
1667
1668 === CONSTANTS ===
1669
1670 *SELECTION_NAME*::
1671 Create the selection by matching package names.
1672
1673 *SELECTION_PROVIDES*::
1674 Create the selection by matching package provides.
1675
1676 *SELECTION_FILELIST*::
1677 Create the selection by matching package files.
1678
1679 *SELECTION_CANON*::
1680 Create the selection by matching the canonical representation
1681 of the package. This is normally a combination of the name,
1682 the version, and the architecture of a package.
1683
1684 *SELECTION_DOTARCH*::
1685 Allow an ``.<architecture>'' suffix when matching names or
1686 provides.
1687  
1688 *SELECTION_REL*::
1689 Allow the specification of a relation when matching names
1690 or provides, e.g. "name >= 1.2".
1691
1692 *SELECTION_INSTALLED_ONLY*::
1693 Limit the package search to installed packages.
1694
1695 *SELECTION_SOURCE_ONLY*::
1696 Limit the package search to source packages only.
1697
1698 *SELECTION_WITH_SOURCE*::
1699 Extend the package search to also match source packages. The default is
1700 only to match binary packages.
1701
1702 *SELECTION_GLOB*::
1703 Allow glob matching for package names, package provides, and file names.
1704
1705 *SELECTION_NOCASE*::
1706 Ignore case when matching package names, package provides, and file names.
1707
1708 *SELECTION_FLAT*::
1709 Return only one selection element describing the selected packages.
1710 The default is to create multiple elements for all globbed packages.
1711 Multiple elements are useful if you want to turn the selection into
1712 an install job, in that case you want an install job for every
1713 globbed package.
1714
1715 === ATTRIBUTES ===
1716
1717         Pool *pool;                             /* read only */
1718         $d->{pool}
1719         d.pool
1720         d.pool
1721
1722 Back pointer to pool.
1723
1724 === METHODS ===
1725
1726         int flags();
1727         my $flags = $sel->flags();
1728         flags = sel.flags()
1729         flags = sel.flags()
1730
1731 Return the result flags of the selection. The flags are a subset
1732 of the ones used when creating the selection, they describe which
1733 method was used to get the result. For example, if you create the
1734 selection with ``SELECTION_NAME | SELECTION_PROVIDES'', the resulting
1735 flags will either be SELECTION_NAME or SELECTION_PROVIDES depending
1736 if there was a package that matched the name or not. If there was
1737 no match at all, the flags will be zero.
1738
1739         bool isempty();
1740         $sel->isempty()
1741         sel.isempty()
1742         sel.isempty?
1743
1744 Return true if the selection is empty, i.e. no package could be matched.
1745
1746         void filter(Selection *other)
1747         $sel->filter($other);
1748         sel.filter(other)
1749         sel.filter(other)
1750
1751 Intersect two selections. Packages will only stay in the selection if there
1752 are also included in the other selecting. Does an in-place modification.
1753
1754         void add(Selection *other)
1755         $sel->add($other);
1756         sel.add(other)
1757         sel.add(other)
1758
1759 Build the union of two selections. All packages of the other selection will
1760 be added to the set of packages of the selection object. Does an in-place
1761 modification. Note that the selection flags are no longer meaningful after the
1762 add operation.
1763
1764         void add_raw(Id how, Id what)
1765         $sel->add_raw($how, $what);
1766         sel.add_raw(how, what)
1767         sel.add_raw(how, what)
1768
1769 Add a raw element to the selection. Check the Job class for information about
1770 the how and what parameters.
1771
1772         Job *jobs(int action)
1773         my @jobs = $sel->jobs($action);
1774         jobs = sel.jobs(action)
1775         jobs = sel.jobs(action)
1776
1777 Convert a selection into an array of Job objects. The action parameter is or-ed
1778 to the ``how'' part of the job, it describes the type of job (e.g. install,
1779 erase). See the Job class for the action and action modifier constants.
1780
1781         Solvable *solvables()
1782         my @solvables = $sel->solvables();
1783         solvables = sel.solvables()
1784         solvables = sel.solvables()
1785
1786 Convert a selection into an array of Solvable objects.
1787
1788         <stringification>
1789         my $str = $sel->str;
1790         str = str(sel)
1791         str = sel.to_s
1792
1793 Return a string describing the selection.
1794
1795 The Job Class
1796 -------------
1797 Jobs are the way to specify to the dependency solver what to do.
1798 Most of the times jobs will get created by calling the jobs() method
1799 on a Selection object, but there is also a Job() constructor in the
1800 Pool class.
1801
1802 === CONSTANTS ===
1803
1804 Selection constants:
1805
1806 *SOLVER_SOLVABLE*::
1807 The ``what'' part is the id of a solvable.
1808
1809 *SOLVER_SOLVABLE_NAME*::
1810 The ``what'' part is the id of a package name.
1811
1812 *SOLVER_SOLVABLE_PROVIDES*::
1813 The ``what'' part is the id of a package provides.
1814
1815 *SOLVER_SOLVABLE_ONE_OF*::
1816 The ``what'' part is an offset into the ``whatprovides'' data, created
1817 by calling the towhatprovides() pool method.
1818
1819 *SOLVER_SOLVABLE_REPO*::
1820 The ``what'' part is the id of a repository.
1821
1822 *SOLVER_SOLVABLE_ALL*::
1823 The ``what'' part is ignored, all packages are selected.
1824
1825 *SOLVER_SOLVABLE_SELECTMASK*::
1826 A mask containing all the above selection bits.
1827
1828 Action constants:
1829
1830 *SOLVER_NOOP*::
1831 Do nothing.
1832
1833 *SOLVER_INSTALL*::
1834 Install a package of the specified set of packages. It tries to install
1835 the best matching package (i.e. the highest version of the packages from
1836 the repositories with the highest priority).
1837
1838 *SOLVER_ERASE*::
1839 Erase all of the packages from the specified set. If a package is not
1840 installed, erasing it will keep it from getting installed.
1841
1842 *SOLVER_UPDATE*::
1843 Update the matching installed packages to their best version. If none
1844 of the specified packages are installed, try to update the installed
1845 packages to the specified versions. See the section about targeted
1846 updates about more information.
1847  
1848 *SOLVER_WEAKENDEPS*::
1849 Allow to break the dependencies of the matching packages. Handle with care.
1850
1851 *SOLVER_MULTIVERSION*::
1852 Mark the matched packages for multiversion install. If they get to be
1853 installed because of some other job, the installation will keep the old
1854 version of the package installed (for rpm this is done by using ``-i''
1855 instead of ``-U'').
1856
1857 *SOLVER_LOCK*::
1858 Do not change the state of the matched packages, i.e. when they are
1859 installed they stay installed, if not they are not selected for
1860 installation.
1861
1862 *SOLVER_DISTUPGRADE*::
1863 Update the matching installed packages to the best version included in one
1864 of the repositories. After this operation, all come from one of the available
1865 repositories except orphaned packages. Orphaned packages are packages that
1866 have no relation to the packages in the repositories, i.e. no package in the
1867 repositories have the same name or obsolete the orphaned package.
1868 This action brings the installed packages in sync with the ones in the
1869 repository. By default it also turns of arch/vendor/version locking for the
1870 affected packages to simulate a fresh installation. This means that distupgrade can
1871 actually downgrade packages if only lower versions of a package are available
1872 in the repositories. You can tweak this behavior with the SOLVER_FLAG_DUP_
1873 solver flags.
1874
1875 *SOLVER_DROP_ORPHANED*::
1876 Erase all the matching installed packages if they are orphaned. This only makes
1877 sense if there is a ``distupgrade all packages'' job. The default is to erase
1878 orphaned packages only if they block the installation of other packages.
1879
1880 *SOLVER_VERIFY*::
1881 Fix dependency problems of matching installed packages. The default is to ignore
1882 dependency problems for installed packages.
1883
1884 *SOLVER_USERINSTALLED*::
1885 The matching installed packages are considered to be installed by a user,
1886 thus not installed to fulfill some dependency. This is needed input for
1887 the calculation of unneeded packages for jobs that have the
1888 SOLVER_CLEANDEPS flag set.
1889
1890 *SOLVER_ALLOWUNINSTALL*::
1891 Allow the solver to deinstall the matching installed packages if they get
1892 into the way of resolving a dependency. This is like the
1893 SOLVER_FLAG_ALLOW_UNINSTALL flag, but limited to a specific set of packages.
1894
1895 *SOLVER_FAVOR*::
1896 Prefer the specified packages if the solver encounters an alternative. If
1897 a job contains multiple matching favor/disfavor elements, the last one takes
1898 precedence.
1899
1900 *SOLVER_DISFAVOR*::
1901 Avoid the specified packages if the solver encounters an alternative. This
1902 can also be used to block recommended or supplemented packages from being
1903 installed.
1904
1905 *SOLVER_JOBMASK*::
1906 A mask containing all the above action bits.
1907
1908 Action modifier constants:
1909
1910 *SOLVER_WEAK*::
1911 Makes the job a weak job. The solver tries to fulfill weak jobs, but does
1912 not report a problem if it is not possible to do so.
1913
1914 *SOLVER_ESSENTIAL*::
1915 Makes the job an essential job. If there is a problem with the job, the
1916 solver will not propose to remove the job as one solution (unless all
1917 other solutions are also to remove essential jobs).
1918
1919 *SOLVER_CLEANDEPS*::
1920 The solver will try to also erase all packages dragged in through
1921 dependencies when erasing the package. This needs SOLVER_USERINSTALLED
1922 jobs to maximize user satisfaction.
1923
1924 *SOLVER_FORCEBEST*::
1925 Insist on the best package for install, update, and distupgrade jobs. If
1926 this flag is not used, the solver will use the second-best package if the
1927 best package cannot be installed for some reason. When this flag is used,
1928 the solver will generate a problem instead.
1929
1930 *SOLVER_TARGETED*::
1931 Forces targeted operation update and distupgrade jobs. See the section
1932 about targeted updates about more information.
1933
1934 Set constants.
1935
1936 *SOLVER_SETEV*::
1937 The job specified the exact epoch and version of the package set.
1938
1939 *SOLVER_SETEVR*::
1940 The job specified the exact epoch, version, and release of the package set.
1941
1942 *SOLVER_SETARCH*::
1943 The job specified the exact architecture of the packages from the set.
1944
1945 *SOLVER_SETVENDOR*::
1946 The job specified the exact vendor of the packages from the set.
1947
1948 *SOLVER_SETREPO*::
1949 The job specified the exact repository of the packages from the set.
1950
1951 *SOLVER_SETNAME*::
1952 The job specified the exact name of the packages from the set.
1953
1954 *SOLVER_NOAUTOSET*::
1955 Turn of automatic set flag generation for SOLVER_SOLVABLE jobs.
1956
1957 *SOLVER_SETMASK*::
1958 A mask containing all the above set bits.
1959
1960 See the section about set bits for more information.
1961
1962 === ATTRIBUTES ===
1963
1964         Pool *pool;                             /* read only */
1965         $job->{pool}
1966         d.pool
1967         d.pool
1968
1969 Back pointer to pool.
1970
1971         Id how;                                 /* read/write */
1972         $job->{how}
1973         d.how
1974         d.how
1975
1976 Union of the selection, action, action modifier, and set flags.
1977 The selection part describes the semantics of the ``what'' Id.
1978
1979         Id what;                                /* read/write */
1980         $job->{what}
1981         d.what
1982         d.what
1983
1984 Id describing the set of packages, the meaning depends on the
1985 selection part of the ``how'' attribute.
1986
1987 === METHODS ===
1988
1989         Solvable *solvables()
1990         my @solvables = $job->solvables();
1991         solvables = job.solvables()
1992         solvables = job.solvables()
1993
1994 Return the set of solvables of the job as an array of Solvable
1995 objects.
1996
1997         bool isemptyupdate();
1998         $job->isemptyupdate()
1999         job.isemptyupdate()
2000         job.isemptyupdate?
2001
2002 Convenience function to find out if the job describes an update
2003 job with no matching packages, i.e. a job that does nothing.
2004 Some package managers like ``zypper'' like to turn those jobs
2005 into install jobs, i.e. an update of a not-installed package
2006 will result into the installation of the package.
2007
2008         <stringification>
2009         my $str = $job->str;
2010         str = str(job)
2011         str = job.to_s
2012
2013 Return a string describing the job.
2014
2015         <equality>
2016         if ($job1 == $job2)
2017         if job1 == job2:
2018         if job1 == job2
2019
2020 Two jobs are equal if they belong to the same pool and both the
2021 ``how'' and the ``what'' attributes are the same.
2022
2023 === TARGETED UPDATES ===
2024 Libsolv has two modes for upgrades and distupgrade: targeted and
2025 untargeted. Untargeted mode means that the installed packages from
2026 the specified set will be updated to the best version. Targeted means
2027 that packages that can be updated to a package in the specified set
2028 will be updated to the best package of the set.
2029
2030 Here's an example to explain the subtle difference. Suppose that
2031 you have package A installed in version "1.1", "A-1.2" is available
2032 in one of the repositories and there is also package "B" that
2033 obsoletes package A.
2034
2035 An untargeted update of "A" will update the installed "A-1.1" to
2036 package "B", because that is the newest version (B obsoletes A and
2037 is thus newer).
2038
2039 A targeted update of "A" will update "A-1.1" to "A-1.2", as the
2040 set of packages contains both "A-1.1" and "A-1.2", and "A-1.2" is
2041 the newer one.
2042
2043 An untargeted update of "B" will do nothing, as "B" is not installed.
2044
2045 An targeted update of "B" will update "A-1.1" to "B".
2046
2047 Note that the default is to do "auto-targeting", thus if the specified
2048 set of packages does not include an installed package, the solver
2049 will assume targeted operation even if SOLVER_TARGETED is not used.
2050
2051 This mostly matches the intent of the user, with one exception: In
2052 the example above, an update of "A-1.2" will update "A-1.1" to
2053 "A-1.2" (targeted mode), but a second update of "A-1.2" will suddenly
2054 update to "B", as untargeted mode is chosen because "A-1.2" is now
2055 installed.
2056
2057 If you want to have full control over when targeting mode is chosen,
2058 turn off auto-targeting with the SOLVER_FLAG_NO_AUTOTARGET solver option.
2059 In that case, all updates are considered to be untargeted unless they
2060 include the SOLVER_TARGETED flag.
2061
2062 === SET BITS ===
2063 Set bits specify which parts of the specified packages where specified
2064 by the user. It is used by the solver when checking if an operation is
2065 allowed or not. For example, the solver will normally not allow the
2066 downgrade of an installed package. But it will not report a problem if
2067 the SOLVER_SETEVR flag is used, as it then assumes that the user specified
2068 the exact version and thus knows what he is doing.
2069
2070 So if a package "screen-1-1" is installed for the x86_64 architecture and
2071 version "2-1" is only available for the i586 architecture, installing
2072 package "screen-2.1" will ask the user for confirmation because of the
2073 different architecture. When using the Selection class to create jobs
2074 the set bits are automatically added, e.g. selecting ``screen.i586'' will
2075 automatically add SOLVER_SETARCH, and thus no problem will be reported.
2076
2077 The Solver Class
2078 ----------------
2079 Dependency solving is what this library is about. A solver object is needed
2080 for solving to store the result of the solver run. The solver object can be
2081 used multiple times for different jobs, reusing it allows the solver to
2082 re-use the dependency rules it already computed.
2083
2084 === CONSTANTS ===
2085
2086 Flags to modify some of the solver's behavior:
2087
2088 *SOLVER_FLAG_ALLOW_DOWNGRADE*::
2089 Allow the solver to downgrade packages without asking for confirmation
2090 (i.e. reporting a problem).
2091
2092 *SOLVER_FLAG_ALLOW_ARCHCHANGE*::
2093 Allow the solver to change the architecture of an installed package
2094 without asking for confirmation. Note that changes to/from noarch
2095 are always considered to be allowed.
2096   
2097 *SOLVER_FLAG_ALLOW_VENDORCHANGE*::
2098 Allow the solver to change the vendor of an installed package
2099 without asking for confirmation. Each vendor is part of one or more
2100 vendor equivalence classes, normally installed packages may only
2101 change their vendor if the new vendor shares at least one equivalence
2102 class.
2103
2104 *SOLVER_FLAG_ALLOW_NAMECHANGE*::
2105 Allow the solver to change the name of an installed package, i.e.
2106 install a package with a different name that obsoletes the installed
2107 package. This option is on by default.
2108
2109 *SOLVER_FLAG_ALLOW_UNINSTALL*::
2110 Allow the solver to erase installed packages to fulfill the jobs.
2111 This flag also includes the above flags. You may want to set this
2112 flag if you only have SOLVER_ERASE jobs, as in that case it's
2113 better for the user to check the transaction overview instead of
2114 approving every single package that needs to be erased.
2115
2116 *SOLVER_FLAG_DUP_ALLOW_DOWNGRADE*::
2117 Like SOLVER_FLAG_ALLOW_DOWNGRADE, but used in distupgrade mode.
2118
2119 *SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE*::
2120 Like SOLVER_FLAG_ALLOW_ARCHCHANGE, but used in distupgrade mode.
2121
2122 *SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE*::
2123 Like SOLVER_FLAG_ALLOW_VENDORCHANGE, but used in distupgrade mode.
2124
2125 *SOLVER_FLAG_DUP_ALLOW_NAMECHANGE*::
2126 Like SOLVER_FLAG_ALLOW_NAMECHANGE, but used in distupgrade mode.
2127
2128 *SOLVER_FLAG_NO_UPDATEPROVIDE*::
2129 If multiple packages obsolete an installed package, the solver checks
2130 the provides of every such package and ignores all packages that
2131 do not provide the installed package name. Thus, you can have an
2132 official update candidate that provides the old name, and other
2133 packages that also obsolete the package but are not considered for
2134 updating. If you cannot use this feature, you can turn it off
2135 by setting this flag.
2136
2137 *SOLVER_FLAG_NEED_UPDATEPROVIDE*::
2138 This is somewhat the opposite of SOLVER_FLAG_NO_UPDATEPROVIDE: Only
2139 packages that provide the installed package names are considered
2140 for updating.
2141
2142 *SOLVER_FLAG_SPLITPROVIDES*::
2143 Make the solver aware of special provides of the form
2144 ``<packagename>:<path>'' used in SUSE systems to support package
2145 splits.
2146
2147 *SOLVER_FLAG_IGNORE_RECOMMENDED*::
2148 Do not process optional (aka weak) dependencies.
2149
2150 *SOLVER_FLAG_ADD_ALREADY_RECOMMENDED*::
2151 Install recommended or supplemented packages even if they have no
2152 connection to the current transaction. You can use this feature
2153 to implement a simple way for the user to install new recommended
2154 packages that were not available in the past.
2155   
2156 *SOLVER_FLAG_NO_INFARCHCHECK*::
2157 Turn off the inferior architecture checking that is normally done
2158 by the solver. Normally, the solver allows only the installation
2159 of packages from the "best" architecture if a package is available
2160 for multiple architectures.
2161
2162 *SOLVER_FLAG_BEST_OBEY_POLICY*::
2163 Make the SOLVER_FORCEBEST job option consider only packages that
2164 meet the policies for installed packages, i.e. no downgrades,
2165 no architecture change, no vendor change (see the first flags
2166 of this section). If the flag is not specified, the solver will
2167 enforce the installation of the best package ignoring the
2168 installed packages, which may conflict with the set policy.
2169
2170 *SOLVER_FLAG_NO_AUTOTARGET*::
2171 Do not enable auto-targeting up update and distupgrade jobs. See
2172 the section on targeted updates for more information.
2173
2174 *SOLVER_FLAG_KEEP_ORPHANS*::
2175 Do not allow orphaned packages to be deinstalled if they get
2176 in the way of resolving other packages.
2177
2178 *SOLVER_FLAG_BREAK_ORPHANS*::
2179 Ignore dependencies of orphaned packages that get in the way
2180 of resolving non-orphaned ones. Setting the flag might result
2181 in no longer working packages in case they are orphaned.
2182
2183 *SOLVER_FLAG_FOCUS_INSTALLED*::
2184 Resolve installed packages before resolving the given jobs.
2185 Setting this flag means that the solver will prefer picking
2186 a package version that fits the other installed packages
2187 over updating installed packages.
2188
2189 *SOLVER_FLAG_FOCUS_BEST*::
2190 First resolve the given jobs, then the dependencies of the
2191 resulting packages, then resolve all already installed
2192 packages. This will result in more packages being updated
2193 as when the flag is not used.
2194
2195 *SOLVER_FLAG_INSTALL_ALSO_UPDATES*::
2196 Update the package if a job is already fulfilled by an installed
2197 package.
2198
2199 *SOLVER_FLAG_YUM_OBSOLETES*::
2200 Turn on yum-like package split handling. See the yum documentation
2201 for more details.
2202
2203 *SOLVER_FLAG_URPM_REORDER*::
2204 Turn on urpm like package reordering for kernel packages. See
2205 the urpm documentation for more details.
2206
2207
2208
2209 Basic rule types:
2210
2211 *SOLVER_RULE_UNKNOWN*::
2212 A rule of an unknown class. You should never encounter those.
2213
2214 *SOLVER_RULE_PKG*::
2215 A package dependency rule.
2216
2217 *SOLVER_RULE_UPDATE*::
2218 A rule to implement the update policy of installed packages. Every
2219 installed package has an update rule that consists of the packages
2220 that may replace the installed package.
2221
2222 *SOLVER_RULE_FEATURE*::
2223 Feature rules are fallback rules used when an update rule is disabled. They
2224 include all packages that may replace the installed package ignoring the
2225 update policy, i.e. they contain downgrades, arch changes and so on.
2226 Without them, the solver would simply erase installed packages if their
2227 update rule gets disabled.
2228
2229 *SOLVER_RULE_JOB*::
2230 Job rules implement the job given to the solver.
2231
2232 *SOLVER_RULE_DISTUPGRADE*::
2233 These are simple negative assertions that make sure that only packages
2234 are kept that are also available in one of the repositories.
2235
2236 *SOLVER_RULE_INFARCH*::
2237 Infarch rules are also negative assertions, they disallow the installation
2238 of packages when there are packages of the same name but with a better
2239 architecture.
2240
2241 *SOLVER_RULE_CHOICE*::
2242 Choice rules are used to make sure that the solver prefers updating to
2243 installing different packages when some dependency is provided by
2244 multiple packages with different names. The solver may always break
2245 choice rules, so you will not see them when a problem is found.
2246
2247 *SOLVER_RULE_LEARNT*::
2248 These rules are generated by the solver to keep it from running into
2249 the same problem multiple times when it has to backtrack. They are
2250 the main reason why a sat solver is faster than other dependency solver
2251 implementations.
2252
2253 Special dependency rule types:
2254
2255 *SOLVER_RULE_PKG_NOT_INSTALLABLE*::
2256 This rule was added to prevent the installation of a package of an
2257 architecture that does not work on the system.
2258
2259 *SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP*::
2260 The package contains a required dependency which was not provided by
2261 any package.
2262
2263 *SOLVER_RULE_PKG_REQUIRES*::
2264 Similar to SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP, but in this case
2265 some packages provided the dependency but none of them could be
2266 installed due to other dependency issues.
2267
2268 *SOLVER_RULE_PKG_SELF_CONFLICT*::
2269 The package conflicts with itself. This is not allowed by older rpm
2270 versions.
2271
2272 *SOLVER_RULE_PKG_CONFLICTS*::
2273 To fulfill the dependencies two packages need to be installed, but
2274 one of the packages contains a conflict with the other one.
2275
2276 *SOLVER_RULE_PKG_SAME_NAME*::
2277 The dependencies can only be fulfilled by multiple versions of
2278 a package, but installing multiple versions of the same package
2279 is not allowed.
2280
2281 *SOLVER_RULE_PKG_OBSOLETES*::
2282 To fulfill the dependencies two packages need to be installed, but
2283 one of the packages obsoletes the other one.
2284
2285 *SOLVER_RULE_PKG_IMPLICIT_OBSOLETES*::
2286 To fulfill the dependencies two packages need to be installed, but
2287 one of the packages has provides a dependency that is obsoleted
2288 by the other one. See the POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES
2289 flag.
2290
2291 *SOLVER_RULE_PKG_INSTALLED_OBSOLETES*::
2292 To fulfill the dependencies a package needs to be installed that is
2293 obsoleted by an installed package. See the POOL_FLAG_NOINSTALLEDOBSOLETES
2294 flag.
2295
2296 *SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP*::
2297 The user asked for installation of a package providing a specific
2298 dependency, but no available package provides it.
2299
2300 *SOLVER_RULE_JOB_UNKNOWN_PACKAGE*::
2301 The user asked for installation of a package with a specific name,
2302 but no available package has that name.
2303
2304 *SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM*::
2305 The user asked for the erasure of a dependency that is provided by the
2306 system (i.e. for special hardware or language dependencies), this
2307 cannot be done with a job.
2308
2309 *SOLVER_RULE_JOB_UNSUPPORTED*::
2310 The user asked for something that is not yet implemented, e.g. the
2311 installation of all packages at once.
2312
2313 Policy error constants
2314
2315 *POLICY_ILLEGAL_DOWNGRADE*::
2316 The solver ask for permission before downgrading packages.
2317
2318 *POLICY_ILLEGAL_ARCHCHANGE*::
2319 The solver ask for permission before changing the architecture of installed
2320 packages.
2321
2322 *POLICY_ILLEGAL_VENDORCHANGE*::
2323 The solver ask for permission before changing the vendor of installed
2324 packages.
2325
2326 *POLICY_ILLEGAL_NAMECHANGE*::
2327 The solver ask for permission before replacing an installed packages with
2328 a package that has a different name.
2329
2330 Solution element type constants
2331
2332 *SOLVER_SOLUTION_JOB*::
2333 The problem can be solved by removing the specified job.
2334
2335 *SOLVER_SOLUTION_POOLJOB*::
2336 The problem can be solved by removing the specified job that is defined
2337 in the pool.
2338
2339 *SOLVER_SOLUTION_INFARCH*::
2340 The problem can be solved by allowing the installation of the specified
2341 package with an inferior architecture.
2342
2343 *SOLVER_SOLUTION_DISTUPGRADE*::
2344 The problem can be solved by allowing to keep the specified package
2345 installed.
2346
2347 *SOLVER_SOLUTION_BEST*::
2348 The problem can be solved by allowing to install the specified package
2349 that is not the best available package.
2350
2351 *SOLVER_SOLUTION_ERASE*::
2352 The problem can be solved by allowing to erase the specified package.
2353
2354 *SOLVER_SOLUTION_REPLACE*::
2355 The problem can be solved by allowing to replace the package with some
2356 other package.
2357
2358 *SOLVER_SOLUTION_REPLACE_DOWNGRADE*::
2359 The problem can be solved by allowing to replace the package with some
2360 other package that has a lower version.
2361
2362 *SOLVER_SOLUTION_REPLACE_ARCHCHANGE*::
2363 The problem can be solved by allowing to replace the package with some
2364 other package that has a different architecture.
2365
2366 *SOLVER_SOLUTION_REPLACE_VENDORCHANGE*::
2367 The problem can be solved by allowing to replace the package with some
2368 other package that has a different vendor.
2369
2370 *SOLVER_SOLUTION_REPLACE_NAMECHANGE*::
2371 The problem can be solved by allowing to replace the package with some
2372 other package that has a different name.
2373
2374
2375 Reason constants
2376
2377 *SOLVER_REASON_UNRELATED*::
2378 The package status did not change as it was not related to any job.
2379
2380 *SOLVER_REASON_UNIT_RULE*::
2381 The package was installed/erased/kept because of a unit rule, i.e. a rule
2382 where all literals but one were false.
2383
2384 *SOLVER_REASON_KEEP_INSTALLED*::
2385 The package was chosen when trying to keep as many packages installed as
2386 possible.
2387
2388 *SOLVER_REASON_RESOLVE_JOB*::
2389 The decision happened to fulfill a job rule.
2390
2391 *SOLVER_REASON_UPDATE_INSTALLED*::
2392 The decision happened to fulfill a package update request.
2393
2394 *SOLVER_REASON_CLEANDEPS_ERASE*::
2395 The package was erased when cleaning up dependencies from other erased
2396 packages.
2397
2398 *SOLVER_REASON_RESOLVE*::
2399 The package was installed to fulfill package dependencies.
2400
2401 *SOLVER_REASON_WEAKDEP*::
2402 The package was installed because of a weak dependency (Recommends or
2403 Supplements).
2404
2405 *SOLVER_REASON_RESOLVE_ORPHAN*::
2406 The decision about the package was made when deciding the fate of orphaned
2407 packages.
2408
2409 *SOLVER_REASON_RECOMMENDED*::
2410 This is a special case of SOLVER_REASON_WEAKDEP.
2411
2412 *SOLVER_REASON_SUPPLEMENTED*::
2413 This is a special case of SOLVER_REASON_WEAKDEP.
2414
2415
2416 === ATTRIBUTES ===
2417
2418         Pool *pool;                             /* read only */
2419         $job->{pool}
2420         d.pool
2421         d.pool
2422
2423 Back pointer to pool.
2424
2425 === METHODS ===
2426
2427         int set_flag(int flag, int value)
2428         my $oldvalue = $solver->set_flag($flag, $value);
2429         oldvalue = solver.set_flag(flag, value)
2430         oldvalue = solver.set_flag(flag, value)
2431
2432         int get_flag(int flag)
2433         my $value = $solver->get_flag($flag);
2434         value = solver.get_flag(flag)
2435         value = solver.get_flag(flag)
2436
2437 Set/get a solver specific flag. The flags define the policies the solver has
2438 to obey. The flags are explained in the CONSTANTS section of this class.
2439
2440         Problem *solve(Job *jobs)
2441         my @problems = $solver->solve(\@jobs);
2442         problems = solver.solve(jobs)
2443         problems = solver.solve(jobs)
2444
2445 Solve a problem specified in the job list (plus the jobs defined in the pool).
2446 Returns an array of problems that need user interaction, or an empty array
2447 if no problems were encountered. See the Problem class on how to deal with
2448 problems.
2449
2450         Transaction transaction()
2451         my $trans = $solver->transaction();
2452         trans = solver.transaction()
2453         trans = solver.transaction()
2454
2455 Return the transaction to implement the calculated package changes. A transaction
2456 is available even if problems were found, this is useful for interactive user
2457 interfaces that show both the job result and the problems.
2458
2459         int reason = describe_decision(Solvable *s, Rule *OUTPUT)
2460         my ($reason, $rule) = $solver->describe_decision($solvable);
2461         (reason, rule) = solver.describe_decision(solvable)
2462         (reason, rule) = solver.describe_decision(solvable)
2463
2464 Return the reason why a specific solvable was installed or erased. For most of
2465 the reasons the rule that triggered the decision is also returned.
2466
2467         Solvable *get_recommended(bool noselected=0);
2468         my @solvables = $solver->get_recommended();
2469         solvables = solver.get_recommended()
2470         solvables = solver.get_recommended()
2471
2472 Return all solvables that are recommended by the solver run result. This includes
2473 solvables included in the result, set noselected if you want to filter those.
2474
2475         Solvable *get_suggested(bool noselected=0);
2476         my @solvables = $solver->get_suggested();
2477         solvables = solver.get_suggested()
2478         solvables = solver.get_suggested()
2479
2480 Return all solvables that are suggested by the solver run result. This includes
2481 solvables included in the result, set noselected if you want to filter those.
2482
2483
2484 The Problem Class
2485 -----------------
2486 Problems are the way of the solver to interact with the user. You can simply list
2487 all problems and terminate your program, but a better way is to present solutions to
2488 the user and let him pick the ones he likes.
2489
2490 === ATTRIBUTES ===
2491
2492         Solver *solv;                           /* read only */
2493         $problem->{solv}
2494         problem.solv
2495         problem.solv
2496
2497 Back pointer to solver object.
2498
2499         Id id;                                  /* read only */
2500         $problem->{id}
2501         problem.id
2502         problem.id
2503
2504 Id of the problem. The first problem has Id 1, they are numbered consecutively.
2505
2506 === METHODS ===
2507
2508         Rule findproblemrule()
2509         my $probrule = $problem->findproblemrule();
2510         probrule = problem.findproblemrule()
2511         probrule = problem.findproblemrule()
2512
2513 Return the rule that caused the problem. Of course in most situations there is no
2514 single responsible rule, but many rules that interconnect with each created the
2515 problem. Nevertheless, the solver uses some heuristic approach to find a rule
2516 that somewhat describes the problem best to the user.
2517
2518         Rule *findallproblemrules(bool unfiltered = 0)
2519         my @probrules = $problem->findallproblemrules();
2520         probrules = problem.findallproblemrules()
2521         probrules = problem.findallproblemrules()
2522
2523 Return all rules responsible for the problem. The returned set of rules contains
2524 all the needed information why there was a problem, but it's hard to present
2525 them to the user in a sensible way. The default is to filter out all update and
2526 job rules (unless the returned rules only consist of those types).
2527
2528         Solution *solutions()
2529         my @solutions = $problem->solutions();
2530         solutions = problem.solutions()
2531         solutions = problem.solutions()
2532
2533 Return an array containing multiple possible solutions to fix the problem. See
2534 the solution class for more information.
2535
2536         int solution_count()
2537         my $cnt = $problem->solution_count();
2538         cnt = problem.solution_count()
2539         cnt = problem.solution_count()
2540
2541 Return the number of solutions without creating solution objects.
2542
2543         <stringification>
2544         my $str = $problem->str;
2545         str = str(problem)
2546         str = problem.to_s
2547
2548 Return a string describing the problem. This is a convenience function, it is
2549 a shorthand for calling findproblemrule(), then ruleinfo() on the problem
2550 rule and problemstr() on the ruleinfo object.
2551
2552 The Rule Class
2553 --------------
2554 Rules are the basic block of sat solving. Each package dependency gets translated
2555 into one or multiple rules.
2556
2557 === ATTRIBUTES ===
2558
2559         Solver *solv;                           /* read only */
2560         $rule->{solv}
2561         rule.solv
2562         rule.solv
2563
2564 Back pointer to solver object.
2565
2566         Id id;                                  /* read only */
2567         $rule->{id}
2568         rule.id
2569         rule.id
2570
2571 The id of the rule.
2572
2573         int type;                               /* read only */
2574         $rule->{type}
2575         rule.type
2576         rule.type
2577
2578 The basic type of the rule. See the constant section of the solver class for the type list.
2579
2580 === METHODS ===
2581
2582         Ruleinfo info()
2583         my $ruleinfo = $rule->info();
2584         ruleinfo = rule.info()
2585         ruleinfo = rule.info()
2586
2587 Return a Ruleinfo object that contains information about why the rule was created. But
2588 see the allinfos() method below.
2589
2590         Ruleinfo *allinfos()
2591         my @ruleinfos = $rule->allinfos();
2592         ruleinfos = rule.allinfos()
2593         ruleinfos = rule.allinfos()
2594
2595 As the same dependency rule can get created because of multiple dependencies, one
2596 Ruleinfo is not enough to describe the reason. Thus the allinfos() method returns
2597 an array of all infos about a rule.
2598
2599         <equality>
2600         if ($rule1 == $rule2)
2601         if rule1 == rule2:
2602         if rule1 == rule2
2603
2604 Two rules are equal if they belong to the same solver and have the same id.
2605
2606 The Ruleinfo Class
2607 ------------------
2608 A Ruleinfo describes one reason why a rule was created.
2609
2610 === ATTRIBUTES ===
2611
2612         Solver *solv;                           /* read only */
2613         $ruleinfo->{solv}
2614         ruleinfo.solv
2615         ruleinfo.solv
2616
2617 Back pointer to solver object.
2618
2619         int type;                               /* read only */
2620         $ruleinfo->{type}
2621         ruleinfo.type
2622         ruleinfo.type
2623
2624 The type of the ruleinfo. See the constant section of the solver class for the
2625 rule type list and the special type list.
2626
2627         Dep *dep;                               /* read only */
2628         $ruleinfo->{dep}
2629         ruleinfo.dep
2630         ruleinfo.dep
2631
2632 The dependency leading to the creation of the rule.
2633
2634         Dep *dep_id;                            /* read only */
2635         $ruleinfo->{'dep_id'}
2636         ruleinfo.dep_id
2637         ruleinfo.dep_id
2638
2639 The Id of the dependency leading to the creation of the rule, or zero.
2640
2641         Solvable *solvable;                     /* read only */
2642         $ruleinfo->{solvable}
2643         ruleinfo.solvable
2644         ruleinfo.solvable
2645
2646 The involved Solvable, e.g. the one containing the dependency.
2647
2648         Solvable *othersolvable;                /* read only */
2649         $ruleinfo->{othersolvable}
2650         ruleinfo.othersolvable
2651         ruleinfo.othersolvable
2652
2653 The other involved Solvable (if any), e.g. the one containing providing
2654 the dependency for conflicts.
2655
2656         const char *problemstr();
2657         my $str = $ruleinfo->problemstr();
2658         str = ruleinfo.problemstr()
2659         str = ruleinfo.problemstr()
2660
2661 A string describing the ruleinfo from a problem perspective. This probably
2662 only makes sense if the rule is part of a problem.
2663
2664 The Solution Class
2665 ------------------
2666 A solution solves one specific problem. It consists of multiple solution elements
2667 that all need to be executed.
2668
2669 === ATTRIBUTES ===
2670
2671         Solver *solv;                           /* read only */
2672         $solution->{solv}
2673         solution.solv
2674         solution.solv
2675
2676 Back pointer to solver object.
2677
2678         Id problemid;                           /* read only */
2679         $solution->{problemid}
2680         solution.problemid
2681         solution.problemid
2682
2683 Id of the problem the solution solves.
2684
2685         Id id;                                  /* read only */
2686         $solution->{id}
2687         solution.id
2688         solution.id
2689
2690 Id of the solution. The first solution has Id 1, they are numbered consecutively.
2691
2692 === METHODS ===
2693
2694         Solutionelement *elements(bool expandreplaces = 0)
2695         my @solutionelements = $solution->elements();
2696         solutionelements = solution.elements()
2697         solutionelements = solution.elements()
2698
2699 Return an array containing the elements describing what needs to be done to
2700 implement the specific solution. If expandreplaces is true, elements of type
2701 SOLVER_SOLUTION_REPLACE will be replaced by one or more elements replace
2702 elements describing the policy mismatches.
2703
2704         int element_count()
2705         my $cnt = $solution->solution_count();
2706         cnt = solution.element_count()
2707         cnt = solution.element_count()
2708
2709 Return the number of solution elements without creating objects. Note that the
2710 count does not match the number of objects returned by the elements() method
2711 of expandreplaces is set to true.
2712
2713
2714 The Solutionelement Class
2715 -------------------------
2716 A solution element describes a single action of a solution. The action is always
2717 either to remove one specific job or to add a new job that installs or erases
2718 a single specific package.
2719
2720 === ATTRIBUTES ===
2721
2722         Solver *solv;                           /* read only */
2723         $solutionelement->{solv}
2724         solutionelement.solv
2725         solutionelement.solv
2726
2727 Back pointer to solver object.
2728
2729         Id problemid;                           /* read only */
2730         $solutionelement->{problemid}
2731         solutionelement.problemid
2732         solutionelement.problemid
2733
2734 Id of the problem the element (partly) solves.
2735
2736         Id solutionid;                          /* read only */
2737         $solutionelement->{solutionid}
2738         solutionelement.solutionid
2739         solutionelement.solutionid
2740
2741 Id of the solution the element is a part of.
2742
2743         Id id;                                  /* read only */
2744         $solutionelement->{id}
2745         solutionelement.id
2746         solutionelement.id
2747
2748 Id of the solution element. The first element has Id 1, they are numbered consecutively.
2749
2750         Id type;                                /* read only */
2751         $solutionelement->{type}
2752         solutionelement.type
2753         solutionelement.type
2754
2755 Type of the solution element. See the constant section of the solver class for the
2756 existing types.
2757
2758         Solvable *solvable;                     /* read only */
2759         $solutionelement->{solvable}
2760         solutionelement.solvable
2761         solutionelement.solvable
2762
2763 The installed solvable that needs to be replaced for replacement elements.
2764
2765         Solvable *replacement;                  /* read only */
2766         $solutionelement->{replacement}
2767         solutionelement.replacement
2768         solutionelement.replacement
2769
2770 The solvable that needs to be installed to fix the problem.
2771
2772         int jobidx;                             /* read only */
2773         $solutionelement->{jobidx}
2774         solutionelement.jobidx
2775         solutionelement.jobidx
2776
2777 The index of the job that needs to be removed to fix the problem, or -1 if the
2778 element is of another type. Note that it's better to change the job to SOLVER_NOOP
2779 type so that the numbering of other elements does not get disturbed. This
2780 method works both for types SOLVER_SOLUTION_JOB and SOLVER_SOLUTION_POOLJOB.
2781
2782 === METHODS ===
2783
2784         Solutionelement *replaceelements()
2785         my @solutionelements = $solutionelement->replaceelements();
2786         solutionelements = solutionelement.replaceelements()
2787         solutionelements = solutionelement.replaceelements()
2788
2789 If the solution element is of type SOLVER_SOLUTION_REPLACE, return an array of
2790 elements describing the policy mismatches, otherwise return a copy of the
2791 element. See also the ``expandreplaces'' option in the solution's elements()
2792 method.
2793
2794         int illegalreplace()
2795         my $illegal = $solutionelement->illegalreplace();
2796         illegal = solutionelement.illegalreplace()
2797         illegal = solutionelement.illegalreplace()
2798
2799 Return an integer that contains the policy mismatch bits or-ed together, or
2800 zero if there was no policy mismatch. See the policy error constants in
2801 the solver class.
2802
2803         Job Job()
2804         my $job = $solutionelement->Job();
2805         illegal = solutionelement.Job()
2806         illegal = solutionelement.Job()
2807
2808 Create a job that implements the solution element. Add this job to the array
2809 of jobs for all elements of type different to SOLVER_SOLUTION_JOB and
2810 SOLVER_SOLUTION_POOLJOB. For the latter two, a SOLVER_NOOB Job is created,
2811 you should replace the old job with the new one.
2812
2813         const char *str()
2814         my $str = $solutionelement->str();
2815         str = solutionelement.str()
2816         str = solutionelement.str()
2817
2818 A string describing the change the solution element consists of.
2819
2820 The Transaction Class
2821 ---------------------
2822 Transactions describe the output of a solver run. A transaction contains
2823 a number of transaction elements, each either the installation of a new
2824 package or the removal of an already installed package. The Transaction
2825 class supports a classify() method that puts the elements into different
2826 groups so that a transaction can be presented to the user in a meaningful
2827 way.
2828
2829 === CONSTANTS ===
2830
2831 Transaction element types, both active and passive
2832
2833 *SOLVER_TRANSACTION_IGNORE*::
2834 This element does nothing. Used to map element types that do not match
2835 the view mode.
2836
2837 *SOLVER_TRANSACTION_INSTALL*::
2838 This element installs a package.
2839
2840 *SOLVER_TRANSACTION_ERASE*::
2841 This element erases a package.
2842
2843 *SOLVER_TRANSACTION_MULTIINSTALL*::
2844 This element installs a package with a different version keeping the other
2845 versions installed.
2846
2847 *SOLVER_TRANSACTION_MULTIREINSTALL*::
2848 This element reinstalls an installed package keeping the other versions
2849 installed.
2850
2851 Transaction element types, active view
2852
2853 *SOLVER_TRANSACTION_REINSTALL*::
2854 This element re-installs a package, i.e. installs the same package again.
2855
2856 *SOLVER_TRANSACTION_CHANGE*::
2857 This element installs a package with same name, version, architecture but
2858 different content.
2859
2860 *SOLVER_TRANSACTION_UPGRADE*::
2861 This element installs a newer version of an installed package.
2862
2863 *SOLVER_TRANSACTION_DOWNGRADE*::
2864 This element installs an older version of an installed package.
2865
2866 *SOLVER_TRANSACTION_OBSOLETES*::
2867 This element installs a package that obsoletes an installed package.
2868
2869 Transaction element types, passive view
2870
2871 *SOLVER_TRANSACTION_REINSTALLED*::
2872 This element re-installs a package, i.e. installs the same package again.
2873
2874 *SOLVER_TRANSACTION_CHANGED*::
2875 This element replaces an installed package with one of the same name,
2876 version, architecture but different content.
2877
2878 *SOLVER_TRANSACTION_UPGRADED*::
2879 This element replaces an installed package with a new version.
2880
2881 *SOLVER_TRANSACTION_DOWNGRADED*::
2882 This element replaces an installed package with an old version.
2883
2884 *SOLVER_TRANSACTION_OBSOLETED*::
2885 This element replaces an installed package with a package that obsoletes
2886 it.
2887
2888 Pseudo element types for showing extra information used by classify()
2889
2890 *SOLVER_TRANSACTION_ARCHCHANGE*::
2891 This element replaces an installed package with a package of a different
2892 architecture.
2893
2894 *SOLVER_TRANSACTION_VENDORCHANGE*::
2895 This element replaces an installed package with a package of a different
2896 vendor.
2897
2898 Transaction mode flags
2899
2900 *SOLVER_TRANSACTION_SHOW_ACTIVE*::
2901 Filter for active view types. The default is to return passive view type,
2902 i.e. to show how the installed packages get changed.
2903
2904 *SOLVER_TRANSACTION_SHOW_OBSOLETES*::
2905 Do not map the obsolete view type into INSTALL/ERASE elements.
2906
2907 *SOLVER_TRANSACTION_SHOW_ALL*::
2908 If multiple packages replace an installed package, only the best of them
2909 is kept as OBSOLETE element, the other ones are mapped to INSTALL/ERASE
2910 elements. This is because most applications want to show just one package
2911 replacing the installed one. The SOLVER_TRANSACTION_SHOW_ALL makes the
2912 library keep all OBSOLETE elements.
2913
2914 *SOLVER_TRANSACTION_SHOW_MULTIINSTALL*::
2915 The library maps MULTIINSTALL elements to simple INSTALL elements. This
2916 flag can be used to disable the mapping.
2917
2918 *SOLVER_TRANSACTION_CHANGE_IS_REINSTALL*::
2919 Use this flag if you want to map CHANGE elements to the REINSTALL type.
2920
2921 *SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE*::
2922 Use this flag if you want to map OBSOLETE elements to the UPGRADE type.
2923
2924 *SOLVER_TRANSACTION_MERGE_ARCHCHANGES*::
2925 Do not add extra categories for every architecture change, instead cumulate
2926 them in one category.
2927   
2928 *SOLVER_TRANSACTION_MERGE_VENDORCHANGES*::
2929 Do not add extra categories for every vendor change, instead cumulate
2930 them in one category.
2931
2932 *SOLVER_TRANSACTION_RPM_ONLY*::
2933 Special view mode that just returns IGNORE, ERASE, INSTALL, MULTIINSTALL
2934 elements. Useful if you want to find out what to feed to the underlying
2935 package manager.
2936
2937 Transaction order flags
2938
2939 *SOLVER_TRANSACTION_KEEP_ORDERDATA*::
2940 Do not throw away the dependency graph used for ordering the transaction.
2941 This flag is needed if you want to do manual ordering.
2942
2943 === ATTRIBUTES ===
2944
2945         Pool *pool;                             /* read only */
2946         $trans->{pool}
2947         trans.pool
2948         trans.pool
2949
2950 Back pointer to pool.
2951
2952 === METHODS ===
2953
2954         bool isempty();
2955         $trans->isempty()
2956         trans.isempty()
2957         trans.isempty?
2958
2959 Returns true if the transaction does not do anything, i.e. has no elements.
2960
2961         Solvable *newsolvables();
2962         my @newsolvables = $trans->newsolvables();
2963         newsolvables = trans.newsolvables()
2964         newsolvables = trans.newsolvables()
2965
2966 Return all packages that are to be installed by the transaction. These are
2967 the packages that need to be downloaded from the repositories.
2968
2969         Solvable *keptsolvables();
2970         my @keptsolvables = $trans->keptsolvables();
2971         keptsolvables = trans.keptsolvables()
2972         keptsolvables = trans.keptsolvables()
2973
2974 Return all installed packages that the transaction will keep installed.
2975
2976         Solvable *steps();
2977         my @steps = $trans->steps();
2978         steps = trans.steps()
2979         steps = trans.steps()
2980
2981 Return all solvables that need to be installed (if the returned solvable
2982 is not already installed) or erased (if the returned solvable is installed).
2983 A step is also called a transaction element.
2984
2985         int steptype(Solvable *solvable, int mode)
2986         my $type = $trans->steptype($solvable, $mode);
2987         type = trans.steptype(solvable, mode)
2988         type = trans.steptype(solvable, mode)
2989
2990 Return the transaction type of the specified solvable. See the CONSTANTS
2991 sections for the mode argument flags and the list of returned types.
2992
2993         TransactionClass *classify(int mode = 0)
2994         my @classes = $trans->classify();
2995         classes = trans.classify()
2996         classes = trans.classify()
2997
2998 Group the transaction elements into classes so that they can be displayed
2999 in a structured way. You can use various mapping mode flags to tweak
3000 the result to match your preferences, see the mode argument flag in
3001 the CONSTANTS section. See the TransactionClass class for how to deal
3002 with the returned objects.
3003
3004         Solvable othersolvable(Solvable *solvable);
3005         my $other = $trans->othersolvable($solvable);
3006         other = trans.othersolvable(solvable)
3007         other = trans.othersolvable(solvable)
3008
3009 Return the ``other'' solvable for a given solvable. For installed packages
3010 the other solvable is the best package with the same name that replaces
3011 the installed package, or the best package of the obsoleting packages if
3012 the package does not get replaced by one with the same name.
3013
3014 For to be installed packages, the ``other'' solvable is the best installed
3015 package with the same name that will be replaced, or the best packages
3016 of all the packages that are obsoleted if the new package does not replace
3017 a package with the same name.
3018
3019 Thus, the ``other'' solvable is normally the package that is also shown
3020 for a given package.
3021
3022         Solvable *allothersolvables(Solvable *solvable);
3023         my @others = $trans->allothersolvables($solvable);
3024         others = trans.allothersolvables(solvable)
3025         others = trans.allothersolvables(solvable)
3026
3027 For installed packages, returns all of the packages that replace us. For to
3028 be installed packages, returns all of the packages that the new package
3029 replaces. The special ``other'' solvable is always the first entry of the
3030 returned array.
3031
3032         int calc_installsizechange();
3033         my $change = $trans->calc_installsizechange();
3034         change = trans.calc_installsizechange()
3035         change = trans.calc_installsizechange()
3036
3037 Return the size change of the installed system in kilobytes (kibibytes).
3038
3039         void order(int flags = 0);
3040         $trans->order();
3041         trans.order()
3042         trans.order()
3043
3044 Order the steps in the transactions so that dependent packages are updated
3045 before packages that depend on them. For rpm, you can also use rpmlib's
3046 ordering functionality, debian's dpkg does not provide a way to order a
3047 transaction.
3048
3049 === ACTIVE/PASSIVE VIEW ===
3050
3051 Active view lists what new packages get installed, while passive view shows
3052 what happens to the installed packages. Most often there's not much
3053 difference between the two modes, but things get interesting if multiple
3054 packages get replaced by one new package. Say you have installed packages
3055 A-1-1 and B-1-1, and now install A-2-1 which has a new dependency that
3056 obsoletes B. The transaction elements will be
3057
3058   updated   A-1-1 (other: A-2-1)
3059   obsoleted B-1-1 (other: A-2-1)
3060
3061 in passive mode, but
3062
3063   update A-2-1 (other: A-1-1)
3064   erase  B
3065
3066 in active mode. If the mode contains SOLVER_TRANSACTION_SHOW_ALL, the 
3067 passive mode list will be unchanged but the active mode list will just
3068 contain A-2-1.
3069
3070 The Transactionclass Class
3071 --------------------------
3072 Objects of this type are returned by the classify() Transaction method.
3073
3074 === ATTRIBUTES ===
3075
3076         Transaction *transaction;               /* read only */
3077         $class->{transaction}
3078         class.transaction
3079         class.transaction
3080
3081 Back pointer to transaction object.
3082
3083         int type;                               /* read only */
3084         $class->{type}
3085         class.type
3086         class.type
3087
3088 The type of the transaction elements in the class.
3089
3090         int count;                              /* read only */
3091         $class->{count}
3092         class.count
3093         class.count
3094
3095 The number of elements in the class.
3096
3097         const char *fromstr;
3098         $class->{fromstr}
3099         class.fromstr
3100         class.fromstr
3101
3102 The old vendor or architecture.
3103
3104         const char *tostr;
3105         $class->{tostr}
3106         class.tostr
3107         class.tostr
3108
3109 The new vendor or architecture.
3110
3111         Id fromid;
3112         $class->{fromid}
3113         class.fromid
3114         class.fromid
3115
3116 The id of the old vendor or architecture.
3117
3118         Id toid;
3119         $class->{toid}
3120         class.toid
3121         class.toid
3122
3123 The id of the new vendor or architecture.
3124
3125 === METHODS ===
3126
3127         void solvables();
3128         my @solvables = $class->solvables();
3129         solvables = class.solvables()
3130         solvables = class.solvables()
3131
3132 Return the solvables for all transaction elements in the class.
3133
3134 Checksums
3135 ---------
3136 Checksums (also called hashes) are used to make sure that downloaded data is
3137 not corrupt and also as a fingerprint mechanism to check if data has changed.
3138
3139 === CLASS METHODS ===
3140
3141         Chksum Chksum(Id type)
3142         my $chksum = solv::Chksum->new($type);
3143         chksum = solv.Chksum(type)
3144         chksum = Solv::Chksum.new(type)
3145
3146 Create a checksum object. Currently the following types are supported:
3147
3148         REPOKEY_TYPE_MD5
3149         REPOKEY_TYPE_SHA1
3150         REPOKEY_TYPE_SHA256
3151
3152 These keys are constants in the *solv* class.
3153
3154         Chksum Chksum(Id type, const char *hex)
3155         my $chksum = solv::Chksum->new($type, $hex);
3156         chksum = solv.Chksum(type, hex)
3157         chksum = Solv::Chksum.new(type, hex)
3158
3159 Create an already finalized checksum object from a hex string.
3160
3161         Chksum Chksum_from_bin(Id type, char *bin)
3162         my $chksum = solv::Chksum->from_bin($type, $bin);
3163         chksum = solv.Chksum.from_bin(type, bin)
3164         chksum = Solv::Chksum.from_bin(type, bin)
3165
3166 Create an already finalized checksum object from a binary checksum.
3167
3168 === ATTRIBUTES ===
3169
3170         Id type;                        /* read only */
3171         $chksum->{type}
3172         chksum.type
3173         chksum.type
3174
3175 Return the type of the checksum object.
3176
3177 === METHODS ===
3178
3179         void add(const char *str)
3180         $chksum->add($str);
3181         chksum.add(str)
3182         chksum.add(str)
3183
3184 Add a (binary) string to the checksum.
3185
3186         void add_fp(FILE *fp)
3187         $chksum->add_fp($file);
3188         chksum.add_fp(file)
3189         chksum.add_fp(file)
3190
3191 Add the contents of a file to the checksum.
3192         
3193         void add_stat(const char *filename)
3194         $chksum->add_stat($filename);
3195         chksum.add_stat(filename)
3196         chksum.add_stat(filename)
3197
3198 Stat the file and add the dev/ino/size/mtime member to the checksum. If the
3199 stat fails, the members are zeroed.
3200
3201         void add_fstat(int fd)
3202         $chksum->add_fstat($fd);
3203         chksum.add_fstat(fd)
3204         chksum.add_fstat(fd)
3205
3206 Same as add_stat, but instead of the filename a file descriptor is used.
3207
3208         unsigned char *raw()
3209         my $raw = $chksum->raw();
3210         raw = chksum.raw()
3211         raw = chksum.raw()
3212
3213 Finalize the checksum and return the result as raw bytes. This means that the
3214 result can contain NUL bytes or unprintable characters.
3215
3216         const char *hex()
3217         my $raw = $chksum->hex();
3218         raw = chksum.hex()
3219         raw = chksum.hex()
3220
3221 Finalize the checksum and return the result as hex string.
3222
3223         const char *typestr()
3224         my $typestr = $chksum->typestr();
3225         typestr = chksum.typestr
3226         typestr = chksum.typestr
3227
3228 Return the type of the checksum as a string, e.g. "sha256".
3229
3230         <equality>
3231         if ($chksum1 == $chksum2)
3232         if chksum1 == chksum2:
3233         if chksum1 == chksum2
3234
3235 Checksums are equal if they are of the same type and the finalized results are
3236 the same.
3237
3238         <stringification>
3239         my $str = $chksum->str;
3240         str = str(chksum)
3241         str = chksum.to_s
3242
3243 If the checksum is finished, the checksum is returned as "<type>:<hex>" string.
3244 Otherwise "<type>:unfinished" is returned.
3245
3246
3247 File Management
3248 ---------------
3249 This functions were added because libsolv uses standard *FILE* pointers to
3250 read/write files, but languages like perl have their own implementation of
3251 files. The libsolv functions also support decompression and compression, the
3252 algorithm is selected by looking at the file name extension.
3253
3254         FILE *xfopen(char *fn, char *mode = "r")
3255         my $file = solv::xfopen($path);
3256         file = solv.xfopen(path)
3257         file = Solv::xfopen(path)
3258
3259 Open a file at the specified path. The `mode` argument is passed on to the
3260 stdio library.
3261
3262         FILE *xfopen_fd(char *fn, int fileno)
3263         my $file = solv::xfopen_fd($path, $fileno);
3264         file = solv.xfopen_fd(path, fileno)
3265         file = Solv::xfopen_fd(path, fileno)
3266
3267 Create a file handle from the specified file descriptor. The path argument is
3268 only used to select the correct (de-)compression algorithm, use an empty path
3269 if you want to make sure to read/write raw data. The file descriptor is dup()ed
3270 before the file handle is created.
3271
3272 === METHODS ===
3273
3274         int fileno()
3275         my $fileno = $file->fileno();
3276         fileno = file.fileno()
3277         fileno = file.fileno()
3278
3279 Return file file descriptor of the file. If the file is not open, `-1` is
3280 returned.
3281
3282         void cloexec(bool state)
3283         $file->cloexec($state)
3284         file.cloexec(state)
3285         file.cloexec(state)
3286
3287 Set the close-on-exec flag of the file descriptor. The xfopen function
3288 returns files with close-on-exec turned on, so if you want to pass
3289 a file to some other process you need to call cloexec(0) before calling
3290 exec.
3291
3292         int dup()
3293         my $fileno = $file->dup();
3294         fileno = file.dup()
3295         fileno = file.dup()
3296
3297 Return a copy of the descriptor of the file. If the file is not open, `-1` is
3298 returned.
3299
3300         bool flush()
3301         $file->flush();
3302         file.flush()
3303         file.flush()
3304
3305 Flush the file. Returns false if there was an error. Flushing a closed file
3306 always returns true.
3307
3308         bool close()
3309         $file->close();
3310         file.close()
3311         file.close()
3312
3313 Close the file. This is needed for languages like Ruby that do not destruct
3314 objects right after they are no longer referenced. In that case, it is good
3315 style to close open files so that the file descriptors are freed right away.
3316 Returns false if there was an error.
3317
3318
3319 The Repodata Class
3320 ------------------
3321 The Repodata stores attributes for packages and the repository itself, each
3322 repository can have multiple repodata areas. You normally only need to
3323 directly access them if you implement lazy downloading of repository data.
3324 Repodata areas are created by calling the repository's add_repodata() method 
3325 or by using repo_add methods without the REPO_REUSE_REPODATA or REPO_USE_LOADING
3326 flag.
3327
3328 === ATTRIBUTES ===
3329
3330         Repo *repo;                     /* read only */
3331         $data->{repo}
3332         data.repo
3333         data.repo
3334
3335 Back pointer to repository object.
3336
3337         Id id;                                  /* read only */
3338         $data->{id}
3339         data.id
3340         data.id
3341
3342 The id of the repodata area. Repodata ids of different repositories overlap.
3343
3344 === METHODS ===
3345
3346         internalize();
3347         $data->internalize();
3348         data.internalize()
3349         data.internalize()
3350
3351 Internalize newly added data. The lookup functions will only see the new data
3352 after it has been internalized.
3353
3354         bool write(FILE *fp);
3355         $data->write($fp);
3356         data.write(fp)
3357         data.write(fp)
3358
3359 Write the contents of the repodata area as solv file.
3360
3361         bool add_solv(FILE *fp, int flags = 0);
3362         $data->add_solv($fp);
3363         data.add_solv(fp)
3364         data.add_solv(fp)
3365
3366 Replace a stub repodata object with the data from a solv file. This method
3367 automatically adds the REPO_USE_LOADING flag. It should only be used from
3368 a load callback.
3369
3370         void create_stubs();
3371         $data->create_stubs()
3372         data.create_stubs()
3373         data.create_stubs()
3374
3375 Create stub repodatas from the information stored in the repodata meta
3376 area.
3377
3378         void extend_to_repo();
3379         $data->extend_to_repo();
3380         data.extend_to_repo()
3381         data.extend_to_repo()
3382
3383 Extend the repodata so that it has the same size as the repo it belongs to.
3384 This method is needed when setting up a new extension repodata so that it
3385 matches the repository size. It is also needed when switching to a just written
3386 repodata extension to make the repodata match the written extension (which is
3387 always of the size of the repo).
3388
3389         <equality>
3390         if ($data1 == $data2)
3391         if data1 == data2:
3392         if data1 == data2
3393
3394 Two repodata objects are equal if they belong to the same repository and have
3395 the same id.
3396
3397 === DATA RETRIEVAL METHODS ===
3398
3399         const char *lookup_str(Id solvid, Id keyname)
3400         my $string = $data->lookup_str($solvid, $keyname);
3401         string = data.lookup_str(solvid, keyname)
3402         string = data.lookup_str(solvid, keyname)
3403
3404         Id *lookup_idarray(Id solvid, Id keyname)
3405         my @ids = $data->lookup_idarray($solvid, $keyname);
3406         ids = data.lookup_idarray(solvid, keyname)
3407         ids = data.lookup_idarray(solvid, keyname)
3408
3409         Chksum lookup_checksum(Id solvid, Id keyname)
3410         my $chksum = $data->lookup_checksum($solvid, $keyname);
3411         chksum = data.lookup_checksum(solvid, keyname)
3412         chksum = data.lookup_checksum(solvid, keyname)
3413
3414 Lookup functions. Return the data element stored in the specified solvable.
3415 The methods probably only make sense to retrieve data from the special
3416 SOLVID_META solvid that stores repodata meta information.
3417
3418 === DATA STORAGE METHODS ===
3419
3420         void set_id(Id solvid, Id keyname, DepId id);
3421         $data->set_id($solvid, $keyname, $id);
3422         data.set_id(solvid, keyname, id)
3423         data.set_id(solvid, keyname, id)
3424
3425         void set_str(Id solvid, Id keyname, const char *str);
3426         $data->set_str($solvid, $keyname, $str);
3427         data.set_str(solvid, keyname, str)
3428         data.set_str(solvid, keyname, str)
3429
3430         void set_poolstr(Id solvid, Id keyname, const char *str);
3431         $data->set_poolstr($solvid, $keyname, $str);
3432         data.set_poolstr(solvid, keyname, str)
3433         data.set_poolstr(solvid, keyname, str)
3434
3435         void set_checksum(Id solvid, Id keyname, Chksum *chksum);
3436         $data->set_checksum($solvid, $keyname, $chksum);
3437         data.set_checksum(solvid, keyname, chksum)
3438         data.set_checksum(solvid, keyname, chksum)
3439
3440         void set_sourcepkg(Id solvid, const char *sourcepkg);
3441         $data.set_sourcepkg($solvid, $sourcepkg);
3442         data.set_sourcepkg(solvid, sourcepkg)
3443         data.set_sourcepkg(solvid, sourcepkg)
3444
3445         void add_idarray(Id solvid, Id keyname, DepId id);
3446         $data->add_idarray($solvid, $keyname, $id);
3447         data.add_idarray(solvid, keyname, id)
3448         data.add_idarray(solvid, keyname, id)
3449
3450         Id new_handle();
3451         my $handle = $data->new_handle();
3452         handle = data.new_handle()
3453         handle = data.new_handle()
3454
3455         void add_flexarray(Id solvid, Id keyname, Id handle);
3456         $data->add_flexarray($solvid, $keyname, $handle);
3457         data.add_flexarray(solvid, keyname, handle)
3458         data.add_flexarray(solvid, keyname, handle)
3459
3460 Data storage methods. Probably only useful to store data in the special
3461 SOLVID_META solvid that stores repodata meta information. Note that
3462 repodata areas can have their own Id pool (see the REPO_LOCALPOOL flag),
3463 so be careful if you need to store ids. Arrays are created by calling
3464 the add function for every element. A flexarray is an array of
3465 sub-structures, call new_handle to create a new structure, use the
3466 handle as solvid to fill the structure with data and call add_flexarray
3467 to put the structure in an array.
3468
3469
3470 The Datapos Class
3471 -----------------
3472 Datapos objects describe a specific position in the repository data area.
3473 Thus they are only valid until the repository is modified in some way.
3474 Datapos objects can be created by the pos() and parentpos() methods of
3475 a Datamatch object or by accessing the ``meta'' attribute of a repository.
3476
3477 === ATTRIBUTES ===
3478
3479         Repo *repo;                     /* read only */
3480         $data->{repo}
3481         data.repo
3482         data.repo
3483
3484 Back pointer to repository object.
3485
3486 === METHODS ===
3487
3488         Dataiterator(Id keyname, const char *match, int flags)
3489         my $di = $datapos->Dataiterator($keyname, $match, $flags);
3490         di = datapos.Dataiterator(keyname, match, flags)
3491         di = datapos.Dataiterator(keyname, match, flags)
3492
3493 Create a Dataiterator at the position of the datapos object.
3494
3495         const char *lookup_deltalocation(unsigned int *OUTPUT);
3496         my ($location, $medianr) = $datapos->lookup_deltalocation();
3497         location, medianr = datapos.lookup_deltalocation()
3498         location, medianr = datapos.lookup_deltalocation()
3499
3500 Return a tuple containing the on-media location and an optional media number
3501 for a delta rpm. This obviously only works if the data position points to
3502 structure describing a delta rpm.
3503
3504         const char *lookup_deltaseq();
3505         my $seq = $datapos->lookup_deltaseq();
3506         seq = datapos.lookup_deltaseq();
3507         seq = datapos.lookup_deltaseq();
3508
3509 Return the delta rpm sequence from the structure describing a delta rpm.
3510
3511 === DATA RETRIEVAL METHODS ===
3512
3513         const char *lookup_str(Id keyname)
3514         my $string = $datapos->lookup_str($keyname);
3515         string = datapos.lookup_str(keyname)
3516         string = datapos.lookup_str(keyname)
3517
3518         Id lookup_id(Id solvid, Id keyname)
3519         my $id = $datapos->lookup_id($keyname);
3520         id = datapos.lookup_id(keyname)
3521         id = datapos.lookup_id(keyname)
3522
3523         unsigned long long lookup_num(Id keyname, unsigned long long notfound = 0)
3524         my $num = $datapos->lookup_num($keyname);
3525         num = datapos.lookup_num(keyname)
3526         num = datapos.lookup_num(keyname)
3527
3528         bool lookup_void(Id keyname)
3529         my $bool = $datapos->lookup_void($keyname);
3530         bool = datapos.lookup_void(keyname)
3531         bool = datapos.lookup_void(keyname)
3532
3533         Id *lookup_idarray(Id keyname)
3534         my @ids = $datapos->lookup_idarray($keyname);
3535         ids = datapos.lookup_idarray(keyname)
3536         ids = datapos.lookup_idarray(keyname)
3537
3538         Chksum lookup_checksum(Id keyname)
3539         my $chksum = $datapos->lookup_checksum($keyname);
3540         chksum = datapos.lookup_checksum(keyname)
3541         chksum = datapos.lookup_checksum(keyname)
3542
3543 Lookup functions. Note that the returned Ids are always translated into
3544 the Ids of the global pool even if the repodata area contains its own pool.
3545
3546         Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
3547         my $di = $datapos->Dataiterator($keyname, $match, $flags);
3548         di = datapos.Dataiterator(keyname, match, flags)
3549         di = datapos.Dataiterator(keyname, match, flags)
3550
3551         for my $d (@$di)
3552         for d in di:
3553         for d in di
3554
3555 Iterate over the matching data elements. See the Dataiterator class for more
3556 information.
3557
3558 Author
3559 ------
3560 Michael Schroeder <mls@suse.de>
3561
3562 ////
3563 vim: syntax=asciidoc
3564 ////