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