document Solver, Problem, Rule, Ruleinfo, Solution, Solutionelement classes
[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 DESCRIPTION
12 -----------
13 bla bla bla
14
15 THE POOL
16 --------
17
18 The pool is libsolv's central resource manager. A pool consists of Solvables,
19 Repositories, Dependencies, each indexed by Ids.
20
21 === CLASS METHODS ===
22
23         Pool *Pool()
24         my $pool = solv::Pool->new();
25         pool = solv.Pool()
26         pool = Solv::Pool.new()
27
28 Create a new pool instance. In most cases you just need
29 one pool.
30
31 === ATTRIBUTES ===
32
33         void *appdata;                  /* read/write */
34         $pool->{'appdata'}
35         pool.appdata
36         pool.appdata
37
38 Application specific data that may be used in any way by the code using the
39 pool.
40
41         Solvable solvables[];           /* read only */
42         my $solvable = $pool->{'solvables'}->[$solvid];
43         solvable = pool.solvables[solvid]
44         solvable = pool.solvables[solvid]
45
46 Look up a Solvable by its id.
47
48         Repo repos[];                   /* read only */
49         my $repo = $pool->{'repos'}->[$repoid];
50         repo = pool.repos[repoid]
51         repo = pool.repos[repoid]
52
53 Look up a Repository by its id.
54
55         Repo *installed;                /* read/write */
56         $pool->{'installed'} = $repo;
57         pool.installed = repo
58         pool.installed = repo
59
60 Define which repository contains all the installed packages.
61
62 === CONSTANTS ===
63
64 *POOL_FLAG_PROMOTEEPOCH*::
65   Promote the epoch of the providing dependency to the requesting
66   dependency if it does not contain an epoch. Used at some time
67   in old rpm versions, modern systems should never need this.
68
69 *POOL_FLAG_FORBIDSELFCONFLICTS*::
70   Disallow the installation of packages that conflict with themselfs.
71   Debian always allowd self-conflicting packages, rpm used to forbid
72   them but switched to also allowing them recently.
73
74 *POOL_FLAG_OBSOLETEUSESPROVIDES*::
75   Make obsolete type dependency match against provides instead of
76   just the name and version of packages. Very old versions of rpm
77   used the name/version, then it got switched to provides and later
78   switched back again to just name/version.
79
80 *POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES*::
81   An implicit obsoletes is the internal mechanism to remove the
82   old package on an update. The default is to remove all packages
83   with the same name, rpm-5 switched to also removing packages
84   providing the same name.
85
86 *POOL_FLAG_OBSOLETEUSESCOLORS*::
87   Rpm's multilib implementation (used in RedHat and Fedora)
88   distinguishes between 32bit and 64bit packages (the terminology
89   is that they have a different color). If obsolteusescolors is
90   set, packages with different colors will not obsolete each other.
91   This is also true for implicit obsoletes, thus you can install
92   both the 32bit and the 64bit version of a package with the
93   same name.
94
95 *POOL_FLAG_NOINSTALLEDOBSOLETES*::
96   New versions of rpm consider the obsoletes of installed packages
97   when checking for dependency, thus you may not install a package
98   that is obsoleted by some other installed package, unless you
99   also deinstall the other package.
100
101 *POOL_FLAG_HAVEDISTEPOCH*::
102   Mandriva added a new field called distepoch that gets checked in
103   version comparison if the epoch/version/release of two packages
104   are the same.
105
106 *POOL_FLAG_NOOBSOLETESMULTIVERSION*::
107   If a package is installed in multiversionmode, rpm used to ignore
108   both the implicit obsoletes and the obsolete dependency of a
109   package. This was changed to ignoring just the implicit obsoletes,
110   thus you may install multiple versions of the same name, but
111   obsoleted packages still get removed.
112
113 *POOL_FLAG_ADDFILEPROVIDESFILTERED*::
114   Make the addfileprovides method only add files from the standard
115   locations (i.e. the ``bin'' and ``etc'' directories). This is
116   useful if you have only few packages that use non-standard file
117   dependencies, but you still wand the fast speed that addfileprovides()
118   generates.
119
120 === METHODS ===
121
122         void free()
123         $pool->free();
124         pool.free()
125         pool.free()
126
127 Free a pool. This is currently done with a method instead of relying on
128 reference counting or garbage collection because it's hard to track every
129 reference to a pool.
130
131         void setdebuglevel(int level)
132         $pool->setdebuglevel($level);
133         pool.setdebuglevel(level)
134         pool.setdebuglevel(level)
135
136 Set the debug level. A value of zero means no debug output, the higher the
137 value, the more output is generated.
138
139         int set_flag(int flag, int value)
140         my $oldvalue = $pool->set_flag($flag, $value);
141         oldvalue = pool.set_flag(flag, value)
142         oldvalue = pool.set_flag(flag, value)
143
144         int get_flag(int flag)
145         my $value = $pool->get_flag($flag);
146         value = pool.get_flag(flag)
147         value = pool.get_flag(flag)
148
149 Set/get a pool specific flag. The flags define how the system works, e.g. how
150 the package manager treats obsoletes. The default flags should be sane for most
151 applications, but in some cases you may want to tweak a flag, for example if
152 you want to solv package dependencies for some other system than yours.
153
154         void set_rootdir(const char *rootdir)
155         $pool->set_rootdir(rootdir);
156         pool.set_rootdir(rootdir)
157         pool.set_rootdir(rootdir)
158
159         const char *get_rootdir()
160         my $rootdir = $pool->get_rootdir();
161         rootdir = pool.get_rootdir()
162         rootdir = pool.get_rootdir()
163
164 Set/get the rootdir to use. This is useful if you want package management
165 to work only in some directory, for example if you want to setup a chroot
166 jail. Note that the rootdir will only be prepended to file paths if the
167 *REPO_USE_ROOTDIR* flag is used.
168
169         void setarch(const char *arch = 0)
170         $pool->setarch();
171         pool.setarch()
172         pool.setarch()
173
174 Set the architecture for your system. The architecture is used to determine
175 which packages are installable. It defaults to the result of ``uname -m''.
176
177         Repo *add_repo(const char *name)
178         $repo = $pool->add_repo($name);
179         repo = pool.add_repo(name)
180         repo = pool.add_repo(name)
181
182 Add a Repository with the specified name to the pool. The reposiory is empty
183 on creation, use the repository methods to populate it with packages.
184
185         Repoiterator *repos_iter()
186         for my $repo (@{$pool->repos_iter()})
187         for repo in pool.repos_iter():
188         for repo in pool.repos_iter()
189
190 Iterate over the existing repositories.
191
192         Solvableiterator *solvables_iter()
193         for my $solvable (@{$pool->solvables_iter()})
194         for solvable in pool.solvables_iter():
195         for solvable in pool.solvables_iter()
196
197 Iterate over the existing solvables.
198
199         Dep *Dep(const char *str, bool create=1)
200         my $dep = $pool->Dep($string);
201         dep = pool.Dep(string)
202         dep = pool.Dep(string)
203
204 Create an object describing a string or dependency. If the string is currently
205 not in the pool and _create_ is false, *undef*/*None*/*nil* is returned.
206
207         void addfileprovides()
208         $pool->addfileprovides();
209         pool.addfileprovides()
210         pool.addfileprovides()
211
212         Queue addfileprovides_queue()
213         my @ids = $pool->addfileprovides_queue();
214         ids = pool.addfileprovides_queue()
215         ids = pool.addfileprovides_queue()
216
217 Some package managers like rpm allow dependencies on files contained in other
218 packages. To allow libsolv to deal with those dependencies in an efficient way,
219 you need to call the addfileprovides method after creating and reading all
220 repositories. This method will scan all dependency for file names and than scan
221 all packages for matching files. If a filename has been matched, it will be
222 added to the provides list of the corresponding package. The
223 addfileprovides_queue variant works the same way but returns an array
224 containing all file dependencies. This information can be stored with the
225 repository to speed up the next usage of the repository.
226
227         void createwhatprovides()
228         $pool->createwhatprovides();
229         pool.createwhatprovides()
230         pool.createwhatprovides()
231
232 Create the internal ``whatprovides'' hash over all of the provides of all
233 packages. This method must be called before doing any lookups on provides.
234 It's encuraged to do it right after all repos are set up, usually right after
235 the call to addfileprovides().
236
237         Queue whatprovides(DepId dep)
238         my @solvables = $pool->whatprovides($dep);
239         solvables = pool.whatprovides(dep)
240         solvables = pool.whatprovides(dep)
241
242 Return all solvables that provide the specified dependency. You can use either
243 a Dep object or an simple Id as argument.
244
245         Queue matchprovidingids(const char *match, int flags)
246         my @ids = $pool->matchprovidingids($match, $flags);
247         ids = pool.matchprovidingids(match, flags)
248         ids = pool.matchprovidingids(match, flags)
249
250 Search the names of all provides and return the ones matching the specified
251 string. See the Dataiterator class for the allowed flags.
252
253         Id towhatprovides(Queue ids)
254         my $offset = $pool->towhatprovides(\@ids);
255         offset = pool.towhatprovides(ids)
256         offset = pool.towhatprovides(ids)
257
258 ``Internalize'' an array containing Ids. The returned value can be used to
259 create solver jobs working on a specific set of packages. See the Solver class
260 for more information.
261
262         bool isknownarch(DepId id)
263         my $bool = $pool->isknownarch($id);
264         bool = pool.isknownarch(id)
265         bool = pool.isknownarch?(id)
266
267 Return true if the specified Id describs a known architecture.
268
269         Solver *Solver()
270         my $solver = $pool->Solver();
271         solver = pool.Solver()
272         solver = pool.Solver()
273
274 Create a new solver object.
275
276         Solver *Job(int how, Id what)
277         my $job = $pool->Job($how, $what);
278         job = pool.Job(how, what)
279         job = pool.Job(how, what)
280
281 Create a new Job object. Kind of low level, in most cases you would use a
282 Selection or Dep job constructor instead.
283
284         Selection *Selection()
285         my $sel = $pool->Selection();
286         sel = pool.Selection()
287         sel = pool.Selection()
288
289 Create an empty selection. Useful as a starting point for merging other
290 selections.
291
292         Selection *Selection_all()
293         my $sel = $pool->Selection_all();
294         sel = pool.Selection_all()
295         sel = pool.Selection_all()
296         
297 Create a selection containing all packages. Useful as starting point for
298 intersecting other selections or for update/distupgrade jobs.
299
300         Selection *select(const char *name, int flags)
301         my $sel = $pool->select($name, $flags);
302         sel = pool.select(name, flags)
303         sel = pool.select(name, flags)
304
305 Create a selection by matching packages against the specified string. See the
306 Selection class for a list of flags and how to create solver jobs from a
307 selection.
308
309         void setpooljobs(Jobs *jobs)
310         $pool->setpooljobs(\@jobs);
311         pool.setpooljobs(jobs)
312         pool.setpooljobs(jobs)
313
314         Jobs *getpooljobs()
315         @jobs = $pool->getpooljobs();
316         jobs = pool.getpooljobs()
317         jobs = pool.getpooljobs()
318
319 Get/Set fixed jobs stored in the pool. Those jobs are automatically appended to
320 all solver jobs, they are meant for fixed configurations like which packages
321 can be multiversion installed, which packages were userinstalled or must not be
322 erased.
323
324         void set_loadcallback(Callable *callback)
325         $pool->setloadcallback(\&callbackfunction);
326         pool.setloadcallback(callbackfunction)
327         pool.setloadcallback { |repodata| ... }
328
329 Set the callback function called when repository metadata needs to be loaded on
330 demand. To make use of this feature, you need to create repodata stubs that
331 tell the library which data is available but not loaded. If later on the data
332 needs to be accessed, the callback function is called with a repodata argument.
333 You can then load the data (maybe fetching it first from an remote server).
334 The callback should return true if the data has been made available.
335
336 === DATA RETRIEVAL METHODS ===
337
338 In the following functions, the _keyname_ argument describes what to retrive.
339 For the standard cases you can use the available Id constants. For example,
340
341         $solv::SOLVABLE_SUMMARY
342         solv.SOLVABLE_SUMMARY
343         Solv::SOLVABLE_SUMMARY
344
345 selects the ``Summary'' entry of a solvable. The _solvid_ argument selects the
346 desired solvable by Id.
347
348         const char *lookup_str(Id solvid, Id keyname)
349         my $string = $pool->lookup_str($solvid, $keyname);
350         string = pool.lookup_str(solvid, keyname)
351         string = pool.lookup_str(solvid, keyname)
352
353         Id lookup_id(Id solvid, Id keyname)
354         my $id = $pool->lookup_id($solvid, $keyname);
355         id = pool.lookup_id(solvid, keyname)
356         id = pool.lookup_id(solvid, keyname)
357
358         unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
359         my $num = $pool->lookup_num($solvid, $keyname);
360         num = pool.lookup_num(solvid, keyname)
361         num = pool.lookup_num(solvid, keyname)
362
363         bool lookup_void(Id solvid, Id keyname)
364         my $bool = $pool->lookup_void($solvid, $keyname);
365         bool = pool.lookup_void(solvid, keyname)
366         bool = pool.lookup_void(solvid, keyname)
367
368         Queue lookup_idarray(Id solvid, Id keyname)
369         my @ids = $pool->lookup_idarray($solvid, $keyname);
370         ids = pool.lookup_idarray(solvid, keyname)
371         ids = pool.lookup_idarray(solvid, keyname)
372
373         Chksum *lookup_checksum(Id solvid, Id keyname)
374         my $chksum = $pool->lookup_checksum($solvid, $keyname);
375         chksum = pool.lookup_checksum(solvid, keyname)
376         chksum = pool.lookup_checksum(solvid, keyname)
377
378 Lookup functions. Return the data element stored in the specified solvable.
379 You should probably use the methods of the Solvable class instead.
380
381         Dataiterator *Dataiterator(Id solvid, Id keyname, const char *match, int flags)
382         my $di = $pool->Dataiterator($solvid, $keyname, $match, $flags);
383         di = pool.Dataiterator(solvid, keyname, match, flags)
384         di = pool.Dataiterator(solvid, keyname, match, flags)
385
386         for my $d (@$di)
387         for d in di:
388         for d in di
389
390 Iterate over the matching data elements. See the Dataiterator class for more
391 information.
392
393 === ID METHODS ===
394
395 The following methods deal with Ids, i.e. integers representing objects in the
396 pool. They are considered ``low level'', in most cases you would not use them
397 but instead the object orientated methods.
398
399         Repo *id2repo(Id id)
400         $repo = $pool->id2repo($id);
401         repo = pool.id2repo(id)
402         repo = pool.id2repo(id)
403
404 Lookup an existing Repository by id. You can also do this by using the *repos*
405 attribute.
406
407         Solvable *id2solvable(Id id)
408         $solvable = $pool->id2solvable($id);
409         solvable = pool.id2solvable(id)
410         solvable = pool.id2solvable(id)
411
412 Lookup an existing Repository by id. You can also do this by using the
413 *solvables* attribute.
414
415         const char *solvid2str(Id id)
416         my $str = $pool->solvid2str($id);
417         str = pool.solvid2str(id)
418         str = pool.solvid2str(id)
419
420 Return a string describing the Solvable with the specified id. The string
421 consists of the name, version, and architecture of the Solvable.
422
423         Id str2id(const char *str, bool create=1)
424         my $id = pool->str2id($string);
425         id = pool.str2id(string)
426         id = pool.str2id(string)
427
428         const char *id2str(Id id)
429         $string = pool->id2str($id);
430         string = pool.id2str(id)
431         string = pool.id2str(id)
432
433 Convert a string into an Id and back. If the string is currently not in the
434 pool and _create_ is false, zero is returned.
435
436         Id rel2id(Id name, Id evr, int flags, bool create=1)
437         my $id = pool->rel2id($nameid, $evrid, $flags);
438         id = pool.rel2id(nameid, evrid, flags)
439         id = pool.rel2id(nameid, evrid, flags)
440
441 Create a ``relational'' dependency. Such dependencies consist of a name part,
442 the _flags_ describing the relation, and a version part. The flags are:
443
444         $solv::REL_EQ | $solv::REL_GT | $solv::REL_LT
445         solv.REL_EQ | solv.REL_GT | solv.REL_LT
446         Solv::REL_EQ | Solv::REL_GT | Solv::REL_LT
447
448 Thus, if you want a ``\<='' relation, you would use *REL_LT | REL_EQ*.
449
450         Id id2langid(Id id, const char *lang, bool create=1)
451         my $id = $pool->id2langid($id, $language);
452         id = pool.id2langid(id, language)
453         id = pool.id2langid(id, language)
454
455 Create a language specific Id from some other id. This function simply converts
456 the id into a string, appends a dot and the specified language to the string
457 and converts the result back into an Id.
458
459         const char *dep2str(Id id)
460         $string = pool->dep2str($id);
461         string = pool.dep2str(id)
462         string = pool.dep2str(id)
463
464 Convert a dependency id into a string. If the id is just a string, this
465 function has the same effect as id2str(). For relational dependencies, the
466 result is the correct ``name relation evr'' string.
467
468
469 THE DEPENDENCY CLASS
470 --------------------
471 The dependency class is an object orientated way to work with strings and
472 dependencies. Internally, dependencies are represented as Ids, i.e. simple
473 numbers. Dependency objects can be constructed by using the Pool's Dep()
474 method.
475
476 === ATTRIBUTES ===
477
478         Pool *pool;             /* read only */
479         $dep->{'pool'}
480         dep.pool
481         dep.pool
482
483 Back reference to the pool this dependency belongs to.
484
485         Id id;          /* read only */
486         $dep->{'id'}
487         dep.id
488         dep.id
489
490 The id of this dependency.
491
492 == Methods ==
493
494         Dep *Rel(int flags, DepId evrid, bool create=1)
495         my $reldep = $dep->Rel($flags, $evrdep);
496         reldep = dep.Rel(flags, evrdep)
497         reldep = dep.Rel(flags, evrdep)
498
499 Create a relational dependency from to string dependencies and a flags
500 argument. See the pool's rel2id method for a description of the flags.
501
502         Selection *Selection_name(int setflags = 0)
503         my $sel = $dep->Selection_name();
504         sel = dep.Selection_name()
505         sel = dep.Selection_name()
506
507 Create a Selection from a dependency. The selection consists of all packages
508 that have a name equal to the dependency. If the dependency is of a relational
509 type, the packages version must also fulfill the dependency.
510
511         Selection *Selection_provides(int setflags = 0)
512         my $sel = $dep->Selection_provides();
513         sel = dep.Selection_provides()
514         sel = dep.Selection_provides()
515
516 Create a Selection from a dependency. The selection consists of all packages
517 that have at least one provides matching the dependency.
518
519         const char *str()
520         my $str = $dep->str();
521         str = $dep.str()
522         str = $dep.str()
523
524 Return a string describing the dependency.
525
526         <stringification>
527         my $str = "$dep";
528         str = str(dep)
529         str = dep.to_s
530
531 Same as calling the str() method.
532
533         <equality>
534         if ($dep1 == $dep2)
535         if dep1 == dep2:
536         if dep1 == dep2
537
538 The dependencies are equal if they are part of the same pool and have the same
539 ids.
540
541 THE REPOSITORY CLASS
542 --------------------
543 A Repository describes a group of packages, normally comming from the same
544 source. Repositories are created by the Pool's add_repo() method.
545
546 === ATTRIBUTES ===
547
548         Pool *pool;                     /* read only */
549         $repo->{'pool'}
550         repo.pool
551         repo.pool
552
553 Back reference to the pool this dependency belongs to.
554
555         Id id;                          /* read only */
556         $repo->{'id'}
557         repo.id
558         repo.id
559
560 The id of the repository.
561
562         const char *name;               /* read/write */
563         $repo->{'name'}
564         repo.name
565         repo.name
566         
567 The repositories name. To libsolv, the name is just a string with no specific
568 meaning.
569
570         int prioprity;                  /* read/write */
571         $repo->{'priority'}
572         repo.priority
573         repo.priority
574
575 The priority of the repository. A higher number means that packages of this
576 repository will be chosen over other repositories, even if they have a greater
577 package version.
578
579         int subprioprity;               /* read/write */
580         $repo->{'subpriority'}
581         repo.subpriority
582         repo.subpriority
583
584 The sub-priority of the repository. This value is compared when the priorities
585 of two repositories are the same. It is useful to make the library prefer
586 on-disk repositories to remote ones.
587
588         int nsolvables;                 /* read only */
589         $repo->{'nsolvables'}
590         repo.nsolvables
591         repo.nsolvables
592
593 The number of solvables in this repository.
594
595         void *appdata;                  /* read/write */
596         $repo->{'appdata'}
597         repo.appdata
598         repo.appdata
599
600 Application specific data that may be used in any way by the code using the
601 repository.
602
603         Datapos *meta;                  /* read only */
604         $repo->{'meta'}
605         repo.meta
606         repo.meta
607
608 Return a Datapos object of the repodata's metadata. You can use the lookup
609 methods of the Datapos class to lookup metadata attributes, like the repository
610 timestamp.
611
612 === CONSTANTS ===
613
614 *REPO_REUSE_REPODATA*::
615   Reuse the last repository data aera (``repodata'') instead of creating a new
616   one.
617
618 *REPO_NO_INTERNALIZE*::
619   Do not internalize the added repository data. This is useful if
620   you plan to add more data because internalization is a costly
621   operation.
622
623 *REPO_LOCALPOOL*::
624   Use the repodata's pool for Id storage instead of the global pool. Useful
625   if you don't want to pollute the global pool with many unneeded ids, like
626   when storing the filelist.
627
628 *REPO_USE_LOADING*::
629   Use the repodata that is currently being loaded instead of creating a new one.
630   This only makes sense if used in a load callback.
631
632 *REPO_EXTEND_SOLVABLES*::
633   Do not create new solvables for the new data, but match existing solvables and
634   add the data to them. Repository metadata is often split into multiple parts,
635   with one primary file describing all packages and other parts holding
636   information that is normally not needed, like the changelog.
637
638 *REPO_USE_ROOTDIR*::
639   Prepend the pool's rootdir to the path when doing file operations.
640
641 *REPO_NO_LOCATION*::
642   Do not add a location element to the solvables. Useful if the solvables are
643   not in the final position, so you can add the correct location later in your code.
644
645 *SOLV_ADD_NO_STUBS*::
646   Do not create stubs for repository parts that can be downloaded on demand.
647
648 *SUSETAGS_RECORD_SHARES*::
649   This is specific to the add_susetags() method. Susetags allows to refer to already
650   read packages to save disk space. If this data sharing needs to work over multiple
651   calls to add_susetags, you need to specify this flag so that the share information
652   is made available to subsequent calls.
653
654 === METHODS ===
655
656         void free(bool reuseids = 0)
657         $repo->free();
658         repo.free()
659         repo.free()
660
661 Free the repository and all solvables it contains. If _reuseids_ is set to
662 true, the solvable ids and the repository id may be reused by the library when
663 added new solvables. Thus you should leave it false if you are not sure that
664 somebody holds a reference.
665
666         void empty(bool reuseids = 0)
667         $repo->empty();
668         repo.empty()
669         repo.empty()
670
671 Free all the solvables in a repository. The repository will be empty after this
672 call. See the free() method for the meaning of _reuseids_.
673
674         bool isempty()
675         $repo->isempty()
676         repo.empty()
677         repo.empty?
678
679 Return true if there are no solvables in this repository.
680
681         void internalize()
682         $repo->internalize();
683         repo.internalize()
684         repo.internalize()
685
686 Internalize added data. Data must be internalized before it is available to the
687 lookup and data iterator functions.
688
689         bool write(FILE *fp)
690         $repo->write($fp)
691         repo.write(fp)
692         repo.write(fp)
693
694 Write a repo as a ``solv'' file. These files can be read very fast and thus are
695 a good way to cache repository data. Returns false if there was some error
696 writing the file.
697
698         Solvableiterator *solvables_iter()
699         for my $solvable (@{$repo->solvables_iter()})
700         for solvable in repo.solvables_iter():
701         for solvable in repo.solvables_iter()
702
703 Iterate over all solvables in a repository.
704
705         Repodata *add_repodata(int flags = 0)
706         my $repodata = $repo->add_repodata();
707         repodata = repo.add_repodata()
708         repodata = repo.add_repodata()
709
710 Add a new repodata area to the repository. This is normally automatically
711 done by the repo_add methods, so you need this method only in very
712 rare circumstances.
713
714         void create_stubs()
715         $repo->create_stubs();
716         repo.create_stubs()
717         repo.create_stubs()
718
719 Calls the create_stubs() repodata method for the last repodata of the
720 repository.
721
722         bool iscontiguous()
723         $repo->iscontiguous()
724         repo.iscontiguous()
725         repo.iscontiguous?
726
727 Return true if the solvables of this repository are all in a single block with
728 no holes, i.e. they have consecutive ids.
729
730         Repodata *first_repodata()
731         my $repodata = $repo->first_repodata();
732         repodata = repo.first_repodata()
733         repodata = repo.first_repodata()
734
735 Checks if all repodatas but the first repodata are extensions, and return the
736 first repodata if this is the case. Useful if you want to do a store/retrive
737 sequence on the repository to reduce the memory using and enable paging, as
738 this does not work if the rpository contains multiple non-extension repodata
739 areas.
740
741         Selection *Selection(int setflags = 0)
742         my $sel = $repo->Selection();
743         sel = repo.Selection()
744         sel = repo.Selection()
745
746 Create a Selection consisting of all packages in the repository.
747
748         Dataiterator *Dataiterator(Id p, Id key, const char *match, int flags)
749         my $di = $repo->Dataiterator($solvid, $keyname, $match, $flags);
750         di = repo.Dataiterator(solvid, keyname, match, flags)
751         di = repo.Dataiterator(solvid, keyname, match, flags)
752
753         for my $d (@$di)
754         for d in di:
755         for d in di
756
757 Iterate over the matching data elements in this repository. See the
758 Dataiterator class for more information.
759
760         <stringification>
761         my $str = "$repo";
762         str = str(repo)
763         str = repo.to_s
764
765 Return the name of the repository, or "Repo#<id>" if no name is set.
766
767         <equality>
768         if ($repo1 == $repo2)
769         if repo1 == repo2:
770         if repo1 == repo2
771
772 Two repositories are equal if they belong to the same pool and have the same id.
773
774 === DATA ADD METHODS ===
775
776         Solvable *add_solvable()
777         $repo->add_solvable();
778         repo.add_solvable()
779         repo.add_solvable()
780
781 Add a single empty solvable to the repository. Returns a Solvable object, see
782 the Solvable class for more information.
783
784         bool add_solv(const char *name, int flags = 0)
785         $repo->add_solv($name, $flags);
786         repo.add_solv(name, flags)
787         repo.add_solv(name, flags)
788
789         bool add_solv(FILE *fp, int flags = 0)
790         $repo->add_solv($fp, $flags);
791         repo.add_solv(fp, flags)
792         repo.add_solv(fp, flags)
793
794 Read a ``solv'' file and add its contents to the repository. These files can be
795 written with the write() method and are normally used as fast cache for
796 repository metadata.
797
798         bool add_rpmdb(int flags = 0)
799         $repo->add_rpmdb($flags);
800         repo.add_rpmdb(flags)
801         repo.add_rpmdb(flags)
802
803         bool add_rpmdb_reffp(FILE *reffp, int flags = 0)
804         $repo->add_rpmdb_reffp($reffp, $flags);
805         repo.add_rpmdb_reffp($reffp, flags)
806         repo.add_rpmdb_reffp($reffp, flags)
807
808 Add the contents of the rpm database to the repository. If a solv file
809 containing an old version of the database is available, it can be passed as
810 reffp to speed up reading.
811
812         bool add_rpm(const char *name, int flags = 0)
813         $repo->add_rpm($name, $flags);
814         repo.add_rpm(name, flags)
815         repo.add_rpm(name, flags)
816
817 Add the metadata of a single rpm package to the repository.
818
819         bool add_rpmdb_pubkeys(int flags = 0)
820         $repo->add_rpmdb_pubkeys();
821         repo.add_rpmdb_pubkeys()
822         repo.add_rpmdb_pubkeys()
823
824 Add all pubkeys contained in the rpm database to the repository. Note that
825 newer rpm versions also allow to store the pubkeys in some directory instead
826 of the rpm database.
827
828         bool add_pubkey(const char *keyfile, int flags = 0)
829         $repo->add_pubkey($keyfile);
830         repo.add_pubkey($keyfile)
831         repo.add_pubkey($keyfile)
832
833 Add a pubkey from a file to the repository.
834
835         bool add_rpmmd(FILE *fp, const char *language, int flags = 0)
836         $repo->add_rpmmd($fp, $language);
837         repo.add_rpmmd(fp, language)
838         repo.add_rpmmd(fp, language)
839
840 Add metadata stored in the "rpm-md" format (i.e. from files in the ``repodata''
841 directory) to a repository. Supported files are "primary", "filelists",
842 "other", "suseinfo". Do not forget to specify the *REPO_EXTEND_SOLVABLES* for
843 extension files like "filelists" and "other". Use the _language_ parameter if
844 you have language extension files, otherwise simply use a *undef*/*None*/*nil*
845 parameter.
846
847         bool add_repomdxml(FILE *fp, int flags = 0)
848         $repo->add_repomdxml($fp);
849         repo.add_repomdxml(fp)
850         repo.add_repomdxml(fp)
851
852 Add the repomd.xml meta description from the "rpm-md" format to the repository.
853 This file contains information about the repository like keywords, and also a
854 list of all database files with checksums. The data is added the the "meta"
855 section of the repository, i.e. no package gets created.
856
857         bool add_updateinfoxml(FILE *fp, int flags = 0)
858         $repo->add_updateinfoxml($fp);
859         repo.add_updateinfoxml(fp)
860         repo.add_updateinfoxml(fp)
861
862 Add the updateinfo.xml file containing available maintenance updates to the
863 repository. All updates are created as special packages that have a "patch:"
864 prefix in their name.
865
866         bool add_deltainfoxml(FILE *fp, int flags = 0)
867         $repo->add_deltainfoxml($fp);
868         repo.add_deltainfoxml(fp)
869         repo.add_deltainfoxml(fp)
870
871 Add the deltainfo.xml file (also called prestodelta.xml) containing available
872 delta-rpms to the repository. The data is added to the "meta" section, i.e. no
873 package gets created.
874
875         bool add_debdb(int flags = 0)
876         $repo->add_debdb();
877         repo.add_debdb()
878         repo.add_debdb()
879
880 Add the contents of the debian installed package database to the repository.
881
882         bool add_debpackages(FILE *fp, int flags = 0)
883         $repo->add_debpackages($fp);
884         repo.add_debpackages($fp)
885         repo.add_debpackages($fp)
886
887 Add the contents of the debian repository metadata (the "packages" file)
888 to the repository.
889
890         bool add_deb(const char *filename, int flags = 0)
891         $repo->add_deb($filename);
892         repo.add_deb(filename)
893         repo.add_deb(filename)
894
895 Add the metadata of a single deb package to the repository.
896
897         bool add_mdk(FILE *fp, int flags = 0)
898         $repo->add_mdk($fp);
899         repo.add_mdk($fp)
900         repo.add_mdk($fp)
901
902 Add the contents of the mageia/mandriva repository metadata (the
903 "synthesis.hdlist" file) to the repository.
904
905         bool add_mdk_info(FILE *fp, int flags = 0)
906         $repo->add_mdk($fp);
907         repo.add_mdk($fp)
908         repo.add_mdk($fp)
909
910 Extend the packages from the synthesis file with the info.xml and files.xml
911 data. Do not forget to specify *REPO_EXTEND_SOLVABLES*.
912
913         bool add_arch_repo(FILE *fp, int flags = 0)
914         $repo->add_arch_repo($fp);
915         repo.add_arch_repo($fp)
916         repo.add_arch_repo($fp)
917
918 Add the contents of the archlinux repository metadata (the ".db.tar" file) to
919 the repository.
920
921         bool add_arch_local(const char *dir, int flags = 0)
922         $repo->add_arch_local($dir);
923         repo.add_arch_local($dir)
924         repo.add_arch_local($dir)
925
926 Add the contents of the archlinux installed package database to the repository.
927 The _dir_ parameter is usually set to "/var/lib/pacman/local".
928
929         bool add_content(FILE *fp, int flags = 0)
930         $repo->add_content($fp);
931         repo.add_content(fp)
932         repo.add_content(fp)
933
934 Add the ``content'' meta description from the susetags format to the repository.
935 This file contains information about the repository like keywords, and also
936 a list of all database files with checksums. The data is added the the "meta"
937 section of the repository, i.e. no package gets created.
938
939         bool add_susetags(FILE *fp, Id defvendor, const char *language, int flags = 0)
940         $repo->add_susetags($fp, $defvendor, $language);
941         repo.add_susetags(fp, defvendor, language)
942         repo.add_susetags(fp, defvendor, language)
943
944 Add repository metadata in the susetags format to the repository. Like with
945 add_rpmmd, you can specify a language if you have language extension files. The
946 _defvendor_ parameter provides a default vendor for packages with missing
947 vendors, it is usually provided in the content file.
948
949         bool add_products(const char *dir, int flags = 0)
950         $repo->add_products($dir);
951         repo.add_products(dir)
952         repo.add_products(dir)
953
954 Add the installed SUSE products database to the repository. The _dir_ parameter
955 is usually "/etc/products.d".
956
957
958 THE SOLVABLE CLASS
959 ------------------
960 A solvable describes all the information of one package. Each solvable belongs to
961 one repository, it can be added and filled manually but in most cases solvables
962 will get created by the repo_add methods.
963
964 === ATTRIBUTES ===
965
966         Repo *repo;                     /* read only */
967         $solvable->{'repo'}
968         solvable.repo
969         solvable.repo
970
971 The repository this solvable belongs to.
972
973         Pool *pool;                     /* read only */
974         $solvable->{'pool'}
975         solvable.pool
976         solvable.pool
977
978 The pool this solvable belongs to, same as the pool of the repo.
979
980         Id id;                          /* read only */
981         $solvable->{'id'}
982         solvable.id
983         solvable.id
984
985 The specific id of the solvable.
986
987         char *name;                     /* read/write */
988         $solvable->{'name'}
989         solvable.name
990         solvable.name
991
992         char *evr;                      /* read/write */
993         $solvable->{'evr'}
994         solvable.evr
995         solvable.evr
996
997         char *arch;                     /* read/write */
998         $solvable->{'arch'}
999         solvable.arch
1000         solvable.arch
1001
1002         char *vendor;                   /* read/write */
1003         $solvable->{'vendor'}
1004         solvable.vendor
1005         solvable.vendor
1006
1007 Easy access to often used attributes of solvables. They are
1008 internally stored as Ids.
1009
1010         Id nameid;                      /* read/write */
1011         $solvable->{'nameid'}
1012         solvable.nameid
1013         solvable.nameid
1014
1015         Id evrid;                       /* read/write */
1016         $solvable->{'evrid'}
1017         solvable.evrid
1018         solvable.evrid
1019
1020         Id archid;                      /* read/write */
1021         $solvable->{'archid'}
1022         solvable.archid
1023         solvable.archid
1024
1025         Id vendorid;                    /* read/write */
1026         $solvable->{'vendorid'}
1027         solvable.vendorid
1028         solvable.vendorid
1029
1030 Raw interface to the ids. Useful if you want to search for
1031 a specific id and want to avoid the string compare overhead.
1032
1033 === METHODS ===
1034
1035         const char *lookup_str(Id keyname)
1036         my $string = $solvable->lookup_str($keyname);
1037         string = solvable.lookup_str(keyname)
1038         string = solvable.lookup_str(keyname)
1039
1040         Id lookup_id(Id keyname)
1041         my $id = $solvable->lookup_id($keyname);
1042         id = solvable.lookup_id(solvid)
1043         id = solvable.lookup_id(solvid)
1044
1045         unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
1046         my $num = $solvable->lookup_num($keyname);
1047         num = solvable.lookup_num(keyname)
1048         num = solvable.lookup_num(keyname)
1049
1050         bool lookup_void(Id keyname)
1051         my $bool = $solvable->lookup_void($keyname);
1052         bool = solvable.lookup_void(keyname)
1053         bool = solvable.lookup_void(keyname)
1054
1055         Chksum *lookup_checksum(Id keyname)
1056         my $chksum = $solvable->lookup_checksum($keyname);
1057         chksum = solvable.lookup_checksum(keyname)
1058         chksum = solvable.lookup_checksum(keyname)
1059
1060         Queue lookup_idarray(Id keyname, Id marker = -1)
1061         my @ids = $solvable->lookup_idarray($keyname);
1062         ids = solvable.lookup_idarray(keyname)
1063         ids = solvable.lookup_idarray(keyname)
1064
1065         Queue lookup_deparray(Id keyname, Id marker = -1)
1066         my @deps = $solvable->lookup_deparray($keyname);
1067         deps = solvable.lookup_deparray(keyname)
1068         deps = solvable.lookup_deparray(keyname)
1069         
1070 Generic lookup methods. Retrieve data stored for the specific keyname.
1071 The lookup_idarray() method will return an array of Ids, use
1072 lookup_deparray if you want an array of Dependency objects instead.
1073 Some Id arrays contain two parts of data divided by a specific marker,
1074 for example the provides array uses the SOLVABLE_FILEMARKER id to
1075 store both the ids provided by the package and the ids added by
1076 the addfileprovides method. The default, -1, translates to the
1077 correct marker for the keyname and returns the first part of the
1078 array, use 1 to select the second part or 0 to retrive all ids
1079 including the marker.
1080
1081         const char *lookup_location(unsigned int *OUTPUT);
1082         my ($location, $medianr) = $solvable->lookup_location();
1083         location, medianr = solvable.lookup_location()
1084         location, medianr = solvable.lookup_location()
1085
1086 Return a tuple containing the on-media location and an optional
1087 media number for multi-part repositories (e.g. repositories
1088 spawning multiple DVDs).
1089
1090         void add_deparray(Id keyname, DepId dep, Id marker = -1);
1091         $solvable->add_deparray($keyname, $dep);
1092         solvable.add_deparray(keyname, dep)
1093         solvable.add_deparray(keyname, dep)
1094
1095 Add a new dependency to the attributes stored in keyname.
1096
1097         bool installable();
1098         $solvable->installable()
1099         solvable.installable()
1100         solvable.installable?
1101
1102 Return true if the solvable is installable on the system. Solvables
1103 are not installable if the system does not support their architecture.
1104
1105         bool isinstalled();
1106         $solvable->isinstalled()
1107         solvable.isinstalled()
1108         solvable.isinstalled?
1109
1110 Return true if the solvable is installed on the system.
1111
1112         Selection *Selection(int setflags = 0)
1113         my $sel = $solvable->Selection();
1114         sel = solvable.Selection()
1115         sel = solvable.Selection()
1116
1117 Create a Selection containing just the single solvable.
1118
1119         const char *str()
1120         my $str = $solvable->str();
1121         str = $solvable.str()
1122         str = $solvable.str()
1123
1124 Return a string describing the solvable. The string consists of the name,
1125 version, and architecture of the Solvable.
1126
1127         <stringification>
1128         my $str = "$solvable";
1129         str = str(solvable)
1130         str = solvable.to_s
1131
1132 Same as calling the str() method.
1133
1134         <equality>
1135         if ($solvable1 == $solvable2)
1136         if solvable1 == solvable2:
1137         if solvable1 == solvable2
1138
1139 Two solvables are equal if they are part of the same pool and have the same
1140 ids.
1141
1142 THE DATAITERATOR CLASS
1143 ----------------------
1144
1145 Dataiterators can be used to do complex string searches or
1146 to iterate over arrays. They can be created via the
1147 constructors in the Pool, Repo, and Solvable classes. The
1148 Repo and Solvable constructors will limit the search to
1149 the repository or the specific package.
1150
1151 === CONSTANTS ===
1152
1153 *SEARCH_STRING*::
1154   Return a match if the search string matches the value.
1155
1156 *SEARCH_STRINGSTART*::
1157   Return a match if the value starts with the search string.
1158
1159 *SEARCH_STRINGEND*::
1160   Return a match if the value ends with the search string.
1161
1162 *SEARCH_SUBSTRING*::
1163   Return a match if the search string can be matched somewhere
1164   in the value.
1165
1166 *SEARCH_GLOB*::
1167   Do a glob match of the search string against the value.
1168
1169 *SEARCH_REGEX*::
1170   Do a regular expression match of the search string against
1171   the value.
1172
1173 *SEARCH_NOCASE*::
1174   Ignore case when matching strings. Works for all the above
1175   match types.
1176
1177 *SEARCH_FILES*::
1178   Match the complete filenames of the file list, not just the
1179   base name.
1180
1181 *SEARCH_COMPLETE_FILELIST*::
1182   When matching the file list, check every file of the package
1183   not just the subset from the primary metadata.
1184
1185 *SEARCH_CHECKSUMS*::
1186   Allow the matching of checksum entries.
1187
1188 === METHODS ===
1189
1190         void prepend_keyname(Id keyname);
1191         $di->prepend_keyname($keyname);
1192         di.prepend_keyname(keyname)
1193         di.prepend_keyname(keyname)
1194
1195 Do a sub-search in the array stored in keyname.
1196
1197         void skip_solvable();
1198         $di->kip_solvable();
1199         di.skip_solvable()
1200         di.skip_solvable()
1201
1202 Stop matching the current solvable and advance to the next
1203 one.
1204
1205         <iteration>
1206         for my $d (@$di)
1207         for d in di:
1208         for d in di
1209
1210 Iterate through the matches. If there is a match, the object
1211 in d will be of type Datamatch.
1212
1213 THE DATAMATCH CLASS
1214 -------------------
1215 Objects of this type will be created for every value matched
1216 by a dataiterator.
1217
1218 === ATTRIBUTES ===
1219
1220         Pool *pool;                             /* read only */
1221         $d->{'pool'}
1222         d.pool
1223         d.pool
1224
1225 Back pointer to pool.
1226
1227         Repo *repo;                             /* read only */
1228         $d->{'repo'}
1229         d.repo
1230         d.repo
1231
1232 The repository containing the matched object.
1233
1234         Solvable *solvable;                     /* read only */
1235         $d->{'solvable'}
1236         d.solvable
1237         d.solvable
1238
1239 The solvable containing the value that was matched.
1240
1241         Id solvid;                              /* read only */
1242         $d->{'solvid'}
1243         d.solvid
1244         d.solvid
1245
1246 The id of the solvable that matched.
1247
1248 === METHODS ===
1249
1250         Id key_id();
1251         $d->key_id()
1252         d.key_id()
1253         d.key_id()
1254
1255         const char *key_idstr();
1256         $d->key_idstr()
1257         d.key_idstr()
1258         d.key_idstr()
1259
1260 The keyname that matched, either as id or string.
1261
1262         Id type_id();
1263         $d->type_id()
1264         d.type_id()
1265         d.type_id()
1266
1267         const char *type_idstr();
1268         $d->type_idstr();
1269         d.type_idstr()
1270         d.type_idstr()
1271
1272 The key type of the value that was matched, either as id or string.
1273
1274         Id id();
1275         $d->id()
1276         d.id()
1277         d.id()
1278
1279         Id idstr();
1280         $d->idstr()
1281         d.idstr()
1282         d.idstr()
1283
1284 The Id of the value that was matched (only valid for id types),
1285 either as id or string.
1286
1287         const char *str();
1288         $d->str()
1289         d.str()
1290         d.str()
1291
1292 The string value that was matched (only valid for string types).
1293
1294         unsigned long long num();
1295         $d->num()
1296         d.num()
1297         d.num()
1298
1299 The numeric value that was matched (only valid for numeric types).
1300
1301         unsigned int num2();
1302         $d->num2()
1303         d.num2()
1304         d.num2()
1305
1306 The secondary numeric value that was matched (only valid for types
1307 containing two values).
1308
1309         Datapos *pos();
1310         my $pos = $d->pos();
1311         pos = d.pos()
1312         pos = d.pos()
1313
1314 The position object of the current match. It can be used to do
1315 sub-searches starting at the match (if it is of an array type).
1316 See the Datapos class for more information.
1317
1318         Datapos *parentpos();
1319         my $pos = $d->parentpos();
1320         pos = d.parentpos()
1321         pos = d.parentpos()
1322
1323 The position object of the array containing the current match.
1324 It can be used to do sub-searches, see the Datapos class for more
1325 information.
1326
1327         <stringification>
1328         my $str = "$d";
1329         str = str(d)
1330         str = d.to_s
1331
1332 Return the stringification of the matched value. Stringification
1333 depends on the search flags, for file list entries it will return
1334 just the base name unless SEARCH_FILES is used, for checksums
1335 it will return an empty string unless SEARCH_CHECKSUMS is used.
1336 Numeric values are currently stringified to an empty string.
1337
1338
1339 THE SELECTION CLASS
1340 -------------------
1341 Selections are a way to easily deal with sets of packages.
1342 There are multiple constructors to create them, the most useful
1343 is probably the select() method in the Pool class.
1344
1345 === CONSTANTS ===
1346
1347 *SELECTION_NAME*::
1348   Create the selection by matching package names
1349
1350 *SELECTION_PROVIDES*::
1351   Create the selection by matching package provides
1352
1353 *SELECTION_FILELIST*::
1354   Create the selection by matching package files
1355
1356 *SELECTION_CANON*::
1357   Create the selection by matching the canonical representation
1358   of the package. This is normally a combination of the name,
1359   the version, and the architecture of a package.
1360
1361 *SELECTION_DOTARCH*::
1362   Allow an ``.<architecture>'' suffix when matching names or
1363   provides.
1364  
1365 *SELECTION_REL*::
1366   Allow the specification of a relation when matching names
1367   or provides, e.g. "name >= 1.2".
1368
1369 *SELECTION_INSTALLED_ONLY*::
1370   Limit the package search to installed packages.
1371
1372 *SELECTION_SOURCE_ONLY*::
1373   Limit the package search to source packages only.
1374
1375 *SELECTION_WITH_SOURCE*::
1376   Extend the package search to also match source packages. The
1377   default is only to match binary packages.
1378
1379 *SELECTION_GLOB*::
1380   Allow glob matching for package names, package provides, and
1381   file names.
1382
1383 *SELECTION_NOCASE*::
1384   Ignore case when matching package names, package provides,
1385   and file names.
1386
1387 *SELECTION_FLAT*::
1388   Return only one selection element describing the selected packages.
1389   The default is to create multiple elements for all globbed packages.
1390   Multiple elements are useful if you want to turn the selection into
1391   an install job, in that case you want an install job for every
1392   globbed package.
1393
1394 === ATTRIBUTES ===
1395
1396         Pool *pool;                             /* read only */
1397         $d->{'pool'}
1398         d.pool
1399         d.pool
1400
1401 Back pointer to pool.
1402
1403 === METHODS ===
1404
1405         int flags();
1406         my $flags = $sel->flags();
1407         flags = sel.flags()
1408         flags = sel.flags()
1409
1410 Return the result flags of the selection. The flags are a subset
1411 of the ones used when creating the selection, they describe which
1412 method was used to get the result. For example, if you create the
1413 selection with ``SELECTION_NAME | SELECTION_PROVIDES'', the resulting
1414 flags will either be SELECTION_NAME or SELECTION_PROVIDES depending
1415 if there was a package that matched the name or not. If there was
1416 no match at all, the flags will be zero.
1417
1418         bool isempty();
1419         $sel->isempty()
1420         sel.isempty()
1421         sel.isempty?
1422
1423 Return true if the selection is empty, i.e. no package could be matched.
1424
1425         void filter(Selection *other)
1426         $sel->filter($other);
1427         sel.filter(other)
1428         sel.filter(other)
1429
1430 Intersect two selections. Packages will only stay in the selection if there
1431 are also included in the other selecting. Does an in-place modification.
1432
1433         void add(Selection *other)
1434         $sel->add($other);
1435         sel.add(other)
1436         sel.add(other)
1437
1438 Build the union of two selections. All packages of the other selection will
1439 be added to the set of packages of the selection object. Does an in-place
1440 modification. Note that the selection flags are no longer meaningful after the
1441 add operation.
1442
1443         void add_raw(Id how, Id what)
1444         $sel->add_raw($how, $what);
1445         sel.add_raw(how, what)
1446         sel.add_raw(how, what)
1447
1448 Add a raw element to the selection. Check the Job class for information about
1449 the how and what parameters.
1450
1451         Job **jobs(int action)
1452         my @jobs = $sel->jobs($action);
1453         jobs = sel.jobs(action)
1454         jobs = sel.jobs(action)
1455
1456 Convert a selection into an array of Job objects. The action parameter is or-ed
1457 to the ``how'' part of the job, it describes the type of job (e.g. install,
1458 erase). See the Job class for the action and action modifier constants.
1459
1460         Solvable **solvables()
1461         my @solvables = $sel->solvables();
1462         solvables = sel.solvables()
1463         solvables = sel.solvables()
1464
1465 Convert a selection into an array of Solvable objects.
1466
1467         <stringification>
1468         my $str = "$sel";
1469         str = str(sel)
1470         str = sel.to_s
1471
1472 Return a string describing the selection.
1473
1474 THE JOB CLASS
1475 -------------
1476 Jobs are the way to specify to the dependency solver what to do.
1477 Most of the times jobs will get created by calling the jobs() method
1478 on a Selection object, but there is also a Job() constructor in the
1479 Pool class.
1480
1481 === CONSTANTS ===
1482
1483 Selection constants:
1484
1485 *SOLVER_SOLVABLE*::
1486   The ``what'' part is the id of a solvable.
1487
1488 *SOLVER_SOLVABLE_NAME*::
1489   The ``what'' part is the id of a package name.
1490
1491 *SOLVER_SOLVABLE_PROVIDES*::
1492   The ``what'' part is the id of a package provides.
1493
1494 *SOLVER_SOLVABLE_ONE_OF*::
1495   The ``what'' part is an offset into the ``whatprovides'' data, created
1496   by calling the towhatprovides() pool method.
1497
1498 *SOLVER_SOLVABLE_REPO*::
1499   The ``what'' part is the id of a repository.
1500
1501 *SOLVER_SOLVABLE_ALL*::
1502   The ``what'' part is ignored, all packages are selected.
1503
1504 *SOLVER_SOLVABLE_SELECTMASK*::
1505   A mask containing all the above selection bits.
1506
1507 Action constants:
1508
1509 *SOLVER_NOOP*::
1510   Do nothing.
1511
1512 *SOLVER_INSTALL*::
1513   Install a package of the specified set of packages. It tries to install
1514   the best matching package (i.e. the highest version of the packages from
1515   the repositories with the highest priority).
1516
1517 *SOLVER_ERASE*::
1518   Erase all of the packages from the specified set. If a package is not
1519   installed, erasing it will keep it from getting installed.
1520
1521 *SOLVER_UPDATE*::
1522   Update the matching installed packages to their best version. If none
1523   of the specified packages are installed, try to update the installed
1524   packages to the specified versions. See the section about targeted
1525   updates about more information.
1526   
1527 *SOLVER_WEAKENDEPS*::
1528   Allow to break the dependencies of the matching packages. Handle with care.
1529
1530 *SOLVER_MULTIVERSION*::
1531   Mark the matched packages for multiversion install. If they get to be installed
1532   because of some other job, the installation will keep the old version of the
1533   package installed (for rpm by using ``-i'' instead of ``-U'').
1534
1535 *SOLVER_LOCK*::
1536   Do not change the state of the matched packages, i.e. when they are installed
1537   they stay installed, if not they are not selected for installation.
1538
1539 *SOLVER_DISTUPGRADE*::
1540   Update the matching installed packages to the best version included in one
1541   of the repositories. After this operation, all come from one of the available
1542   repositories except orphaned packages. Orphaned packages are packages that
1543   have no relation to the packages in the repositories, i.e. no package in the
1544   repositories have the same name or obsolete the orphaned package.
1545   This action brings the installed packages in sync with the ones in the
1546   repository. It also turns of arch/vendor/version locking for the affected
1547   packages to simulate a fresh installation. This means that distupgrade can
1548   actually downgrade packages if only lower versions of a package are available
1549   in the repositories.
1550
1551 *SOLVER_DROP_ORPHANED*::
1552   Erase all the matching installed packages if they are orphaned. This only makes
1553   sense if there is a ``distupgrade all packages'' job. The default is to erase
1554   orphaned packages only if they block the installation of other packages.
1555
1556 *SOLVER_VERIFY*::
1557   Fix dependency problems of matching installed packages. The default is to ignore
1558   dependency problems for installed packages.
1559
1560 *SOLVER_USERINSTALLED*::
1561   The matching installed packages are considered to be installed by a user, thus
1562   not installed to fulfil some dependency. This is needed input for the calculation
1563   of unneeded packages for jobs that have the SOLVER_CLEANDEPS flag set.
1564
1565 *SOLVER_JOBMASK*::
1566   A mask containing all the above action bits.
1567
1568 Action modifier constants:
1569
1570 *SOLVER_WEAK*::
1571   Makes the job a weak job. The solver tries to fulfil weak jobs, but does not
1572   report a problem if it is not possible to do so.
1573
1574 *SOLVER_ESSENTIAL*::
1575   Makes the job an essential job. If there is a problem with the job, the solver
1576   will not propose to remove the job as one solution (unless all other solutions
1577   are also to remove essential jobs).
1578
1579 *SOLVER_CLEANDEPS*::
1580   The solver will try to also erase all packages dragged in through dependencies
1581   when erasing the package. This needs SOLVER_USERINSTALLED jobs to maximize user
1582   satisfaction.
1583
1584 *SOLVER_FORCEBEST*::
1585   Insist on the best package for install, update, and distupgrade jobs. If this
1586   flag is not used, the solver will use the second-best package if the best
1587   package cannot be installed for some reason. When this flag is used, the solver
1588   will generate a problem instead.
1589
1590 *SOLVER_TARGETED*::
1591   Forces targeted operation update and distupgrade jobs. See the section about
1592   targeted updates about more information.
1593
1594 Set constants.
1595
1596 *SOLVER_SETEV*::
1597   The job specified the exact epoch and version of the package set.
1598
1599 *SOLVER_SETEVR*::
1600   The job specified the exact epoch, version, and release of the package set.
1601
1602 *SOLVER_SETARCH*::
1603   The job specified the exact architecture of the packages from the set.
1604
1605 *SOLVER_SETVENDOR*::
1606   The job specified the exact vendor of the packages from the set.
1607
1608 *SOLVER_SETREPO*::
1609   The job specified the exact repository of the packages from the set.
1610
1611 *SOLVER_SETNAME*::
1612   The job specified the exact name of the packages from the set.
1613
1614 *SOLVER_NOAUTOSET*::
1615   Turn of automatic set flag generation for SOLVER_SOLVABLE jobs.
1616
1617 *SOLVER_SETMASK*::
1618   A mask containing all the above set bits.
1619
1620 See the section about set bits for more information.
1621
1622 === ATTRIBUTES ===
1623
1624         Pool *pool;                             /* read only */
1625         $job->{'pool'}
1626         d.pool
1627         d.pool
1628
1629 Back pointer to pool.
1630
1631         Id how;                                 /* read/write */
1632         $job->{'how'}
1633         d.how
1634         d.how
1635
1636 Union of the selection, action, action modifier, and set flags.
1637 The selection part describes the semantics of the ``what'' Id.
1638
1639         Id what;                                /* read/write */
1640         $job->{'what'}
1641         d.what
1642         d.what
1643
1644 Id describing the set of packages, the meaning depends on the
1645 selection part of the ``how'' attribute.
1646
1647 === METHODS ===
1648
1649         Solvable **solvables()
1650         my @solvables = $job->solvables();
1651         solvables = job.solvables()
1652         solvables = job.solvables()
1653
1654 Return the set of solvables of the job as an array of Solvable
1655 objects.
1656
1657         bool isemptyupdate();
1658         $job->isemptyupdate()
1659         job.isemptyupdate()
1660         job.isemptyupdate?
1661
1662 Convenience function to find out if the job describes an update
1663 job with no matching packages, i.e. a job that does nothing.
1664 Some package managers like ``zypper'' like to turn those jobs
1665 into install jobs, i.e. an update of a not-installed package
1666 will result into the installation of the package.
1667
1668         <stringification>
1669         my $str = "$job";
1670         str = str(job)
1671         str = job.to_s
1672
1673 Return a string describing the job.
1674
1675         <equality>
1676         if ($job1 == $job2)
1677         if job1 == job2:
1678         if job1 == job2
1679
1680 Two jobs are equal if they belong to the same pool and both the
1681 ``how'' and the ``what'' attributes are the same.
1682
1683 === TARGETED UPDATES ===
1684 Libsolv has two modes for upgrades and distupgrade: targeted and
1685 untargeted. Untargeted mode means that the installed packages from
1686 the specified set will be updated to the best version. Targeted means
1687 that packages that can be updated to a package in the specified set
1688 will be updated to the best package of the set.
1689
1690 Here's an example to explain the subtle difference. Suppose that
1691 you have package A installed in version "1.1", "A-1.2" is available
1692 in one of the repositories and there is also package "B" that
1693 obsoletes package A.
1694
1695 An untargeted update of "A" will update the installed "A-1.1" to
1696 package "B", because that is the newest version (B obsoletes A and
1697 is thus newer).
1698
1699 A targeted update of "A" will update "A-1.1" to "A-1.2", as the
1700 set of packages contains both "A-1.1" and "A-1.2", and "A-1.2" is
1701 the newer one.
1702
1703 An untargeted update of "B" will do nothing, as "B" is not installed.
1704
1705 An targeted update of "B" will update "A-1.1" to "B".
1706
1707 Note that the default is to do "auto-targeting", thus if the specified
1708 set of packages does not include an installed package, the solver
1709 will assume targeted operation even if SOLVER_TARGETED is not used.
1710
1711 This mostly matches the intent of the user, with one exception: In
1712 the example above, an update of "A-1.2" will update "A-1.1" to
1713 "A-1.2" (targeted mode), but a second update of "A-1.2" will suddenly
1714 update to "B", as untargeted mode is chosen because "A-1.2" is now
1715 installed.
1716
1717 If you want to have full control over when targeting mode is chosen,
1718 turn off auto-targeting with the SOLVER_FLAG_NO_AUTOTARGET solver option.
1719 In that case, all updates are considered to be untargeted unless they
1720 include the SOLVER_TARGETED flag.
1721
1722 === SET BITS ===
1723 Set bits specify which parts of the specified packages where specified
1724 by the user. It is used by the solver when checking if an operation is
1725 allowed or not. For example, the solver will normally not allow the
1726 downgrade of an installed package. But it will not report a problem if
1727 the SOLVER_SETEVR flag is used, as it then assumes that the user specified
1728 the exact version and thus knows what he is doing.
1729
1730 So if a package "screen-1-1" is installed for the x86_64 architecture and
1731 version "2-1" is only available for the i586 architecture, installing
1732 package "screen-2.1" will ask the user for confirmation because of the
1733 different architecture. When using the Selection class to create jobs
1734 the set bits are automatically added, e.g. selecting ``screen.i586'' will
1735 automatically add SOLVER_SETARCH, and thus no problem will be reported.
1736
1737 THE SOLVER CLASS
1738 ----------------
1739
1740 === CONSTANTS ===
1741
1742 Flags to modify some of the solver's behaviour:
1743
1744 *SOLVER_FLAG_ALLOW_DOWNGRADE*::
1745   Allow the solver to downgrade packages without asking for confirmation
1746   (i.e. reporting a problem).
1747
1748 *SOLVER_FLAG_ALLOW_ARCHCHANGE*::
1749   Allow the solver to change the architecture of an installed package
1750   without asking for confirmation. Note that changes to/from noarch
1751   are always considered to be allowed.
1752   
1753 *SOLVER_FLAG_ALLOW_VENDORCHANGE*::
1754   Allow the solver to change the vendor of an installed package
1755   without asking for confirmation. Each vendor is part of one or more
1756   vendor equivalence classes, normally installed packages may only
1757   change their vendor if the new vendor shares at least one equivalence
1758   class.
1759
1760 *SOLVER_FLAG_ALLOW_NAMECHANGE*::
1761   Allow the solver to change the name of an installed package, i.e.
1762   install a package with a different name that obsoletes the installed
1763   package. This option is on by default.
1764
1765 *SOLVER_FLAG_ALLOW_UNINSTALL*::
1766   Allow the solver to deinstall installed packages to fulfil the jobs.
1767   This flag also includes the above flags. You may want to set this
1768   flag if you only have SOLVER_ERASE jobs, as in that case it's
1769   better for the user to check the transaction overview instead of
1770   approving every single package that needs to be deinstalled.
1771
1772 *SOLVER_FLAG_NO_UPDATEPROVIDE*::
1773   If multiple packages obsolete an installed package, the solver checks
1774   the provides of every such package and ignores all packages that
1775   do not provide the installed package name. Thus, you can have an
1776   official update candidate that provides the old name, and other
1777   packages that also obsolete the package but are not considered for
1778   updating. If you cannot use this feature, you can turn it off
1779   by setting this flag.
1780
1781 *SOLVER_FLAG_SPLITPROVIDES*::
1782   Make the solver aware of special provides of the form
1783   ``<packagename>:<path>'' used in SUSE systems to support package
1784   splits.
1785
1786 *SOLVER_FLAG_IGNORE_RECOMMENDED*::
1787   Do not process optional (aka weak) dependencies.
1788
1789 *SOLVER_FLAG_ADD_ALREADY_RECOMMENDED*::
1790   Install recommened or supplemented packages even if they have no
1791   connection to the current transaction. You can use this feature
1792   to implement a simple way for the user to install new recommended
1793   packages that were not available in the past.
1794   
1795 *SOLVER_FLAG_NO_INFARCHCHECK*::
1796   Turn off the inferior architecture checking that is normally done
1797   by the solver. Normally, the solver allows only the installation
1798   of packages from the "best" architecture if a package is available
1799   for multiple architectures.
1800
1801 *SOLVER_FLAG_BEST_OBEY_POLICY*::
1802   Make the SOLVER_FORCEBEST job option consider only packages that
1803   meet the policies for installed packages, i.e. no downgrades,
1804   no architecture change, no vendor change (see the first flags
1805   of this section). If the flag is not specified, the solver will
1806   enforce the installation of the best package ignoring the
1807   installed packages, which may conflict with the set policy.
1808
1809 *SOLVER_FLAG_NO_AUTOTARGET*::
1810   Do not enable auto-targeting up update and distupgrade jobs. See
1811   the section on targeted updates for more information.
1812
1813 Basic rule types:
1814
1815 *SOLVER_RULE_UNKNOWN*::
1816   A rule of an unknown class. You should never encounter those.
1817
1818 *SOLVER_RULE_RPM*::
1819   A package dependency rule, called rpm rule for historical reasons.
1820
1821 *SOLVER_RULE_UPDATE*::
1822   A rule to implement the update policy of installed packages. Every
1823   installed package has an update rule that consists of the packages
1824   that may replace the installed package.
1825
1826 *SOLVER_RULE_FEATURE*::
1827   Feature rules are fallback rules used when a update rule is disabled.
1828   They include all packages that may replace the installed package
1829   ignoring the update policy, i.e. they contain downgrades, arch
1830   changes and so on. Without them, the solver would simply deinstall
1831   installed packages if their update rule gets disabled.
1832
1833 *SOLVER_RULE_JOB*::
1834   Job rules implement the job given to the solver.
1835
1836 *SOLVER_RULE_DISTUPGRADE*::
1837   This are simple negative assertions that make sure that only packages
1838   are kept that are also available in one of the repositories.
1839
1840 *SOLVER_RULE_INFARCH*::
1841   Infarch rules are also negative assertions, they disallow the installation
1842   of packages when there are packages of the same name but with a better
1843   architecture.
1844
1845 *SOLVER_RULE_CHOICE*::
1846   Choice rules are used to make sure that the solver preferes updating to
1847   installing different packages when some dependency is provided by
1848   multiple packages with different names. The solver may always break
1849   choice rules, so you will not see them when a problem is found.
1850
1851 *SOLVER_RULE_LEARNT*::
1852   These rules are generated by the solver to keep it from running into
1853   the same problem multiple times when it has to backtrack. They are
1854   the main reason why a sat solver is faster then other dependency solver
1855   implementations.
1856
1857 Special dependency rule types:
1858
1859 *SOLVER_RULE_RPM_NOT_INSTALLABLE*::
1860   This rule was added to prevent the installation of a package of an
1861   architecture that does not work on the system.
1862
1863 *SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP*::
1864   The package contanis a required dependency which was not provided by
1865   any package.
1866
1867 *SOLVER_RULE_RPM_PACKAGE_REQUIRES*::
1868   Similar to SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, but in this case
1869   some packages provided the dependency but none of them could be
1870   installed due to other dependency issues.
1871
1872 *SOLVER_RULE_RPM_SELF_CONFLICT*::
1873   The package conflicts with itself. This is not allowed by older rpm
1874   versions.
1875
1876 *SOLVER_RULE_RPM_PACKAGE_CONFLICT*::
1877   To fulfill the dependencies two packages need to be installed, but
1878   one of the packages contains a conflict with the other one.
1879
1880 *SOLVER_RULE_RPM_SAME_NAME*::
1881   The dependencies can only be fulfilled by multiple versions of
1882   a package, but installing multiple versions of the same package
1883   is not allowed.
1884
1885 *SOLVER_RULE_RPM_PACKAGE_OBSOLETES*::
1886   To fulfill the dependencies two packages need to be installed, but
1887   one of the packages obsoletes the other one.
1888
1889 *SOLVER_RULE_RPM_IMPLICIT_OBSOLETES*::
1890   To fulfill the dependencies two packages need to be installed, but
1891   one of the packages has provides a dependency that is obsoleted
1892   by the other one. See the POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES
1893   flag.
1894
1895 *SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES*::
1896   To fulfill the dependencies a package needs to be installed that is
1897   obsoleted by an installed package. See the POOL_FLAG_NOINSTALLEDOBSOLETES
1898   flag.
1899
1900 *SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP*::
1901   The user asked for installation of a package providing a specific
1902   dependency, but no available package provides it.
1903
1904 *SOLVER_RULE_JOB_UNKNOWN_PACKAGE*::
1905   The user asked for installation of a package with a specific name,
1906   but no available package has that name.
1907
1908 *SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM*::
1909   The user asked for the erasure of a dependency that is provided by the
1910   system (i.e. for special hardware or language dependencies), this
1911   cannot be done with a job.
1912
1913 *SOLVER_RULE_JOB_UNSUPPORTED*::
1914   The user asked for something that is not yet implemented, e.g. the
1915   installation of all packages at once.
1916
1917 Policy error constants
1918
1919 *POLICY_ILLEGAL_DOWNGRADE*::
1920   The solver ask for permission before downgrading packages.
1921
1922 *POLICY_ILLEGAL_ARCHCHANGE*::
1923   The solver ask for permission before changing the architecture of installed
1924   packages.
1925
1926 *POLICY_ILLEGAL_VENDORCHANGE*::
1927   The solver ask for permission before changing the vendor of installed
1928   packages.
1929
1930 *POLICY_ILLEGAL_NAMECHANGE*::
1931   The solver ask for permission before replacing an installed packages with
1932   a packge that has a different name.
1933
1934 Solution element type constants
1935
1936 *SOLVER_SOLUTION_JOB*::
1937   The problem can be solved by removing the specified job.
1938
1939 *SOLVER_SOLUTION_POOLJOB*::
1940   The problem can be solved by removing the specified job that is defined in the pool.
1941
1942 *SOLVER_SOLUTION_INFARCH*::
1943   The problem can be solved by allowing the installation of the specified package
1944   with an inferior architecture.
1945
1946 *SOLVER_SOLUTION_DISTUPGRADE*::
1947   The problem can be solved by allowing to keep the specified package installed.
1948
1949 *SOLVER_SOLUTION_BEST*::
1950   The problem can be solved by allowing to install the specified package that is
1951   not the best available package.
1952
1953 *SOLVER_SOLUTION_ERASE*::
1954   The problem can be solved by allowing to erase the specified package.
1955
1956 *SOLVER_SOLUTION_REPLACE*::
1957   The problem can be solved by allowing to replace the package with some other
1958   package.
1959
1960 *SOLVER_SOLUTION_REPLACE_DOWNGRADE*::
1961   The problem can be solved by allowing to replace the package with some other
1962   package that has a lower version.
1963
1964 *SOLVER_SOLUTION_REPLACE_ARCHCHANGE*::
1965   The problem can be solved by allowing to replace the package with some other
1966   package that has a different architecture.
1967
1968 *SOLVER_SOLUTION_REPLACE_VENDORCHANGE*::
1969   The problem can be solved by allowing to replace the package with some other
1970   package that has a different vendor.
1971
1972 *SOLVER_SOLUTION_REPLACE_NAMECHANGE*::
1973   The problem can be solved by allowing to replace the package with some other
1974   package that has a different name.
1975
1976
1977 === ATTRIBUTES ===
1978
1979         Pool *pool;                             /* read only */
1980         $job->{'pool'}
1981         d.pool
1982         d.pool
1983
1984 Back pointer to pool.
1985
1986 === METHODS ===
1987
1988         int set_flag(int flag, int value)
1989         my $oldvalue = $pool->set_flag($flag, $value);
1990         oldvalue = pool.set_flag(flag, value)
1991         oldvalue = pool.set_flag(flag, value)
1992
1993         int get_flag(int flag)
1994         my $value = $pool->get_flag($flag);
1995         value = pool.get_flag(flag)
1996         value = pool.get_flag(flag)
1997
1998 Set/get a solver specific flag. The flags define the policies the solver has
1999 to obey. The flags are explained in the CONSTANTS section of this class.
2000
2001         Problem **solve(Job *jobs)
2002         my @problems = $solver->solve(\@jobs);
2003         problems = solver.solve(jobs)
2004         problems = solver.solve(jobs)
2005
2006 Solve a problem specified in the job list (plus the jobs defined in the pool).
2007 Returns an array of problems that need user interaction, or an empty array
2008 if no problems were encountered. See the Problem class on how to deal with
2009 problems.
2010
2011         Transaction *transaction()
2012         my $trans = $solver->transaction();
2013         trans = solver.transaction()
2014         trans = solver.transaction()
2015
2016 Return the transaction to implement the calculated package changes. A transaction
2017 is available even if problems were found, this is useful for interactive user
2018 interfaces that show both the job result and the problems.
2019
2020 THE PROBLEM CLASS
2021 -----------------
2022
2023 Problems are the way of the solver to interact with the user. You can simply list
2024 all problems and terminate your program, but a better way is to present solutions to
2025 the user and let him pick the ones he likes.
2026
2027 === ATTRIBUTES ===
2028
2029         Solver *solv;                           /* read only */
2030         $problem->{'solv'}
2031         problem.solv
2032         problem.solv
2033
2034 Back pointer to solver object.
2035
2036         Id id;                                  /* read only */
2037         $problem->{'id'}
2038         problem.id
2039         problem.id
2040
2041 Id of the problem. The first problem has Id 1, they are numbered consecutively.
2042
2043 === METHODS ===
2044
2045         Rule *findproblemrule()
2046         my $probrule = $problem->findproblemrule();
2047         probrule = problem.findproblemrule()
2048         probrule = problem.findproblemrule()
2049
2050 Return the rule that caused the problem. Of cource in most situations there is no
2051 single responsible rule, but many rules that interconnect with each created the
2052 problem. Nevertheless, the solver uses some heuristic approch to find a rule
2053 that somewhat describes the problem best to the user.
2054
2055         Rule **findallproblemrules(bool unfiltered = 0)
2056         my @probrules = $problem->findallproblemrules();
2057         probrules = problem.findallproblemrule()
2058         probrules = problem.findallproblemrule()
2059
2060 Return all rules responsible for the problem. The returned set of rules contains
2061 all the needed information why there was a problem, but it's hard to present
2062 them to the user in a sensible way. The default is to filter out all update and
2063 job rules (unless the returned rules only consist of those types).
2064
2065         Solutions **solutions()
2066         my @solutions = $problem->solutions();
2067         solutions = problem.solutions()
2068         solutions = problem.solutions()
2069
2070 Return an array containing multiple possible solutions to fix the problem. See
2071 the solution class for more information.
2072
2073         int solution_count()
2074         my $cnt = $problem->solution_count();
2075         cnt = problem.solution_count()
2076         cnt = problem.solution_count()
2077
2078 Return the number of solutions without creating solution objects.
2079
2080 THE RULE CLASS
2081 --------------
2082
2083 Rules are the basic block of sat solving. Each package dependency gets translated
2084 into one or multiple rules.
2085
2086 === ATTRIBUTES ===
2087
2088         Solver *solv;                           /* read only */
2089         $rule->{'solv'}
2090         rule.solv
2091         rule.solv
2092
2093 Back pointer to solver object.
2094
2095         Id id;                                  /* read only */
2096         $rule->{'id'}
2097         rule.id
2098         rule.id
2099
2100 The id of the rule.
2101
2102         int type;                               /* read only */
2103         $rule->{'type'}
2104         rule.type
2105         rule.type
2106
2107 The basic type of the rule. See the constant section of the solver class for the type list.
2108
2109 === METHODS ===
2110
2111         Ruleinfo *info()
2112         my $ruleinfo = $rule->info();
2113         ruleinfo = rule.info()
2114         ruleinfo = rule.info()
2115
2116 Return a Ruleinfo object that contains information about why the rule was created. But
2117 see the allinfos() method below.
2118
2119         Ruleinfo **allinfos()
2120         my @ruleinfos = $rule->allinfos();
2121         ruleinfos = rule.allinfos()
2122         ruleinfos = rule.allinfos()
2123
2124 As the same dependency rule can get created because of multiple dependencies, one
2125 Ruleinfo is not enough to describe the reason. Thus the allinfos() method returns
2126 an array of all infos about a rule.
2127
2128         <equality>
2129         if ($rule1 == $rule2)
2130         if rule1 == rule2:
2131         if rule1 == rule2
2132
2133 Two rules are equal if they belong to the same solver and have the same id.
2134
2135 THE RULEINFO CLASS
2136 ------------------
2137
2138 A Ruleinfo describes one reason why a rule was created.
2139
2140 === ATTRIBUTES ===
2141
2142         Solver *solv;                           /* read only */
2143         $ruleinfo->{'solv'}
2144         ruleinfo.solv
2145         ruleinfo.solv
2146
2147 Back pointer to solver object.
2148
2149         int type;                               /* read only */
2150         $ruleinfo->{'type'}
2151         ruleinfo.type
2152         ruleinfo.type
2153
2154 The type of the ruleinfo. See the constant section of the solver class for the
2155 rule type list and the special type list.
2156
2157         Id dep;                                 /* read only */
2158         $ruleinfo->{'dep'}
2159         ruleinfo.dep
2160         ruleinfo.dep
2161
2162 The id of the dependency leading to the creation of the rule, or zero.
2163
2164         Solvable *solvable;                     /* read only */
2165         $ruleinfo->{'solvable'}
2166         ruleinfo.solvable
2167         ruleinfo.solvable
2168
2169 The involved Solvable, e.g. the one containing the dependency.
2170
2171         Solvable *othersolvable;                /* read only */
2172         $ruleinfo->{'othersolvable'}
2173         ruleinfo.othersolvable
2174         ruleinfo.othersolvable
2175
2176 The other involved Solvable (if any), e.g. the one containing providing
2177 the dependency for conflicts.
2178
2179         const char *problemstr();
2180         my $str = $ruleinfo->problemstr();
2181         str = ruleinfo.problemstr()
2182         str = ruleinfo.problemstr()
2183
2184 A string describing the ruleinfo from a problem perspective. This probably
2185 only makes sense if the rule is part of a problem.
2186
2187 THE SOLUTION CLASS
2188 ------------------
2189
2190 A solution solves one specific problem. It consists of multiple solution elements
2191 that all need to be executed.
2192
2193 === ATTRIBUTES ===
2194
2195         Solver *solv;                           /* read only */
2196         $solution->{'solv'}
2197         solution.solv
2198         solution.solv
2199
2200 Back pointer to solver object.
2201
2202         Id problemid;                           /* read only */
2203         $solution->{'problemid'}
2204         solution.problemid
2205         solution.problemid
2206
2207 Id of the problem the solution solves.
2208
2209         Id id;                                  /* read only */
2210         $solution->{'id'}
2211         solution.id
2212         solution.id
2213
2214 Id of the solution. The first solution has Id 1, they are numbered consecutively.
2215
2216 === METHODS ===
2217
2218         Solutionelement **elements(bool expandreplaces = 0)
2219         my @solutionelements = $solution->elements();
2220         solutionelements = solution.elements()
2221         solutionelements = solution.elements()
2222
2223 Return an array containing the elements describing what neeeds to be done to
2224 implement the specific solution. If expandreplaces is true, elements of type
2225 SOLVER_SOLUTION_REPLACE will be replaced by one or more elements replace
2226 elements describing the policy mismatches.
2227
2228         int element_count()
2229         my $cnt = $solution->solution_count();
2230         cnt = solution.element_count()
2231         cnt = solution.element_count()
2232
2233 Return the number of solution elements without creating objects. Note that the
2234 count does not match the number of objects returned by the elements() method
2235 of expandreplaces is set to true.
2236
2237
2238 THE SOLUTIONELEMENT CLASS
2239 -------------------------
2240
2241 A solution element describes a single action of a solution. The action is always
2242 either to remove one specific job or to add a new job that installs or erases
2243 a single specific package.
2244
2245 === ATTRIBUTES ===
2246
2247         Solver *solv;                           /* read only */
2248         $solutionelement->{'solv'}
2249         solutionelement.solv
2250         solutionelement.solv
2251
2252 Back pointer to solver object.
2253
2254         Id problemid;                           /* read only */
2255         $solutionelement->{'problemid'}
2256         solutionelement.problemid
2257         solutionelement.problemid
2258
2259 Id of the problem the element (partly) solves.
2260
2261         Id solutionid;                          /* read only */
2262         $solutionelement->{'solutionid'}
2263         solutionelement.solutionid
2264         solutionelement.solutionid
2265
2266 Id of the solution the element is a part of.
2267
2268         Id id;                                  /* read only */
2269         $solutionelement->{'id'}
2270         solutionelement.id
2271         solutionelement.id
2272
2273 Id of the solution element. The first element has Id 1, they are numbered consecutively.
2274
2275         Id type;                                /* read only */
2276         $solutionelement->{'type'}
2277         solutionelement.type
2278         solutionelement.type
2279
2280 Type of the solution element. See the constant section of the solver class for the
2281 existing types.
2282
2283         Solvable *solvable;                     /* read only */
2284         $solutionelement->{'solvable'}
2285         solutionelement.solvable
2286         solutionelement.solvable
2287
2288 The installed solvable that needs to be replaced for replacement elements.
2289
2290         Solvable *replacement;                  /* read only */
2291         $solutionelement->{'replacement'}
2292         solutionelement.replacement
2293         solutionelement.replacement
2294
2295 The solvable that needs to be installed to fix the problem.
2296
2297         int jobidx;                             /* read only */
2298         $solutionelement->{'jobidx'}
2299         solutionelement.jobidx
2300         solutionelement.jobidx
2301
2302 The index of the job that needs to be removed to fix the problem, or -1 if the
2303 element is of another type. Note that it's better to change the job to SOLVER_NOOP
2304 type so that the numbering of other elements does not get disturbed. This
2305 method works both for types SOLVER_SOLUTION_JOB and SOLVER_SOLUTION_POOLJOB.
2306
2307 === METHODS ===
2308
2309         Solutionelement **replaceelements()
2310         my @solutionelements = $solutionelement->replaceelements();
2311         solutionelements = solutionelement.replaceelements()
2312         solutionelements = solutionelement.replaceelements()
2313
2314 If the solution element is of type SOLVER_SOLUTION_REPLACE, return an array of
2315 elements describing the policy mismatches, otherwise return a copy of the
2316 element. See also the ``expandreplaces'' option in the solution's elements()
2317 method.
2318
2319         int illegalreplace()
2320         my $illegal = $solutionelement->illegalreplace();
2321         illegal = solutionelement.illegalreplace()
2322         illegal = solutionelement.illegalreplace()
2323
2324 Return an integer that contains the policy mismatch bits or-ed together, or
2325 zero if there was no policy mismatch. See the policy error constants in
2326 the solver class.
2327
2328         Job *Job()
2329         my $job = $solutionelement->Job();
2330         illegal = solutionelement.Job()
2331         illegal = solutionelement.Job()
2332
2333 Create a job that implements the solution element. Add this job to the array
2334 of jobs for all elements of type different to SOLVER_SOLUTION_JOB and
2335 SOLVER_SOLUTION_POOLJOB. For the later two, a SOLVER_NOOB Job is created,
2336 you should replace the old job with the new one.
2337
2338         const char *str()
2339         my $str = $solutionelement->str();
2340         str = solutionelement.str()
2341         str = solutionelement.str()
2342
2343 A string describing the change the solution element consists of.
2344
2345 THE TRANSACTION CLASS
2346 ---------------------
2347 xxx
2348
2349 CHECKSUMS
2350 ---------
2351 Checksums (also called hashes) are used to make sure that downloaded data is
2352 not corrupt and also as a fingerprint mechanism to check if data has changed.
2353
2354 === CLASS METHODS ===
2355
2356         Chksum *Chksum(Id type)
2357         my $chksum = solv::Chksum->new($type);
2358         chksum = solv.Chksum(type)
2359         chksum = Solv::Chksum.new(type)
2360
2361 Create a checksum object. Currently the following types are supported:
2362
2363         REPOKEY_TYPE_MD5
2364         REPOKEY_TYPE_SHA1
2365         REPOKEY_TYPE_SHA256
2366
2367 These keys are constants in the *solv* class.
2368
2369         Chksum *Chksum(Id type, const char *hex)
2370         my $chksum = solv::Chksum->new($type, $hex);
2371         chksum = solv.Chksum(type, hex)
2372         chksum = Solv::Chksum.new(type, hex)
2373
2374 Create an already finalized checksum object.
2375
2376 === ATTRIBUTES ===
2377
2378         Id type;                        /* read only */
2379         $chksum->{'type'}
2380         chksum.type
2381         chksum.type
2382
2383 Return the type of the checksum object.
2384
2385 === METHODS ===
2386
2387         void add(const char *str)
2388         $chksum->add($str);
2389         chksum.add(str)
2390         chksum.add(str)
2391
2392 Add a string to the checksum.
2393
2394         void add_fp(FILE *fp)
2395         $chksum->add_fp($file);
2396         chksum.add_fp(file)
2397         chksum.add_fp(file)
2398
2399 Add the contents of a file to the checksum.
2400         
2401         void add_stat(const char *filename)
2402         $chksum->add_stat($filename);
2403         chksum.add_stat(filename)
2404         chksum.add_stat(filename)
2405
2406 Stat the file and add the dev/ino/size/mtime member to the checksum. If the
2407 stat fails, the members are zeroed.
2408
2409         void add_fstat(int fd)
2410         $chksum->add_fstat($fd);
2411         chksum.add_fstat(fd)
2412         chksum.add_fstat(fd)
2413
2414 Same as add_stat, but instead of the filename a file descriptor is used.
2415
2416         unsigned char *raw()
2417         my $raw = $chksum->raw();
2418         raw = chksum.raw()
2419         raw = chksum.raw()
2420
2421 Finalize the checksum and return the result as raw bytes. This means that the
2422 result can contain NUL bytes or unprintable characters.
2423
2424         const char *hex()
2425         my $raw = $chksum->hex();
2426         raw = chksum.hex()
2427         raw = chksum.hex()
2428
2429 Finalize the checksum and return the result as hex string.
2430
2431         <equality>
2432         if ($chksum1 == $chksum2)
2433         if chksum1 == chksum2:
2434         if chksum1 == chksum2
2435
2436 Checksums are equal if they are of the same type and the finalized results are
2437 the same.
2438
2439         <stringification>
2440         my $str = "$chksum";
2441         str = str(chksum)
2442         str = chksum.to_s
2443
2444 If the checksum is finished, the checksum is returned as "<type>:<hex>" string.
2445 Otherwise "<type>:unfinished" is returned.
2446
2447
2448 FILE MANAGEMENT
2449 ---------------
2450 This functions were added because libsolv uses standard *FILE* pointers to
2451 read/write files, but languages like perl have their own implementation of
2452 files. The libsolv functions also support decompression and compression, the
2453 algorithm is selected by looking at the file name extension.
2454
2455         FILE *xfopen(char *fn, char *mode = "r")
2456         my $file = solv::xfopen($path);
2457         file = solv.xfopen(path)
2458         file = Solv::xfopen(path)
2459
2460 Open a file at the specified path. The `mode` argument is passed on to the
2461 stdio library.
2462
2463         FILE *xfopen_fd(char *fn, int fileno)
2464         my $file = solv::xfopen_fd($path, $fileno);
2465         file = solv.xfopen_fd(path, fileno)
2466         file = Solv::xfopen_fd(path, fileno)
2467
2468 Create a file handle from the specified file descriptor. The path argument is
2469 only used to select the correct (de-)compression algorithm, use an empty path
2470 if you want to make sure to read/write raw data.
2471
2472 === METHODS ===
2473
2474         int fileno()
2475         my $fileno = $file->fileno();
2476         fileno = file.fileno()
2477         fileno = file.fileno()
2478
2479 Return file file descriptor of the file. If the file is not open, `-1` is
2480 returned.
2481
2482         int dup()
2483         my $fileno = $file->dup();
2484         fileno = file.dup()
2485         fileno = file.dup()
2486
2487 Return a copy of the descriptor of the file. If the file is not open, `-1` is
2488 returned.
2489
2490         bool flush()
2491         $file->flush();
2492         file.flush()
2493         file.flush()
2494
2495 Flush the file. Returns false if there was an error. Flushing a closed file
2496 always returns true.
2497
2498         bool close()
2499         $file->close();
2500         file.close()
2501         file.close()
2502
2503 Close the file. This is needed for languages like Ruby, that do not destruct
2504 objects right after they are no longer referenced. In that case, it is good
2505 style to close open files so that the file descriptors are freed right away.
2506 Returns false if there was an error.
2507
2508 THE REPODATACLASS
2509 -----------------
2510 xxx
2511
2512 Author
2513 ------
2514 Michael Schroeder <mls@suse.de>
2515