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