1LIBSOLV-BINDINGS(3)                 LIBSOLV                LIBSOLV-BINDINGS(3)
2
3
4

NAME

6       libsolv-bindings - access libsolv from perl/python/ruby
7

DESCRIPTION

9       Libsolv’s language bindings offer an abstract, object orientated
10       interface to the library. The supported languages are currently perl,
11       python, and ruby. All example code (except in the specifics sections,
12       of course) lists first the “C-ish” interface, then the syntax for perl,
13       python, and ruby (in that order).
14

PERL SPECIFICS

16       Libsolv’s perl bindings can be loaded with the following statement:
17
18           use solv;
19
20       Objects are either created by calling the new() method on a class or
21       they are returned by calling methods on other objects.
22
23           my $pool = solv::Pool->new();
24           my $repo = $pool->add_repo("my_first_repo");
25
26       Swig encapsulates all objects as tied hashes, thus the attributes can
27       be accessed by treating the object as standard hash reference:
28
29           $pool->{appdata} = 42;
30           printf "appdata is %d\n", $pool->{appdata};
31
32       A special exception to this are iterator objects, they are encapsulated
33       as tied arrays so that it is possible to iterate with a for()
34       statement:
35
36           my $iter = $pool->solvables_iter();
37           for my $solvable (@$iter) { ... };
38
39       As a downside of this approach, iterator objects cannot have
40       attributes.
41
42       If an array needs to be passed to a method it is usually done by
43       reference, if a method returns an array it returns it on the stack:
44
45           my @problems = $solver->solve(\@jobs);
46
47       Due to a bug in swig, stringification does not work for libsolv’s
48       objects. Instead, you have to call the object’s str() method.
49
50           print $dep->str() . "\n";
51
52       Swig implements all constants as numeric variables (instead of the more
53       natural constant subs), so don’t forget the leading “$” when accessing
54       a constant. Also do not forget to prepend the namespace of the
55       constant:
56
57           $pool->set_flag($solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1);
58

PYTHON SPECIFICS

60       The python bindings can be loaded with:
61
62           import solv
63
64       Objects are either created by calling the constructor method for a
65       class or they are returned by calling methods on other objects.
66
67           pool = solv.Pool()
68           repo = pool.add_repo("my_first_repo")
69
70       Attributes can be accessed as usual:
71
72           pool.appdata = 42
73           print "appdata is %d" % (pool.appdata)
74
75       Iterators also work as expected:
76
77           for solvable in pool.solvables_iter():
78
79       Arrays are passed and returned as list objects:
80
81           jobs = []
82           problems = solver.solve(jobs)
83
84       The bindings define stringification for many classes, some also have a
85       repr method to ease debugging.
86
87           print dep
88           print repr(repo)
89
90       Constants are attributes of the classes:
91
92           pool.set_flag(solv.Pool.POOL_FLAG_OBSOLETEUSESCOLORS, 1);
93

RUBY SPECIFICS

95       The ruby bindings can be loaded with:
96
97           require 'solv'
98
99       Objects are either created by calling the new method on a class or they
100       are returned by calling methods on other objects. Note that all classes
101       start with an uppercase letter in ruby, so the class is called “Solv”.
102
103           pool = Solv::Pool.new
104           repo = pool.add_repo("my_first_repo")
105
106       Attributes can be accessed as usual:
107
108           pool.appdata = 42
109           puts "appdata is #{pool.appdata}"
110
111       Iterators also work as expected:
112
113           for solvable in pool.solvables_iter() do ...
114
115       Arrays are passed and returned as array objects:
116
117           jobs = []
118           problems = solver.solve(jobs)
119
120       Most classes define a to_s method, so objects can be easily
121       stringified. Many also define an inspect() method.
122
123           puts dep
124           puts repo.inspect
125
126       Constants live in the namespace of the class they belong to:
127
128           pool.set_flag(Solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1);
129
130       Note that boolean methods have an added trailing “?”, to be consistent
131       with other ruby modules:
132
133           puts "empty" if repo.isempty?
134

TCL SPECIFICS

136       Libsolv’s tcl bindings can be loaded with the following statement:
137
138           package require solv
139
140       Objects are either created by calling class name prefixed with “new_”,
141       or they are returned by calling methods on other objects.
142
143           set pool [solv::new_Pool]
144           set repo [$pool add_repo "my_first_repo"]
145
146       Swig provides a “cget” method to read object attributes, and a
147       “configure” method to write them:
148
149           $pool configure -appdata 42
150           puts "appdata is [$pool cget -appdata]"
151
152       The tcl bindings provide a little helper to work with iterators in a
153       foreach style:
154
155           set iter [$pool solvables_iter]
156           solv::iter s $iter { ... }
157
158       libsolv’s arrays are mapped to tcl’s lists:
159
160           set jobs [list $job1 $job2]
161           set problems [$solver solve $jobs]
162           puts "We have [llength $problems] problems..."
163
164       Stringification is done by calling the object’s “str” method.
165
166           puts [$dep str]
167
168       There is one exception: you have to use “stringify” for Datamatch
169       objects, as swig reports a clash with the “str” attribute. Some objects
170       also support a “==” method for equality tests, and a “!=” method.
171
172       Swig implements all constants as numeric variables, constants belonging
173       to a libsolv class are prefixed with the class name:
174
175           $pool set_flag $solv::Pool_POOL_FLAG_OBSOLETEUSESCOLORS  1
176           puts [$solvable lookup_str $solv::SOLVABLE_SUMMARY]
177

THE SOLV CLASS

179       This is the main namespace of the library, you cannot create objects of
180       this type but it contains some useful constants.
181
182   CONSTANTS
183       Relational flag constants, the first three can be or-ed together
184
185       REL_LT
186           the “less than” bit
187
188       REL_EQ
189           the “equals to” bit
190
191       REL_GT
192           the “greater than” bit
193
194       REL_ARCH
195           used for relations that describe an extra architecture filter, the
196           version part of the relation is interpreted as architecture.
197
198       Special Solvable Ids
199
200       SOLVID_META
201           Access the meta section of a repository or repodata area. This is
202           like an extra Solvable that has the Id SOLVID_META.
203
204       SOLVID_POS
205           Use the data position stored inside of the pool instead of
206           accessing some solvable by Id. The bindings have the Datapos
207           objects as an abstraction mechanism, so you do not need this
208           constant.
209
210       Constant string Ids
211
212       ID_NULL
213           Always zero
214
215       ID_EMPTY
216           Always one, describes the empty string
217
218       SOLVABLE_NAME
219           The keyname Id of the name of the solvable.
220
221       ...
222           see the libsolv-constantids manpage for a list of fixed Ids.
223

THE POOL CLASS

225       The pool is libsolv’s central resource manager. A pool consists of
226       Solvables, Repositories, Dependencies, each indexed by Ids.
227
228   CLASS METHODS
229           Pool *Pool()
230           my $pool = solv::Pool->new();
231           pool = solv.Pool()
232           pool = Solv::Pool.new()
233
234       Create a new pool instance. In most cases you just need one pool. Note
235       that the returned object "owns" the pool, i.e. if the object is freed,
236       the pool is also freed. You can use the disown method to break this
237       ownership relation.
238
239   ATTRIBUTES
240           void *appdata;                  /* read/write */
241           $pool->{appdata}
242           pool.appdata
243           pool.appdata
244
245       Application specific data that may be used in any way by the code using
246       the pool.
247
248           Solvable solvables[];           /* read only */
249           my $solvable = $pool->{solvables}->[$solvid];
250           solvable = pool.solvables[solvid]
251           solvable = pool.solvables[solvid]
252
253       Look up a Solvable by its id.
254
255           Repo repos[];                   /* read only */
256           my $repo = $pool->{repos}->[$repoid];
257           repo = pool.repos[repoid]
258           repo = pool.repos[repoid]
259
260       Look up a Repository by its id.
261
262           Repo *installed;                /* read/write */
263           $pool->{installed} = $repo;
264           pool.installed = repo
265           pool.installed = repo
266
267       Define which repository contains all the installed packages.
268
269           const char *errstr;             /* read only */
270           my $err = $pool->{errstr};
271           err = pool.errstr
272           err = pool.errstr
273
274       Return the last error string that was stored in the pool.
275
276   CONSTANTS
277       POOL_FLAG_PROMOTEEPOCH
278           Promote the epoch of the providing dependency to the requesting
279           dependency if it does not contain an epoch. Used at some time in
280           old rpm versions, modern systems should never need this.
281
282       POOL_FLAG_FORBIDSELFCONFLICTS
283           Disallow the installation of packages that conflict with
284           themselves. Debian always allows self-conflicting packages, rpm
285           used to forbid them but switched to also allowing them recently.
286
287       POOL_FLAG_OBSOLETEUSESPROVIDES
288           Make obsolete type dependency match against provides instead of
289           just the name and version of packages. Very old versions of rpm
290           used the name/version, then it got switched to provides and later
291           switched back again to just name/version.
292
293       POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES
294           An implicit obsoletes is the internal mechanism to remove the old
295           package on an update. The default is to remove all packages with
296           the same name, rpm-5 switched to also removing packages providing
297           the same name.
298
299       POOL_FLAG_OBSOLETEUSESCOLORS
300           Rpm’s multilib implementation (used in RedHat and Fedora)
301           distinguishes between 32bit and 64bit packages (the terminology is
302           that they have a different color). If obsoleteusescolors is set,
303           packages with different colors will not obsolete each other.
304
305       POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS
306           Same as POOL_FLAG_OBSOLETEUSESCOLORS, but used to find out if
307           packages of the same name can be installed in parallel. For current
308           Fedora systems, POOL_FLAG_OBSOLETEUSESCOLORS should be false and
309           POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS should be true (this is the
310           default if FEDORA is defined when libsolv is compiled).
311
312       POOL_FLAG_NOINSTALLEDOBSOLETES
313           New versions of rpm consider the obsoletes of installed packages
314           when checking for dependency, thus you may not install a package
315           that is obsoleted by some other installed package, unless you also
316           erase the other package.
317
318       POOL_FLAG_HAVEDISTEPOCH
319           Mandriva added a new field called distepoch that gets checked in
320           version comparison if the epoch/version/release of two packages are
321           the same.
322
323       POOL_FLAG_NOOBSOLETESMULTIVERSION
324           If a package is installed in multiversionmode, rpm used to ignore
325           both the implicit obsoletes and the obsolete dependency of a
326           package. This was changed to ignoring just the implicit obsoletes,
327           thus you may install multiple versions of the same name, but
328           obsoleted packages still get removed.
329
330       POOL_FLAG_ADDFILEPROVIDESFILTERED
331           Make the addfileprovides method only add files from the standard
332           locations (i.e. the “bin” and “etc” directories). This is useful if
333           you have only few packages that use non-standard file dependencies,
334           but you still want the fast speed that addfileprovides() generates.
335
336   METHODS
337           void free()
338           $pool->free();
339           pool.free()
340           pool.free()
341
342       Force a free of the pool. After this call, you must not access any
343       object that still references the pool.
344
345           void disown()
346           $pool->disown();
347           pool.disown()
348           pool.disown()
349
350       Break the ownership relation between the binding object and the pool.
351       After this call, the pool will not get freed even if the object goes
352       out of scope. This also means that you must manually call the free
353       method to free the pool data.
354
355           void setdebuglevel(int level)
356           $pool->setdebuglevel($level);
357           pool.setdebuglevel(level)
358           pool.setdebuglevel(level)
359
360       Set the debug level. A value of zero means no debug output, the higher
361       the value, the more output is generated.
362
363           int set_flag(int flag, int value)
364           my $oldvalue = $pool->set_flag($flag, $value);
365           oldvalue = pool.set_flag(flag, value)
366           oldvalue = pool.set_flag(flag, value)
367
368           int get_flag(int flag)
369           my $value = $pool->get_flag($flag);
370           value = pool.get_flag(flag)
371           value = pool.get_flag(flag)
372
373       Set/get a pool specific flag. The flags define how the system works,
374       e.g. how the package manager treats obsoletes. The default flags should
375       be sane for most applications, but in some cases you may want to tweak
376       a flag, for example if you want to solv package dependencies for some
377       other system than yours.
378
379           void set_rootdir(const char *rootdir)
380           $pool->set_rootdir(rootdir);
381           pool.set_rootdir(rootdir)
382           pool.set_rootdir(rootdir)
383
384           const char *get_rootdir()
385           my $rootdir = $pool->get_rootdir();
386           rootdir = pool.get_rootdir()
387           rootdir = pool.get_rootdir()
388
389       Set/get the rootdir to use. This is useful if you want package
390       management to work only in some directory, for example if you want to
391       setup a chroot jail. Note that the rootdir will only be prepended to
392       file paths if the REPO_USE_ROOTDIR flag is used.
393
394           void setarch(const char *arch = 0)
395           $pool->setarch();
396           pool.setarch()
397           pool.setarch()
398
399       Set the architecture for your system. The architecture is used to
400       determine which packages are installable. It defaults to the result of
401       “uname -m”.
402
403           Repo add_repo(const char *name)
404           $repo = $pool->add_repo($name);
405           repo = pool.add_repo(name)
406           repo = pool.add_repo(name)
407
408       Add a Repository with the specified name to the pool. The repository is
409       empty on creation, use the repository methods to populate it with
410       packages.
411
412           Repoiterator repos_iter()
413           for my $repo (@{$pool->repos_iter()})
414           for repo in pool.repos_iter():
415           for repo in pool.repos_iter()
416
417       Iterate over the existing repositories.
418
419           Solvableiterator solvables_iter()
420           for my $solvable (@{$pool->solvables_iter()})
421           for solvable in pool.solvables_iter():
422           for solvable in pool.solvables_iter()
423
424       Iterate over the existing solvables.
425
426           Dep Dep(const char *str, bool create = 1)
427           my $dep = $pool->Dep($string);
428           dep = pool.Dep(string)
429           dep = pool.Dep(string)
430
431       Create an object describing a string or dependency. If the string is
432       currently not in the pool and create is false, undef/None/nil is
433       returned.
434
435           void addfileprovides()
436           $pool->addfileprovides();
437           pool.addfileprovides()
438           pool.addfileprovides()
439
440           Id *addfileprovides_queue()
441           my @ids = $pool->addfileprovides_queue();
442           ids = pool.addfileprovides_queue()
443           ids = pool.addfileprovides_queue()
444
445       Some package managers like rpm allow dependencies on files contained in
446       other packages. To allow libsolv to deal with those dependencies in an
447       efficient way, you need to call the addfileprovides method after
448       creating and reading all repositories. This method will scan all
449       dependency for file names and then scan all packages for matching
450       files. If a filename has been matched, it will be added to the provides
451       list of the corresponding package. The addfileprovides_queue variant
452       works the same way but returns an array containing all file
453       dependencies. This information can be stored in the meta section of the
454       repositories to speed up the next time the repository is loaded and
455       addfileprovides is called.
456
457           void createwhatprovides()
458           $pool->createwhatprovides();
459           pool.createwhatprovides()
460           pool.createwhatprovides()
461
462       Create the internal “whatprovides” hash over all of the provides of all
463       packages. This method must be called before doing any lookups on
464       provides. It’s encouraged to do it right after all repos are set up,
465       usually right after the call to addfileprovides().
466
467           Solvable *whatprovides(DepId dep)
468           my @solvables = $pool->whatprovides($dep);
469           solvables = pool.whatprovides(dep)
470           solvables = pool.whatprovides(dep)
471
472       Return all solvables that provide the specified dependency. You can use
473       either a Dep object or a simple Id as argument.
474
475           Id *matchprovidingids(const char *match, int flags)
476           my @ids = $pool->matchprovidingids($match, $flags);
477           ids = pool.matchprovidingids(match, flags)
478           ids = pool.matchprovidingids(match, flags)
479
480       Search the names of all provides and return the ones matching the
481       specified string. See the Dataiterator class for the allowed flags.
482
483           Id towhatprovides(Id *ids)
484           my $offset = $pool->towhatprovides(\@ids);
485           offset = pool.towhatprovides(ids)
486           offset = pool.towhatprovides(ids)
487
488       “Internalize” an array containing Ids. The returned value can be used
489       to create solver jobs working on a specific set of packages. See the
490       Solver class for more information.
491
492           void set_namespaceproviders(DepId ns, DepId evr, bool value = 1)
493           $pool->set_namespaceproviders($ns, $evr, 1);
494           pool.set_namespaceproviders(ns, evr, True)
495           pool.set_namespaceproviders(ns, evr, true)
496
497       Manually set an namespace provides entry in the whatprovides index.
498
499           void flush_namespaceproviders(DepId ns, DepId evr)
500           $pool->flush_namespaceproviders($ns, $evr);
501           $pool.flush_namespaceproviders(ns, evr)
502           $pool.flush_namespaceproviders(ns, evr)
503
504       Flush the cache of all namespacprovudes matching the specified
505       namespace dependency. You can use zero as a wildcard argument.
506
507           bool isknownarch(DepId id)
508           my $bool = $pool->isknownarch($id);
509           bool = pool.isknownarch(id)
510           bool = pool.isknownarch?(id)
511
512       Return true if the specified Id describes a known architecture.
513
514           Solver Solver()
515           my $solver = $pool->Solver();
516           solver = pool.Solver()
517           solver = pool.Solver()
518
519       Create a new solver object.
520
521           Job Job(int how, Id what)
522           my $job = $pool->Job($how, $what);
523           job = pool.Job(how, what)
524           job = pool.Job(how, what)
525
526       Create a new Job object. Kind of low level, in most cases you would use
527       a Selection or Dep job constructor instead.
528
529           Selection Selection()
530           my $sel = $pool->Selection();
531           sel = pool.Selection()
532           sel = pool.Selection()
533
534       Create an empty selection. Useful as a starting point for merging other
535       selections.
536
537           Selection Selection_all()
538           my $sel = $pool->Selection_all();
539           sel = pool.Selection_all()
540           sel = pool.Selection_all()
541
542       Create a selection containing all packages. Useful as starting point
543       for intersecting other selections or for update/distupgrade jobs.
544
545           Selection select(const char *name, int flags)
546           my $sel = $pool->select($name, $flags);
547           sel = pool.select(name, flags)
548           sel = pool.select(name, flags)
549
550       Create a selection by matching packages against the specified string.
551       See the Selection class for a list of flags and how to create solver
552       jobs from a selection.
553
554           Selection matchdeps(const char *name, int flags, Id keyname, Id marker = -1)
555           my $sel = $pool->matchdeps($name, $flags, $keyname);
556           sel = pool.matchdeps(name, flags, keyname)
557           sel = pool.matchdeps(name, flags, keyname)
558
559       Create a selection by matching package dependencies against the
560       specified string. This can be used if you want to match other
561       dependency types than "provides".
562
563           Selection matchdepid(DepId dep, int flags, Id keyname, Id marker = -1)
564           my $sel = $pool->matchdepid(dep, $flags, $keyname);
565           sel = pool.matchdepid(dep, flags, keyname)
566           sel = pool.matchdepid(dep, flags, keyname)
567
568       Create a selection by matching package dependencies against the
569       specified dependency. This may be faster than matchdeps and also works
570       with complex dependencies. The downside is that you cannot use globs or
571       case insensitive matching.
572
573           void setpooljobs(Jobs *jobs)
574           $pool->setpooljobs(\@jobs);
575           pool.setpooljobs(jobs)
576           pool.setpooljobs(jobs)
577
578           Job *getpooljobs()
579           @jobs = $pool->getpooljobs();
580           jobs = pool.getpooljobs()
581           jobs = pool.getpooljobs()
582
583       Get/Set fixed jobs stored in the pool. Those jobs are automatically
584       appended to all solver jobs, they are meant for fixed configurations
585       like which packages can be multiversion installed, which packages were
586       userinstalled or must not be erased.
587
588           void set_loadcallback(Callable *callback)
589           $pool->setloadcallback(\&callbackfunction);
590           pool.setloadcallback(callbackfunction)
591           pool.setloadcallback { |repodata| ... }
592
593       Set the callback function called when repository metadata needs to be
594       loaded on demand. To make use of this feature, you need to create
595       repodata stubs that tell the library which data is available but not
596       loaded. If later on the data needs to be accessed, the callback
597       function is called with a repodata argument. You can then load the data
598       (maybe fetching it first from a remote server). The callback should
599       return true if the data has been made available.
600
601           /* bindings only */
602           $pool->appdata_disown()
603           pool.appdata_disown()
604           pool.appdata_disown()
605
606       Decrement the reference count of the appdata object. This can be used
607       to break circular references (e.g. if the pool’s appdata value points
608       to some meta data structure that contains a pool handle). If used
609       incorrectly, this method can lead to application crashes, so beware.
610       (This method is a no-op for ruby and tcl.)
611
612   DATA RETRIEVAL METHODS
613       In the following functions, the keyname argument describes what to
614       retrieve. For the standard cases you can use the available Id
615       constants. For example,
616
617           $solv::SOLVABLE_SUMMARY
618           solv.SOLVABLE_SUMMARY
619           Solv::SOLVABLE_SUMMARY
620
621       selects the “Summary” entry of a solvable. The solvid argument selects
622       the desired solvable by Id.
623
624           const char *lookup_str(Id solvid, Id keyname)
625           my $string = $pool->lookup_str($solvid, $keyname);
626           string = pool.lookup_str(solvid, keyname)
627           string = pool.lookup_str(solvid, keyname)
628
629           Id lookup_id(Id solvid, Id keyname)
630           my $id = $pool->lookup_id($solvid, $keyname);
631           id = pool.lookup_id(solvid, keyname)
632           id = pool.lookup_id(solvid, keyname)
633
634           unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
635           my $num = $pool->lookup_num($solvid, $keyname);
636           num = pool.lookup_num(solvid, keyname)
637           num = pool.lookup_num(solvid, keyname)
638
639           bool lookup_void(Id solvid, Id keyname)
640           my $bool = $pool->lookup_void($solvid, $keyname);
641           bool = pool.lookup_void(solvid, keyname)
642           bool = pool.lookup_void(solvid, keyname)
643
644           Id *lookup_idarray(Id solvid, Id keyname)
645           my @ids = $pool->lookup_idarray($solvid, $keyname);
646           ids = pool.lookup_idarray(solvid, keyname)
647           ids = pool.lookup_idarray(solvid, keyname)
648
649           Chksum lookup_checksum(Id solvid, Id keyname)
650           my $chksum = $pool->lookup_checksum($solvid, $keyname);
651           chksum = pool.lookup_checksum(solvid, keyname)
652           chksum = pool.lookup_checksum(solvid, keyname)
653
654       Lookup functions. Return the data element stored in the specified
655       solvable. You should probably use the methods of the Solvable class
656       instead.
657
658           Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
659           my $di = $pool->Dataiterator($keyname, $match, $flags);
660           di = pool.Dataiterator(keyname, match, flags)
661           di = pool.Dataiterator(keyname, match, flags)
662
663           Dataiterator Dataiterator_solvid(Id solvid, Id keyname, const char *match = 0, int flags = 0)
664           my $di = $pool->Dataiterator($solvid, $keyname, $match, $flags);
665           di = pool.Dataiterator(solvid, keyname, match, flags)
666           di = pool.Dataiterator(solvid, keyname, match, flags)
667
668           for my $d (@$di)
669           for d in di:
670           for d in di
671
672       Iterate over the matching data elements. See the Dataiterator class for
673       more information. The Dataiterator method iterates over all solvables
674       in the pool, whereas the Dataiterator_solvid only iterates over the
675       specified solvable.
676
677   ID METHODS
678       The following methods deal with Ids, i.e. integers representing objects
679       in the pool. They are considered “low level”, in most cases you would
680       not use them but instead the object orientated methods.
681
682           Repo id2repo(Id id)
683           $repo = $pool->id2repo($id);
684           repo = pool.id2repo(id)
685           repo = pool.id2repo(id)
686
687       Lookup an existing Repository by id. You can also do this by using the
688       repos attribute.
689
690           Solvable id2solvable(Id id)
691           $solvable = $pool->id2solvable($id);
692           solvable = pool.id2solvable(id)
693           solvable = pool.id2solvable(id)
694
695       Lookup an existing Repository by id. You can also do this by using the
696       solvables attribute.
697
698           const char *solvid2str(Id id)
699           my $str = $pool->solvid2str($id);
700           str = pool.solvid2str(id)
701           str = pool.solvid2str(id)
702
703       Return a string describing the Solvable with the specified id. The
704       string consists of the name, version, and architecture of the Solvable.
705
706           Id str2id(const char *str, bool create = 1)
707           my $id = pool->str2id($string);
708           id = pool.str2id(string)
709           id = pool.str2id(string)
710
711           const char *id2str(Id id)
712           $string = pool->id2str($id);
713           string = pool.id2str(id)
714           string = pool.id2str(id)
715
716       Convert a string into an Id and back. If the string is currently not in
717       the pool and create is false, zero is returned.
718
719           Id rel2id(Id name, Id evr, int flags, bool create = 1)
720           my $id = pool->rel2id($nameid, $evrid, $flags);
721           id = pool.rel2id(nameid, evrid, flags)
722           id = pool.rel2id(nameid, evrid, flags)
723
724       Create a “relational” dependency. Such dependencies consist of a name
725       part, the flags describing the relation, and a version part. The flags
726       are:
727
728           $solv::REL_EQ | $solv::REL_GT | $solv::REL_LT
729           solv.REL_EQ | solv.REL_GT | solv.REL_LT
730           Solv::REL_EQ | Solv::REL_GT | Solv::REL_LT
731
732       Thus, if you want a “<=” relation, you would use REL_LT | REL_EQ.
733
734           Id id2langid(Id id, const char *lang, bool create = 1)
735           my $id = $pool->id2langid($id, $language);
736           id = pool.id2langid(id, language)
737           id = pool.id2langid(id, language)
738
739       Create a language specific Id from some other id. This function simply
740       converts the id into a string, appends a dot and the specified language
741       to the string and converts the result back into an Id.
742
743           const char *dep2str(Id id)
744           $string = pool->dep2str($id);
745           string = pool.dep2str(id)
746           string = pool.dep2str(id)
747
748       Convert a dependency id into a string. If the id is just a string, this
749       function has the same effect as id2str(). For relational dependencies,
750       the result is the correct “name relation evr” string.
751

THE DEPENDENCY CLASS

753       The dependency class is an object orientated way to work with strings
754       and dependencies. Internally, dependencies are represented as Ids, i.e.
755       simple numbers. Dependency objects can be constructed by using the
756       Pool’s Dep() method.
757
758   ATTRIBUTES
759           Pool *pool;             /* read only */
760           $dep->{pool}
761           dep.pool
762           dep.pool
763
764       Back reference to the pool this dependency belongs to.
765
766           Id id;          /* read only */
767           $dep->{id}
768           dep.id
769           dep.id
770
771       The id of this dependency.
772

METHODS

774           Dep Rel(int flags, DepId evrid, bool create = 1)
775           my $reldep = $dep->Rel($flags, $evrdep);
776           reldep = dep.Rel(flags, evrdep)
777           reldep = dep.Rel(flags, evrdep)
778
779       Create a relational dependency from to string dependencies and a flags
780       argument. See the pool’s rel2id method for a description of the flags.
781
782           Selection Selection_name(int setflags = 0)
783           my $sel = $dep->Selection_name();
784           sel = dep.Selection_name()
785           sel = dep.Selection_name()
786
787       Create a Selection from a dependency. The selection consists of all
788       packages that have a name equal to the dependency. If the dependency is
789       of a relational type, the packages version must also fulfill the
790       dependency.
791
792           Selection Selection_provides(int setflags = 0)
793           my $sel = $dep->Selection_provides();
794           sel = dep.Selection_provides()
795           sel = dep.Selection_provides()
796
797       Create a Selection from a dependency. The selection consists of all
798       packages that have at least one provides matching the dependency.
799
800           const char *str()
801           my $str = $dep->str();
802           str = $dep.str()
803           str = $dep.str()
804
805       Return a string describing the dependency.
806
807           <stringification>
808           my $str = $dep->str;
809           str = str(dep)
810           str = dep.to_s
811
812       Same as calling the str() method.
813
814           <equality>
815           if ($dep1 == $dep2)
816           if dep1 == dep2:
817           if dep1 == dep2
818
819       The dependencies are equal if they are part of the same pool and have
820       the same ids.
821

THE REPOSITORY CLASS

823       A Repository describes a group of packages, normally coming from the
824       same source. Repositories are created by the Pool’s add_repo() method.
825
826   ATTRIBUTES
827           Pool *pool;                     /* read only */
828           $repo->{pool}
829           repo.pool
830           repo.pool
831
832       Back reference to the pool this dependency belongs to.
833
834           Id id;                          /* read only */
835           $repo->{id}
836           repo.id
837           repo.id
838
839       The id of the repository.
840
841           const char *name;               /* read/write */
842           $repo->{name}
843           repo.name
844           repo.name
845
846       The repositories name. To libsolv, the name is just a string with no
847       specific meaning.
848
849           int priority;                   /* read/write */
850           $repo->{priority}
851           repo.priority
852           repo.priority
853
854       The priority of the repository. A higher number means that packages of
855       this repository will be chosen over other repositories, even if they
856       have a greater package version.
857
858           int subpriority;                /* read/write */
859           $repo->{subpriority}
860           repo.subpriority
861           repo.subpriority
862
863       The sub-priority of the repository. This value is compared when the
864       priorities of two repositories are the same. It is useful to make the
865       library prefer on-disk repositories to remote ones.
866
867           int nsolvables;                 /* read only */
868           $repo->{nsolvables}
869           repo.nsolvables
870           repo.nsolvables
871
872       The number of solvables in this repository.
873
874           void *appdata;                  /* read/write */
875           $repo->{appdata}
876           repo.appdata
877           repo.appdata
878
879       Application specific data that may be used in any way by the code using
880       the repository.
881
882           Datapos *meta;                  /* read only */
883           $repo->{meta}
884           repo.meta
885           repo.meta
886
887       Return a Datapos object of the repodata’s metadata. You can use the
888       lookup methods of the Datapos class to lookup metadata attributes, like
889       the repository timestamp.
890
891   CONSTANTS
892       REPO_REUSE_REPODATA
893           Reuse the last repository data area (“repodata”) instead of
894           creating a new one.
895
896       REPO_NO_INTERNALIZE
897           Do not internalize the added repository data. This is useful if you
898           plan to add more data because internalization is a costly
899           operation.
900
901       REPO_LOCALPOOL
902           Use the repodata’s pool for Id storage instead of the global pool.
903           Useful if you don’t want to pollute the global pool with many
904           unneeded ids, like when storing the filelist.
905
906       REPO_USE_LOADING
907           Use the repodata that is currently being loaded instead of creating
908           a new one. This only makes sense if used in a load callback.
909
910       REPO_EXTEND_SOLVABLES
911           Do not create new solvables for the new data, but match existing
912           solvables and add the data to them. Repository metadata is often
913           split into multiple parts, with one primary file describing all
914           packages and other parts holding information that is normally not
915           needed, like the changelog.
916
917       REPO_USE_ROOTDIR
918           Prepend the pool’s rootdir to the path when doing file operations.
919
920       REPO_NO_LOCATION
921           Do not add a location element to the solvables. Useful if the
922           solvables are not in the final position, so you can add the correct
923           location later in your code.
924
925       SOLV_ADD_NO_STUBS
926           Do not create stubs for repository parts that can be downloaded on
927           demand.
928
929       SUSETAGS_RECORD_SHARES
930           This is specific to the add_susetags() method. Susetags allows one
931           to refer to already read packages to save disk space. If this data
932           sharing needs to work over multiple calls to add_susetags, you need
933           to specify this flag so that the share information is made
934           available to subsequent calls.
935
936   METHODS
937           void free(bool reuseids = 0)
938           $repo->free();
939           repo.free()
940           repo.free()
941
942       Free the repository and all solvables it contains. If reuseids is set
943       to true, the solvable ids and the repository id may be reused by the
944       library when added new solvables. Thus you should leave it false if you
945       are not sure that somebody holds a reference.
946
947           void empty(bool reuseids = 0)
948           $repo->empty();
949           repo.empty()
950           repo.empty()
951
952       Free all the solvables in a repository. The repository will be empty
953       after this call. See the free() method for the meaning of reuseids.
954
955           bool isempty()
956           $repo->isempty()
957           repo.empty()
958           repo.empty?
959
960       Return true if there are no solvables in this repository.
961
962           void internalize()
963           $repo->internalize();
964           repo.internalize()
965           repo.internalize()
966
967       Internalize added data. Data must be internalized before it is
968       available to the lookup and data iterator functions.
969
970           bool write(FILE *fp)
971           $repo->write($fp)
972           repo.write(fp)
973           repo.write(fp)
974
975       Write a repo as a “solv” file. These files can be read very fast and
976       thus are a good way to cache repository data. Returns false if there
977       was some error writing the file.
978
979           Solvableiterator solvables_iter()
980           for my $solvable (@{$repo->solvables_iter()})
981           for solvable in repo.solvables_iter():
982           for solvable in repo.solvables_iter()
983
984       Iterate over all solvables in a repository.
985
986           Repodata add_repodata(int flags = 0)
987           my $repodata = $repo->add_repodata();
988           repodata = repo.add_repodata()
989           repodata = repo.add_repodata()
990
991       Add a new repodata area to the repository. This is normally
992       automatically done by the repo_add methods, so you need this method
993       only in very rare circumstances.
994
995           void create_stubs()
996           $repo->create_stubs();
997           repo.create_stubs()
998           repo.create_stubs()
999
1000       Calls the create_stubs() repodata method for the last repodata of the
1001       repository.
1002
1003           bool iscontiguous()
1004           $repo->iscontiguous()
1005           repo.iscontiguous()
1006           repo.iscontiguous?
1007
1008       Return true if the solvables of this repository are all in a single
1009       block with no holes, i.e. they have consecutive ids.
1010
1011           Repodata first_repodata()
1012           my $repodata = $repo->first_repodata();
1013           repodata = repo.first_repodata()
1014           repodata = repo.first_repodata()
1015
1016       Checks if all repodatas but the first repodata are extensions, and
1017       return the first repodata if this is the case. Useful if you want to do
1018       a store/retrieve sequence on the repository to reduce the memory using
1019       and enable paging, as this does not work if the repository contains
1020       multiple non-extension repodata areas.
1021
1022           Selection Selection(int setflags = 0)
1023           my $sel = $repo->Selection();
1024           sel = repo.Selection()
1025           sel = repo.Selection()
1026
1027       Create a Selection consisting of all packages in the repository.
1028
1029           Dataiterator Dataiterator(Id key, const char *match = 0, int flags = 0)
1030           my $di = $repo->Dataiterator($keyname, $match, $flags);
1031           di = repo.Dataiterator(keyname, match, flags)
1032           di = repo.Dataiterator(keyname, match, flags)
1033
1034           Dataiterator Dataiterator_meta(Id key, const char *match = 0, int flags = 0)
1035           my $di = $repo->Dataiterator_meta($keyname, $match, $flags);
1036           di = repo.Dataiterator_meta(keyname, match, flags)
1037           di = repo.Dataiterator_meta(keyname, match, flags)
1038
1039           for my $d (@$di)
1040           for d in di:
1041           for d in di
1042
1043       Iterate over the matching data elements in this repository. See the
1044       Dataiterator class for more information. The Dataiterator() method
1045       iterates over all solvables in a repository, whereas the
1046       Dataiterator_meta method only iterates over the repository’s meta data.
1047
1048           <stringification>
1049           my $str = $repo->str;
1050           str = str(repo)
1051           str = repo.to_s
1052
1053       Return the name of the repository, or "Repo#<id>" if no name is set.
1054
1055           <equality>
1056           if ($repo1 == $repo2)
1057           if repo1 == repo2:
1058           if repo1 == repo2
1059
1060       Two repositories are equal if they belong to the same pool and have the
1061       same id.
1062
1063   DATA ADD METHODS
1064           Solvable add_solvable()
1065           $repo->add_solvable();
1066           repo.add_solvable()
1067           repo.add_solvable()
1068
1069       Add a single empty solvable to the repository. Returns a Solvable
1070       object, see the Solvable class for more information.
1071
1072           bool add_solv(const char *name, int flags = 0)
1073           $repo->add_solv($name);
1074           repo.add_solv(name)
1075           repo.add_solv(name)
1076
1077           bool add_solv(FILE *fp, int flags = 0)
1078           $repo->add_solv($fp);
1079           repo.add_solv(fp)
1080           repo.add_solv(fp)
1081
1082       Read a “solv” file and add its contents to the repository. These files
1083       can be written with the write() method and are normally used as fast
1084       cache for repository metadata.
1085
1086           bool add_rpmdb(int flags = 0)
1087           $repo->add_rpmdb();
1088           repo.add_rpmdb()
1089           repo.add_rpmdb()
1090
1091           bool add_rpmdb_reffp(FILE *reffp, int flags = 0)
1092           $repo->add_rpmdb_reffp($reffp);
1093           repo.add_rpmdb_reffp(reffp)
1094           repo.add_rpmdb_reffp(reffp)
1095
1096       Add the contents of the rpm database to the repository. If a solv file
1097       containing an old version of the database is available, it can be
1098       passed as reffp to speed up reading.
1099
1100           Solvable add_rpm(const char *filename, int flags = 0)
1101           my $solvable = $repo->add_rpm($filename);
1102           solvable = repo.add_rpm(filename)
1103           solvable = repo.add_rpm(filename)
1104
1105       Add the metadata of a single rpm package to the repository.
1106
1107           bool add_rpmdb_pubkeys(int flags = 0)
1108           $repo->add_rpmdb_pubkeys();
1109           repo.add_rpmdb_pubkeys()
1110           repo.add_rpmdb_pubkeys()
1111
1112       Add all pubkeys contained in the rpm database to the repository. Note
1113       that newer rpm versions also allow to store the pubkeys in some
1114       directory instead of the rpm database.
1115
1116           Solvable add_pubkey(const char *keyfile, int flags = 0)
1117           my $solvable = $repo->add_pubkey($keyfile);
1118           solvable = repo.add_pubkey(keyfile)
1119           solvable = repo.add_pubkey(keyfile)
1120
1121       Add a pubkey from a file to the repository.
1122
1123           bool add_rpmmd(FILE *fp, const char *language, int flags = 0)
1124           $repo->add_rpmmd($fp, undef);
1125           repo.add_rpmmd(fp, None)
1126           repo.add_rpmmd(fp, nil)
1127
1128       Add metadata stored in the "rpm-md" format (i.e. from files in the
1129       “repodata” directory) to a repository. Supported files are "primary",
1130       "filelists", "other", "suseinfo". Do not forget to specify the
1131       REPO_EXTEND_SOLVABLES for extension files like "filelists" and "other".
1132       Use the language parameter if you have language extension files,
1133       otherwise simply use a undef/None/nil parameter.
1134
1135           bool add_repomdxml(FILE *fp, int flags = 0)
1136           $repo->add_repomdxml($fp);
1137           repo.add_repomdxml(fp)
1138           repo.add_repomdxml(fp)
1139
1140       Add the repomd.xml meta description from the "rpm-md" format to the
1141       repository. This file contains information about the repository like
1142       keywords, and also a list of all database files with checksums. The
1143       data is added to the "meta" section of the repository, i.e. no package
1144       gets created.
1145
1146           bool add_updateinfoxml(FILE *fp, int flags = 0)
1147           $repo->add_updateinfoxml($fp);
1148           repo.add_updateinfoxml(fp)
1149           repo.add_updateinfoxml(fp)
1150
1151       Add the updateinfo.xml file containing available maintenance updates to
1152       the repository. All updates are created as special packages that have a
1153       "patch:" prefix in their name.
1154
1155           bool add_deltainfoxml(FILE *fp, int flags = 0)
1156           $repo->add_deltainfoxml($fp);
1157           repo.add_deltainfoxml(fp)
1158           repo.add_deltainfoxml(fp)
1159
1160       Add the deltainfo.xml file (also called prestodelta.xml) containing
1161       available delta-rpms to the repository. The data is added to the "meta"
1162       section, i.e. no package gets created.
1163
1164           bool add_debdb(int flags = 0)
1165           $repo->add_debdb();
1166           repo.add_debdb()
1167           repo.add_debdb()
1168
1169       Add the contents of the debian installed package database to the
1170       repository.
1171
1172           bool add_debpackages(FILE *fp, int flags = 0)
1173           $repo->add_debpackages($fp);
1174           repo.add_debpackages($fp)
1175           repo.add_debpackages($fp)
1176
1177       Add the contents of the debian repository metadata (the "packages"
1178       file) to the repository.
1179
1180           Solvable add_deb(const char *filename, int flags = 0)
1181           my $solvable = $repo->add_deb($filename);
1182           solvable = repo.add_deb(filename)
1183           solvable = repo.add_deb(filename)
1184
1185       Add the metadata of a single deb package to the repository.
1186
1187           bool add_mdk(FILE *fp, int flags = 0)
1188           $repo->add_mdk($fp);
1189           repo.add_mdk(fp)
1190           repo.add_mdk(fp)
1191
1192       Add the contents of the mageia/mandriva repository metadata (the
1193       "synthesis.hdlist" file) to the repository.
1194
1195           bool add_mdk_info(FILE *fp, int flags = 0)
1196           $repo->add_mdk_info($fp);
1197           repo.add_mdk_info(fp)
1198           repo.add_mdk_info(fp)
1199
1200       Extend the packages from the synthesis file with the info.xml and
1201       files.xml data. Do not forget to specify REPO_EXTEND_SOLVABLES.
1202
1203           bool add_arch_repo(FILE *fp, int flags = 0)
1204           $repo->add_arch_repo($fp);
1205           repo.add_arch_repo(fp)
1206           repo.add_arch_repo(fp)
1207
1208       Add the contents of the archlinux repository metadata (the ".db.tar"
1209       file) to the repository.
1210
1211           bool add_arch_local(const char *dir, int flags = 0)
1212           $repo->add_arch_local($dir);
1213           repo.add_arch_local(dir)
1214           repo.add_arch_local(dir)
1215
1216       Add the contents of the archlinux installed package database to the
1217       repository. The dir parameter is usually set to
1218       "/var/lib/pacman/local".
1219
1220           bool add_content(FILE *fp, int flags = 0)
1221           $repo->add_content($fp);
1222           repo.add_content(fp)
1223           repo.add_content(fp)
1224
1225       Add the “content” meta description from the susetags format to the
1226       repository. This file contains information about the repository like
1227       keywords, and also a list of all database files with checksums. The
1228       data is added to the "meta" section of the repository, i.e. no package
1229       gets created.
1230
1231           bool add_susetags(FILE *fp, Id defvendor, const char *language, int flags = 0)
1232           $repo->add_susetags($fp, $defvendor, $language);
1233           repo.add_susetags(fp, defvendor, language)
1234           repo.add_susetags(fp, defvendor, language)
1235
1236       Add repository metadata in the susetags format to the repository. Like
1237       with add_rpmmd, you can specify a language if you have language
1238       extension files. The defvendor parameter provides a default vendor for
1239       packages with missing vendors, it is usually provided in the content
1240       file.
1241
1242           bool add_products(const char *dir, int flags = 0)
1243           $repo->add_products($dir);
1244           repo.add_products(dir)
1245           repo.add_products(dir)
1246
1247       Add the installed SUSE products database to the repository. The dir
1248       parameter is usually "/etc/products.d".
1249

THE SOLVABLE CLASS

1251       A solvable describes all the information of one package. Each solvable
1252       belongs to one repository, it can be added and filled manually but in
1253       most cases solvables will get created by the repo_add methods.
1254
1255   ATTRIBUTES
1256           Repo *repo;                     /* read only */
1257           $solvable->{repo}
1258           solvable.repo
1259           solvable.repo
1260
1261       The repository this solvable belongs to.
1262
1263           Pool *pool;                     /* read only */
1264           $solvable->{pool}
1265           solvable.pool
1266           solvable.pool
1267
1268       The pool this solvable belongs to, same as the pool of the repo.
1269
1270           Id id;                          /* read only */
1271           $solvable->{id}
1272           solvable.id
1273           solvable.id
1274
1275       The specific id of the solvable.
1276
1277           char *name;                     /* read/write */
1278           $solvable->{name}
1279           solvable.name
1280           solvable.name
1281
1282           char *evr;                      /* read/write */
1283           $solvable->{evr}
1284           solvable.evr
1285           solvable.evr
1286
1287           char *arch;                     /* read/write */
1288           $solvable->{arch}
1289           solvable.arch
1290           solvable.arch
1291
1292           char *vendor;                   /* read/write */
1293           $solvable->{vendor}
1294           solvable.vendor
1295           solvable.vendor
1296
1297       Easy access to often used attributes of solvables. They are internally
1298       stored as Ids.
1299
1300           Id nameid;                      /* read/write */
1301           $solvable->{nameid}
1302           solvable.nameid
1303           solvable.nameid
1304
1305           Id evrid;                       /* read/write */
1306           $solvable->{evrid}
1307           solvable.evrid
1308           solvable.evrid
1309
1310           Id archid;                      /* read/write */
1311           $solvable->{archid}
1312           solvable.archid
1313           solvable.archid
1314
1315           Id vendorid;                    /* read/write */
1316           $solvable->{vendorid}
1317           solvable.vendorid
1318           solvable.vendorid
1319
1320       Raw interface to the ids. Useful if you want to search for a specific
1321       id and want to avoid the string compare overhead.
1322
1323   METHODS
1324           const char *lookup_str(Id keyname)
1325           my $string = $solvable->lookup_str($keyname);
1326           string = solvable.lookup_str(keyname)
1327           string = solvable.lookup_str(keyname)
1328
1329           Id lookup_id(Id keyname)
1330           my $id = $solvable->lookup_id($keyname);
1331           id = solvable.lookup_id(solvid)
1332           id = solvable.lookup_id(solvid)
1333
1334           unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
1335           my $num = $solvable->lookup_num($keyname);
1336           num = solvable.lookup_num(keyname)
1337           num = solvable.lookup_num(keyname)
1338
1339           bool lookup_void(Id keyname)
1340           my $bool = $solvable->lookup_void($keyname);
1341           bool = solvable.lookup_void(keyname)
1342           bool = solvable.lookup_void(keyname)
1343
1344           Chksum lookup_checksum(Id keyname)
1345           my $chksum = $solvable->lookup_checksum($keyname);
1346           chksum = solvable.lookup_checksum(keyname)
1347           chksum = solvable.lookup_checksum(keyname)
1348
1349           Id *lookup_idarray(Id keyname, Id marker = -1)
1350           my @ids = $solvable->lookup_idarray($keyname);
1351           ids = solvable.lookup_idarray(keyname)
1352           ids = solvable.lookup_idarray(keyname)
1353
1354           Dep *lookup_deparray(Id keyname, Id marker = -1)
1355           my @deps = $solvable->lookup_deparray($keyname);
1356           deps = solvable.lookup_deparray(keyname)
1357           deps = solvable.lookup_deparray(keyname)
1358
1359       Generic lookup methods. Retrieve data stored for the specific keyname.
1360       The lookup_idarray() method will return an array of Ids, use
1361       lookup_deparray if you want an array of Dependency objects instead.
1362       Some Id arrays contain two parts of data divided by a specific marker,
1363       for example the provides array uses the SOLVABLE_FILEMARKER id to store
1364       both the ids provided by the package and the ids added by the
1365       addfileprovides method. The default, -1, translates to the correct
1366       marker for the keyname and returns the first part of the array, use 1
1367       to select the second part or 0 to retrieve all ids including the
1368       marker.
1369
1370           const char *lookup_location(unsigned int *OUTPUT);
1371           my ($location, $medianr) = $solvable->lookup_location();
1372           location, medianr = solvable.lookup_location()
1373           location, medianr = solvable.lookup_location()
1374
1375       Return a tuple containing the on-media location and an optional media
1376       number for multi-part repositories (e.g. repositories spawning multiple
1377       DVDs).
1378
1379           const char *lookup_sourcepkg();
1380           my $sourcepkg = $solvable->lookup_sourcepkg();
1381           sourcepkg = solvable.lookup_sourcepkg()
1382           sourcepkg = solvable.lookup_sourcepkg()
1383
1384       Return a sourcepkg name associated with solvable.
1385
1386           Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
1387           my $di = $solvable->Dataiterator($keyname, $match, $flags);
1388           di = solvable.Dataiterator(keyname, match, flags)
1389           di = solvable.Dataiterator(keyname, match, flags)
1390
1391           for my $d (@$di)
1392           for d in di:
1393           for d in di
1394
1395       Iterate over the matching data elements. See the Dataiterator class for
1396       more information.
1397
1398           void add_deparray(Id keyname, DepId dep, Id marker = -1);
1399           $solvable->add_deparray($keyname, $dep);
1400           solvable.add_deparray(keyname, dep)
1401           solvable.add_deparray(keyname, dep)
1402
1403       Add a new dependency to the attributes stored in keyname.
1404
1405           void unset(Id keyname);
1406           $solvable->unset($keyname);
1407           solvable.unset(keyname)
1408           solvable.unset(keyname)
1409
1410       Delete data stored for the specific keyname.
1411
1412           bool installable();
1413           $solvable->installable()
1414           solvable.installable()
1415           solvable.installable?
1416
1417       Return true if the solvable is installable on the system. Solvables are
1418       not installable if the system does not support their architecture.
1419
1420           bool isinstalled();
1421           $solvable->isinstalled()
1422           solvable.isinstalled()
1423           solvable.isinstalled?
1424
1425       Return true if the solvable is installed on the system.
1426
1427           bool identical(Solvable *other)
1428           $solvable->identical($other)
1429           solvable.identical(other)
1430           solvable.identical?(other)
1431
1432       Return true if the two solvables are identical.
1433
1434           int evrcmp(Solvable *other)
1435           $solvable->evrcmp($other)
1436           solvable.evrcmp(other)
1437           solvable.evrcmp(other)
1438
1439       Returns -1 if the epoch/version/release of the solvable is less than
1440       the one from the other solvable, 1 if it is greater, and 0 if they are
1441       equal. Note that "equal" does not mean that the evr is identical.
1442
1443           int matchesdep(Id keyname, DepId id, Id marker = -1)
1444           $solvable->matchesdep($keyname, $dep)
1445           solvable.matchesdep(keyname, dep)
1446           solvable.matchesdep?(keyname, dep)
1447
1448       Return true if the dependencies stored in keyname match the specified
1449       dependency.
1450
1451           Selection Selection(int setflags = 0)
1452           my $sel = $solvable->Selection();
1453           sel = solvable.Selection()
1454           sel = solvable.Selection()
1455
1456       Create a Selection containing just the single solvable.
1457
1458           const char *str()
1459           my $str = $solvable->str();
1460           str = $solvable.str()
1461           str = $solvable.str()
1462
1463       Return a string describing the solvable. The string consists of the
1464       name, version, and architecture of the Solvable.
1465
1466           <stringification>
1467           my $str = $solvable->str;
1468           str = str(solvable)
1469           str = solvable.to_s
1470
1471       Same as calling the str() method.
1472
1473           <equality>
1474           if ($solvable1 == $solvable2)
1475           if solvable1 == solvable2:
1476           if solvable1 == solvable2
1477
1478       Two solvables are equal if they are part of the same pool and have the
1479       same ids.
1480

THE DATAITERATOR CLASS

1482       Dataiterators can be used to do complex string searches or to iterate
1483       over arrays. They can be created via the constructors in the Pool,
1484       Repo, and Solvable classes. The Repo and Solvable constructors will
1485       limit the search to the repository or the specific package.
1486
1487   CONSTANTS
1488       SEARCH_STRING
1489           Return a match if the search string matches the value.
1490
1491       SEARCH_STRINGSTART
1492           Return a match if the value starts with the search string.
1493
1494       SEARCH_STRINGEND
1495           Return a match if the value ends with the search string.
1496
1497       SEARCH_SUBSTRING
1498           Return a match if the search string can be matched somewhere in the
1499           value.
1500
1501       SEARCH_GLOB
1502           Do a glob match of the search string against the value.
1503
1504       SEARCH_REGEX
1505           Do a regular expression match of the search string against the
1506           value.
1507
1508       SEARCH_NOCASE
1509           Ignore case when matching strings. Works for all the above match
1510           types.
1511
1512       SEARCH_FILES
1513           Match the complete filenames of the file list, not just the base
1514           name.
1515
1516       SEARCH_COMPLETE_FILELIST
1517           When matching the file list, check every file of the package not
1518           just the subset from the primary metadata.
1519
1520       SEARCH_CHECKSUMS
1521           Allow the matching of checksum entries.
1522
1523   METHODS
1524           void prepend_keyname(Id keyname);
1525           $di->prepend_keyname($keyname);
1526           di.prepend_keyname(keyname)
1527           di.prepend_keyname(keyname)
1528
1529       Do a sub-search in the array stored in keyname.
1530
1531           void skip_solvable();
1532           $di->kip_solvable();
1533           di.skip_solvable()
1534           di.skip_solvable()
1535
1536       Stop matching the current solvable and advance to the next one.
1537
1538           <iteration>
1539           for my $d (@$di)
1540           for d in di:
1541           for d in di
1542
1543       Iterate through the matches. If there is a match, the object in d will
1544       be of type Datamatch.
1545

THE DATAMATCH CLASS

1547       Objects of this type will be created for every value matched by a
1548       dataiterator.
1549
1550   ATTRIBUTES
1551           Pool *pool;                             /* read only */
1552           $d->{pool}
1553           d.pool
1554           d.pool
1555
1556       Back pointer to pool.
1557
1558           Repo *repo;                             /* read only */
1559           $d->{repo}
1560           d.repo
1561           d.repo
1562
1563       The repository containing the matched object.
1564
1565           Solvable *solvable;                     /* read only */
1566           $d->{solvable}
1567           d.solvable
1568           d.solvable
1569
1570       The solvable containing the value that was matched.
1571
1572           Id solvid;                              /* read only */
1573           $d->{solvid}
1574           d.solvid
1575           d.solvid
1576
1577       The id of the solvable that matched.
1578
1579           Id key_id;
1580           $d->{key_id}
1581           d.key_id
1582           d.key_id
1583
1584           const char *key_idstr;
1585           $d->{key_idstr}
1586           d.key_idstr
1587           d.key_idstr
1588
1589       The keyname that matched, either as id or string.
1590
1591           Id type_id;
1592           $d->{type_id}
1593           d.type_id
1594           d.type_id
1595
1596           const char *type_idstr;
1597           $d->{type_idstr};
1598           d.type_idstr
1599           d.type_idstr
1600
1601       The key type of the value that was matched, either as id or string.
1602
1603           Id id;
1604           $d->{id}
1605           d.id
1606           d.id
1607
1608           Id idstr;
1609           $d->{idstr}
1610           d.idstr
1611           d.idstr
1612
1613       The Id of the value that was matched (only valid for id types), either
1614       as id or string.
1615
1616           const char *str;
1617           $d->{str}
1618           d.str
1619           d.str
1620
1621       The string value that was matched (only valid for string types).
1622
1623           unsigned long long num;
1624           $d->{num}
1625           d.num
1626           d.num
1627
1628       The numeric value that was matched (only valid for numeric types).
1629
1630           unsigned int num2;
1631           $d->{num2}
1632           d.num2
1633           d.num2
1634
1635       The secondary numeric value that was matched (only valid for types
1636       containing two values).
1637
1638           unsigned int binary;
1639           $d->{binary}
1640           d.binary
1641           d.binary
1642
1643       The value in binary form, useful for checksums and other data that
1644       cannot be represented as a string.
1645
1646   METHODS
1647           Datapos pos();
1648           my $pos = $d->pos();
1649           pos = d.pos()
1650           pos = d.pos()
1651
1652       The position object of the current match. It can be used to do
1653       sub-searches starting at the match (if it is of an array type). See the
1654       Datapos class for more information.
1655
1656           Datapos parentpos();
1657           my $pos = $d->parentpos();
1658           pos = d.parentpos()
1659           pos = d.parentpos()
1660
1661       The position object of the array containing the current match. It can
1662       be used to do sub-searches, see the Datapos class for more information.
1663
1664           <stringification>
1665           my $str = $d->str;
1666           str = str(d)
1667           str = d.to_s
1668
1669       Return the stringification of the matched value. Stringification
1670       depends on the search flags, for file list entries it will return just
1671       the base name unless SEARCH_FILES is used, for checksums it will return
1672       an empty string unless SEARCH_CHECKSUMS is used. Numeric values are
1673       currently stringified to an empty string.
1674

THE SELECTION CLASS

1676       Selections are a way to easily deal with sets of packages. There are
1677       multiple constructors to create them, the most useful is probably the
1678       select() method in the Pool class.
1679
1680   CONSTANTS
1681       SELECTION_NAME
1682           Create the selection by matching package names.
1683
1684       SELECTION_PROVIDES
1685           Create the selection by matching package provides.
1686
1687       SELECTION_FILELIST
1688           Create the selection by matching package files.
1689
1690       SELECTION_CANON
1691           Create the selection by matching the canonical representation of
1692           the package. This is normally a combination of the name, the
1693           version, and the architecture of a package.
1694
1695       SELECTION_DOTARCH
1696           Allow an ".<architecture>" suffix when matching names or provides.
1697
1698       SELECTION_REL
1699           Allow the specification of a relation when matching names or
1700           dependencies, e.g. "name >= 1.2".
1701
1702       SELECTION_GLOB
1703           Allow glob matching for package names, package provides, and file
1704           names.
1705
1706       SELECTION_NOCASE
1707           Ignore case when matching package names, package provides, and file
1708           names.
1709
1710       SELECTION_FLAT
1711           Return only one selection element describing the selected packages.
1712           The default is to create multiple elements for all globbed
1713           packages. Multiple elements are useful if you want to turn the
1714           selection into an install job, in that case you want an install job
1715           for every globbed package.
1716
1717       SELECTION_SKIP_KIND
1718           Remove a "packagekind:" prefix from the package names.
1719
1720       SELECTION_MATCH_DEPSTR
1721           When matching dependencies, do a string match on the result of
1722           dep2str instead of using the normal dependency intersect algorithm.
1723
1724       SELECTION_INSTALLED_ONLY
1725           Limit the package search to installed packages.
1726
1727       SELECTION_SOURCE_ONLY
1728           Limit the package search to source packages only.
1729
1730       SELECTION_WITH_SOURCE
1731           Extend the package search to also match source packages. The
1732           default is only to match binary packages.
1733
1734       SELECTION_WITH_DISABLED
1735           Extend the package search to also include disabled packages.
1736
1737       SELECTION_WITH_BADARCH
1738           Extend the package search to also include packages that are not
1739           installable on the configured architecture.
1740
1741       SELECTION_WITH_ALL
1742           Shortcut for selecting the three modifiers above.
1743
1744       SELECTION_ADD
1745           Add the result of the match to the current selection instead of
1746           replacing it.
1747
1748       SELECTION_SUBTRACT
1749           Remove the result of the match to the current selection instead of
1750           replacing it.
1751
1752       SELECTION_FILTER
1753           Intersect the result of the match to the current selection instead
1754           of replacing it.
1755
1756   ATTRIBUTES
1757           Pool *pool;                             /* read only */
1758           $d->{pool}
1759           d.pool
1760           d.pool
1761
1762       Back pointer to pool.
1763
1764   METHODS
1765           int flags()
1766           my $flags = $sel->flags();
1767           flags = sel.flags()
1768           flags = sel.flags()
1769
1770       Return the result flags of the selection. The flags are a subset of the
1771       ones used when creating the selection, they describe which method was
1772       used to get the result. For example, if you create the selection with
1773       “SELECTION_NAME | SELECTION_PROVIDES”, the resulting flags will either
1774       be SELECTION_NAME or SELECTION_PROVIDES depending if there was a
1775       package that matched the name or not. If there was no match at all, the
1776       flags will be zero.
1777
1778           bool isempty()
1779           $sel->isempty()
1780           sel.isempty()
1781           sel.isempty?
1782
1783       Return true if the selection is empty, i.e. no package could be
1784       matched.
1785
1786           Selection clone(int flags = 0)
1787           my $cloned = $sel->clone();
1788           cloned = sel.clone()
1789           cloned = sel.clone()
1790
1791       Return a copy of a selection.
1792
1793           void filter(Selection *other)
1794           $sel->filter($other);
1795           sel.filter(other)
1796           sel.filter(other)
1797
1798       Intersect two selections. Packages will only stay in the selection if
1799       there are also included in the other selecting. Does an in-place
1800       modification.
1801
1802           void add(Selection *other)
1803           $sel->add($other);
1804           sel.add(other)
1805           sel.add(other)
1806
1807       Build the union of two selections. All packages of the other selection
1808       will be added to the set of packages of the selection object. Does an
1809       in-place modification. Note that the selection flags are no longer
1810       meaningful after the add operation.
1811
1812           void subtract(Selection *other)
1813           $sel->subtract($other);
1814           sel.subtract(other)
1815           sel.subtract(other)
1816
1817       Remove the packages of the other selection from the packages of the
1818       selection object. Does an in-place modification.
1819
1820           void add_raw(Id how, Id what)
1821           $sel->add_raw($how, $what);
1822           sel.add_raw(how, what)
1823           sel.add_raw(how, what)
1824
1825       Add a raw element to the selection. Check the Job class for information
1826       about the how and what parameters. Note that the selection flags are no
1827       longer meaningful after the add_raw operation.
1828
1829           Job *jobs(int action)
1830           my @jobs = $sel->jobs($action);
1831           jobs = sel.jobs(action)
1832           jobs = sel.jobs(action)
1833
1834       Convert a selection into an array of Job objects. The action parameter
1835       is or-ed to the “how” part of the job, it describes the type of job
1836       (e.g. install, erase). See the Job class for the action and action
1837       modifier constants.
1838
1839           Solvable *solvables()
1840           my @solvables = $sel->solvables();
1841           solvables = sel.solvables()
1842           solvables = sel.solvables()
1843
1844       Convert a selection into an array of Solvable objects.
1845
1846           void select(const char *name, int flags)
1847           $sel->select($name, $flags);
1848           sel.select(name, flags)
1849           sel.select(name, flags)
1850
1851       Do a select operation and combine the result with the current
1852       selection. You can choose the desired combination method by using
1853       either the SELECTION_ADD, SELECTION_SUBTRACT, or SELECTION_FILTER flag.
1854       If none of the flags are used, SELECTION_FILTER|SELECTION_WITH_ALL is
1855       assumed.
1856
1857           void matchdeps(const char *name, int flags, Id keyname, Id marker = -1)
1858           $sel->matchdeps($name, $flags, $keyname);
1859           sel.matchdeps(name, flags, keyname)
1860           sel.matchdeps(name, flags, keyname)
1861
1862       Do a matchdeps operation and combine the result with the current
1863       selection.
1864
1865           void matchdepid(DepId dep, int flags, Id keyname, Id marker = -1)
1866           $sel->matchdepid($dep, $flags, $keyname);
1867           sel.matchdepid(dep, flags, keyname)
1868           sel.matchdepid(dep, flags, keyname)
1869
1870       Do a matchdepid operation and combine the result with the current
1871       selection.
1872
1873           <stringification>
1874           my $str = $sel->str;
1875           str = str(sel)
1876           str = sel.to_s
1877
1878       Return a string describing the selection.
1879

THE JOB CLASS

1881       Jobs are the way to specify to the dependency solver what to do. Most
1882       of the times jobs will get created by calling the jobs() method on a
1883       Selection object, but there is also a Job() constructor in the Pool
1884       class.
1885
1886   CONSTANTS
1887       Selection constants:
1888
1889       SOLVER_SOLVABLE
1890           The “what” part is the id of a solvable.
1891
1892       SOLVER_SOLVABLE_NAME
1893           The “what” part is the id of a package name.
1894
1895       SOLVER_SOLVABLE_PROVIDES
1896           The “what” part is the id of a package provides.
1897
1898       SOLVER_SOLVABLE_ONE_OF
1899           The “what” part is an offset into the “whatprovides” data, created
1900           by calling the towhatprovides() pool method.
1901
1902       SOLVER_SOLVABLE_REPO
1903           The “what” part is the id of a repository.
1904
1905       SOLVER_SOLVABLE_ALL
1906           The “what” part is ignored, all packages are selected.
1907
1908       SOLVER_SOLVABLE_SELECTMASK
1909           A mask containing all the above selection bits.
1910
1911       Action constants:
1912
1913       SOLVER_NOOP
1914           Do nothing.
1915
1916       SOLVER_INSTALL
1917           Install a package of the specified set of packages. It tries to
1918           install the best matching package (i.e. the highest version of the
1919           packages from the repositories with the highest priority).
1920
1921       SOLVER_ERASE
1922           Erase all of the packages from the specified set. If a package is
1923           not installed, erasing it will keep it from getting installed.
1924
1925       SOLVER_UPDATE
1926           Update the matching installed packages to their best version. If
1927           none of the specified packages are installed, try to update the
1928           installed packages to the specified versions. See the section about
1929           targeted updates about more information.
1930
1931       SOLVER_WEAKENDEPS
1932           Allow to break the dependencies of the matching packages. Handle
1933           with care.
1934
1935       SOLVER_MULTIVERSION
1936           Mark the matched packages for multiversion install. If they get to
1937           be installed because of some other job, the installation will keep
1938           the old version of the package installed (for rpm this is done by
1939           using “-i” instead of “-U”).
1940
1941       SOLVER_LOCK
1942           Do not change the state of the matched packages, i.e. when they are
1943           installed they stay installed, if not they are not selected for
1944           installation.
1945
1946       SOLVER_DISTUPGRADE
1947           Update the matching installed packages to the best version included
1948           in one of the repositories. After this operation, all come from one
1949           of the available repositories except orphaned packages. Orphaned
1950           packages are packages that have no relation to the packages in the
1951           repositories, i.e. no package in the repositories have the same
1952           name or obsolete the orphaned package. This action brings the
1953           installed packages in sync with the ones in the repository. By
1954           default it also turns of arch/vendor/version locking for the
1955           affected packages to simulate a fresh installation. This means that
1956           distupgrade can actually downgrade packages if only lower versions
1957           of a package are available in the repositories. You can tweak this
1958           behavior with the SOLVER_FLAG_DUP_ solver flags.
1959
1960       SOLVER_DROP_ORPHANED
1961           Erase all the matching installed packages if they are orphaned.
1962           This only makes sense if there is a “distupgrade all packages” job.
1963           The default is to erase orphaned packages only if they block the
1964           installation of other packages.
1965
1966       SOLVER_VERIFY
1967           Fix dependency problems of matching installed packages. The default
1968           is to ignore dependency problems for installed packages.
1969
1970       SOLVER_USERINSTALLED
1971           The matching installed packages are considered to be installed by a
1972           user, thus not installed to fulfill some dependency. This is needed
1973           input for the calculation of unneeded packages for jobs that have
1974           the SOLVER_CLEANDEPS flag set.
1975
1976       SOLVER_ALLOWUNINSTALL
1977           Allow the solver to deinstall the matching installed packages if
1978           they get into the way of resolving a dependency. This is like the
1979           SOLVER_FLAG_ALLOW_UNINSTALL flag, but limited to a specific set of
1980           packages.
1981
1982       SOLVER_FAVOR
1983           Prefer the specified packages if the solver encounters an
1984           alternative. If a job contains multiple matching favor/disfavor
1985           elements, the last one takes precedence.
1986
1987       SOLVER_DISFAVOR
1988           Avoid the specified packages if the solver encounters an
1989           alternative. This can also be used to block recommended or
1990           supplemented packages from being installed.
1991
1992       SOLVER_JOBMASK
1993           A mask containing all the above action bits.
1994
1995       Action modifier constants:
1996
1997       SOLVER_WEAK
1998           Makes the job a weak job. The solver tries to fulfill weak jobs,
1999           but does not report a problem if it is not possible to do so.
2000
2001       SOLVER_ESSENTIAL
2002           Makes the job an essential job. If there is a problem with the job,
2003           the solver will not propose to remove the job as one solution
2004           (unless all other solutions are also to remove essential jobs).
2005
2006       SOLVER_CLEANDEPS
2007           The solver will try to also erase all packages dragged in through
2008           dependencies when erasing the package. This needs
2009           SOLVER_USERINSTALLED jobs to maximize user satisfaction.
2010
2011       SOLVER_FORCEBEST
2012           Insist on the best package for install, update, and distupgrade
2013           jobs. If this flag is not used, the solver will use the second-best
2014           package if the best package cannot be installed for some reason.
2015           When this flag is used, the solver will generate a problem instead.
2016
2017       SOLVER_TARGETED
2018           Forces targeted operation update and distupgrade jobs. See the
2019           section about targeted updates about more information.
2020
2021       Set constants.
2022
2023       SOLVER_SETEV
2024           The job specified the exact epoch and version of the package set.
2025
2026       SOLVER_SETEVR
2027           The job specified the exact epoch, version, and release of the
2028           package set.
2029
2030       SOLVER_SETARCH
2031           The job specified the exact architecture of the packages from the
2032           set.
2033
2034       SOLVER_SETVENDOR
2035           The job specified the exact vendor of the packages from the set.
2036
2037       SOLVER_SETREPO
2038           The job specified the exact repository of the packages from the
2039           set.
2040
2041       SOLVER_SETNAME
2042           The job specified the exact name of the packages from the set.
2043
2044       SOLVER_NOAUTOSET
2045           Turn of automatic set flag generation for SOLVER_SOLVABLE jobs.
2046
2047       SOLVER_SETMASK
2048           A mask containing all the above set bits.
2049
2050       See the section about set bits for more information.
2051
2052   ATTRIBUTES
2053           Pool *pool;                             /* read only */
2054           $job->{pool}
2055           d.pool
2056           d.pool
2057
2058       Back pointer to pool.
2059
2060           Id how;                                 /* read/write */
2061           $job->{how}
2062           d.how
2063           d.how
2064
2065       Union of the selection, action, action modifier, and set flags. The
2066       selection part describes the semantics of the “what” Id.
2067
2068           Id what;                                /* read/write */
2069           $job->{what}
2070           d.what
2071           d.what
2072
2073       Id describing the set of packages, the meaning depends on the selection
2074       part of the “how” attribute.
2075
2076   METHODS
2077           Solvable *solvables()
2078           my @solvables = $job->solvables();
2079           solvables = job.solvables()
2080           solvables = job.solvables()
2081
2082       Return the set of solvables of the job as an array of Solvable objects.
2083
2084           bool isemptyupdate();
2085           $job->isemptyupdate()
2086           job.isemptyupdate()
2087           job.isemptyupdate?
2088
2089       Convenience function to find out if the job describes an update job
2090       with no matching packages, i.e. a job that does nothing. Some package
2091       managers like “zypper” like to turn those jobs into install jobs, i.e.
2092       an update of a not-installed package will result into the installation
2093       of the package.
2094
2095           <stringification>
2096           my $str = $job->str;
2097           str = str(job)
2098           str = job.to_s
2099
2100       Return a string describing the job.
2101
2102           <equality>
2103           if ($job1 == $job2)
2104           if job1 == job2:
2105           if job1 == job2
2106
2107       Two jobs are equal if they belong to the same pool and both the “how”
2108       and the “what” attributes are the same.
2109
2110   TARGETED UPDATES
2111       Libsolv has two modes for upgrades and distupgrade: targeted and
2112       untargeted. Untargeted mode means that the installed packages from the
2113       specified set will be updated to the best version. Targeted means that
2114       packages that can be updated to a package in the specified set will be
2115       updated to the best package of the set.
2116
2117       Here’s an example to explain the subtle difference. Suppose that you
2118       have package A installed in version "1.1", "A-1.2" is available in one
2119       of the repositories and there is also package "B" that obsoletes
2120       package A.
2121
2122       An untargeted update of "A" will update the installed "A-1.1" to
2123       package "B", because that is the newest version (B obsoletes A and is
2124       thus newer).
2125
2126       A targeted update of "A" will update "A-1.1" to "A-1.2", as the set of
2127       packages contains both "A-1.1" and "A-1.2", and "A-1.2" is the newer
2128       one.
2129
2130       An untargeted update of "B" will do nothing, as "B" is not installed.
2131
2132       An targeted update of "B" will update "A-1.1" to "B".
2133
2134       Note that the default is to do "auto-targeting", thus if the specified
2135       set of packages does not include an installed package, the solver will
2136       assume targeted operation even if SOLVER_TARGETED is not used.
2137
2138       This mostly matches the intent of the user, with one exception: In the
2139       example above, an update of "A-1.2" will update "A-1.1" to "A-1.2"
2140       (targeted mode), but a second update of "A-1.2" will suddenly update to
2141       "B", as untargeted mode is chosen because "A-1.2" is now installed.
2142
2143       If you want to have full control over when targeting mode is chosen,
2144       turn off auto-targeting with the SOLVER_FLAG_NO_AUTOTARGET solver
2145       option. In that case, all updates are considered to be untargeted
2146       unless they include the SOLVER_TARGETED flag.
2147
2148   SET BITS
2149       Set bits specify which parts of the specified packages where specified
2150       by the user. It is used by the solver when checking if an operation is
2151       allowed or not. For example, the solver will normally not allow the
2152       downgrade of an installed package. But it will not report a problem if
2153       the SOLVER_SETEVR flag is used, as it then assumes that the user
2154       specified the exact version and thus knows what he is doing.
2155
2156       So if a package "screen-1-1" is installed for the x86_64 architecture
2157       and version "2-1" is only available for the i586 architecture,
2158       installing package "screen-2.1" will ask the user for confirmation
2159       because of the different architecture. When using the Selection class
2160       to create jobs the set bits are automatically added, e.g. selecting
2161       “screen.i586” will automatically add SOLVER_SETARCH, and thus no
2162       problem will be reported.
2163

THE SOLVER CLASS

2165       Dependency solving is what this library is about. A solver object is
2166       needed for solving to store the result of the solver run. The solver
2167       object can be used multiple times for different jobs, reusing it allows
2168       the solver to re-use the dependency rules it already computed.
2169
2170   CONSTANTS
2171       Flags to modify some of the solver’s behavior:
2172
2173       SOLVER_FLAG_ALLOW_DOWNGRADE
2174           Allow the solver to downgrade packages without asking for
2175           confirmation (i.e. reporting a problem).
2176
2177       SOLVER_FLAG_ALLOW_ARCHCHANGE
2178           Allow the solver to change the architecture of an installed package
2179           without asking for confirmation. Note that changes to/from noarch
2180           are always considered to be allowed.
2181
2182       SOLVER_FLAG_ALLOW_VENDORCHANGE
2183           Allow the solver to change the vendor of an installed package
2184           without asking for confirmation. Each vendor is part of one or more
2185           vendor equivalence classes, normally installed packages may only
2186           change their vendor if the new vendor shares at least one
2187           equivalence class.
2188
2189       SOLVER_FLAG_ALLOW_NAMECHANGE
2190           Allow the solver to change the name of an installed package, i.e.
2191           install a package with a different name that obsoletes the
2192           installed package. This option is on by default.
2193
2194       SOLVER_FLAG_ALLOW_UNINSTALL
2195           Allow the solver to erase installed packages to fulfill the jobs.
2196           This flag also includes the above flags. You may want to set this
2197           flag if you only have SOLVER_ERASE jobs, as in that case it’s
2198           better for the user to check the transaction overview instead of
2199           approving every single package that needs to be erased.
2200
2201       SOLVER_FLAG_DUP_ALLOW_DOWNGRADE
2202           Like SOLVER_FLAG_ALLOW_DOWNGRADE, but used in distupgrade mode.
2203
2204       SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE
2205           Like SOLVER_FLAG_ALLOW_ARCHCHANGE, but used in distupgrade mode.
2206
2207       SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE
2208           Like SOLVER_FLAG_ALLOW_VENDORCHANGE, but used in distupgrade mode.
2209
2210       SOLVER_FLAG_DUP_ALLOW_NAMECHANGE
2211           Like SOLVER_FLAG_ALLOW_NAMECHANGE, but used in distupgrade mode.
2212
2213       SOLVER_FLAG_NO_UPDATEPROVIDE
2214           If multiple packages obsolete an installed package, the solver
2215           checks the provides of every such package and ignores all packages
2216           that do not provide the installed package name. Thus, you can have
2217           an official update candidate that provides the old name, and other
2218           packages that also obsolete the package but are not considered for
2219           updating. If you cannot use this feature, you can turn it off by
2220           setting this flag.
2221
2222       SOLVER_FLAG_NEED_UPDATEPROVIDE
2223           This is somewhat the opposite of SOLVER_FLAG_NO_UPDATEPROVIDE: Only
2224           packages that provide the installed package names are considered
2225           for updating.
2226
2227       SOLVER_FLAG_SPLITPROVIDES
2228           Make the solver aware of special provides of the form
2229           “<packagename>:<path>” used in SUSE systems to support package
2230           splits.
2231
2232       SOLVER_FLAG_IGNORE_RECOMMENDED
2233           Do not process optional (aka weak) dependencies.
2234
2235       SOLVER_FLAG_ADD_ALREADY_RECOMMENDED
2236           Install recommended or supplemented packages even if they have no
2237           connection to the current transaction. You can use this feature to
2238           implement a simple way for the user to install new recommended
2239           packages that were not available in the past.
2240
2241       SOLVER_FLAG_NO_INFARCHCHECK
2242           Turn off the inferior architecture checking that is normally done
2243           by the solver. Normally, the solver allows only the installation of
2244           packages from the "best" architecture if a package is available for
2245           multiple architectures.
2246
2247       SOLVER_FLAG_BEST_OBEY_POLICY
2248           Make the SOLVER_FORCEBEST job option consider only packages that
2249           meet the policies for installed packages, i.e. no downgrades, no
2250           architecture change, no vendor change (see the first flags of this
2251           section). If the flag is not specified, the solver will enforce the
2252           installation of the best package ignoring the installed packages,
2253           which may conflict with the set policy.
2254
2255       SOLVER_FLAG_NO_AUTOTARGET
2256           Do not enable auto-targeting up update and distupgrade jobs. See
2257           the section on targeted updates for more information.
2258
2259       SOLVER_FLAG_KEEP_ORPHANS
2260           Do not allow orphaned packages to be deinstalled if they get in the
2261           way of resolving other packages.
2262
2263       SOLVER_FLAG_BREAK_ORPHANS
2264           Ignore dependencies of orphaned packages that get in the way of
2265           resolving non-orphaned ones. Setting the flag might result in no
2266           longer working packages in case they are orphaned.
2267
2268       SOLVER_FLAG_FOCUS_INSTALLED
2269           Resolve installed packages before resolving the given jobs. Setting
2270           this flag means that the solver will prefer picking a package
2271           version that fits the other installed packages over updating
2272           installed packages.
2273
2274       SOLVER_FLAG_FOCUS_BEST
2275           First resolve the given jobs, then the dependencies of the
2276           resulting packages, then resolve all already installed packages.
2277           This will result in more packages being updated as when the flag is
2278           not used.
2279
2280       SOLVER_FLAG_INSTALL_ALSO_UPDATES
2281           Update the package if a job is already fulfilled by an installed
2282           package.
2283
2284       SOLVER_FLAG_YUM_OBSOLETES
2285           Turn on yum-like package split handling. See the yum documentation
2286           for more details.
2287
2288       SOLVER_FLAG_URPM_REORDER
2289           Turn on urpm like package reordering for kernel packages. See the
2290           urpm documentation for more details.
2291
2292       Basic rule types:
2293
2294       SOLVER_RULE_UNKNOWN
2295           A rule of an unknown class. You should never encounter those.
2296
2297       SOLVER_RULE_PKG
2298           A package dependency rule.
2299
2300       SOLVER_RULE_UPDATE
2301           A rule to implement the update policy of installed packages. Every
2302           installed package has an update rule that consists of the packages
2303           that may replace the installed package.
2304
2305       SOLVER_RULE_FEATURE
2306           Feature rules are fallback rules used when an update rule is
2307           disabled. They include all packages that may replace the installed
2308           package ignoring the update policy, i.e. they contain downgrades,
2309           arch changes and so on. Without them, the solver would simply erase
2310           installed packages if their update rule gets disabled.
2311
2312       SOLVER_RULE_JOB
2313           Job rules implement the job given to the solver.
2314
2315       SOLVER_RULE_DISTUPGRADE
2316           These are simple negative assertions that make sure that only
2317           packages are kept that are also available in one of the
2318           repositories.
2319
2320       SOLVER_RULE_INFARCH
2321           Infarch rules are also negative assertions, they disallow the
2322           installation of packages when there are packages of the same name
2323           but with a better architecture.
2324
2325       SOLVER_RULE_CHOICE
2326           Choice rules are used to make sure that the solver prefers updating
2327           to installing different packages when some dependency is provided
2328           by multiple packages with different names. The solver may always
2329           break choice rules, so you will not see them when a problem is
2330           found.
2331
2332       SOLVER_RULE_LEARNT
2333           These rules are generated by the solver to keep it from running
2334           into the same problem multiple times when it has to backtrack. They
2335           are the main reason why a sat solver is faster than other
2336           dependency solver implementations.
2337
2338       Special dependency rule types:
2339
2340       SOLVER_RULE_PKG_NOT_INSTALLABLE
2341           This rule was added to prevent the installation of a package of an
2342           architecture that does not work on the system.
2343
2344       SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP
2345           The package contains a required dependency which was not provided
2346           by any package.
2347
2348       SOLVER_RULE_PKG_REQUIRES
2349           Similar to SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP, but in this case
2350           some packages provided the dependency but none of them could be
2351           installed due to other dependency issues.
2352
2353       SOLVER_RULE_PKG_SELF_CONFLICT
2354           The package conflicts with itself. This is not allowed by older rpm
2355           versions.
2356
2357       SOLVER_RULE_PKG_CONFLICTS
2358           To fulfill the dependencies two packages need to be installed, but
2359           one of the packages contains a conflict with the other one.
2360
2361       SOLVER_RULE_PKG_SAME_NAME
2362           The dependencies can only be fulfilled by multiple versions of a
2363           package, but installing multiple versions of the same package is
2364           not allowed.
2365
2366       SOLVER_RULE_PKG_OBSOLETES
2367           To fulfill the dependencies two packages need to be installed, but
2368           one of the packages obsoletes the other one.
2369
2370       SOLVER_RULE_PKG_IMPLICIT_OBSOLETES
2371           To fulfill the dependencies two packages need to be installed, but
2372           one of the packages has provides a dependency that is obsoleted by
2373           the other one. See the POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES flag.
2374
2375       SOLVER_RULE_PKG_INSTALLED_OBSOLETES
2376           To fulfill the dependencies a package needs to be installed that is
2377           obsoleted by an installed package. See the
2378           POOL_FLAG_NOINSTALLEDOBSOLETES flag.
2379
2380       SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP
2381           The user asked for installation of a package providing a specific
2382           dependency, but no available package provides it.
2383
2384       SOLVER_RULE_JOB_UNKNOWN_PACKAGE
2385           The user asked for installation of a package with a specific name,
2386           but no available package has that name.
2387
2388       SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM
2389           The user asked for the erasure of a dependency that is provided by
2390           the system (i.e. for special hardware or language dependencies),
2391           this cannot be done with a job.
2392
2393       SOLVER_RULE_JOB_UNSUPPORTED
2394           The user asked for something that is not yet implemented, e.g. the
2395           installation of all packages at once.
2396
2397       Policy error constants
2398
2399       POLICY_ILLEGAL_DOWNGRADE
2400           The solver ask for permission before downgrading packages.
2401
2402       POLICY_ILLEGAL_ARCHCHANGE
2403           The solver ask for permission before changing the architecture of
2404           installed packages.
2405
2406       POLICY_ILLEGAL_VENDORCHANGE
2407           The solver ask for permission before changing the vendor of
2408           installed packages.
2409
2410       POLICY_ILLEGAL_NAMECHANGE
2411           The solver ask for permission before replacing an installed
2412           packages with a package that has a different name.
2413
2414       Solution element type constants
2415
2416       SOLVER_SOLUTION_JOB
2417           The problem can be solved by removing the specified job.
2418
2419       SOLVER_SOLUTION_POOLJOB
2420           The problem can be solved by removing the specified job that is
2421           defined in the pool.
2422
2423       SOLVER_SOLUTION_INFARCH
2424           The problem can be solved by allowing the installation of the
2425           specified package with an inferior architecture.
2426
2427       SOLVER_SOLUTION_DISTUPGRADE
2428           The problem can be solved by allowing to keep the specified package
2429           installed.
2430
2431       SOLVER_SOLUTION_BEST
2432           The problem can be solved by allowing to install the specified
2433           package that is not the best available package.
2434
2435       SOLVER_SOLUTION_ERASE
2436           The problem can be solved by allowing to erase the specified
2437           package.
2438
2439       SOLVER_SOLUTION_REPLACE
2440           The problem can be solved by allowing to replace the package with
2441           some other package.
2442
2443       SOLVER_SOLUTION_REPLACE_DOWNGRADE
2444           The problem can be solved by allowing to replace the package with
2445           some other package that has a lower version.
2446
2447       SOLVER_SOLUTION_REPLACE_ARCHCHANGE
2448           The problem can be solved by allowing to replace the package with
2449           some other package that has a different architecture.
2450
2451       SOLVER_SOLUTION_REPLACE_VENDORCHANGE
2452           The problem can be solved by allowing to replace the package with
2453           some other package that has a different vendor.
2454
2455       SOLVER_SOLUTION_REPLACE_NAMECHANGE
2456           The problem can be solved by allowing to replace the package with
2457           some other package that has a different name.
2458
2459       Reason constants
2460
2461       SOLVER_REASON_UNRELATED
2462           The package status did not change as it was not related to any job.
2463
2464       SOLVER_REASON_UNIT_RULE
2465           The package was installed/erased/kept because of a unit rule, i.e.
2466           a rule where all literals but one were false.
2467
2468       SOLVER_REASON_KEEP_INSTALLED
2469           The package was chosen when trying to keep as many packages
2470           installed as possible.
2471
2472       SOLVER_REASON_RESOLVE_JOB
2473           The decision happened to fulfill a job rule.
2474
2475       SOLVER_REASON_UPDATE_INSTALLED
2476           The decision happened to fulfill a package update request.
2477
2478       SOLVER_REASON_CLEANDEPS_ERASE
2479           The package was erased when cleaning up dependencies from other
2480           erased packages.
2481
2482       SOLVER_REASON_RESOLVE
2483           The package was installed to fulfill package dependencies.
2484
2485       SOLVER_REASON_WEAKDEP
2486           The package was installed because of a weak dependency (Recommends
2487           or Supplements).
2488
2489       SOLVER_REASON_RESOLVE_ORPHAN
2490           The decision about the package was made when deciding the fate of
2491           orphaned packages.
2492
2493       SOLVER_REASON_RECOMMENDED
2494           This is a special case of SOLVER_REASON_WEAKDEP.
2495
2496       SOLVER_REASON_SUPPLEMENTED
2497           This is a special case of SOLVER_REASON_WEAKDEP.
2498
2499   ATTRIBUTES
2500           Pool *pool;                             /* read only */
2501           $job->{pool}
2502           d.pool
2503           d.pool
2504
2505       Back pointer to pool.
2506
2507   METHODS
2508           int set_flag(int flag, int value)
2509           my $oldvalue = $solver->set_flag($flag, $value);
2510           oldvalue = solver.set_flag(flag, value)
2511           oldvalue = solver.set_flag(flag, value)
2512
2513           int get_flag(int flag)
2514           my $value = $solver->get_flag($flag);
2515           value = solver.get_flag(flag)
2516           value = solver.get_flag(flag)
2517
2518       Set/get a solver specific flag. The flags define the policies the
2519       solver has to obey. The flags are explained in the CONSTANTS section of
2520       this class.
2521
2522           Problem *solve(Job *jobs)
2523           my @problems = $solver->solve(\@jobs);
2524           problems = solver.solve(jobs)
2525           problems = solver.solve(jobs)
2526
2527       Solve a problem specified in the job list (plus the jobs defined in the
2528       pool). Returns an array of problems that need user interaction, or an
2529       empty array if no problems were encountered. See the Problem class on
2530       how to deal with problems.
2531
2532           Transaction transaction()
2533           my $trans = $solver->transaction();
2534           trans = solver.transaction()
2535           trans = solver.transaction()
2536
2537       Return the transaction to implement the calculated package changes. A
2538       transaction is available even if problems were found, this is useful
2539       for interactive user interfaces that show both the job result and the
2540       problems.
2541
2542           int reason = describe_decision(Solvable *s, Rule *OUTPUT)
2543           my ($reason, $rule) = $solver->describe_decision($solvable);
2544           (reason, rule) = solver.describe_decision(solvable)
2545           (reason, rule) = solver.describe_decision(solvable)
2546
2547       Return the reason why a specific solvable was installed or erased. For
2548       most of the reasons the rule that triggered the decision is also
2549       returned.
2550
2551           Solvable *get_recommended(bool noselected=0);
2552           my @solvables = $solver->get_recommended();
2553           solvables = solver.get_recommended()
2554           solvables = solver.get_recommended()
2555
2556       Return all solvables that are recommended by the solver run result.
2557       This includes solvables included in the result, set noselected if you
2558       want to filter those.
2559
2560           Solvable *get_suggested(bool noselected=0);
2561           my @solvables = $solver->get_suggested();
2562           solvables = solver.get_suggested()
2563           solvables = solver.get_suggested()
2564
2565       Return all solvables that are suggested by the solver run result. This
2566       includes solvables included in the result, set noselected if you want
2567       to filter those.
2568

THE PROBLEM CLASS

2570       Problems are the way of the solver to interact with the user. You can
2571       simply list all problems and terminate your program, but a better way
2572       is to present solutions to the user and let him pick the ones he likes.
2573
2574   ATTRIBUTES
2575           Solver *solv;                           /* read only */
2576           $problem->{solv}
2577           problem.solv
2578           problem.solv
2579
2580       Back pointer to solver object.
2581
2582           Id id;                                  /* read only */
2583           $problem->{id}
2584           problem.id
2585           problem.id
2586
2587       Id of the problem. The first problem has Id 1, they are numbered
2588       consecutively.
2589
2590   METHODS
2591           Rule findproblemrule()
2592           my $probrule = $problem->findproblemrule();
2593           probrule = problem.findproblemrule()
2594           probrule = problem.findproblemrule()
2595
2596       Return the rule that caused the problem. Of course in most situations
2597       there is no single responsible rule, but many rules that interconnect
2598       with each created the problem. Nevertheless, the solver uses some
2599       heuristic approach to find a rule that somewhat describes the problem
2600       best to the user.
2601
2602           Rule *findallproblemrules(bool unfiltered = 0)
2603           my @probrules = $problem->findallproblemrules();
2604           probrules = problem.findallproblemrules()
2605           probrules = problem.findallproblemrules()
2606
2607       Return all rules responsible for the problem. The returned set of rules
2608       contains all the needed information why there was a problem, but it’s
2609       hard to present them to the user in a sensible way. The default is to
2610       filter out all update and job rules (unless the returned rules only
2611       consist of those types).
2612
2613           Solution *solutions()
2614           my @solutions = $problem->solutions();
2615           solutions = problem.solutions()
2616           solutions = problem.solutions()
2617
2618       Return an array containing multiple possible solutions to fix the
2619       problem. See the solution class for more information.
2620
2621           int solution_count()
2622           my $cnt = $problem->solution_count();
2623           cnt = problem.solution_count()
2624           cnt = problem.solution_count()
2625
2626       Return the number of solutions without creating solution objects.
2627
2628           <stringification>
2629           my $str = $problem->str;
2630           str = str(problem)
2631           str = problem.to_s
2632
2633       Return a string describing the problem. This is a convenience function,
2634       it is a shorthand for calling findproblemrule(), then ruleinfo() on the
2635       problem rule and problemstr() on the ruleinfo object.
2636

THE RULE CLASS

2638       Rules are the basic block of sat solving. Each package dependency gets
2639       translated into one or multiple rules.
2640
2641   ATTRIBUTES
2642           Solver *solv;                           /* read only */
2643           $rule->{solv}
2644           rule.solv
2645           rule.solv
2646
2647       Back pointer to solver object.
2648
2649           Id id;                                  /* read only */
2650           $rule->{id}
2651           rule.id
2652           rule.id
2653
2654       The id of the rule.
2655
2656           int type;                               /* read only */
2657           $rule->{type}
2658           rule.type
2659           rule.type
2660
2661       The basic type of the rule. See the constant section of the solver
2662       class for the type list.
2663
2664   METHODS
2665           Ruleinfo info()
2666           my $ruleinfo = $rule->info();
2667           ruleinfo = rule.info()
2668           ruleinfo = rule.info()
2669
2670       Return a Ruleinfo object that contains information about why the rule
2671       was created. But see the allinfos() method below.
2672
2673           Ruleinfo *allinfos()
2674           my @ruleinfos = $rule->allinfos();
2675           ruleinfos = rule.allinfos()
2676           ruleinfos = rule.allinfos()
2677
2678       As the same dependency rule can get created because of multiple
2679       dependencies, one Ruleinfo is not enough to describe the reason. Thus
2680       the allinfos() method returns an array of all infos about a rule.
2681
2682           <equality>
2683           if ($rule1 == $rule2)
2684           if rule1 == rule2:
2685           if rule1 == rule2
2686
2687       Two rules are equal if they belong to the same solver and have the same
2688       id.
2689

THE RULEINFO CLASS

2691       A Ruleinfo describes one reason why a rule was created.
2692
2693   ATTRIBUTES
2694           Solver *solv;                           /* read only */
2695           $ruleinfo->{solv}
2696           ruleinfo.solv
2697           ruleinfo.solv
2698
2699       Back pointer to solver object.
2700
2701           int type;                               /* read only */
2702           $ruleinfo->{type}
2703           ruleinfo.type
2704           ruleinfo.type
2705
2706       The type of the ruleinfo. See the constant section of the solver class
2707       for the rule type list and the special type list.
2708
2709           Dep *dep;                               /* read only */
2710           $ruleinfo->{dep}
2711           ruleinfo.dep
2712           ruleinfo.dep
2713
2714       The dependency leading to the creation of the rule.
2715
2716           Dep *dep_id;                            /* read only */
2717           $ruleinfo->{'dep_id'}
2718           ruleinfo.dep_id
2719           ruleinfo.dep_id
2720
2721       The Id of the dependency leading to the creation of the rule, or zero.
2722
2723           Solvable *solvable;                     /* read only */
2724           $ruleinfo->{solvable}
2725           ruleinfo.solvable
2726           ruleinfo.solvable
2727
2728       The involved Solvable, e.g. the one containing the dependency.
2729
2730           Solvable *othersolvable;                /* read only */
2731           $ruleinfo->{othersolvable}
2732           ruleinfo.othersolvable
2733           ruleinfo.othersolvable
2734
2735       The other involved Solvable (if any), e.g. the one containing providing
2736       the dependency for conflicts.
2737
2738           const char *problemstr();
2739           my $str = $ruleinfo->problemstr();
2740           str = ruleinfo.problemstr()
2741           str = ruleinfo.problemstr()
2742
2743       A string describing the ruleinfo from a problem perspective. This
2744       probably only makes sense if the rule is part of a problem.
2745

THE SOLUTION CLASS

2747       A solution solves one specific problem. It consists of multiple
2748       solution elements that all need to be executed.
2749
2750   ATTRIBUTES
2751           Solver *solv;                           /* read only */
2752           $solution->{solv}
2753           solution.solv
2754           solution.solv
2755
2756       Back pointer to solver object.
2757
2758           Id problemid;                           /* read only */
2759           $solution->{problemid}
2760           solution.problemid
2761           solution.problemid
2762
2763       Id of the problem the solution solves.
2764
2765           Id id;                                  /* read only */
2766           $solution->{id}
2767           solution.id
2768           solution.id
2769
2770       Id of the solution. The first solution has Id 1, they are numbered
2771       consecutively.
2772
2773   METHODS
2774           Solutionelement *elements(bool expandreplaces = 0)
2775           my @solutionelements = $solution->elements();
2776           solutionelements = solution.elements()
2777           solutionelements = solution.elements()
2778
2779       Return an array containing the elements describing what needs to be
2780       done to implement the specific solution. If expandreplaces is true,
2781       elements of type SOLVER_SOLUTION_REPLACE will be replaced by one or
2782       more elements replace elements describing the policy mismatches.
2783
2784           int element_count()
2785           my $cnt = $solution->solution_count();
2786           cnt = solution.element_count()
2787           cnt = solution.element_count()
2788
2789       Return the number of solution elements without creating objects. Note
2790       that the count does not match the number of objects returned by the
2791       elements() method of expandreplaces is set to true.
2792

THE SOLUTIONELEMENT CLASS

2794       A solution element describes a single action of a solution. The action
2795       is always either to remove one specific job or to add a new job that
2796       installs or erases a single specific package.
2797
2798   ATTRIBUTES
2799           Solver *solv;                           /* read only */
2800           $solutionelement->{solv}
2801           solutionelement.solv
2802           solutionelement.solv
2803
2804       Back pointer to solver object.
2805
2806           Id problemid;                           /* read only */
2807           $solutionelement->{problemid}
2808           solutionelement.problemid
2809           solutionelement.problemid
2810
2811       Id of the problem the element (partly) solves.
2812
2813           Id solutionid;                          /* read only */
2814           $solutionelement->{solutionid}
2815           solutionelement.solutionid
2816           solutionelement.solutionid
2817
2818       Id of the solution the element is a part of.
2819
2820           Id id;                                  /* read only */
2821           $solutionelement->{id}
2822           solutionelement.id
2823           solutionelement.id
2824
2825       Id of the solution element. The first element has Id 1, they are
2826       numbered consecutively.
2827
2828           Id type;                                /* read only */
2829           $solutionelement->{type}
2830           solutionelement.type
2831           solutionelement.type
2832
2833       Type of the solution element. See the constant section of the solver
2834       class for the existing types.
2835
2836           Solvable *solvable;                     /* read only */
2837           $solutionelement->{solvable}
2838           solutionelement.solvable
2839           solutionelement.solvable
2840
2841       The installed solvable that needs to be replaced for replacement
2842       elements.
2843
2844           Solvable *replacement;                  /* read only */
2845           $solutionelement->{replacement}
2846           solutionelement.replacement
2847           solutionelement.replacement
2848
2849       The solvable that needs to be installed to fix the problem.
2850
2851           int jobidx;                             /* read only */
2852           $solutionelement->{jobidx}
2853           solutionelement.jobidx
2854           solutionelement.jobidx
2855
2856       The index of the job that needs to be removed to fix the problem, or -1
2857       if the element is of another type. Note that it’s better to change the
2858       job to SOLVER_NOOP type so that the numbering of other elements does
2859       not get disturbed. This method works both for types SOLVER_SOLUTION_JOB
2860       and SOLVER_SOLUTION_POOLJOB.
2861
2862   METHODS
2863           Solutionelement *replaceelements()
2864           my @solutionelements = $solutionelement->replaceelements();
2865           solutionelements = solutionelement.replaceelements()
2866           solutionelements = solutionelement.replaceelements()
2867
2868       If the solution element is of type SOLVER_SOLUTION_REPLACE, return an
2869       array of elements describing the policy mismatches, otherwise return a
2870       copy of the element. See also the “expandreplaces” option in the
2871       solution’s elements() method.
2872
2873           int illegalreplace()
2874           my $illegal = $solutionelement->illegalreplace();
2875           illegal = solutionelement.illegalreplace()
2876           illegal = solutionelement.illegalreplace()
2877
2878       Return an integer that contains the policy mismatch bits or-ed
2879       together, or zero if there was no policy mismatch. See the policy error
2880       constants in the solver class.
2881
2882           Job Job()
2883           my $job = $solutionelement->Job();
2884           illegal = solutionelement.Job()
2885           illegal = solutionelement.Job()
2886
2887       Create a job that implements the solution element. Add this job to the
2888       array of jobs for all elements of type different to SOLVER_SOLUTION_JOB
2889       and SOLVER_SOLUTION_POOLJOB. For the latter two, a SOLVER_NOOB Job is
2890       created, you should replace the old job with the new one.
2891
2892           const char *str()
2893           my $str = $solutionelement->str();
2894           str = solutionelement.str()
2895           str = solutionelement.str()
2896
2897       A string describing the change the solution element consists of.
2898

THE TRANSACTION CLASS

2900       Transactions describe the output of a solver run. A transaction
2901       contains a number of transaction elements, each either the installation
2902       of a new package or the removal of an already installed package. The
2903       Transaction class supports a classify() method that puts the elements
2904       into different groups so that a transaction can be presented to the
2905       user in a meaningful way.
2906
2907   CONSTANTS
2908       Transaction element types, both active and passive
2909
2910       SOLVER_TRANSACTION_IGNORE
2911           This element does nothing. Used to map element types that do not
2912           match the view mode.
2913
2914       SOLVER_TRANSACTION_INSTALL
2915           This element installs a package.
2916
2917       SOLVER_TRANSACTION_ERASE
2918           This element erases a package.
2919
2920       SOLVER_TRANSACTION_MULTIINSTALL
2921           This element installs a package with a different version keeping
2922           the other versions installed.
2923
2924       SOLVER_TRANSACTION_MULTIREINSTALL
2925           This element reinstalls an installed package keeping the other
2926           versions installed.
2927
2928       Transaction element types, active view
2929
2930       SOLVER_TRANSACTION_REINSTALL
2931           This element re-installs a package, i.e. installs the same package
2932           again.
2933
2934       SOLVER_TRANSACTION_CHANGE
2935           This element installs a package with same name, version,
2936           architecture but different content.
2937
2938       SOLVER_TRANSACTION_UPGRADE
2939           This element installs a newer version of an installed package.
2940
2941       SOLVER_TRANSACTION_DOWNGRADE
2942           This element installs an older version of an installed package.
2943
2944       SOLVER_TRANSACTION_OBSOLETES
2945           This element installs a package that obsoletes an installed
2946           package.
2947
2948       Transaction element types, passive view
2949
2950       SOLVER_TRANSACTION_REINSTALLED
2951           This element re-installs a package, i.e. installs the same package
2952           again.
2953
2954       SOLVER_TRANSACTION_CHANGED
2955           This element replaces an installed package with one of the same
2956           name, version, architecture but different content.
2957
2958       SOLVER_TRANSACTION_UPGRADED
2959           This element replaces an installed package with a new version.
2960
2961       SOLVER_TRANSACTION_DOWNGRADED
2962           This element replaces an installed package with an old version.
2963
2964       SOLVER_TRANSACTION_OBSOLETED
2965           This element replaces an installed package with a package that
2966           obsoletes it.
2967
2968       Pseudo element types for showing extra information used by classify()
2969
2970       SOLVER_TRANSACTION_ARCHCHANGE
2971           This element replaces an installed package with a package of a
2972           different architecture.
2973
2974       SOLVER_TRANSACTION_VENDORCHANGE
2975           This element replaces an installed package with a package of a
2976           different vendor.
2977
2978       Transaction mode flags
2979
2980       SOLVER_TRANSACTION_SHOW_ACTIVE
2981           Filter for active view types. The default is to return passive view
2982           type, i.e. to show how the installed packages get changed.
2983
2984       SOLVER_TRANSACTION_SHOW_OBSOLETES
2985           Do not map the obsolete view type into INSTALL/ERASE elements.
2986
2987       SOLVER_TRANSACTION_SHOW_ALL
2988           If multiple packages replace an installed package, only the best of
2989           them is kept as OBSOLETE element, the other ones are mapped to
2990           INSTALL/ERASE elements. This is because most applications want to
2991           show just one package replacing the installed one. The
2992           SOLVER_TRANSACTION_SHOW_ALL makes the library keep all OBSOLETE
2993           elements.
2994
2995       SOLVER_TRANSACTION_SHOW_MULTIINSTALL
2996           The library maps MULTIINSTALL elements to simple INSTALL elements.
2997           This flag can be used to disable the mapping.
2998
2999       SOLVER_TRANSACTION_CHANGE_IS_REINSTALL
3000           Use this flag if you want to map CHANGE elements to the REINSTALL
3001           type.
3002
3003       SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE
3004           Use this flag if you want to map OBSOLETE elements to the UPGRADE
3005           type.
3006
3007       SOLVER_TRANSACTION_MERGE_ARCHCHANGES
3008           Do not add extra categories for every architecture change, instead
3009           cumulate them in one category.
3010
3011       SOLVER_TRANSACTION_MERGE_VENDORCHANGES
3012           Do not add extra categories for every vendor change, instead
3013           cumulate them in one category.
3014
3015       SOLVER_TRANSACTION_RPM_ONLY
3016           Special view mode that just returns IGNORE, ERASE, INSTALL,
3017           MULTIINSTALL elements. Useful if you want to find out what to feed
3018           to the underlying package manager.
3019
3020       Transaction order flags
3021
3022       SOLVER_TRANSACTION_KEEP_ORDERDATA
3023           Do not throw away the dependency graph used for ordering the
3024           transaction. This flag is needed if you want to do manual ordering.
3025
3026   ATTRIBUTES
3027           Pool *pool;                             /* read only */
3028           $trans->{pool}
3029           trans.pool
3030           trans.pool
3031
3032       Back pointer to pool.
3033
3034   METHODS
3035           bool isempty();
3036           $trans->isempty()
3037           trans.isempty()
3038           trans.isempty?
3039
3040       Returns true if the transaction does not do anything, i.e. has no
3041       elements.
3042
3043           Solvable *newsolvables();
3044           my @newsolvables = $trans->newsolvables();
3045           newsolvables = trans.newsolvables()
3046           newsolvables = trans.newsolvables()
3047
3048       Return all packages that are to be installed by the transaction. These
3049       are the packages that need to be downloaded from the repositories.
3050
3051           Solvable *keptsolvables();
3052           my @keptsolvables = $trans->keptsolvables();
3053           keptsolvables = trans.keptsolvables()
3054           keptsolvables = trans.keptsolvables()
3055
3056       Return all installed packages that the transaction will keep installed.
3057
3058           Solvable *steps();
3059           my @steps = $trans->steps();
3060           steps = trans.steps()
3061           steps = trans.steps()
3062
3063       Return all solvables that need to be installed (if the returned
3064       solvable is not already installed) or erased (if the returned solvable
3065       is installed). A step is also called a transaction element.
3066
3067           int steptype(Solvable *solvable, int mode)
3068           my $type = $trans->steptype($solvable, $mode);
3069           type = trans.steptype(solvable, mode)
3070           type = trans.steptype(solvable, mode)
3071
3072       Return the transaction type of the specified solvable. See the
3073       CONSTANTS sections for the mode argument flags and the list of returned
3074       types.
3075
3076           TransactionClass *classify(int mode = 0)
3077           my @classes = $trans->classify();
3078           classes = trans.classify()
3079           classes = trans.classify()
3080
3081       Group the transaction elements into classes so that they can be
3082       displayed in a structured way. You can use various mapping mode flags
3083       to tweak the result to match your preferences, see the mode argument
3084       flag in the CONSTANTS section. See the TransactionClass class for how
3085       to deal with the returned objects.
3086
3087           Solvable othersolvable(Solvable *solvable);
3088           my $other = $trans->othersolvable($solvable);
3089           other = trans.othersolvable(solvable)
3090           other = trans.othersolvable(solvable)
3091
3092       Return the “other” solvable for a given solvable. For installed
3093       packages the other solvable is the best package with the same name that
3094       replaces the installed package, or the best package of the obsoleting
3095       packages if the package does not get replaced by one with the same
3096       name.
3097
3098       For to be installed packages, the “other” solvable is the best
3099       installed package with the same name that will be replaced, or the best
3100       packages of all the packages that are obsoleted if the new package does
3101       not replace a package with the same name.
3102
3103       Thus, the “other” solvable is normally the package that is also shown
3104       for a given package.
3105
3106           Solvable *allothersolvables(Solvable *solvable);
3107           my @others = $trans->allothersolvables($solvable);
3108           others = trans.allothersolvables(solvable)
3109           others = trans.allothersolvables(solvable)
3110
3111       For installed packages, returns all of the packages that replace us.
3112       For to be installed packages, returns all of the packages that the new
3113       package replaces. The special “other” solvable is always the first
3114       entry of the returned array.
3115
3116           int calc_installsizechange();
3117           my $change = $trans->calc_installsizechange();
3118           change = trans.calc_installsizechange()
3119           change = trans.calc_installsizechange()
3120
3121       Return the size change of the installed system in kilobytes
3122       (kibibytes).
3123
3124           void order(int flags = 0);
3125           $trans->order();
3126           trans.order()
3127           trans.order()
3128
3129       Order the steps in the transactions so that dependent packages are
3130       updated before packages that depend on them. For rpm, you can also use
3131       rpmlib’s ordering functionality, debian’s dpkg does not provide a way
3132       to order a transaction.
3133
3134   ACTIVE/PASSIVE VIEW
3135       Active view lists what new packages get installed, while passive view
3136       shows what happens to the installed packages. Most often there’s not
3137       much difference between the two modes, but things get interesting if
3138       multiple packages get replaced by one new package. Say you have
3139       installed packages A-1-1 and B-1-1, and now install A-2-1 which has a
3140       new dependency that obsoletes B. The transaction elements will be
3141
3142           updated   A-1-1 (other: A-2-1)
3143           obsoleted B-1-1 (other: A-2-1)
3144
3145       in passive mode, but
3146
3147           update A-2-1 (other: A-1-1)
3148           erase  B
3149
3150       in active mode. If the mode contains SOLVER_TRANSACTION_SHOW_ALL, the
3151       passive mode list will be unchanged but the active mode list will just
3152       contain A-2-1.
3153

THE TRANSACTIONCLASS CLASS

3155       Objects of this type are returned by the classify() Transaction method.
3156
3157   ATTRIBUTES
3158           Transaction *transaction;               /* read only */
3159           $class->{transaction}
3160           class.transaction
3161           class.transaction
3162
3163       Back pointer to transaction object.
3164
3165           int type;                               /* read only */
3166           $class->{type}
3167           class.type
3168           class.type
3169
3170       The type of the transaction elements in the class.
3171
3172           int count;                              /* read only */
3173           $class->{count}
3174           class.count
3175           class.count
3176
3177       The number of elements in the class.
3178
3179           const char *fromstr;
3180           $class->{fromstr}
3181           class.fromstr
3182           class.fromstr
3183
3184       The old vendor or architecture.
3185
3186           const char *tostr;
3187           $class->{tostr}
3188           class.tostr
3189           class.tostr
3190
3191       The new vendor or architecture.
3192
3193           Id fromid;
3194           $class->{fromid}
3195           class.fromid
3196           class.fromid
3197
3198       The id of the old vendor or architecture.
3199
3200           Id toid;
3201           $class->{toid}
3202           class.toid
3203           class.toid
3204
3205       The id of the new vendor or architecture.
3206
3207   METHODS
3208           void solvables();
3209           my @solvables = $class->solvables();
3210           solvables = class.solvables()
3211           solvables = class.solvables()
3212
3213       Return the solvables for all transaction elements in the class.
3214

CHECKSUMS

3216       Checksums (also called hashes) are used to make sure that downloaded
3217       data is not corrupt and also as a fingerprint mechanism to check if
3218       data has changed.
3219
3220   CLASS METHODS
3221           Chksum Chksum(Id type)
3222           my $chksum = solv::Chksum->new($type);
3223           chksum = solv.Chksum(type)
3224           chksum = Solv::Chksum.new(type)
3225
3226       Create a checksum object. Currently the following types are supported:
3227
3228           REPOKEY_TYPE_MD5
3229           REPOKEY_TYPE_SHA1
3230           REPOKEY_TYPE_SHA256
3231
3232       These keys are constants in the solv class.
3233
3234           Chksum Chksum(Id type, const char *hex)
3235           my $chksum = solv::Chksum->new($type, $hex);
3236           chksum = solv.Chksum(type, hex)
3237           chksum = Solv::Chksum.new(type, hex)
3238
3239       Create an already finalized checksum object from a hex string.
3240
3241           Chksum Chksum_from_bin(Id type, char *bin)
3242           my $chksum = solv::Chksum->from_bin($type, $bin);
3243           chksum = solv.Chksum.from_bin(type, bin)
3244           chksum = Solv::Chksum.from_bin(type, bin)
3245
3246       Create an already finalized checksum object from a binary checksum.
3247
3248   ATTRIBUTES
3249           Id type;                        /* read only */
3250           $chksum->{type}
3251           chksum.type
3252           chksum.type
3253
3254       Return the type of the checksum object.
3255
3256   METHODS
3257           void add(const char *str)
3258           $chksum->add($str);
3259           chksum.add(str)
3260           chksum.add(str)
3261
3262       Add a (binary) string to the checksum.
3263
3264           void add_fp(FILE *fp)
3265           $chksum->add_fp($file);
3266           chksum.add_fp(file)
3267           chksum.add_fp(file)
3268
3269       Add the contents of a file to the checksum.
3270
3271           void add_stat(const char *filename)
3272           $chksum->add_stat($filename);
3273           chksum.add_stat(filename)
3274           chksum.add_stat(filename)
3275
3276       Stat the file and add the dev/ino/size/mtime member to the checksum. If
3277       the stat fails, the members are zeroed.
3278
3279           void add_fstat(int fd)
3280           $chksum->add_fstat($fd);
3281           chksum.add_fstat(fd)
3282           chksum.add_fstat(fd)
3283
3284       Same as add_stat, but instead of the filename a file descriptor is
3285       used.
3286
3287           unsigned char *raw()
3288           my $raw = $chksum->raw();
3289           raw = chksum.raw()
3290           raw = chksum.raw()
3291
3292       Finalize the checksum and return the result as raw bytes. This means
3293       that the result can contain NUL bytes or unprintable characters.
3294
3295           const char *hex()
3296           my $raw = $chksum->hex();
3297           raw = chksum.hex()
3298           raw = chksum.hex()
3299
3300       Finalize the checksum and return the result as hex string.
3301
3302           const char *typestr()
3303           my $typestr = $chksum->typestr();
3304           typestr = chksum.typestr
3305           typestr = chksum.typestr
3306
3307       Return the type of the checksum as a string, e.g. "sha256".
3308
3309           <equality>
3310           if ($chksum1 == $chksum2)
3311           if chksum1 == chksum2:
3312           if chksum1 == chksum2
3313
3314       Checksums are equal if they are of the same type and the finalized
3315       results are the same.
3316
3317           <stringification>
3318           my $str = $chksum->str;
3319           str = str(chksum)
3320           str = chksum.to_s
3321
3322       If the checksum is finished, the checksum is returned as "<type>:<hex>"
3323       string. Otherwise "<type>:unfinished" is returned.
3324

FILE MANAGEMENT

3326       This functions were added because libsolv uses standard FILE pointers
3327       to read/write files, but languages like perl have their own
3328       implementation of files. The libsolv functions also support
3329       decompression and compression, the algorithm is selected by looking at
3330       the file name extension.
3331
3332           FILE *xfopen(char *fn, char *mode = "r")
3333           my $file = solv::xfopen($path);
3334           file = solv.xfopen(path)
3335           file = Solv::xfopen(path)
3336
3337       Open a file at the specified path. The mode argument is passed on to
3338       the stdio library.
3339
3340           FILE *xfopen_fd(char *fn, int fileno)
3341           my $file = solv::xfopen_fd($path, $fileno);
3342           file = solv.xfopen_fd(path, fileno)
3343           file = Solv::xfopen_fd(path, fileno)
3344
3345       Create a file handle from the specified file descriptor. The path
3346       argument is only used to select the correct (de-)compression algorithm,
3347       use an empty path if you want to make sure to read/write raw data. The
3348       file descriptor is dup()ed before the file handle is created.
3349
3350   METHODS
3351           int fileno()
3352           my $fileno = $file->fileno();
3353           fileno = file.fileno()
3354           fileno = file.fileno()
3355
3356       Return file file descriptor of the file. If the file is not open, -1 is
3357       returned.
3358
3359           void cloexec(bool state)
3360           $file->cloexec($state)
3361           file.cloexec(state)
3362           file.cloexec(state)
3363
3364       Set the close-on-exec flag of the file descriptor. The xfopen function
3365       returns files with close-on-exec turned on, so if you want to pass a
3366       file to some other process you need to call cloexec(0) before calling
3367       exec.
3368
3369           int dup()
3370           my $fileno = $file->dup();
3371           fileno = file.dup()
3372           fileno = file.dup()
3373
3374       Return a copy of the descriptor of the file. If the file is not open,
3375       -1 is returned.
3376
3377           bool flush()
3378           $file->flush();
3379           file.flush()
3380           file.flush()
3381
3382       Flush the file. Returns false if there was an error. Flushing a closed
3383       file always returns true.
3384
3385           bool close()
3386           $file->close();
3387           file.close()
3388           file.close()
3389
3390       Close the file. This is needed for languages like Ruby that do not
3391       destruct objects right after they are no longer referenced. In that
3392       case, it is good style to close open files so that the file descriptors
3393       are freed right away. Returns false if there was an error.
3394

THE REPODATA CLASS

3396       The Repodata stores attributes for packages and the repository itself,
3397       each repository can have multiple repodata areas. You normally only
3398       need to directly access them if you implement lazy downloading of
3399       repository data. Repodata areas are created by calling the repository’s
3400       add_repodata() method or by using repo_add methods without the
3401       REPO_REUSE_REPODATA or REPO_USE_LOADING flag.
3402
3403   ATTRIBUTES
3404           Repo *repo;                     /* read only */
3405           $data->{repo}
3406           data.repo
3407           data.repo
3408
3409       Back pointer to repository object.
3410
3411           Id id;                                  /* read only */
3412           $data->{id}
3413           data.id
3414           data.id
3415
3416       The id of the repodata area. Repodata ids of different repositories
3417       overlap.
3418
3419   METHODS
3420           internalize();
3421           $data->internalize();
3422           data.internalize()
3423           data.internalize()
3424
3425       Internalize newly added data. The lookup functions will only see the
3426       new data after it has been internalized.
3427
3428           bool write(FILE *fp);
3429           $data->write($fp);
3430           data.write(fp)
3431           data.write(fp)
3432
3433       Write the contents of the repodata area as solv file.
3434
3435           bool add_solv(FILE *fp, int flags = 0);
3436           $data->add_solv($fp);
3437           data.add_solv(fp)
3438           data.add_solv(fp)
3439
3440       Replace a stub repodata object with the data from a solv file. This
3441       method automatically adds the REPO_USE_LOADING flag. It should only be
3442       used from a load callback.
3443
3444           void create_stubs();
3445           $data->create_stubs()
3446           data.create_stubs()
3447           data.create_stubs()
3448
3449       Create stub repodatas from the information stored in the repodata meta
3450       area.
3451
3452           void extend_to_repo();
3453           $data->extend_to_repo();
3454           data.extend_to_repo()
3455           data.extend_to_repo()
3456
3457       Extend the repodata so that it has the same size as the repo it belongs
3458       to. This method is needed when setting up a new extension repodata so
3459       that it matches the repository size. It is also needed when switching
3460       to a just written repodata extension to make the repodata match the
3461       written extension (which is always of the size of the repo).
3462
3463           <equality>
3464           if ($data1 == $data2)
3465           if data1 == data2:
3466           if data1 == data2
3467
3468       Two repodata objects are equal if they belong to the same repository
3469       and have the same id.
3470
3471   DATA RETRIEVAL METHODS
3472           const char *lookup_str(Id solvid, Id keyname)
3473           my $string = $data->lookup_str($solvid, $keyname);
3474           string = data.lookup_str(solvid, keyname)
3475           string = data.lookup_str(solvid, keyname)
3476
3477           Id *lookup_idarray(Id solvid, Id keyname)
3478           my @ids = $data->lookup_idarray($solvid, $keyname);
3479           ids = data.lookup_idarray(solvid, keyname)
3480           ids = data.lookup_idarray(solvid, keyname)
3481
3482           Chksum lookup_checksum(Id solvid, Id keyname)
3483           my $chksum = $data->lookup_checksum($solvid, $keyname);
3484           chksum = data.lookup_checksum(solvid, keyname)
3485           chksum = data.lookup_checksum(solvid, keyname)
3486
3487       Lookup functions. Return the data element stored in the specified
3488       solvable. The methods probably only make sense to retrieve data from
3489       the special SOLVID_META solvid that stores repodata meta information.
3490
3491   DATA STORAGE METHODS
3492           void set_id(Id solvid, Id keyname, DepId id);
3493           $data->set_id($solvid, $keyname, $id);
3494           data.set_id(solvid, keyname, id)
3495           data.set_id(solvid, keyname, id)
3496
3497           void set_str(Id solvid, Id keyname, const char *str);
3498           $data->set_str($solvid, $keyname, $str);
3499           data.set_str(solvid, keyname, str)
3500           data.set_str(solvid, keyname, str)
3501
3502           void set_poolstr(Id solvid, Id keyname, const char *str);
3503           $data->set_poolstr($solvid, $keyname, $str);
3504           data.set_poolstr(solvid, keyname, str)
3505           data.set_poolstr(solvid, keyname, str)
3506
3507           void set_checksum(Id solvid, Id keyname, Chksum *chksum);
3508           $data->set_checksum($solvid, $keyname, $chksum);
3509           data.set_checksum(solvid, keyname, chksum)
3510           data.set_checksum(solvid, keyname, chksum)
3511
3512           void set_sourcepkg(Id solvid, const char *sourcepkg);
3513           $data.set_sourcepkg($solvid, $sourcepkg);
3514           data.set_sourcepkg(solvid, sourcepkg)
3515           data.set_sourcepkg(solvid, sourcepkg)
3516
3517           void add_idarray(Id solvid, Id keyname, DepId id);
3518           $data->add_idarray($solvid, $keyname, $id);
3519           data.add_idarray(solvid, keyname, id)
3520           data.add_idarray(solvid, keyname, id)
3521
3522           Id new_handle();
3523           my $handle = $data->new_handle();
3524           handle = data.new_handle()
3525           handle = data.new_handle()
3526
3527           void add_flexarray(Id solvid, Id keyname, Id handle);
3528           $data->add_flexarray($solvid, $keyname, $handle);
3529           data.add_flexarray(solvid, keyname, handle)
3530           data.add_flexarray(solvid, keyname, handle)
3531
3532       Data storage methods. Probably only useful to store data in the special
3533       SOLVID_META solvid that stores repodata meta information. Note that
3534       repodata areas can have their own Id pool (see the REPO_LOCALPOOL
3535       flag), so be careful if you need to store ids. Arrays are created by
3536       calling the add function for every element. A flexarray is an array of
3537       sub-structures, call new_handle to create a new structure, use the
3538       handle as solvid to fill the structure with data and call add_flexarray
3539       to put the structure in an array.
3540

THE DATAPOS CLASS

3542       Datapos objects describe a specific position in the repository data
3543       area. Thus they are only valid until the repository is modified in some
3544       way. Datapos objects can be created by the pos() and parentpos()
3545       methods of a Datamatch object or by accessing the “meta” attribute of a
3546       repository.
3547
3548   ATTRIBUTES
3549           Repo *repo;                     /* read only */
3550           $data->{repo}
3551           data.repo
3552           data.repo
3553
3554       Back pointer to repository object.
3555
3556   METHODS
3557           Dataiterator(Id keyname, const char *match, int flags)
3558           my $di = $datapos->Dataiterator($keyname, $match, $flags);
3559           di = datapos.Dataiterator(keyname, match, flags)
3560           di = datapos.Dataiterator(keyname, match, flags)
3561
3562       Create a Dataiterator at the position of the datapos object.
3563
3564           const char *lookup_deltalocation(unsigned int *OUTPUT);
3565           my ($location, $medianr) = $datapos->lookup_deltalocation();
3566           location, medianr = datapos.lookup_deltalocation()
3567           location, medianr = datapos.lookup_deltalocation()
3568
3569       Return a tuple containing the on-media location and an optional media
3570       number for a delta rpm. This obviously only works if the data position
3571       points to structure describing a delta rpm.
3572
3573           const char *lookup_deltaseq();
3574           my $seq = $datapos->lookup_deltaseq();
3575           seq = datapos.lookup_deltaseq();
3576           seq = datapos.lookup_deltaseq();
3577
3578       Return the delta rpm sequence from the structure describing a delta
3579       rpm.
3580
3581   DATA RETRIEVAL METHODS
3582           const char *lookup_str(Id keyname)
3583           my $string = $datapos->lookup_str($keyname);
3584           string = datapos.lookup_str(keyname)
3585           string = datapos.lookup_str(keyname)
3586
3587           Id lookup_id(Id solvid, Id keyname)
3588           my $id = $datapos->lookup_id($keyname);
3589           id = datapos.lookup_id(keyname)
3590           id = datapos.lookup_id(keyname)
3591
3592           unsigned long long lookup_num(Id keyname, unsigned long long notfound = 0)
3593           my $num = $datapos->lookup_num($keyname);
3594           num = datapos.lookup_num(keyname)
3595           num = datapos.lookup_num(keyname)
3596
3597           bool lookup_void(Id keyname)
3598           my $bool = $datapos->lookup_void($keyname);
3599           bool = datapos.lookup_void(keyname)
3600           bool = datapos.lookup_void(keyname)
3601
3602           Id *lookup_idarray(Id keyname)
3603           my @ids = $datapos->lookup_idarray($keyname);
3604           ids = datapos.lookup_idarray(keyname)
3605           ids = datapos.lookup_idarray(keyname)
3606
3607           Chksum lookup_checksum(Id keyname)
3608           my $chksum = $datapos->lookup_checksum($keyname);
3609           chksum = datapos.lookup_checksum(keyname)
3610           chksum = datapos.lookup_checksum(keyname)
3611
3612       Lookup functions. Note that the returned Ids are always translated into
3613       the Ids of the global pool even if the repodata area contains its own
3614       pool.
3615
3616           Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
3617           my $di = $datapos->Dataiterator($keyname, $match, $flags);
3618           di = datapos.Dataiterator(keyname, match, flags)
3619           di = datapos.Dataiterator(keyname, match, flags)
3620
3621           for my $d (@$di)
3622           for d in di:
3623           for d in di
3624
3625       Iterate over the matching data elements. See the Dataiterator class for
3626       more information.
3627

AUTHOR

3629       Michael Schroeder <mls@suse.de>
3630
3631
3632
3633libsolv                           02/28/2018               LIBSOLV-BINDINGS(3)
Impressum