28184906c00f306ca6459bc827374c451dfead00
[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         Dep *dep;                               /* read only */
2163         $ruleinfo->{'dep'}
2164         ruleinfo.dep
2165         ruleinfo.dep
2166
2167 The dependency leading to the creation of the rule.
2168
2169         Dep *dep_id;                            /* read only */
2170         $ruleinfo->{'dep_id'}
2171         ruleinfo.dep_id
2172         ruleinfo.dep_id
2173
2174 The Id of the dependency leading to the creation of the rule, or zero.
2175
2176         Solvable *solvable;                     /* read only */
2177         $ruleinfo->{'solvable'}
2178         ruleinfo.solvable
2179         ruleinfo.solvable
2180
2181 The involved Solvable, e.g. the one containing the dependency.
2182
2183         Solvable *othersolvable;                /* read only */
2184         $ruleinfo->{'othersolvable'}
2185         ruleinfo.othersolvable
2186         ruleinfo.othersolvable
2187
2188 The other involved Solvable (if any), e.g. the one containing providing
2189 the dependency for conflicts.
2190
2191         const char *problemstr();
2192         my $str = $ruleinfo->problemstr();
2193         str = ruleinfo.problemstr()
2194         str = ruleinfo.problemstr()
2195
2196 A string describing the ruleinfo from a problem perspective. This probably
2197 only makes sense if the rule is part of a problem.
2198
2199 THE SOLUTION CLASS
2200 ------------------
2201
2202 A solution solves one specific problem. It consists of multiple solution elements
2203 that all need to be executed.
2204
2205 === ATTRIBUTES ===
2206
2207         Solver *solv;                           /* read only */
2208         $solution->{'solv'}
2209         solution.solv
2210         solution.solv
2211
2212 Back pointer to solver object.
2213
2214         Id problemid;                           /* read only */
2215         $solution->{'problemid'}
2216         solution.problemid
2217         solution.problemid
2218
2219 Id of the problem the solution solves.
2220
2221         Id id;                                  /* read only */
2222         $solution->{'id'}
2223         solution.id
2224         solution.id
2225
2226 Id of the solution. The first solution has Id 1, they are numbered consecutively.
2227
2228 === METHODS ===
2229
2230         Solutionelement **elements(bool expandreplaces = 0)
2231         my @solutionelements = $solution->elements();
2232         solutionelements = solution.elements()
2233         solutionelements = solution.elements()
2234
2235 Return an array containing the elements describing what neeeds to be done to
2236 implement the specific solution. If expandreplaces is true, elements of type
2237 SOLVER_SOLUTION_REPLACE will be replaced by one or more elements replace
2238 elements describing the policy mismatches.
2239
2240         int element_count()
2241         my $cnt = $solution->solution_count();
2242         cnt = solution.element_count()
2243         cnt = solution.element_count()
2244
2245 Return the number of solution elements without creating objects. Note that the
2246 count does not match the number of objects returned by the elements() method
2247 of expandreplaces is set to true.
2248
2249
2250 THE SOLUTIONELEMENT CLASS
2251 -------------------------
2252
2253 A solution element describes a single action of a solution. The action is always
2254 either to remove one specific job or to add a new job that installs or erases
2255 a single specific package.
2256
2257 === ATTRIBUTES ===
2258
2259         Solver *solv;                           /* read only */
2260         $solutionelement->{'solv'}
2261         solutionelement.solv
2262         solutionelement.solv
2263
2264 Back pointer to solver object.
2265
2266         Id problemid;                           /* read only */
2267         $solutionelement->{'problemid'}
2268         solutionelement.problemid
2269         solutionelement.problemid
2270
2271 Id of the problem the element (partly) solves.
2272
2273         Id solutionid;                          /* read only */
2274         $solutionelement->{'solutionid'}
2275         solutionelement.solutionid
2276         solutionelement.solutionid
2277
2278 Id of the solution the element is a part of.
2279
2280         Id id;                                  /* read only */
2281         $solutionelement->{'id'}
2282         solutionelement.id
2283         solutionelement.id
2284
2285 Id of the solution element. The first element has Id 1, they are numbered consecutively.
2286
2287         Id type;                                /* read only */
2288         $solutionelement->{'type'}
2289         solutionelement.type
2290         solutionelement.type
2291
2292 Type of the solution element. See the constant section of the solver class for the
2293 existing types.
2294
2295         Solvable *solvable;                     /* read only */
2296         $solutionelement->{'solvable'}
2297         solutionelement.solvable
2298         solutionelement.solvable
2299
2300 The installed solvable that needs to be replaced for replacement elements.
2301
2302         Solvable *replacement;                  /* read only */
2303         $solutionelement->{'replacement'}
2304         solutionelement.replacement
2305         solutionelement.replacement
2306
2307 The solvable that needs to be installed to fix the problem.
2308
2309         int jobidx;                             /* read only */
2310         $solutionelement->{'jobidx'}
2311         solutionelement.jobidx
2312         solutionelement.jobidx
2313
2314 The index of the job that needs to be removed to fix the problem, or -1 if the
2315 element is of another type. Note that it's better to change the job to SOLVER_NOOP
2316 type so that the numbering of other elements does not get disturbed. This
2317 method works both for types SOLVER_SOLUTION_JOB and SOLVER_SOLUTION_POOLJOB.
2318
2319 === METHODS ===
2320
2321         Solutionelement **replaceelements()
2322         my @solutionelements = $solutionelement->replaceelements();
2323         solutionelements = solutionelement.replaceelements()
2324         solutionelements = solutionelement.replaceelements()
2325
2326 If the solution element is of type SOLVER_SOLUTION_REPLACE, return an array of
2327 elements describing the policy mismatches, otherwise return a copy of the
2328 element. See also the ``expandreplaces'' option in the solution's elements()
2329 method.
2330
2331         int illegalreplace()
2332         my $illegal = $solutionelement->illegalreplace();
2333         illegal = solutionelement.illegalreplace()
2334         illegal = solutionelement.illegalreplace()
2335
2336 Return an integer that contains the policy mismatch bits or-ed together, or
2337 zero if there was no policy mismatch. See the policy error constants in
2338 the solver class.
2339
2340         Job *Job()
2341         my $job = $solutionelement->Job();
2342         illegal = solutionelement.Job()
2343         illegal = solutionelement.Job()
2344
2345 Create a job that implements the solution element. Add this job to the array
2346 of jobs for all elements of type different to SOLVER_SOLUTION_JOB and
2347 SOLVER_SOLUTION_POOLJOB. For the later two, a SOLVER_NOOB Job is created,
2348 you should replace the old job with the new one.
2349
2350         const char *str()
2351         my $str = $solutionelement->str();
2352         str = solutionelement.str()
2353         str = solutionelement.str()
2354
2355 A string describing the change the solution element consists of.
2356
2357 THE TRANSACTION CLASS
2358 ---------------------
2359
2360 === CONSTANTS ===
2361
2362 Transaction element types, both active and passive
2363
2364 *SOLVER_TRANSACTION_IGNORE*::
2365   This element does nothing. Used to map element types that do not
2366   match the view mode.
2367
2368 *SOLVER_TRANSACTION_INSTALL*::
2369   This element installes a package.
2370
2371 *SOLVER_TRANSACTION_ERASE*::
2372   This element erases a package.
2373
2374 *SOLVER_TRANSACTION_MULTIINSTALL*::
2375   This element installs a package with a different version keeping the
2376   other versions installed.
2377
2378 *SOLVER_TRANSACTION_MULTIREINSTALL*::
2379   This element reinstalls a installed package keeping the other versions
2380   installed.
2381
2382 Transaction element types, active view
2383
2384 *SOLVER_TRANSACTION_REINSTALL*::
2385   This element re-installs a package, i.e. installs the same package again.
2386
2387 *SOLVER_TRANSACTION_CHANGE*::
2388   This element installs a package with same name, version, architecture but
2389   different content.
2390
2391 *SOLVER_TRANSACTION_UPGRADE*::
2392   This element installs a newer version of an installed package.
2393
2394 *SOLVER_TRANSACTION_DOWNGRADE*::
2395   This element installs a older version of an installed package.
2396
2397 *SOLVER_TRANSACTION_OBSOLETES*::
2398   This element installs a package that obsoletes an installed package.
2399
2400 Transaction element types, passive view
2401
2402 *SOLVER_TRANSACTION_REINSTALLED*::
2403   This element re-installs a package, i.e. installs the same package again.
2404
2405 *SOLVER_TRANSACTION_CHANGED*::
2406   This element replaces an installed package with one of the same name,
2407   version, architecture but different content.
2408
2409 *SOLVER_TRANSACTION_UPGRADED*::
2410   This element replaces an installed package with a new version.
2411
2412 *SOLVER_TRANSACTION_DOWNGRADED*::
2413   This element replaces an installed package with an old version.
2414
2415 *SOLVER_TRANSACTION_OBSOLETED*::
2416   This element replaces an installed package with a package that obsoletes
2417   it.
2418
2419 Pseudo element types for showing extra information used by classify()
2420
2421 *SOLVER_TRANSACTION_ARCHCHANGE*::
2422   This element replaces an installed package with a package of a different
2423   architecture.
2424
2425 *SOLVER_TRANSACTION_VENDORCHANGE*::
2426   This element replaces an installed package with a package of a different
2427   vendor.
2428
2429 Transaction mode flags
2430
2431 *SOLVER_TRANSACTION_SHOW_ACTIVE*::
2432   Filter for active view types. The default is to return passive view type,
2433   i.e. to show how the installed packages get changed.
2434
2435 *SOLVER_TRANSACTION_SHOW_OBSOLETES*::
2436   Do not map the obsolete view type into INSTALL/ERASE elements.
2437
2438 *SOLVER_TRANSACTION_SHOW_ALL*::
2439   If multiple packages replace an installed package, only the best of them
2440   is kept as OBSOLETE element, the other ones are mapped to INSTALL/ERASE
2441   elements. This is because most applications want to show just one package
2442   replacing the installed one. The SOLVER_TRANSACTION_SHOW_ALL makes the
2443   library keep all OBSOLETE elements.
2444
2445 *SOLVER_TRANSACTION_SHOW_MULTIINSTALL*::
2446   The library maps MULTIINSTALL elements to simple INSTALL elements. This
2447   flag can be used to disable the mapping.
2448
2449 *SOLVER_TRANSACTION_CHANGE_IS_REINSTALL*::
2450   Use this flag if you want to map CHANGE elements to the REINSTALL type.
2451
2452 *SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE*::
2453   Use this flag if you want to map OBSOLETE elements to the UPGRADE type.
2454
2455 *SOLVER_TRANSACTION_MERGE_ARCHCHANGES*::
2456   Do not add extra categories for every architecture change, instead cumulate
2457   them in one category.
2458   
2459 *SOLVER_TRANSACTION_MERGE_VENDORCHANGES*::
2460   Do not add extra categories for every vendor change, instead cumulate
2461   them in one category.
2462
2463 *SOLVER_TRANSACTION_RPM_ONLY*::
2464   Special view mode that just returns IGNORE, ERASE, INSTALL, MULTIINSTALL
2465   elements. Useful if you want to find out what to feed to the underlying
2466   package manager.
2467
2468 Transaction order flags
2469
2470 *SOLVER_TRANSACTION_KEEP_ORDERDATA*::
2471   Do not throw away the dependency graph used for ordering the transaction.
2472   This flag is needed if you want to do manual ordering.
2473
2474 === ATTRIBUTES ===
2475
2476         Pool *pool;                             /* read only */
2477         $trans->{'pool'}
2478         trans.pool
2479         trans.pool
2480
2481 Back pointer to pool.
2482
2483 === METHODS ===
2484
2485         bool isempty();
2486         $trans->isempty()
2487         trans.isempty()
2488         trans.isempty?
2489
2490 Returns true if the transaction does not do anything, i.e. has no elements.
2491
2492         Solvable **newpackages();
2493         my @newsolvables = $trans->newpackages();
2494         newsolvables = trans.newpackages()
2495         newsolvables = trans.newpackages()
2496
2497 Return all packages that are to be installed by the transaction. This are
2498 the packages that need to be downloaded from the repositories.
2499
2500         Solvable **keptpackages();
2501         my @keptsolvables = $trans->keptpackages();
2502         keptsolvables = trans.keptpackages()
2503         keptsolvables = trans.keptpackages()
2504
2505 Return all installed packages that the transaction will keep installed.
2506
2507         Solvable **steps();
2508         my @steps = $trans->steps();
2509         steps = trans.steps()
2510         steps = trans.steps()
2511
2512 Return all solvables that need to be installed (if the returned solvable
2513 is not already installed) or erased (if the returned solvable is installed).
2514 A step is also called a transaction element.
2515
2516         int steptype(Solvable *solvable, int mode)
2517         my $type = $trans->steptype($solvable, $mode);
2518         type = trans.steptype(solvable, mode)
2519         type = trans.steptype(solvable, mode)
2520
2521 Return the transaction type of the specified solvable. See the CONSTANTS
2522 sections for the mode argument flags and the list of returned types.
2523
2524         TransactionClass **classify(int mode = 0)
2525         my @classes = $trans->classify();
2526         classes = trans.classify()
2527         classes = trans.classify()
2528
2529 Group the transaction elements into classes so that they can be displayed
2530 in a structured way. You can use various mapping mode flags to tweak
2531 the result to match your preferences, see the mode argument flag in
2532 the CONSTANTS section. See the TransactionClass class for how to deal
2533 with the returned objects.
2534
2535         Solvable *othersolvable(Solvable *solvable);
2536         my $other = $trans->othersolvable($solvable);
2537         other = trans.othersolvable(solvable)
2538         other = trans.othersolvable(solvable)
2539
2540 Return the ``other'' solvable for a given solvable. For installed packages
2541 the other solvable is the best package with the same name that replaces
2542 the installed package, or the best package of the obsoleting packages if
2543 the package does not get replaced by one with the same name.
2544
2545 For to be installed packages, the ``other'' solvable is the best installed
2546 package with the same name that will be replaced, or the best packages
2547 of all the packages that are obsoleted if the new package does not replace
2548 a package with the same name.
2549
2550 Thus, the ``other'' solvable is normally the package that is also shown
2551 for a given package.
2552
2553         Solvable **allothersolvables(Solvable *solvable);
2554         my @others = $trans->allothersolvables($solvable);
2555         others = trans.allothersolvables(solvable)
2556         others = trans.allothersolvables(solvable)
2557
2558 For installed packages, returns all of the packages that replace us. For to
2559 be installed packages, returns all of the packages that the new package
2560 replaces. The special ``other'' solvable is always the first entry of the
2561 returned array.
2562
2563         int calc_installsizechange();
2564         my $change = $trans->calc_installsizechange();
2565         change = trans.calc_installsizechange()
2566         change = trans.calc_installsizechange()
2567
2568 Return the size change of the installed system in kilobytes (kibibytes).
2569
2570         void order(int flags = 0);
2571         $trans->order();
2572         trans.order()
2573         trans.order()
2574
2575 Order the steps in the transactions so that dependant packages are updated
2576 before packages that depend on them. For rpm, you can also use rpmlib's
2577 ordering functionality, debian's dpkg does not provide a way to order a
2578 transaction.
2579
2580 === ACTIVE/PASSIVE VIEW ===
2581
2582 Active view list what new packages get installed, while passive view shows
2583 what happens to the installed packages. Most often there's not much
2584 difference between the two modes, but things get interesting of multiple
2585 package get replaced by one new package. Say you have installed package
2586 A-1-1 and B-1-1, and now install A-2-1 with has a new dependency that
2587 obsoletes B. The transaction elements will be
2588
2589   updated   A-1-1 (other: A-2-1)
2590   obsoleted B-1-1 (other: A-2-1)
2591
2592 in passive mode, but
2593
2594   update A-2-1 (other: A-1-1)
2595   erase  B
2596
2597 in active mode. If the mode containes SOLVER_TRANSACTION_SHOW_ALL, the 
2598 passive mode list will be unchanged but the active mode list will just
2599 contain A-2-1.
2600
2601 THE TRANSACTIONCLASS CLASS
2602 --------------------------
2603
2604 Objects of this type are returned by the classify() Transaction method.
2605
2606 === ATTRIBUTES ===
2607
2608         Transaction *transaction;               /* read only */
2609         $class->{'transaction'}
2610         class.transaction
2611         class.transaction
2612
2613 Back pointer to transaction object.
2614
2615         int type;                               /* read only */
2616         $class->{'type'}
2617         class.type
2618         class.type
2619
2620 The type of the transaction elements in the class.
2621
2622         int count;                              /* read only */
2623         $class->{'count'}
2624         class.count
2625         class.count
2626
2627 The number of elements in the class.
2628
2629         const char *fromstr;
2630         $class->{'fromstr'}
2631         class.fromstr
2632         class.fromstr
2633
2634 The old vendor or architecture.
2635
2636         const char *tostr;
2637         $class->{'tostr'}
2638         class.tostr
2639         class.tostr
2640
2641 The new vendor or architecture.
2642
2643         Id fromid;
2644         $class->{'fromid'}
2645         class.fromid
2646         class.fromid
2647
2648 The id of the old vendor or architecture.
2649
2650         Id toid;
2651         $class->{'toid'}
2652         class.toid
2653         class.toid
2654
2655 The id of the new vendor or architecture.
2656
2657 === METHODS ===
2658
2659         void solvables();
2660         my @solvables = $class->solvables();
2661         solvables = class.solvables()
2662         solvables = class.solvables()
2663
2664 Return the solvables for all transaction elements in the class.
2665
2666 CHECKSUMS
2667 ---------
2668 Checksums (also called hashes) are used to make sure that downloaded data is
2669 not corrupt and also as a fingerprint mechanism to check if data has changed.
2670
2671 === CLASS METHODS ===
2672
2673         Chksum *Chksum(Id type)
2674         my $chksum = solv::Chksum->new($type);
2675         chksum = solv.Chksum(type)
2676         chksum = Solv::Chksum.new(type)
2677
2678 Create a checksum object. Currently the following types are supported:
2679
2680         REPOKEY_TYPE_MD5
2681         REPOKEY_TYPE_SHA1
2682         REPOKEY_TYPE_SHA256
2683
2684 These keys are constants in the *solv* class.
2685
2686         Chksum *Chksum(Id type, const char *hex)
2687         my $chksum = solv::Chksum->new($type, $hex);
2688         chksum = solv.Chksum(type, hex)
2689         chksum = Solv::Chksum.new(type, hex)
2690
2691 Create an already finalized checksum object.
2692
2693 === ATTRIBUTES ===
2694
2695         Id type;                        /* read only */
2696         $chksum->{'type'}
2697         chksum.type
2698         chksum.type
2699
2700 Return the type of the checksum object.
2701
2702 === METHODS ===
2703
2704         void add(const char *str)
2705         $chksum->add($str);
2706         chksum.add(str)
2707         chksum.add(str)
2708
2709 Add a string to the checksum.
2710
2711         void add_fp(FILE *fp)
2712         $chksum->add_fp($file);
2713         chksum.add_fp(file)
2714         chksum.add_fp(file)
2715
2716 Add the contents of a file to the checksum.
2717         
2718         void add_stat(const char *filename)
2719         $chksum->add_stat($filename);
2720         chksum.add_stat(filename)
2721         chksum.add_stat(filename)
2722
2723 Stat the file and add the dev/ino/size/mtime member to the checksum. If the
2724 stat fails, the members are zeroed.
2725
2726         void add_fstat(int fd)
2727         $chksum->add_fstat($fd);
2728         chksum.add_fstat(fd)
2729         chksum.add_fstat(fd)
2730
2731 Same as add_stat, but instead of the filename a file descriptor is used.
2732
2733         unsigned char *raw()
2734         my $raw = $chksum->raw();
2735         raw = chksum.raw()
2736         raw = chksum.raw()
2737
2738 Finalize the checksum and return the result as raw bytes. This means that the
2739 result can contain NUL bytes or unprintable characters.
2740
2741         const char *hex()
2742         my $raw = $chksum->hex();
2743         raw = chksum.hex()
2744         raw = chksum.hex()
2745
2746 Finalize the checksum and return the result as hex string.
2747
2748         <equality>
2749         if ($chksum1 == $chksum2)
2750         if chksum1 == chksum2:
2751         if chksum1 == chksum2
2752
2753 Checksums are equal if they are of the same type and the finalized results are
2754 the same.
2755
2756         <stringification>
2757         my $str = "$chksum";
2758         str = str(chksum)
2759         str = chksum.to_s
2760
2761 If the checksum is finished, the checksum is returned as "<type>:<hex>" string.
2762 Otherwise "<type>:unfinished" is returned.
2763
2764
2765 FILE MANAGEMENT
2766 ---------------
2767 This functions were added because libsolv uses standard *FILE* pointers to
2768 read/write files, but languages like perl have their own implementation of
2769 files. The libsolv functions also support decompression and compression, the
2770 algorithm is selected by looking at the file name extension.
2771
2772         FILE *xfopen(char *fn, char *mode = "r")
2773         my $file = solv::xfopen($path);
2774         file = solv.xfopen(path)
2775         file = Solv::xfopen(path)
2776
2777 Open a file at the specified path. The `mode` argument is passed on to the
2778 stdio library.
2779
2780         FILE *xfopen_fd(char *fn, int fileno)
2781         my $file = solv::xfopen_fd($path, $fileno);
2782         file = solv.xfopen_fd(path, fileno)
2783         file = Solv::xfopen_fd(path, fileno)
2784
2785 Create a file handle from the specified file descriptor. The path argument is
2786 only used to select the correct (de-)compression algorithm, use an empty path
2787 if you want to make sure to read/write raw data.
2788
2789 === METHODS ===
2790
2791         int fileno()
2792         my $fileno = $file->fileno();
2793         fileno = file.fileno()
2794         fileno = file.fileno()
2795
2796 Return file file descriptor of the file. If the file is not open, `-1` is
2797 returned.
2798
2799         int dup()
2800         my $fileno = $file->dup();
2801         fileno = file.dup()
2802         fileno = file.dup()
2803
2804 Return a copy of the descriptor of the file. If the file is not open, `-1` is
2805 returned.
2806
2807         bool flush()
2808         $file->flush();
2809         file.flush()
2810         file.flush()
2811
2812 Flush the file. Returns false if there was an error. Flushing a closed file
2813 always returns true.
2814
2815         bool close()
2816         $file->close();
2817         file.close()
2818         file.close()
2819
2820 Close the file. This is needed for languages like Ruby, that do not destruct
2821 objects right after they are no longer referenced. In that case, it is good
2822 style to close open files so that the file descriptors are freed right away.
2823 Returns false if there was an error.
2824
2825
2826 THE REPODATA CLASS
2827 ------------------
2828 The Repodata stores attrinbutes for packages and the repository itself, each
2829 repository can have multiple repodata areas. You normally only need to
2830 directly access them if you implement lazy downloading of repository data.
2831 Repodata areas are created by calling the repository's add_repodata() method 
2832 or by using repo_add methods without the REPO_REUSE_REPODATA or REPO_USE_LOADING
2833 flag.
2834
2835 === ATTRIBUTES ===
2836
2837         Repo *repo;                     /* read only */
2838         $data->{'repo'}
2839         data.repo
2840         data.repo
2841
2842 Back pointer to repository object.
2843
2844         Id id;                                  /* read only */
2845         $data->{'id'}
2846         data.id
2847         data.id
2848
2849 The id of the repodata area. Repodata ids of different repositories overlap.
2850
2851 === METHODS ====
2852
2853         internalize();
2854         $data->internalize();
2855         data.internalize()
2856         data.internalize()
2857
2858 Internalize newly added data. The lookup functions will only see the new data
2859 after it has been internalized.
2860
2861         bool write(FILE *fp);
2862         $data->write($fp);
2863         data.write(fp)
2864         data.write(fp)
2865
2866 Write the contents of the repodata area as solv file.
2867
2868         bool add_solv(FILE *fp, int flags = 0);
2869         $data->add_solv($fp);
2870         data.add_solv(fp)
2871         data.add_solv(fp)
2872
2873 Replace a stub repodata object with the data from a solv file. This method
2874 automatically adds the REPO_USE_LOADING flag. It should only be used from
2875 a load callback.
2876
2877         void create_stubs();
2878         $data->create_stubs()
2879         data.create_stubs()
2880         data.create_stubs()
2881
2882 Create stub repodatas from the information stored in the repodata meta
2883 area.
2884
2885         void extend_to_repo();
2886         $data->extend_to_repo();
2887         data.extend_to_repo()
2888         data.extend_to_repo()
2889
2890 Extend the repodata so that it has the same size as the repo it belongs to.
2891 This method is only needed when switching to a just written repodata extension
2892 to make the repodata match the written extension (which is always of the
2893 size of the repo).
2894
2895         <equality>
2896         if ($data1 == $data2)
2897         if data1 == data2:
2898         if data1 == data2
2899
2900 Two repodata objects are equal if they belong to the same repository and have
2901 the same id.
2902
2903 === DATA RETRIEVAL METHODS ===
2904
2905         const char *lookup_str(Id solvid, Id keyname)
2906         my $string = $data->lookup_str($solvid, $keyname);
2907         string = data.lookup_str(solvid, keyname)
2908         string = data.lookup_str(solvid, keyname)
2909
2910         Id *lookup_idarray(Id solvid, Id keyname)
2911         my @ids = $data->lookup_idarray($solvid, $keyname);
2912         ids = data.lookup_idarray(solvid, keyname)
2913         ids = data.lookup_idarray(solvid, keyname)
2914
2915         Chksum *lookup_checksum(Id solvid, Id keyname)
2916         my $chksum = $data->lookup_checksum($solvid, $keyname);
2917         chksum = data.lookup_checksum(solvid, keyname)
2918         chksum = data.lookup_checksum(solvid, keyname)
2919
2920 Lookup functions. Return the data element stored in the specified solvable.
2921 The methods probably only make sense to retrive data from the special
2922 SOLVID_META solvid that stores repodata meta information.
2923
2924 === DATA STORAGE METHODS ===
2925
2926         void set_id(Id solvid, Id keyname, DepId id);
2927         $data->set_id($solvid, $keyname, $id);
2928         data.set_id(solvid, keyname, id)
2929         data.set_id(solvid, keyname, id)
2930
2931         void set_str(Id solvid, Id keyname, const char *str);
2932         $data->set_str($solvid, $keyname, $str);
2933         data.set_str(solvid, keyname, str)
2934         data.set_str(solvid, keyname, str)
2935
2936         void set_poolstr(Id solvid, Id keyname, const char *str);
2937         $data->set_poolstr($solvid, $keyname, $str);
2938         data.set_poolstr(solvid, keyname, str)
2939         data.set_poolstr(solvid, keyname, str)
2940
2941         void set_checksum(Id solvid, Id keyname, Chksum *chksum);
2942         $data->set_checksum($solvid, $keyname, $chksum);
2943         data.set_checksum(solvid, keyname, chksum)
2944         data.set_checksum(solvid, keyname, chksum)
2945
2946         void add_idarray(Id solvid, Id keyname, DepId id);
2947         $data->add_idarray($solvid, $keyname, $id);
2948         data.add_idarray(solvid, keyname, id)
2949         data.add_idarray(solvid, keyname, id)
2950
2951         Id new_handle();
2952         my $handle = $data->new_handle();
2953         handle = data.new_handle()
2954         handle = data.new_handle()
2955
2956         void add_flexarray(Id solvid, Id keyname, Id handle);
2957         $data->add_flexarray($solvid, $keyname, $handle);
2958         data.add_flexarray(solvid, keyname, handle)
2959         data.add_flexarray(solvid, keyname, handle)
2960
2961 Data storage methods. Probably only useful to store data in the special
2962 SOLVID_META solvid that stores repodata meta information. Note that
2963 repodata areas can have their own Id pool (see the REPO_LOCALPOOL flag),
2964 so be careful if you need to store ids. Arrays are created by calling
2965 the add function for every element. A flexarray is an array of
2966 sub-structures, call new_handle to create a new structure, use the
2967 handle as solvid to fill the structure with data and call add_flexarray
2968 to put the structure in an array.
2969
2970
2971 THE DATAPOS CLASS
2972 -----------------
2973
2974 Datapos objects describe a specific position in the repository data area.
2975 Thus they are only valid until the repository is modified in some way.
2976 Datapos objects can be created by the pos() and parentpos() methods of
2977 a Datamatch object or by accesing the ``meta'' attribute of a repository.
2978
2979 === ATTRIBUTES ===
2980
2981         Repo *repo;                     /* read only */
2982         $data->{'repo'}
2983         data.repo
2984         data.repo
2985
2986 Back pointer to repository object.
2987
2988 === METHODS ===
2989
2990         Dataiterator(Id keyname, const char *match, int flags)
2991         my $di = $datapos->Dataiterator($keyname, $match, $flags);
2992         di = datapos.Dataiterator(keyname, match, flags)
2993         di = datapos.Dataiterator(keyname, match, flags)
2994
2995 Create a Dataiterator at the position of the datapos object.
2996
2997         const char *lookup_deltalocation(unsigned int *OUTPUT);
2998         my ($location, $medianr) = $datapos->lookup_deltalocation();
2999         location, medianr = datapos.lookup_deltalocation()
3000         location, medianr = datapos.lookup_deltalocation()
3001
3002 Return a tuple containing the on-media location and an optional media number
3003 for a delta rpm. This obviously only works if the data position points to
3004 structure describing a delta rpm.
3005
3006         const char *lookup_deltaseq();
3007         my $seq = $datapos->lookup_deltaseq();
3008         seq = datapos.lookup_deltaseq();
3009         seq = datapos.lookup_deltaseq();
3010
3011 Return the delta rpm sequence from the structure describing a delta rpm.
3012
3013 === DATA RETRIEVAL METHODS ===
3014
3015         const char *lookup_str(Id keyname)
3016         my $string = $datapos->lookup_str($keyname);
3017         string = datapos.lookup_str(keyname)
3018         string = datapos.lookup_str(keyname)
3019
3020         Id lookup_id(Id solvid, Id keyname)
3021         my $id = $datapos->lookup_id($keyname);
3022         id = datapos.lookup_id(keyname)
3023         id = datapos.lookup_id(keyname)
3024
3025         unsigned long long lookup_num(Id keyname, unsigned long long notfound = 0)
3026         my $num = $datapos->lookup_num($keyname);
3027         num = datapos.lookup_num(keyname)
3028         num = datapos.lookup_num(keyname)
3029
3030         bool lookup_void(Id keyname)
3031         my $bool = $datapos->lookup_void($keyname);
3032         bool = datapos.lookup_void(keyname)
3033         bool = datapos.lookup_void(keyname)
3034
3035         Queue lookup_idarray(Id keyname)
3036         my @ids = $datapos->lookup_idarray($keyname);
3037         ids = datapos.lookup_idarray(keyname)
3038         ids = datapos.lookup_idarray(keyname)
3039
3040         Chksum *lookup_checksum(Id keyname)
3041         my $chksum = $datapos->lookup_checksum($keyname);
3042         chksum = datapos.lookup_checksum(keyname)
3043         chksum = datapos.lookup_checksum(keyname)
3044
3045 Lookup functions. Note that the returned Ids are always translated into
3046 the Ids of the global pool even if the repodata area contains its own pool.
3047
3048 Author
3049 ------
3050 Michael Schroeder <mls@suse.de>
3051