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