document Selection and Job classes
[platform/upstream/libsolv.git] / doc / libsolv-bindings.txt
1 LIBSOLV-BINDINGS(3)
2 ===================
3 :man manual: LIBSOLV
4 :man source: libsolv
5
6
7 NAME
8 ----
9 libsolv-bindings - access libsolv from perl/python/ruby
10
11 DESCRIPTION
12 -----------
13 bla bla bla
14
15 THE POOL
16 --------
17
18 The pool is libsolv's central resource manager. A pool consists of Solvables,
19 Repositories, Dependencies, each indexed by Ids.
20
21 === CLASS METHODS ===
22
23         Pool *Pool()
24         my $pool = solv::Pool->new();
25         pool = solv.Pool()
26         pool = Solv::Pool.new()
27
28 Create a new pool instance. In most cases you just need
29 one pool.
30
31 === ATTRIBUTES ===
32
33         void *appdata;                  /* read/write */
34         $pool->{'appdata'}
35         pool.appdata
36         pool.appdata
37
38 Application specific data that may be used in any way by the code using the
39 pool.
40
41         Solvable solvables[];           /* read only */
42         my $solvable = $pool->{'solvables'}->[$solvid];
43         solvable = pool.solvables[solvid]
44         solvable = pool.solvables[solvid]
45
46 Look up a Solvable by its id.
47
48         Repo repos[];                   /* read only */
49         my $repo = $pool->{'repos'}->[$repoid];
50         repo = pool.repos[repoid]
51         repo = pool.repos[repoid]
52
53 Look up a Repository by its id.
54
55         Repo *installed;                /* read/write */
56         $pool->{'installed'} = $repo;
57         pool.installed = repo
58         pool.installed = repo
59
60 Define which repository contains all the installed packages.
61
62 === CONSTANTS ===
63
64 *POOL_FLAG_PROMOTEEPOCH*::
65   Promote the epoch of the providing dependency to the requesting
66   dependency if it does not contain an epoch. Used at some time
67   in old rpm versions, modern systems should never need this.
68
69 *POOL_FLAG_FORBIDSELFCONFLICTS*::
70   Disallow the installation of packages that conflict with themselfs.
71   Debian always allowd self-conflicting packages, rpm used to forbid
72   them but switched to also allowing them recently.
73
74 *POOL_FLAG_OBSOLETEUSESPROVIDES*::
75   Make obsolete type dependency match against provides instead of
76   just the name and version of packages. Very old versions of rpm
77   used the name/version, then it got switched to provides and later
78   switched back again to just name/version.
79
80 *POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES*::
81   An implicit obsoletes is the internal mechanism to remove the
82   old package on an update. The default is to remove all packages
83   with the same name, rpm-5 switched to also removing packages
84   providing the same name.
85
86 *POOL_FLAG_OBSOLETEUSESCOLORS*::
87   Rpm's multilib implementation (used in RedHat and Fedora)
88   distinguishes between 32bit and 64bit packages (the terminology
89   is that they have a different color). If obsolteusescolors is
90   set, packages with different colors will not obsolete each other.
91   This is also true for implicit obsoletes, thus you can install
92   both the 32bit and the 64bit version of a package with the
93   same name.
94
95 *POOL_FLAG_NOINSTALLEDOBSOLETES*::
96   New versions of rpm consider the obsoletes of installed packages
97   when checking for dependency, thus you may not install a package
98   that is obsoleted by some other installed package, unless you
99   also deinstall the other package.
100
101 *POOL_FLAG_HAVEDISTEPOCH*::
102   Mandriva added a new field called distepoch that gets checked in
103   version comparison if the epoch/version/release of two packages
104   are the same.
105
106 *POOL_FLAG_NOOBSOLETESMULTIVERSION*::
107   If a package is installed in multiversionmode, rpm used to ignore
108   both the implicit obsoletes and the obsolete dependency of a
109   package. This was changed to ignoring just the implicit obsoletes,
110   thus you may install multiple versions of the same name, but
111   obsoleted packages still get removed.
112
113 === METHODS ===
114
115         void free()
116         $pool->free();
117         pool.free()
118         pool.free()
119
120 Free a pool. This is currently done with a method instead of relying on
121 reference counting or garbage collection because it's hard to track every
122 reference to a pool.
123
124         void setdebuglevel(int level)
125         $pool->setdebuglevel($level);
126         pool.setdebuglevel(level)
127         pool.setdebuglevel(level)
128
129 Set the debug level. A value of zero means no debug output, the higher the
130 value, the more output is generated.
131
132         int set_flag(int flag, int value)
133         my $oldvalue = $pool->set_flag($flag, $value);
134         oldvalue = pool.set_flag(flag, value)
135         oldvalue = pool.set_flag(flag, value)
136
137         int get_flag(int flag)
138         my $value = $pool->get_flag($flag);
139         value = pool.get_flag(flag)
140         value = pool.get_flag(flag)
141
142 Set/get a pool specific flag. The flags define how the system works, e.g. how
143 the package manager treats obsoletes. The default flags should be sane for most
144 applications, but in some cases you may want to tweak a flag, for example if
145 you want to solv package dependencies for some other system than yours.
146
147         void set_rootdir(const char *rootdir)
148         $pool->set_rootdir(rootdir);
149         pool.set_rootdir(rootdir)
150         pool.set_rootdir(rootdir)
151
152         const char *get_rootdir()
153         my $rootdir = $pool->get_rootdir();
154         rootdir = pool.get_rootdir()
155         rootdir = pool.get_rootdir()
156
157 Set/get the rootdir to use. This is useful if you want package management
158 to work only in some directory, for example if you want to setup a chroot
159 jail. Note that the rootdir will only be prepended to file paths if the
160 *REPO_USE_ROOTDIR* flag is used.
161
162         void setarch(const char *arch = 0)
163         $pool->setarch();
164         pool.setarch()
165         pool.setarch()
166
167 Set the architecture for your system. The architecture is used to determine
168 which packages are installable. It defaults to the result of ``uname -m''.
169
170         Repo *add_repo(const char *name)
171         $repo = $pool->add_repo($name);
172         repo = pool.add_repo(name)
173         repo = pool.add_repo(name)
174
175 Add a Repository with the specified name to the pool. The reposiory is empty
176 on creation, use the repository methods to populate it with packages.
177
178         Repoiterator *repos_iter()
179         for my $repo (@{$pool->repos_iter()})
180         for repo in pool.repos_iter():
181         for repo in pool.repos_iter()
182
183 Iterate over the existing repositories.
184
185         Solvableiterator *solvables_iter()
186         for my $solvable (@{$pool->solvables_iter()})
187         for solvable in pool.solvables_iter():
188         for solvable in pool.solvables_iter()
189
190 Iterate over the existing solvables.
191
192         Dep *Dep(const char *str, bool create=1)
193         my $dep = $pool->Dep($string);
194         dep = pool.Dep(string)
195         dep = pool.Dep(string)
196
197 Create an object describing a string or dependency. If the string is currently
198 not in the pool and _create_ is false, *undef*/*None*/*nil* is returned.
199
200         void addfileprovides()
201         $pool->addfileprovides();
202         pool.addfileprovides()
203         pool.addfileprovides()
204
205         Queue addfileprovides_queue()
206         my @ids = $pool->addfileprovides_queue();
207         ids = pool.addfileprovides_queue()
208         ids = pool.addfileprovides_queue()
209
210 Some package managers like rpm allow dependencies on files contained in other
211 packages. To allow libsolv to deal with those dependencies in an efficient way,
212 you need to call the addfileprovides method after creating and reading all
213 repositories. This method will scan all dependency for file names and than scan
214 all packages for matching files. If a filename has been matched, it will be
215 added to the provides list of the corresponding package. The
216 addfileprovides_queue variant works the same way but returns an array
217 containing all file dependencies. This information can be stored with the
218 repository to speed up the next usage of the repository.
219
220         void createwhatprovides()
221         $pool->createwhatprovides();
222         pool.createwhatprovides()
223         pool.createwhatprovides()
224
225 Create the internal ``whatprovides'' hash over all of the provides of all
226 packages. This method must be called before doing any lookups on provides.
227 It's encuraged to do it right after all repos are set up, usually right after
228 the call to addfileprovides().
229
230         Queue whatprovides(DepId dep)
231         my @solvables = $pool->whatprovides($dep);
232         solvables = pool.whatprovides(dep)
233         solvables = pool.whatprovides(dep)
234
235 Return all solvables that provide the specified dependency. You can use either
236 a Dep object or an simple Id as argument.
237
238         Queue matchprovidingids(const char *match, int flags)
239         my @ids = $pool->matchprovidingids($match, $flags);
240         ids = pool.matchprovidingids(match, flags)
241         ids = pool.matchprovidingids(match, flags)
242
243 Search the names of all provides and return the ones matching the specified
244 string. See the Dataiterator class for the allowed flags.
245
246         Id towhatprovides(Queue ids)
247         my $offset = $pool->towhatprovides(\@ids);
248         offset = pool.towhatprovides(ids)
249         offset = pool.towhatprovides(ids)
250
251 ``Internalize'' an array containing Ids. The returned value can be used to
252 create solver jobs working on a specific set of packages. See the Solver class
253 for more information.
254
255         bool isknownarch(DepId id)
256         my $bool = $pool->isknownarch($id);
257         bool = pool.isknownarch(id)
258         bool = pool.isknownarch?(id)
259
260 Return true if the specified Id describs a known architecture.
261
262         Solver *Solver()
263         my $solver = $pool->Solver();
264         solver = pool.Solver()
265         solver = pool.Solver()
266
267 Create a new solver object.
268
269         Solver *Job(int how, Id what)
270         my $job = $pool->Job($how, $what);
271         job = pool.Job(how, what)
272         job = pool.Job(how, what)
273
274 Create a new Job object. Kind of low level, in most cases you would use a
275 Selection or Dep job constructor instead.
276
277         Selection *Selection()
278         my $sel = $pool->Selection();
279         sel = pool.Selection()
280         sel = pool.Selection()
281
282 Create an empty selection. Useful as a starting point for merging other
283 selections.
284
285         Selection *Selection_all()
286         my $sel = $pool->Selection_all();
287         sel = pool.Selection_all()
288         sel = pool.Selection_all()
289         
290 Create a selection containing all packages. Useful as starting point for
291 intersecting other selections or for update/distupgrade jobs.
292
293         Selection *select(const char *name, int flags)
294         my $sel = $pool->select($name, $flags);
295         sel = pool.select(name, flags)
296         sel = pool.select(name, flags)
297
298 Create a selection by matching packages against the specified string. See the
299 Selection class for a list of flags and how to create solver jobs from a
300 selection.
301
302         void setpooljobs(Jobs *jobs)
303         $pool->setpooljobs(\@jobs);
304         pool.setpooljobs(jobs)
305         pool.setpooljobs(jobs)
306
307         Jobs *getpooljobs()
308         @jobs = $pool->getpooljobs();
309         jobs = pool.getpooljobs()
310         jobs = pool.getpooljobs()
311
312 Get/Set fixed jobs stored in the pool. Those jobs are automatically appended to
313 all solver jobs, they are meant for fixed configurations like which packages
314 can be multiversion installed, which packages were userinstalled or must not be
315 erased.
316
317         void set_loadcallback(Callable *callback)
318         $pool->setloadcallback(\&callbackfunction);
319         pool.setloadcallback(callbackfunction)
320         pool.setloadcallback { |repodata| ... }
321
322 Set the callback function called when repository metadata needs to be loaded on
323 demand. To make use of this feature, you need to create repodata stubs that
324 tell the library which data is available but not loaded. If later on the data
325 needs to be accessed, the callback function is called with a repodata argument.
326 You can then load the data (maybe fetching it first from an remote server).
327 The callback should return true if the data has been made available.
328
329 === DATA RETRIEVAL METHODS ===
330
331 In the following functions, the _keyname_ argument describes what to retrive.
332 For the standard cases you can use the available Id constants. For example,
333
334         $solv::SOLVABLE_SUMMARY
335         solv.SOLVABLE_SUMMARY
336         Solv::SOLVABLE_SUMMARY
337
338 selects the ``Summary'' entry of a solvable. The _solvid_ argument selects the
339 desired solvable by Id.
340
341         const char *lookup_str(Id solvid, Id keyname)
342         my $string = $pool->lookup_str($solvid, $keyname);
343         string = pool.lookup_str(solvid, keyname)
344         string = pool.lookup_str(solvid, keyname)
345
346         Id lookup_id(Id solvid, Id keyname)
347         my $id = $pool->lookup_id($solvid, $keyname);
348         id = pool.lookup_id(solvid, keyname)
349         id = pool.lookup_id(solvid, keyname)
350
351         unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
352         my $num = $pool->lookup_num($solvid, $keyname);
353         num = pool.lookup_num(solvid, keyname)
354         num = pool.lookup_num(solvid, keyname)
355
356         bool lookup_void(Id solvid, Id keyname)
357         my $bool = $pool->lookup_void($solvid, $keyname);
358         bool = pool.lookup_void(solvid, keyname)
359         bool = pool.lookup_void(solvid, keyname)
360
361         Queue lookup_idarray(Id solvid, Id keyname)
362         my @ids = $pool->lookup_idarray($solvid, $keyname);
363         ids = pool.lookup_idarray(solvid, keyname)
364         ids = pool.lookup_idarray(solvid, keyname)
365
366         Chksum *lookup_checksum(Id solvid, Id keyname)
367         my $chksum = $pool->lookup_checksum($solvid, $keyname);
368         chksum = pool.lookup_checksum(solvid, keyname)
369         chksum = pool.lookup_checksum(solvid, keyname)
370
371 Lookup functions. Return the data element stored in the specified solvable.
372 You should probably use the methods of the Solvable class instead.
373
374         Dataiterator *Dataiterator(Id solvid, Id keyname, const char *match, int flags)
375         my $di = $pool->Dataiterator($solvid, $keyname, $match, $flags);
376         di = pool.Dataiterator(solvid, keyname, match, flags)
377         di = pool.Dataiterator(solvid, keyname, match, flags)
378
379         for my $d (@$di)
380         for d in di:
381         for d in di
382
383 Iterate over the matching data elements. See the Dataiterator class for more
384 information.
385
386 === ID METHODS ===
387
388 The following methods deal with Ids, i.e. integers representing objects in the
389 pool. They are considered ``low level'', in most cases you would not use them
390 but instead the object orientated methods.
391
392         Repo *id2repo(Id id)
393         $repo = $pool->id2repo($id);
394         repo = pool.id2repo(id)
395         repo = pool.id2repo(id)
396
397 Lookup an existing Repository by id. You can also do this by using the *repos*
398 attribute.
399
400         Solvable *id2solvable(Id id)
401         $solvable = $pool->id2solvable($id);
402         solvable = pool.id2solvable(id)
403         solvable = pool.id2solvable(id)
404
405 Lookup an existing Repository by id. You can also do this by using the
406 *solvables* attribute.
407
408         const char *solvid2str(Id id)
409         my $str = $pool->solvid2str($id);
410         str = pool.solvid2str(id)
411         str = pool.solvid2str(id)
412
413 Return a string describing the Solvable with the specified id. The string
414 consists of the name, version, and architecture of the Solvable.
415
416         Id str2id(const char *str, bool create=1)
417         my $id = pool->str2id($string);
418         id = pool.str2id(string)
419         id = pool.str2id(string)
420
421         const char *id2str(Id id)
422         $string = pool->id2str($id);
423         string = pool.id2str(id)
424         string = pool.id2str(id)
425
426 Convert a string into an Id and back. If the string is currently not in the
427 pool and _create_ is false, zero is returned.
428
429         Id rel2id(Id name, Id evr, int flags, bool create=1)
430         my $id = pool->rel2id($nameid, $evrid, $flags);
431         id = pool.rel2id(nameid, evrid, flags)
432         id = pool.rel2id(nameid, evrid, flags)
433
434 Create a ``relational'' dependency. Such dependencies consist of a name part,
435 the _flags_ describing the relation, and a version part. The flags are:
436
437         $solv::REL_EQ | $solv::REL_GT | $solv::REL_LT
438         solv.REL_EQ | solv.REL_GT | solv.REL_LT
439         Solv::REL_EQ | Solv::REL_GT | Solv::REL_LT
440
441 Thus, if you want a ``\<='' relation, you would use *REL_LT | REL_EQ*.
442
443         Id id2langid(Id id, const char *lang, bool create=1)
444         my $id = $pool->id2langid($id, $language);
445         id = pool.id2langid(id, language)
446         id = pool.id2langid(id, language)
447
448 Create a language specific Id from some other id. This function simply converts
449 the id into a string, appends a dot and the specified language to the string
450 and converts the result back into an Id.
451
452         const char *dep2str(Id id)
453         $string = pool->dep2str($id);
454         string = pool.dep2str(id)
455         string = pool.dep2str(id)
456
457 Convert a dependency id into a string. If the id is just a string, this
458 function has the same effect as id2str(). For relational dependencies, the
459 result is the correct ``name relation evr'' string.
460
461
462 THE DEPENDENCY CLASS
463 --------------------
464 The dependency class is an object orientated way to work with strings and
465 dependencies. Internally, dependencies are represented as Ids, i.e. simple
466 numbers. Dependency objects can be constructed by using the Pool's Dep()
467 method.
468
469 === ATTRIBUTES ===
470
471         Pool *pool;             /* read only */
472         $dep->{'pool'}
473         dep.pool
474         dep.pool
475
476 Back reference to the pool this dependency belongs to.
477
478         Id id;          /* read only */
479         $dep->{'id'}
480         dep.id
481         dep.id
482
483 The id of this dependency.
484
485 == Methods ==
486
487         Dep *Rel(int flags, DepId evrid, bool create=1)
488         my $reldep = $dep->Rel($flags, $evrdep);
489         reldep = dep.Rel(flags, evrdep)
490         reldep = dep.Rel(flags, evrdep)
491
492 Create a relational dependency from to string dependencies and a flags
493 argument. See the pool's rel2id method for a description of the flags.
494
495         Selection *Selection_name(int setflags = 0)
496         my $sel = $dep->Selection_name();
497         sel = dep.Selection_name()
498         sel = dep.Selection_name()
499
500 Create a Selection from a dependency. The selection consists of all packages
501 that have a name equal to the dependency. If the dependency is of a relational
502 type, the packages version must also fulfill the dependency.
503
504         Selection *Selection_provides(int setflags = 0)
505         my $sel = $dep->Selection_provides();
506         sel = dep.Selection_provides()
507         sel = dep.Selection_provides()
508
509 Create a Selection from a dependency. The selection consists of all packages
510 that have at least one provides matching the dependency.
511
512         const char *str()
513         my $str = $dep->str();
514         str = $dep.str()
515         str = $dep.str()
516
517 Return a string describing the dependency.
518
519         <stringification>
520         my $str = "$dep";
521         str = str(dep)
522         str = dep.to_s
523
524 Same as calling the str() method.
525
526         <equality>
527         if ($dep1 == $dep2)
528         if dep1 == dep2:
529         if dep1 == dep2
530
531 The dependencies are equal if they are part of the same pool and have the same
532 ids.
533
534 THE REPOSITORY CLASS
535 --------------------
536 A Repository describes a group of packages, normally comming from the same
537 source. Repositories are created by the Pool's add_repo() method.
538
539 === ATTRIBUTES ===
540
541         Pool *pool;                     /* read only */
542         $repo->{'pool'}
543         repo.pool
544         repo.pool
545
546 Back reference to the pool this dependency belongs to.
547
548         Id id;                          /* read only */
549         $repo->{'id'}
550         repo.id
551         repo.id
552
553 The id of the repository.
554
555         const char *name;               /* read/write */
556         $repo->{'name'}
557         repo.name
558         repo.name
559         
560 The repositories name. To libsolv, the name is just a string with no specific
561 meaning.
562
563         int prioprity;                  /* read/write */
564         $repo->{'priority'}
565         repo.priority
566         repo.priority
567
568 The priority of the repository. A higher number means that packages of this
569 repository will be chosen over other repositories, even if they have a greater
570 package version.
571
572         int subprioprity;               /* read/write */
573         $repo->{'subpriority'}
574         repo.subpriority
575         repo.subpriority
576
577 The sub-priority of the repository. This value is compared when the priorities
578 of two repositories are the same. It is useful to make the library prefer
579 on-disk repositories to remote ones.
580
581         int nsolvables;                 /* read only */
582         $repo->{'nsolvables'}
583         repo.nsolvables
584         repo.nsolvables
585
586 The number of solvables in this repository.
587
588         void *appdata;                  /* read/write */
589         $repo->{'appdata'}
590         repo.appdata
591         repo.appdata
592
593 Application specific data that may be used in any way by the code using the
594 repository.
595
596         Datapos *meta;                  /* read only */
597         $repo->{'meta'}
598         repo.meta
599         repo.meta
600
601 Return a Datapos object of the repodata's metadata. You can use the lookup
602 methods of the Datapos class to lookup metadata attributes, like the repository
603 timestamp.
604
605 === CONSTANTS ===
606
607 *REPO_REUSE_REPODATA*::
608   Reuse the last repository data aera (``repodata'') instead of creating a new
609   one.
610
611 *REPO_NO_INTERNALIZE*::
612   Do not internalize the added repository data. This is useful if
613   you plan to add more data because internalization is a costly
614   operation.
615
616 *REPO_LOCALPOOL*::
617   Use the repodata's pool for Id storage instead of the global pool. Useful
618   if you don't want to pollute the global pool with many unneeded ids, like
619   when storing the filelist.
620
621 *REPO_USE_LOADING*::
622   Use the repodata that is currently being loaded instead of creating a new one.
623   This only makes sense if used in a load callback.
624
625 *REPO_EXTEND_SOLVABLES*::
626   Do not create new solvables for the new data, but match existing solvables and
627   add the data to them. Repository metadata is often split into multiple parts,
628   with one primary file describing all packages and other parts holding
629   information that is normally not needed, like the changelog.
630
631 *REPO_USE_ROOTDIR*::
632   Prepend the pool's rootdir to the path when doing file operations.
633
634 *REPO_NO_LOCATION*::
635   Do not add a location element to the solvables. Useful if the solvables are
636   not in the final position, so you can add the correct location later in your code.
637
638 *SOLV_ADD_NO_STUBS*::
639   Do not create stubs for repository parts that can be downloaded on demand.
640
641 *SUSETAGS_RECORD_SHARES*::
642   This is specific to the add_susetags() method. Susetags allows to refer to already
643   read packages to save disk space. If this data sharing needs to work over multiple
644   calls to add_susetags, you need to specify this flag so that the share information
645   is made available to subsequent calls.
646
647 === METHODS ===
648
649         void free(bool reuseids = 0)
650         $repo->free();
651         repo.free()
652         repo.free()
653
654 Free the repository and all solvables it contains. If _reuseids_ is set to
655 true, the solvable ids and the repository id may be reused by the library when
656 added new solvables. Thus you should leave it false if you are not sure that
657 somebody holds a reference.
658
659         void empty(bool reuseids = 0)
660         $repo->empty();
661         repo.empty()
662         repo.empty()
663
664 Free all the solvables in a repository. The repository will be empty after this
665 call. See the free() method for the meaning of _reuseids_.
666
667         bool isempty()
668         $repo->isempty()
669         repo.empty()
670         repo.empty?
671
672 Return true if there are no solvables in this repository.
673
674         void internalize()
675         $repo->internalize();
676         repo.internalize()
677         repo.internalize()
678
679 Internalize added data. Data must be internalized before it is available to the
680 lookup and data iterator functions.
681
682         bool write(FILE *fp)
683         $repo->write($fp)
684         repo.write(fp)
685         repo.write(fp)
686
687 Write a repo as a ``solv'' file. These files can be read very fast and thus are
688 a good way to cache repository data. Returns false if there was some error
689 writing the file.
690
691         Solvableiterator *solvables_iter()
692         for my $solvable (@{$repo->solvables_iter()})
693         for solvable in repo.solvables_iter():
694         for solvable in repo.solvables_iter()
695
696 Iterate over all solvables in a repository.
697
698         Repodata *add_repodata(int flags = 0)
699         my $repodata = $repo->add_repodata();
700         repodata = repo.add_repodata()
701         repodata = repo.add_repodata()
702
703 Add a new repodata area to the repository. This is normally automatically
704 done by the repo_add methods, so you need this method only in very
705 rare circumstances.
706
707         void create_stubs()
708         $repo->create_stubs();
709         repo.create_stubs()
710         repo.create_stubs()
711
712 Calls the create_stubs() repodata method for the last repodata of the
713 repository.
714
715         bool iscontiguous()
716         $repo->iscontiguous()
717         repo.iscontiguous()
718         repo.iscontiguous?
719
720 Return true if the solvables of this repository are all in a single block with
721 no holes, i.e. they have consecutive ids.
722
723         Repodata *first_repodata()
724         my $repodata = $repo->first_repodata();
725         repodata = repo.first_repodata()
726         repodata = repo.first_repodata()
727
728 Checks if all repodatas but the first repodata are extensions, and return the
729 first repodata if this is the case. Useful if you want to do a store/retrive
730 sequence on the repository to reduce the memory using and enable paging, as
731 this does not work if the rpository contains multiple non-extension repodata
732 areas.
733
734         Selection *Selection(int setflags = 0)
735         my $sel = $repo->Selection();
736         sel = repo.Selection()
737         sel = repo.Selection()
738
739 Create a Selection consisting of all packages in the repository.
740
741         Dataiterator *Dataiterator(Id p, Id key, const char *match, int flags)
742         my $di = $repo->Dataiterator($solvid, $keyname, $match, $flags);
743         di = repo.Dataiterator(solvid, keyname, match, flags)
744         di = repo.Dataiterator(solvid, keyname, match, flags)
745
746         for my $d (@$di)
747         for d in di:
748         for d in di
749
750 Iterate over the matching data elements in this repository. See the
751 Dataiterator class for more information.
752
753         <stringification>
754         my $str = "$repo";
755         str = str(repo)
756         str = repo.to_s
757
758 Return the name of the repository, or "Repo#<id>" if no name is set.
759
760         <equality>
761         if ($repo1 == $repo2)
762         if repo1 == repo2:
763         if repo1 == repo2
764
765 Two repositories are equal if they belong to the same pool and have the same id.
766
767 === DATA ADD METHODS ===
768
769         Solvable *add_solvable()
770         $repo->add_solvable();
771         repo.add_solvable()
772         repo.add_solvable()
773
774 Add a single empty solvable to the repository. Returns a Solvable object, see
775 the Solvable class for more information.
776
777         bool add_solv(const char *name, int flags = 0)
778         $repo->add_solv($name, $flags);
779         repo.add_solv(name, flags)
780         repo.add_solv(name, flags)
781
782         bool add_solv(FILE *fp, int flags = 0)
783         $repo->add_solv($fp, $flags);
784         repo.add_solv(fp, flags)
785         repo.add_solv(fp, flags)
786
787 Read a ``solv'' file and add its contents to the repository. These files can be
788 written with the write() method and are normally used as fast cache for
789 repository metadata.
790
791         bool add_rpmdb(int flags = 0)
792         $repo->add_rpmdb($flags);
793         repo.add_rpmdb(flags)
794         repo.add_rpmdb(flags)
795
796         bool add_rpmdb_reffp(FILE *reffp, int flags = 0)
797         $repo->add_rpmdb_reffp($reffp, $flags);
798         repo.add_rpmdb_reffp($reffp, flags)
799         repo.add_rpmdb_reffp($reffp, flags)
800
801 Add the contents of the rpm database to the repository. If a solv file
802 containing an old version of the database is available, it can be passed as
803 reffp to speed up reading.
804
805         bool add_rpm(const char *name, int flags = 0)
806         $repo->add_rpm($name, $flags);
807         repo.add_rpm(name, flags)
808         repo.add_rpm(name, flags)
809
810 Add the metadata of a single rpm package to the repository.
811
812         bool add_rpmdb_pubkeys(int flags = 0)
813         $repo->add_rpmdb_pubkeys();
814         repo.add_rpmdb_pubkeys()
815         repo.add_rpmdb_pubkeys()
816
817 Add all pubkeys contained in the rpm database to the repository. Note that
818 newer rpm versions also allow to store the pubkeys in some directory instead
819 of the rpm database.
820
821         bool add_pubkey(const char *keyfile, int flags = 0)
822         $repo->add_pubkey($keyfile);
823         repo.add_pubkey($keyfile)
824         repo.add_pubkey($keyfile)
825
826 Add a pubkey from a file to the repository.
827
828         bool add_rpmmd(FILE *fp, const char *language, int flags = 0)
829         $repo->add_rpmmd($fp, $language);
830         repo.add_rpmmd(fp, language)
831         repo.add_rpmmd(fp, language)
832
833 Add metadata stored in the "rpm-md" format (i.e. from files in the ``repodata''
834 directory) to a repository. Supported files are "primary", "filelists",
835 "other", "suseinfo". Do not forget to specify the *REPO_EXTEND_SOLVABLES* for
836 extension files like "filelists" and "other". Use the _language_ parameter if
837 you have language extension files, otherwise simply use a *undef*/*None*/*nil*
838 parameter.
839
840         bool add_repomdxml(FILE *fp, int flags = 0)
841         $repo->add_repomdxml($fp);
842         repo.add_repomdxml(fp)
843         repo.add_repomdxml(fp)
844
845 Add the repomd.xml meta description from the "rpm-md" format to the repository.
846 This file contains information about the repository like keywords, and also a
847 list of all database files with checksums. The data is added the the "meta"
848 section of the repository, i.e. no package gets created.
849
850         bool add_updateinfoxml(FILE *fp, int flags = 0)
851         $repo->add_updateinfoxml($fp);
852         repo.add_updateinfoxml(fp)
853         repo.add_updateinfoxml(fp)
854
855 Add the updateinfo.xml file containing available maintenance updates to the
856 repository. All updates are created as special packages that have a "patch:"
857 prefix in their name.
858
859         bool add_deltainfoxml(FILE *fp, int flags = 0)
860         $repo->add_deltainfoxml($fp);
861         repo.add_deltainfoxml(fp)
862         repo.add_deltainfoxml(fp)
863
864 Add the deltainfo.xml file (also called prestodelta.xml) containing available
865 delta-rpms to the repository. The data is added to the "meta" section, i.e. no
866 package gets created.
867
868         bool add_debdb(int flags = 0)
869         $repo->add_debdb();
870         repo.add_debdb()
871         repo.add_debdb()
872
873 Add the contents of the debian installed package database to the repository.
874
875         bool add_debpackages(FILE *fp, int flags = 0)
876         $repo->add_debpackages($fp);
877         repo.add_debpackages($fp)
878         repo.add_debpackages($fp)
879
880 Add the contents of the debian repository metadata (the "packages" file)
881 to the repository.
882
883         bool add_deb(const char *filename, int flags = 0)
884         $repo->add_deb($filename);
885         repo.add_deb(filename)
886         repo.add_deb(filename)
887
888 Add the metadata of a single deb package to the repository.
889
890         bool add_mdk(FILE *fp, int flags = 0)
891         $repo->add_mdk($fp);
892         repo.add_mdk($fp)
893         repo.add_mdk($fp)
894
895 Add the contents of the mageia/mandriva repository metadata (the
896 "synthesis.hdlist" file) to the repository.
897
898         bool add_mdk_info(FILE *fp, int flags = 0)
899         $repo->add_mdk($fp);
900         repo.add_mdk($fp)
901         repo.add_mdk($fp)
902
903 Extend the packages from the synthesis file with the info.xml and files.xml
904 data. Do not forget to specify *REPO_EXTEND_SOLVABLES*.
905
906         bool add_arch_repo(FILE *fp, int flags = 0)
907         $repo->add_arch_repo($fp);
908         repo.add_arch_repo($fp)
909         repo.add_arch_repo($fp)
910
911 Add the contents of the archlinux repository metadata (the ".db.tar" file) to
912 the repository.
913
914         bool add_arch_local(const char *dir, int flags = 0)
915         $repo->add_arch_local($dir);
916         repo.add_arch_local($dir)
917         repo.add_arch_local($dir)
918
919 Add the contents of the archlinux installed package database to the repository.
920 The _dir_ parameter is usually set to "/var/lib/pacman/local".
921
922         bool add_content(FILE *fp, int flags = 0)
923         $repo->add_content($fp);
924         repo.add_content(fp)
925         repo.add_content(fp)
926
927 Add the ``content'' meta description from the susetags format to the repository.
928 This file contains information about the repository like keywords, and also
929 a list of all database files with checksums. The data is added the the "meta"
930 section of the repository, i.e. no package gets created.
931
932         bool add_susetags(FILE *fp, Id defvendor, const char *language, int flags = 0)
933         $repo->add_susetags($fp, $defvendor, $language);
934         repo.add_susetags(fp, defvendor, language)
935         repo.add_susetags(fp, defvendor, language)
936
937 Add repository metadata in the susetags format to the repository. Like with
938 add_rpmmd, you can specify a language if you have language extension files. The
939 _defvendor_ parameter provides a default vendor for packages with missing
940 vendors, it is usually provided in the content file.
941
942         bool add_products(const char *dir, int flags = 0)
943         $repo->add_products($dir);
944         repo.add_products(dir)
945         repo.add_products(dir)
946
947 Add the installed SUSE products database to the repository. The _dir_ parameter
948 is usually "/etc/products.d".
949
950
951 THE SOLVABLE CLASS
952 ------------------
953 A solvable describes all the information of one package. Each solvable belongs to
954 one repository, it can be added and filled manually but in most cases solvables
955 will get created by the repo_add methods.
956
957 === ATTRIBUTES ===
958
959         Repo *repo;                     /* read only */
960         $solvable->{'repo'}
961         solvable.repo
962         solvable.repo
963
964 The repository this solvable belongs to.
965
966         Pool *pool;                     /* read only */
967         $solvable->{'pool'}
968         solvable.pool
969         solvable.pool
970
971 The pool this solvable belongs to, same as the pool of the repo.
972
973         Id id;                          /* read only */
974         $solvable->{'id'}
975         solvable.id
976         solvable.id
977
978 The specific id of the solvable.
979
980         char *name;                     /* read/write */
981         $solvable->{'name'}
982         solvable.name
983         solvable.name
984
985         char *evr;                      /* read/write */
986         $solvable->{'evr'}
987         solvable.evr
988         solvable.evr
989
990         char *arch;                     /* read/write */
991         $solvable->{'arch'}
992         solvable.arch
993         solvable.arch
994
995         char *vendor;                   /* read/write */
996         $solvable->{'vendor'}
997         solvable.vendor
998         solvable.vendor
999
1000 Easy access to often used attributes of solvables. They are
1001 internally stored as Ids.
1002
1003         Id nameid;                      /* read/write */
1004         $solvable->{'nameid'}
1005         solvable.nameid
1006         solvable.nameid
1007
1008         Id evrid;                       /* read/write */
1009         $solvable->{'evrid'}
1010         solvable.evrid
1011         solvable.evrid
1012
1013         Id archid;                      /* read/write */
1014         $solvable->{'archid'}
1015         solvable.archid
1016         solvable.archid
1017
1018         Id vendorid;                    /* read/write */
1019         $solvable->{'vendorid'}
1020         solvable.vendorid
1021         solvable.vendorid
1022
1023 Raw interface to the ids. Useful if you want to search for
1024 a specific id and want to avoid the string compare overhead.
1025
1026 === METHODS ===
1027
1028         const char *lookup_str(Id keyname)
1029         my $string = $solvable->lookup_str($keyname);
1030         string = solvable.lookup_str(keyname)
1031         string = solvable.lookup_str(keyname)
1032
1033         Id lookup_id(Id keyname)
1034         my $id = $solvable->lookup_id($keyname);
1035         id = solvable.lookup_id(solvid)
1036         id = solvable.lookup_id(solvid)
1037
1038         unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
1039         my $num = $solvable->lookup_num($keyname);
1040         num = solvable.lookup_num(keyname)
1041         num = solvable.lookup_num(keyname)
1042
1043         bool lookup_void(Id keyname)
1044         my $bool = $solvable->lookup_void($keyname);
1045         bool = solvable.lookup_void(keyname)
1046         bool = solvable.lookup_void(keyname)
1047
1048         Chksum *lookup_checksum(Id keyname)
1049         my $chksum = $solvable->lookup_checksum($keyname);
1050         chksum = solvable.lookup_checksum(keyname)
1051         chksum = solvable.lookup_checksum(keyname)
1052
1053         Queue lookup_idarray(Id keyname, Id marker = -1)
1054         my @ids = $solvable->lookup_idarray($keyname);
1055         ids = solvable.lookup_idarray(keyname)
1056         ids = solvable.lookup_idarray(keyname)
1057
1058         Queue lookup_deparray(Id keyname, Id marker = -1)
1059         my @deps = $solvable->lookup_deparray($keyname);
1060         deps = solvable.lookup_deparray(keyname)
1061         deps = solvable.lookup_deparray(keyname)
1062         
1063 Generic lookup methods. Retrieve data stored for the specific keyname.
1064 The lookup_idarray() method will return an array of Ids, use
1065 lookup_deparray if you want an array of Dependency objects instead.
1066 Some Id arrays contain two parts of data divided by a specific marker,
1067 for example the provides array uses the SOLVABLE_FILEMARKER id to
1068 store both the ids provided by the package and the ids added by
1069 the addfileprovides method. The default, -1, translates to the
1070 correct marker for the keyname and returns the first part of the
1071 array, use 1 to select the second part or 0 to retrive all ids
1072 including the marker.
1073
1074         const char *lookup_location(unsigned int *OUTPUT);
1075         my ($location, $medianr) = $solvable->lookup_location();
1076         location, medianr = solvable.lookup_location()
1077         location, medianr = solvable.lookup_location()
1078
1079 Return a tuple containing the on-media location and an optional
1080 media number for multi-part repositories (e.g. repositories
1081 spawning multiple DVDs).
1082
1083         void add_deparray(Id keyname, DepId dep, Id marker = -1);
1084         $solvable->add_deparray($keyname, $dep);
1085         solvable.add_deparray(keyname, dep)
1086         solvable.add_deparray(keyname, dep)
1087
1088 Add a new dependency to the attributes stored in keyname.
1089
1090         bool installable();
1091         $solvable->installable()
1092         solvable.installable()
1093         solvable.installable?
1094
1095 Return true if the solvable is installable on the system. Solvables
1096 are not installable if the system does not support their architecture.
1097
1098         bool isinstalled();
1099         $solvable->isinstalled()
1100         solvable.isinstalled()
1101         solvable.isinstalled?
1102
1103 Return true if the solvable is installed on the system.
1104
1105         Selection *Selection(int setflags = 0)
1106         my $sel = $solvable->Selection();
1107         sel = solvable.Selection()
1108         sel = solvable.Selection()
1109
1110 Create a Selection containing just the single solvable.
1111
1112         const char *str()
1113         my $str = $solvable->str();
1114         str = $solvable.str()
1115         str = $solvable.str()
1116
1117 Return a string describing the solvable. The string consists of the name,
1118 version, and architecture of the Solvable.
1119
1120         <stringification>
1121         my $str = "$solvable";
1122         str = str(solvable)
1123         str = solvable.to_s
1124
1125 Same as calling the str() method.
1126
1127         <equality>
1128         if ($solvable1 == $solvable2)
1129         if solvable1 == solvable2:
1130         if solvable1 == solvable2
1131
1132 Two solvables are equal if they are part of the same pool and have the same
1133 ids.
1134
1135 THE DATAITERATOR CLASS
1136 ----------------------
1137
1138 Dataiterators can be used to do complex string searches or
1139 to iterate over arrays. They can be created via the
1140 constructors in the Pool, Repo, and Solvable classes. The
1141 Repo and Solvable constructors will limit the search to
1142 the repository or the specific package.
1143
1144 === CONSTANTS ===
1145
1146 *SEARCH_STRING*::
1147   Return a match if the search string matches the value.
1148
1149 *SEARCH_STRINGSTART*::
1150   Return a match if the value starts with the search string.
1151
1152 *SEARCH_STRINGEND*::
1153   Return a match if the value ends with the search string.
1154
1155 *SEARCH_SUBSTRING*::
1156   Return a match if the search string can be matched somewhere
1157   in the value.
1158
1159 *SEARCH_GLOB*::
1160   Do a glob match of the search string against the value.
1161
1162 *SEARCH_REGEX*::
1163   Do a regular expression match of the search string against
1164   the value.
1165
1166 *SEARCH_NOCASE*::
1167   Ignore case when matching strings. Works for all the above
1168   match types.
1169
1170 *SEARCH_FILES*::
1171   Match the complete filenames of the file list, not just the
1172   base name.
1173
1174 *SEARCH_COMPLETE_FILELIST*::
1175   When matching the file list, check every file of the package
1176   not just the subset from the primary metadata.
1177
1178 *SEARCH_CHECKSUMS*::
1179   Allow the matching of checksum entries.
1180
1181 === METHODS ===
1182
1183         void prepend_keyname(Id keyname);
1184         $di->prepend_keyname($keyname);
1185         di.prepend_keyname(keyname)
1186         di.prepend_keyname(keyname)
1187
1188 Do a sub-search in the array stored in keyname.
1189
1190         void skip_solvable();
1191         $di->kip_solvable();
1192         di.skip_solvable()
1193         di.skip_solvable()
1194
1195 Stop matching the current solvable and advance to the next
1196 one.
1197
1198         <iteration>
1199         for my $d (@$di)
1200         for d in di:
1201         for d in di
1202
1203 Iterate through the matches. If there is a match, the object
1204 in d will be of type Datamatch.
1205
1206 THE DATAMATCH CLASS
1207 -------------------
1208 Objects of this type will be created for every value matched
1209 by a dataiterator.
1210
1211 === ATTRIBUTES ===
1212
1213         Pool *pool;                             /* read only */
1214         $d->{'pool'}
1215         d.pool
1216         d.pool
1217
1218 Back pointer to pool.
1219
1220         Repo *repo;                             /* read only */
1221         $d->{'repo'}
1222         d.repo
1223         d.repo
1224
1225 The repository containing the matched object.
1226
1227         Solvable *solvable;                     /* read only */
1228         $d->{'solvable'}
1229         d.solvable
1230         d.solvable
1231
1232 The solvable containing the value that was matched.
1233
1234         Id solvid;                              /* read only */
1235         $d->{'solvid'}
1236         d.solvid
1237         d.solvid
1238
1239 The id of the solvable that matched.
1240
1241 === METHODS ===
1242
1243         Id key_id();
1244         $d->key_id()
1245         d.key_id()
1246         d.key_id()
1247
1248         const char *key_idstr();
1249         $d->key_idstr()
1250         d.key_idstr()
1251         d.key_idstr()
1252
1253 The keyname that matched, either as id or string.
1254
1255         Id type_id();
1256         $d->type_id()
1257         d.type_id()
1258         d.type_id()
1259
1260         const char *type_idstr();
1261         $d->type_idstr();
1262         d.type_idstr()
1263         d.type_idstr()
1264
1265 The key type of the value that was matched, either as id or string.
1266
1267         Id id();
1268         $d->id()
1269         d.id()
1270         d.id()
1271
1272         Id idstr();
1273         $d->idstr()
1274         d.idstr()
1275         d.idstr()
1276
1277 The Id of the value that was matched (only valid for id types),
1278 either as id or string.
1279
1280         const char *str();
1281         $d->str()
1282         d.str()
1283         d.str()
1284
1285 The string value that was matched (only valid for string types).
1286
1287         unsigned long long num();
1288         $d->num()
1289         d.num()
1290         d.num()
1291
1292 The numeric value that was matched (only valid for numeric types).
1293
1294         unsigned int num2();
1295         $d->num2()
1296         d.num2()
1297         d.num2()
1298
1299 The secondary numeric value that was matched (only valid for types
1300 containing two values).
1301
1302         Datapos *pos();
1303         my $pos = $d->pos();
1304         pos = d.pos()
1305         pos = d.pos()
1306
1307 The position object of the current match. It can be used to do
1308 sub-searches starting at the match (if it is of an array type).
1309 See the Datapos class for more information.
1310
1311         Datapos *parentpos();
1312         my $pos = $d->parentpos();
1313         pos = d.parentpos()
1314         pos = d.parentpos()
1315
1316 The position object of the array containing the current match.
1317 It can be used to do sub-searches, see the Datapos class for more
1318 information.
1319
1320         <stringification>
1321         my $str = "$d";
1322         str = str(d)
1323         str = d.to_s
1324
1325 Return the stringification of the matched value. Stringification
1326 depends on the search flags, for file list entries it will return
1327 just the base name unless SEARCH_FILES is used, for checksums
1328 it will return an empty string unless SEARCH_CHECKSUMS is used.
1329 Numeric values are currently stringified to an empty string.
1330
1331
1332 THE SELECTION CLASS
1333 -------------------
1334 Selections are a way to easily deal with sets of packages.
1335 There are multiple constructors to create them, the most useful
1336 is probably the select() method in the Pool class.
1337
1338 === CONSTANTS ===
1339
1340 *SELECTION_NAME*::
1341   Create the selection by matching package names
1342
1343 *SELECTION_PROVIDES*::
1344   Create the selection by matching package provides
1345
1346 *SELECTION_FILELIST*::
1347   Create the selection by matching package files
1348
1349 *SELECTION_CANON*::
1350   Create the selection by matching the canonical representation
1351   of the package. This is normally a combination of the name,
1352   the version, and the architecture of a package.
1353
1354 *SELECTION_DOTARCH*::
1355   Allow an ``.<architecture>'' suffix when matching names or
1356   provides.
1357  
1358 *SELECTION_REL*::
1359   Allow the specification of a relation when matching names
1360   or provides, e.g. "name >= 1.2".
1361
1362 *SELECTION_INSTALLED_ONLY*::
1363   Limit the package search to installed packages.
1364
1365 *SELECTION_SOURCE_ONLY*::
1366   Limit the package search to source packages only.
1367
1368 *SELECTION_WITH_SOURCE*::
1369   Extend the package search to also match source packages. The
1370   default is only to match binary packages.
1371
1372 *SELECTION_GLOB*::
1373   Allow glob matching for package names, package provides, and
1374   file names.
1375
1376 *SELECTION_NOCASE*::
1377   Ignore case when matching package names, package provides,
1378   and file names.
1379
1380 *SELECTION_FLAT*::
1381   Return only one selection element describing the selected packages.
1382   The default is to create multiple elements for all globbed packages.
1383   Multiple elements are useful if you want to turn the selection into
1384   an install job, in that case you want an install job for every
1385   globbed package.
1386
1387 === ATTRIBUTES ===
1388
1389         Pool *pool;                             /* read only */
1390         $d->{'pool'}
1391         d.pool
1392         d.pool
1393
1394 Back pointer to pool.
1395
1396 === METHODS ===
1397
1398         int flags();
1399         my $flags = $sel->flags();
1400         flags = sel.flags()
1401         flags = sel.flags()
1402
1403 Return the result flags of the selection. The flags are a subset
1404 of the ones used when creating the selection, they describe which
1405 method was used to get the result. For example, if you create the
1406 selection with ``SELECTION_NAME | SELECTION_PROVIDES'', the resulting
1407 flags will either be SELECTION_NAME or SELECTION_PROVIDES depending
1408 if there was a package that matched the name or not. If there was
1409 no match at all, the flags will be zero.
1410
1411         bool isempty();
1412         $sel->isempty()
1413         sel.isempty()
1414         sel.isempty?
1415
1416 Return true if the selection is empty, i.e. no package could be matched.
1417
1418         void filter(Selection *other)
1419         $sel->filter($other);
1420         sel.filter(other)
1421         sel.filter(other)
1422
1423 Intersect two selections. Packages will only stay in the selection if there
1424 are also included in the other selecting. Does an in-place modification.
1425
1426         void add(Selection *other)
1427         $sel->add($other);
1428         sel.add(other)
1429         sel.add(other)
1430
1431 Build the union of two selections. All packages of the other selection will
1432 be added to the set of packages of the selection object. Does an in-place
1433 modification. Note that the selection flags are no longer meaningful after the
1434 add operation.
1435
1436         void add_raw(Id how, Id what)
1437         $sel->add_raw($how, $what);
1438         sel.add_raw(how, what)
1439         sel.add_raw(how, what)
1440
1441 Add a raw element to the selection. Check the Job class for information about
1442 the how and what parameters.
1443
1444         Job *jobs(int action)
1445         my @jobs = $sel->jobs($action);
1446         jobs = sel.jobs(action)
1447         jobs = sel.jobs(action)
1448
1449 Convert a selection into an array of Job objects. The action parameter is or-ed
1450 to the ``how'' part of the job, it describes the type of job (e.g. install,
1451 erase). See the Job class for the action and action modifier constants.
1452
1453         Solvable *solvables()
1454         my @solvables = $sel->solvables();
1455         solvables = sel.solvables()
1456         solvables = sel.solvables()
1457
1458 Convert a selection into an array of Solvable objects.
1459
1460         <stringification>
1461         my $str = "$sel";
1462         str = str(sel)
1463         str = sel.to_s
1464
1465 Return a string describing the selection.
1466
1467 THE JOB CLASS
1468 -------------
1469 Jobs are the way to specify to the dependency solver what to do.
1470 Most of the times jobs will get created by calling the jobs() method
1471 on a Selection object, but there is also a Job() constructor in the
1472 Pool class.
1473
1474 === CONSTANTS ===
1475
1476 Selection constants:
1477
1478 *SOLVER_SOLVABLE*::
1479   The ``what'' part is the id of a solvable.
1480
1481 *SOLVER_SOLVABLE_NAME*::
1482   The ``what'' part is the id of a package name.
1483
1484 *SOLVER_SOLVABLE_PROVIDES*::
1485   The ``what'' part is the id of a package provides.
1486
1487 *SOLVER_SOLVABLE_ONE_OF*::
1488   The ``what'' part is an offset into the ``whatprovides'' data, created
1489   by calling the towhatprovides() pool method.
1490
1491 *SOLVER_SOLVABLE_REPO*::
1492   The ``what'' part is the id of a repository.
1493
1494 *SOLVER_SOLVABLE_ALL*::
1495   The ``what'' part is ignored, all packages are selected.
1496
1497 *SOLVER_SOLVABLE_SELECTMASK*::
1498   A mask containing all the above selection bits.
1499
1500 Action constants:
1501
1502 *SOLVER_NOOP*::
1503   Do nothing.
1504
1505 *SOLVER_INSTALL*::
1506   Install a package of the specified set of packages. It tries to install
1507   the best matching package (i.e. the highest version of the packages from
1508   the repositories with the highest priority).
1509
1510 *SOLVER_ERASE*::
1511   Erase all of the packages from the specified set. If a package is not
1512   installed, erasing it will keep it from getting installed.
1513
1514 *SOLVER_UPDATE*::
1515   Update the matching installed packages to their best version. If none
1516   of the specified packages are installed, try to update the installed
1517   packages to the specified versions. See the section about targeted
1518   updates about more information.
1519   
1520 *SOLVER_WEAKENDEPS*::
1521   Allow to break the dependencies of the matching packages. Handle with care.
1522
1523 *SOLVER_MULTIVERSION*::
1524   Mark the matched packages for multiversion install. If they get to be installed
1525   because of some other job, the installation will keep the old version of the
1526   package installed (for rpm by using ``-i'' instead of ``-U'').
1527
1528 *SOLVER_LOCK*::
1529   Do not change the state of the matched packages, i.e. when they are installed
1530   they stay installed, if not they are not selected for installation.
1531
1532 *SOLVER_DISTUPGRADE*::
1533   Update the matching installed packages to the best version included in one
1534   of the repositories. After this operation, all come from one of the available
1535   repositories except orphaned packages. Orphaned packages are packages that
1536   have no relation to the packages in the repositories, i.e. no package in the
1537   repositories have the same name or obsolete the orphaned package.
1538   This action brings the installed packages in sync with the ones in the
1539   repository. It also turns of arch/vendor/version locking for the affected
1540   packages to simulate a fresh installation. This means that distupgrade can
1541   actually downgrade packages if only lower versions of a package are available
1542   in the repositories.
1543
1544 *SOLVER_DROP_ORPHANED*::
1545   Erase all the matching installed packages if they are orphaned. This only makes
1546   sense if there is a ``distupgrade all packages'' job. The default is to erase
1547   orphaned packages only if they block the installation of other packages.
1548
1549 *SOLVER_VERIFY*::
1550   Fix dependency problems of matching installed packages. The default is to ignore
1551   dependency problems for installed packages.
1552
1553 *SOLVER_USERINSTALLED*::
1554   The matching installed packages are considered to be installed by a user, thus
1555   not installed to fulfil some dependency. This is needed input for the calculation
1556   of unneeded packages for jobs that have the SOLVER_CLEANDEPS flag set.
1557
1558 *SOLVER_JOBMASK*::
1559   A mask containing all the above action bits.
1560
1561 Action modifier constants:
1562
1563 *SOLVER_WEAK*::
1564   Makes the job a weak job. The solver tries to fulfil weak jobs, but does not
1565   report a problem if it is not possible to do so.
1566
1567 *SOLVER_ESSENTIAL*::
1568   Makes the job an essential job. If there is a problem with the job, the solver
1569   will not propose to remove the job as one solution (unless all other solutions
1570   are also to remove essential jobs).
1571
1572 *SOLVER_CLEANDEPS*::
1573   The solver will try to also erase all packages dragged in through dependencies
1574   when erasing the package. This needs SOLVER_USERINSTALLED jobs to maximize user
1575   satisfaction.
1576
1577 *SOLVER_FORCEBEST*::
1578   Insist on the best package for install, update, and distupgrade jobs. If this
1579   flag is not used, the solver will use the second-best package if the best
1580   package cannot be installed for some reason. When this flag is used, the solver
1581   will generate a problem instead.
1582
1583 *SOLVER_TARGETED*::
1584   Forces targeted operation update and distupgrade jobs. See the section about
1585   targeted updates about more information.
1586
1587 Set constants.
1588
1589 *SOLVER_SETEV*::
1590   The job specified the exact epoch and version of the package set.
1591
1592 *SOLVER_SETEVR*::
1593   The job specified the exact epoch, version, and release of the package set.
1594
1595 *SOLVER_SETARCH*::
1596   The job specified the exact architecture of the packages from the set.
1597
1598 *SOLVER_SETVENDOR*::
1599   The job specified the exact vendor of the packages from the set.
1600
1601 *SOLVER_SETREPO*::
1602   The job specified the exact repository of the packages from the set.
1603
1604 *SOLVER_SETNAME*::
1605   The job specified the exact name of the packages from the set.
1606
1607 *SOLVER_NOAUTOSET*::
1608   Turn of automatic set flag generation for SOLVER_SOLVABLE jobs.
1609
1610 *SOLVER_SETMASK*::
1611   A mask containing all the above set bits.
1612
1613 See the section about set bits for more information.
1614
1615 === ATTRIBUTES ===
1616
1617         Pool *pool;                             /* read only */
1618         $job->{'pool'}
1619         d.pool
1620         d.pool
1621
1622 Back pointer to pool.
1623
1624         Id how;                                 /* read/write */
1625         $job->{'how'}
1626         d.how
1627         d.how
1628
1629 Union of the selection, action, action modifier, and set flags.
1630 The selection part describes the semantics of the ``what'' Id.
1631
1632         Id what;                                /* read/write */
1633         $job->{'what'}
1634         d.what
1635         d.what
1636
1637 Id describing the set of packages, the meaning depends on the
1638 selection part of the ``how'' attribute.
1639
1640 === METHODS ===
1641
1642         Solvable *solvables()
1643         my @solvables = $job->solvables();
1644         solvables = job.solvables()
1645         solvables = job.solvables()
1646
1647 Return the set of solvables of the job as an array of Solvable
1648 objects.
1649
1650         bool isemptyupdate();
1651         $job->isemptyupdate()
1652         job.isemptyupdate()
1653         job.isemptyupdate?
1654
1655 Convenience function to find out if the job describes an update
1656 job with no matching packages, i.e. a job that does nothing.
1657 Some package managers like ``zypper'' like to turn those jobs
1658 into install jobs, i.e. an update of a not-installed package
1659 will result into the installation of the package.
1660
1661         <stringification>
1662         my $str = "$job";
1663         str = str(job)
1664         str = job.to_s
1665
1666 Return a string describing the job.
1667
1668         <equality>
1669         if ($job1 == $job2)
1670         if job1 == job2:
1671         if job1 == job2
1672
1673 Two jobs are equal if they belong to the same pool and both the
1674 ``how'' and the ``what'' attributes are the same.
1675
1676 === TARGETED UPDATES ===
1677 Libsolv has two modes for upgrades and distupgrade: targeted and
1678 untargeted. Untargeted mode means that the installed packages from
1679 the specified set will be updated to the best version. Targeted means
1680 that packages that can be updated to a package in the specified set
1681 will be updated to the best package of the set.
1682
1683 Here's an example to explain the subtle difference. Suppose that
1684 you have package A installed in version "1.1", "A-1.2" is available
1685 in one of the repositories and there is also package "B" that
1686 obsoletes package A.
1687
1688 An untargeted update of "A" will update the installed "A-1.1" to
1689 package "B", because that is the newest version (B obsoletes A and
1690 is thus newer).
1691
1692 A targeted update of "A" will update "A-1.1" to "A-1.2", as the
1693 set of packages contains both "A-1.1" and "A-1.2", and "A-1.2" is
1694 the newer one.
1695
1696 An untargeted update of "B" will do nothing, as "B" is not installed.
1697
1698 An targeted update of "B" will update "A-1.1" to "B".
1699
1700 Note that the default is to do "auto-targeting", thus if the specified
1701 set of packages does not include an installed package, the solver
1702 will assume targeted operation even if SOLVER_TARGETED is not used.
1703 You can turn off auto-targeting with the SOLVER_FLAG_NO_AUTOTARGET
1704 solver option, see the Solver class for details.
1705
1706 === SET BITS ===
1707 Set bits specify which parts of the specified packages where specified
1708 by the user. It is used by the solver when checking if an operation is
1709 allowed or not. For example, the solver will normally not allow the
1710 downgrade of an installed package. But it will not report a problem if
1711 the SOLVER_SETEVR flag is used, as it then assumes that the user specified
1712 the exact version and thus knows what he is doing.
1713
1714 So if a package "screen-1-1" is installed for the x86_64 architecture and
1715 version "2-1" is only available for the i586 architecture, installing
1716 package "screen-2.1" will ask the user for confirmation because of the
1717 different architecture. When using the Selection class to create jobs
1718 the set bits are automatically added, e.g. selecting ``screen.i586'' will
1719 automatically add SOLVER_SETARCH, and thus no problem will be reported.
1720
1721 THE SOLVER CLASS
1722 ----------------
1723 xxx
1724
1725 THE TRANSACTION CLASS
1726 ---------------------
1727 xxx
1728
1729 CHECKSUMS
1730 ---------
1731 Checksums (also called hashes) are used to make sure that downloaded data is
1732 not corrupt and also as a fingerprint mechanism to check if data has changed.
1733
1734 === CLASS METHODS ===
1735
1736         Chksum *Chksum(Id type)
1737         my $chksum = solv::Chksum->new($type);
1738         chksum = solv.Chksum(type)
1739         chksum = Solv::Chksum.new(type)
1740
1741 Create a checksum object. Currently the following types are supported:
1742
1743         REPOKEY_TYPE_MD5
1744         REPOKEY_TYPE_SHA1
1745         REPOKEY_TYPE_SHA256
1746
1747 These keys are constants in the *solv* class.
1748
1749         Chksum *Chksum(Id type, const char *hex)
1750         my $chksum = solv::Chksum->new($type, $hex);
1751         chksum = solv.Chksum(type, hex)
1752         chksum = Solv::Chksum.new(type, hex)
1753
1754 Create an already finalized checksum object.
1755
1756 === ATTRIBUTES ===
1757
1758         Id type;                        /* read only */
1759         $chksum->{'type'}
1760         chksum.type
1761         chksum.type
1762
1763 Return the type of the checksum object.
1764
1765 === METHODS ===
1766
1767         void add(const char *str)
1768         $chksum->add($str);
1769         chksum.add(str)
1770         chksum.add(str)
1771
1772 Add a string to the checksum.
1773
1774         void add_fp(FILE *fp)
1775         $chksum->add_fp($file);
1776         chksum.add_fp(file)
1777         chksum.add_fp(file)
1778
1779 Add the contents of a file to the checksum.
1780         
1781         void add_stat(const char *filename)
1782         $chksum->add_stat($filename);
1783         chksum.add_stat(filename)
1784         chksum.add_stat(filename)
1785
1786 Stat the file and add the dev/ino/size/mtime member to the checksum. If the
1787 stat fails, the members are zeroed.
1788
1789         void add_fstat(int fd)
1790         $chksum->add_fstat($fd);
1791         chksum.add_fstat(fd)
1792         chksum.add_fstat(fd)
1793
1794 Same as add_stat, but instead of the filename a file descriptor is used.
1795
1796         unsigned char *raw()
1797         my $raw = $chksum->raw();
1798         raw = chksum.raw()
1799         raw = chksum.raw()
1800
1801 Finalize the checksum and return the result as raw bytes. This means that the
1802 result can contain NUL bytes or unprintable characters.
1803
1804         const char *hex()
1805         my $raw = $chksum->hex();
1806         raw = chksum.hex()
1807         raw = chksum.hex()
1808
1809 Finalize the checksum and return the result as hex string.
1810
1811         <equality>
1812         if ($chksum1 == $chksum2)
1813         if chksum1 == chksum2:
1814         if chksum1 == chksum2
1815
1816 Checksums are equal if they are of the same type and the finalized results are
1817 the same.
1818
1819         <stringification>
1820         my $str = "$chksum";
1821         str = str(chksum)
1822         str = chksum.to_s
1823
1824 If the checksum is finished, the checksum is returned as "<type>:<hex>" string.
1825 Otherwise "<type>:unfinished" is returned.
1826
1827
1828 FILE MANAGEMENT
1829 ---------------
1830 This functions were added because libsolv uses standard *FILE* pointers to
1831 read/write files, but languages like perl have their own implementation of
1832 files. The libsolv functions also support decompression and compression, the
1833 algorithm is selected by looking at the file name extension.
1834
1835         FILE *xfopen(char *fn, char *mode = "r")
1836         my $file = solv::xfopen($path);
1837         file = solv.xfopen(path)
1838         file = Solv::xfopen(path)
1839
1840 Open a file at the specified path. The `mode` argument is passed on to the
1841 stdio library.
1842
1843         FILE *xfopen_fd(char *fn, int fileno)
1844         my $file = solv::xfopen_fd($path, $fileno);
1845         file = solv.xfopen_fd(path, fileno)
1846         file = Solv::xfopen_fd(path, fileno)
1847
1848 Create a file handle from the specified file descriptor. The path argument is
1849 only used to select the correct (de-)compression algorithm, use an empty path
1850 if you want to make sure to read/write raw data.
1851
1852 === METHODS ===
1853
1854         int fileno()
1855         my $fileno = $file->fileno();
1856         fileno = file.fileno()
1857         fileno = file.fileno()
1858
1859 Return file file descriptor of the file. If the file is not open, `-1` is
1860 returned.
1861
1862         int dup()
1863         my $fileno = $file->dup();
1864         fileno = file.dup()
1865         fileno = file.dup()
1866
1867 Return a copy of the descriptor of the file. If the file is not open, `-1` is
1868 returned.
1869
1870         bool flush()
1871         $file->flush();
1872         file.flush()
1873         file.flush()
1874
1875 Flush the file. Returns false if there was an error. Flushing a closed file
1876 always returns true.
1877
1878         bool close()
1879         $file->close();
1880         file.close()
1881         file.close()
1882
1883 Close the file. This is needed for languages like Ruby, that do not destruct
1884 objects right after they are no longer referenced. In that case, it is good
1885 style to close open files so that the file descriptors are freed right away.
1886 Returns false if there was an error.
1887
1888 THE REPODATACLASS
1889 -----------------
1890 xxx
1891
1892 Author
1893 ------
1894 Michael Schroeder <mls@suse.de>
1895