2 .\" Title: libsolv-bindings
3 .\" Author: [see the "Author" section]
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
10 .TH "LIBSOLV\-BINDINGS" "3" "06/10/2013" "libsolv" "LIBSOLV"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 libsolv-bindings \- access libsolv from perl/python/ruby
34 Libsolv\(cqs language bindings offer an abstract, object orientated interface to the library\&. The supported languages are currently perl, python, and ruby\&. All example code (except in the specifics sections, of course) lists first the \(lqC\-ish\(rq interface, then the syntax for perl, python, and ruby (in that order)\&.
37 Libsolv\(cqs perl bindings can be loaded with the following statement:
49 Objects are either created by calling the new() method on a class or they are returned by calling methods on other objects\&.
55 my \fI$pool\fR \fB= solv::Pool\->new()\fR;
56 my \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->add_repo("my_first_repo")\fR;
62 Swig encapsulates all objects as tied hashes, thus the attributes can be accessed by treating the object as standard hash reference:
68 \fI$pool\fR\fB\->{appdata} = 42\fR;
69 \fBprintf "appdata is %d\en",\fR \fI$pool\fR\fB\->{appdata}\fR;
75 An special exception to this are iterator objects, they are encapsulated as tied arrays so that it is possible to iterate with a for() statement:
81 my \fI$iter\fR \fB=\fR \fI$pool\fR\fB\->solvables_iter()\fR;
82 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@$iter\fR\fB) { \&.\&.\&. }\fR;
88 As a downside of this approach, iterator objects can have no attributes\&.
90 If an array needs to be passed to a method it is usually done by reference, if a method returns an array it returns it on the stack:
96 my \fI@problems\fR \fB=\fR \fI$solver\fR\fB\->solve(\e\fR\fI@jobs\fR\fB)\fR;
102 Due to a bug in swig, stringification does not work for libsolv\(cqs object\&. Instead you have to call the object\(cqs str() method\&.
108 \fBprint\fR \fI$dep\fR\fB\->str() \&. "\e\fR\fIn\fR\fB"\fR;
114 Swig implements all constants as numeric variables (instead of the more natural constant subs), so don\(cqt forget the leading \(lq$\(rq when accessing a constant\&. Also do not forget to prepend the namespace of the constant:
120 \fI$pool\fR\fB\->set_flag($solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1)\fR;
125 .SH "PYTHON SPECIFICS"
127 The python bindings can be loaded with:
139 Objects are either created by calling the constructor method for a class or they are returned by calling methods on other objects\&.
145 \fIpool\fR \fB= solv\&.Pool()\fR
146 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo("my_first_repo")\fR
152 Attributes can be accessed as usual:
158 \fIpool\fR\fB\&.appdata = 42\fR
159 \fBprint "appdata is %\fR\fId\fR\fB" % (\fR\fIpool\fR\fB\&.appdata)\fR
165 Iterators also work as expected:
171 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter():\fR
177 Arrays are passed an returned as list objects:
183 \fIjobs\fR \fB=\fR \fI[\fR\fB]\fR
184 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
190 The bindings define stringification for many classes, some also have a \fIrepr\fR method to ease debugging\&.
196 \fBprint\fR \fIdep\fR
197 \fBprint repr(\fR\fIrepo\fR\fB)\fR
203 Constants are attributes of the classes:
209 \fIpool\fR\fB\&.set_flag(solv\&.Pool\&.POOL_FLAG_OBSOLETEUSESCOLORS, 1)\fR;
216 The ruby bindings can be loaded with:
222 \fBrequire \*(Aqsolv\*(Aq\fR
228 Objects are either created by calling the new method on a class or they are returned by calling methods on other objects\&. Note that all classes start with an uppercase letter in ruby, so the class is called \(lqSolv\(rq\&.
234 \fIpool\fR \fB= Solv::Pool\&.new\fR
235 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo("my_first_repo")\fR
241 Attributes can be accessed as usual:
247 \fIpool\fR\fB\&.appdata = 42\fR
248 \fBputs "appdata is #{\fR\fIpool\fR\fB\&.appdata}"\fR
254 Iterators also work as expected:
260 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter() do \&.\&.\&.\fR
266 Arrays are passed an returned as array objects:
272 \fIjobs\fR \fB=\fR \fI[\fR\fB]\fR
273 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
279 Most classes define a to_s method, so objects can be easily stringified\&. Many also define an inspect() method\&.
286 \fBputs\fR \fIrepo\fR\fB\&.inspect\fR
292 Constants live in the namespace of the class they belong to:
298 \fIpool\fR\fB\&.set_flag(Solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1)\fR;
304 Note that boolean methods have an added trailing \(lq?\(rq, to be consistent with other ruby modules:
310 \fBputs "empty\fR \fIrepo\fR\fB" if\fR \fIrepo\fR\fB\&.isempty?\fR
317 This is the main namespace of the library, you cannot create objects of this type but it contains some useful constants\&.
320 Relational flag constants, the first three can be or\-ed together
324 the \(lqless than\(rq bit
329 the \(lqequals to\(rq bit
334 the \(lqgreater then\(rq bit
339 used for relations that describe an extra architecture filter, the version part of the relation is interpreted as architecture\&.
346 Access the meta section of a repository or repodata area\&. This is like an extra Solvable that has the Id SOLVID_META\&.
351 Use the data position stored inside of the pool instead of accessing some solvable by Id\&. The bindings have the Datapos objects as an abstraction mechanism, so you do not need this constant\&.
363 Always one, describes the empty string
368 The keyname Id of the name of the solvable\&.
373 see the libsolv\-constantids manpage for a list of fixed Ids\&.
377 The pool is libsolv\(cqs central resource manager\&. A pool consists of Solvables, Repositories, Dependencies, each indexed by Ids\&.
385 my \fI$pool\fR \fB= solv::Pool\->new()\fR;
386 \fIpool\fR \fB= solv\&.Pool()\fR
387 \fIpool\fR \fB= Solv::Pool\&.new()\fR
393 Create a new pool instance\&. In most cases you just need one pool\&.
400 \fBvoid *appdata;\fR /* read/write */
401 \fI$pool\fR\fB\->{appdata}\fR
402 \fIpool\fR\fB\&.appdata\fR
403 \fIpool\fR\fB\&.appdata\fR
409 Application specific data that may be used in any way by the code using the pool\&.
415 \fBSolvable solvables[];\fR /* read only */
416 my \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->{solvables}\->[\fR\fI$solvid\fR\fB]\fR;
417 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.solvables[\fR\fIsolvid\fR\fB]\fR
418 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.solvables[\fR\fIsolvid\fR\fB]\fR
424 Look up a Solvable by its id\&.
430 \fBRepo repos[];\fR /* read only */
431 my \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->{repos}\->[\fR\fI$repoid\fR\fB]\fR;
432 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.repos[\fR\fIrepoid\fR\fB]\fR
433 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.repos[\fR\fIrepoid\fR\fB]\fR
439 Look up a Repository by its id\&.
445 \fBRepo *installed;\fR /* read/write */
446 \fI$pool\fR\fB\->{installed} =\fR \fI$repo\fR;
447 \fIpool\fR\fB\&.installed =\fR \fIrepo\fR
448 \fIpool\fR\fB\&.installed =\fR \fIrepo\fR
454 Define which repository contains all the installed packages\&.
457 \fBPOOL_FLAG_PROMOTEEPOCH\fR
459 Promote the epoch of the providing dependency to the requesting dependency if it does not contain an epoch\&. Used at some time in old rpm versions, modern systems should never need this\&.
462 \fBPOOL_FLAG_FORBIDSELFCONFLICTS\fR
464 Disallow the installation of packages that conflict with themselves\&. Debian always allows self\-conflicting packages, rpm used to forbid them but switched to also allowing them recently\&.
467 \fBPOOL_FLAG_OBSOLETEUSESPROVIDES\fR
469 Make obsolete type dependency match against provides instead of just the name and version of packages\&. Very old versions of rpm used the name/version, then it got switched to provides and later switched back again to just name/version\&.
472 \fBPOOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES\fR
474 An implicit obsoletes is the internal mechanism to remove the old package on an update\&. The default is to remove all packages with the same name, rpm\-5 switched to also removing packages providing the same name\&.
477 \fBPOOL_FLAG_OBSOLETEUSESCOLORS\fR
479 Rpm\(cqs multilib implementation (used in RedHat and Fedora) distinguishes between 32bit and 64bit packages (the terminology is that they have a different color)\&. If obsolteusescolors is set, packages with different colors will not obsolete each other\&.
482 \fBPOOL_FLAG_IMPLICITOBSOLETEUSESCOLORS\fR
484 Same as POOL_FLAG_OBSOLETEUSESCOLORS, but used to find out if packages of the same name can be installed in parallel\&. For current Fedora systems, POOL_FLAG_OBSOLETEUSESCOLORS should be false and POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS should be true (this is the default if FEDORA is defined when libsolv is compiled)\&.
487 \fBPOOL_FLAG_NOINSTALLEDOBSOLETES\fR
489 New versions of rpm consider the obsoletes of installed packages when checking for dependency, thus you may not install a package that is obsoleted by some other installed package, unless you also erase the other package\&.
492 \fBPOOL_FLAG_HAVEDISTEPOCH\fR
494 Mandriva added a new field called distepoch that gets checked in version comparison if the epoch/version/release of two packages are the same\&.
497 \fBPOOL_FLAG_NOOBSOLETESMULTIVERSION\fR
499 If a package is installed in multiversionmode, rpm used to ignore both the implicit obsoletes and the obsolete dependency of a package\&. This was changed to ignoring just the implicit obsoletes, thus you may install multiple versions of the same name, but obsoleted packages still get removed\&.
502 \fBPOOL_FLAG_ADDFILEPROVIDESFILTERED\fR
504 Make the addfileprovides method only add files from the standard locations (i\&.e\&. the \(lqbin\(rq and \(lqetc\(rq directories)\&. This is useful if you have only few packages that use non\-standard file dependencies, but you still wand the fast speed that addfileprovides() generates\&.
513 \fI$pool\fR\fB\->free()\fR;
514 \fIpool\fR\fB\&.free()\fR
515 \fIpool\fR\fB\&.free()\fR
521 Free a pool\&. This is currently done with a method instead of relying on reference counting or garbage collection because it\(cqs hard to track every reference to a pool\&.
527 \fBvoid setdebuglevel(int\fR \fIlevel\fR\fB)\fR
528 \fI$pool\fR\fB\->setdebuglevel(\fR\fI$level\fR\fB)\fR;
529 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
530 \fIpool\fR\fB\&.setdebuglevel(\fR\fIlevel\fR\fB)\fR
536 Set the debug level\&. A value of zero means no debug output, the higher the value, the more output is generated\&.
542 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
543 my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
544 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
545 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
555 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
556 my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
557 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
558 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
564 Set/get a pool specific flag\&. The flags define how the system works, e\&.g\&. how the package manager treats obsoletes\&. The default flags should be sane for most applications, but in some cases you may want to tweak a flag, for example if you want to solv package dependencies for some other system than yours\&.
570 \fBvoid set_rootdir(const char *\fR\fIrootdir\fR\fB)\fR
571 \fI$pool\fR\fB\->set_rootdir(\fR\fIrootdir\fR\fB)\fR;
572 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
573 \fIpool\fR\fB\&.set_rootdir(\fR\fIrootdir\fR\fB)\fR
583 \fBconst char *get_rootdir()\fR
584 my \fI$rootdir\fR \fB=\fR \fI$pool\fR\fB\->get_rootdir()\fR;
585 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
586 \fIrootdir\fR \fB=\fR \fIpool\fR\fB\&.get_rootdir()\fR
592 Set/get the rootdir to use\&. This is useful if you want package management to work only in some directory, for example if you want to setup a chroot jail\&. Note that the rootdir will only be prepended to file paths if the \fBREPO_USE_ROOTDIR\fR flag is used\&.
598 \fBvoid setarch(const char *\fR\fIarch\fR \fB= 0)\fR
599 \fI$pool\fR\fB\->setarch()\fR;
600 \fIpool\fR\fB\&.setarch()\fR
601 \fIpool\fR\fB\&.setarch()\fR
607 Set the architecture for your system\&. The architecture is used to determine which packages are installable\&. It defaults to the result of \(lquname \-m\(rq\&.
613 \fBRepo add_repo(const char *\fR\fIname\fR\fB)\fR
614 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->add_repo(\fR\fI$name\fR\fB)\fR;
615 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
616 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.add_repo(\fR\fIname\fR\fB)\fR
622 Add a Repository with the specified name to the pool\&. The repository is empty on creation, use the repository methods to populate it with packages\&.
628 \fBRepoiterator repos_iter()\fR
629 \fBfor my\fR \fI$repo\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->repos_iter()})\fR
630 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter():\fR
631 \fBfor\fR \fIrepo\fR \fBin\fR \fIpool\fR\fB\&.repos_iter()\fR
637 Iterate over the existing repositories\&.
643 \fBSolvableiterator solvables_iter()\fR
644 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$pool\fR\fB\->solvables_iter()})\fR
645 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter():\fR
646 \fBfor\fR \fIsolvable\fR \fBin\fR \fIpool\fR\fB\&.solvables_iter()\fR
652 Iterate over the existing solvables\&.
658 \fBDep Dep(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
659 my \fI$dep\fR \fB=\fR \fI$pool\fR\fB\->Dep(\fR\fI$string\fR\fB)\fR;
660 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
661 \fIdep\fR \fB=\fR \fIpool\fR\fB\&.Dep(\fR\fIstring\fR\fB)\fR
667 Create an object describing a string or dependency\&. If the string is currently not in the pool and \fIcreate\fR is false, \fBundef\fR/\fBNone\fR/\fBnil\fR is returned\&.
673 \fBvoid addfileprovides()\fR
674 \fI$pool\fR\fB\->addfileprovides()\fR;
675 \fIpool\fR\fB\&.addfileprovides()\fR
676 \fIpool\fR\fB\&.addfileprovides()\fR
686 \fBId *addfileprovides_queue()\fR
687 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->addfileprovides_queue()\fR;
688 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
689 \fIids\fR \fB=\fR \fIpool\fR\fB\&.addfileprovides_queue()\fR
695 Some package managers like rpm allow dependencies on files contained in other packages\&. To allow libsolv to deal with those dependencies in an efficient way, you need to call the addfileprovides method after creating and reading all repositories\&. This method will scan all dependency for file names and than scan all packages for matching files\&. If a filename has been matched, it will be added to the provides list of the corresponding package\&. The addfileprovides_queue variant works the same way but returns an array containing all file dependencies\&. This information can be stored in the meta section of the repositories to speed up the next time the repository is loaded and addfileprovides is called\&.
701 \fBvoid createwhatprovides()\fR
702 \fI$pool\fR\fB\->createwhatprovides()\fR;
703 \fIpool\fR\fB\&.createwhatprovides()\fR
704 \fIpool\fR\fB\&.createwhatprovides()\fR
710 Create the internal \(lqwhatprovides\(rq hash over all of the provides of all packages\&. This method must be called before doing any lookups on provides\&. It\(cqs encouraged to do it right after all repos are set up, usually right after the call to addfileprovides()\&.
716 \fBSolvable *whatprovides(DepId\fR \fIdep\fR\fB)\fR
717 my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatprovides(\fR\fI$dep\fR\fB)\fR;
718 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
719 \fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatprovides(\fR\fIdep\fR\fB)\fR
725 Return all solvables that provide the specified dependency\&. You can use either a Dep object or an simple Id as argument\&.
731 \fBId *matchprovidingids(const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
732 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->matchprovidingids(\fR\fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
733 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
734 \fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
740 Search the names of all provides and return the ones matching the specified string\&. See the Dataiterator class for the allowed flags\&.
746 \fBId towhatprovides(Id *\fR\fIids\fR\fB)\fR
747 my \fI$offset\fR \fB=\fR \fI$pool\fR\fB\->towhatprovides(\e\fR\fI@ids\fR\fB)\fR;
748 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
749 \fIoffset\fR \fB=\fR \fIpool\fR\fB\&.towhatprovides(\fR\fIids\fR\fB)\fR
755 \(lqInternalize\(rq an array containing Ids\&. The returned value can be used to create solver jobs working on a specific set of packages\&. See the Solver class for more information\&.
761 \fBbool isknownarch(DepId\fR \fIid\fR\fB)\fR
762 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->isknownarch(\fR\fI$id\fR\fB)\fR;
763 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch(\fR\fIid\fR\fB)\fR
764 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch?(\fR\fIid\fR\fB)\fR
770 Return true if the specified Id describes a known architecture\&.
776 \fBSolver Solver()\fR
777 my \fI$solver\fR \fB=\fR \fI$pool\fR\fB\->Solver()\fR;
778 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
779 \fIsolver\fR \fB=\fR \fIpool\fR\fB\&.Solver()\fR
785 Create a new solver object\&.
791 \fBJob Job(int\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
792 my \fI$job\fR \fB=\fR \fI$pool\fR\fB\->Job(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
793 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
794 \fIjob\fR \fB=\fR \fIpool\fR\fB\&.Job(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
800 Create a new Job object\&. Kind of low level, in most cases you would use a Selection or Dep job constructor instead\&.
806 \fBSelection Selection()\fR
807 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection()\fR;
808 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
809 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection()\fR
815 Create an empty selection\&. Useful as a starting point for merging other selections\&.
821 \fBSelection Selection_all()\fR
822 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->Selection_all()\fR;
823 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
824 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.Selection_all()\fR
830 Create a selection containing all packages\&. Useful as starting point for intersecting other selections or for update/distupgrade jobs\&.
836 \fBSelection select(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR\fB)\fR
837 my \fI$sel\fR \fB=\fR \fI$pool\fR\fB\->select(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
838 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
839 \fIsel\fR \fB=\fR \fIpool\fR\fB\&.select(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
845 Create a selection by matching packages against the specified string\&. See the Selection class for a list of flags and how to create solver jobs from a selection\&.
851 \fBvoid setpooljobs(Jobs *\fR\fIjobs\fR\fB)\fR
852 \fI$pool\fR\fB\->setpooljobs(\e\fR\fI@jobs\fR\fB)\fR;
853 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
854 \fIpool\fR\fB\&.setpooljobs(\fR\fIjobs\fR\fB)\fR
864 \fBJob *getpooljobs()\fR
865 \fI@jobs\fR \fB=\fR \fI$pool\fR\fB\->getpooljobs()\fR;
866 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
867 \fIjobs\fR \fB=\fR \fIpool\fR\fB\&.getpooljobs()\fR
873 Get/Set fixed jobs stored in the pool\&. Those jobs are automatically appended to all solver jobs, they are meant for fixed configurations like which packages can be multiversion installed, which packages were userinstalled or must not be erased\&.
879 \fBvoid set_loadcallback(Callable *\fR\fIcallback\fR\fB)\fR
880 \fI$pool\fR\fB\->setloadcallback(\e\fR\fI&callbackfunction\fR\fB)\fR;
881 \fIpool\fR\fB\&.setloadcallback(\fR\fIcallbackfunction\fR\fB)\fR
882 \fIpool\fR\fB\&.setloadcallback { |\fR\fIrepodata\fR\fB| \&.\&.\&. }\fR
888 Set the callback function called when repository metadata needs to be loaded on demand\&. To make use of this feature, you need to create repodata stubs that tell the library which data is available but not loaded\&. If later on the data needs to be accessed, the callback function is called with a repodata argument\&. You can then load the data (maybe fetching it first from an remote server)\&. The callback should return true if the data has been made available\&.
889 .SS "DATA RETRIEVAL METHODS"
891 In the following functions, the \fIkeyname\fR argument describes what to retrieve\&. For the standard cases you can use the available Id constants\&. For example,
897 \fB$solv::SOLVABLE_SUMMARY\fR
898 \fBsolv\&.SOLVABLE_SUMMARY\fR
899 \fBSolv::SOLVABLE_SUMMARY\fR
905 selects the \(lqSummary\(rq entry of a solvable\&. The \fIsolvid\fR argument selects the desired solvable by Id\&.
911 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
912 my \fI$string\fR \fB=\fR \fI$pool\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
913 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
914 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
924 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
925 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->lookup_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
926 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
927 \fIid\fR \fB=\fR \fIpool\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
937 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
938 my \fI$num\fR \fB=\fR \fI$pool\fR\fB\->lookup_num(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
939 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
940 \fInum\fR \fB=\fR \fIpool\fR\fB\&.lookup_num(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
950 \fBbool lookup_void(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
951 my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->lookup_void(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
952 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
953 \fIbool\fR \fB=\fR \fIpool\fR\fB\&.lookup_void(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
963 \fBId *lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
964 my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
965 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
966 \fIids\fR \fB=\fR \fIpool\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
976 \fBChksum lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
977 my \fI$chksum\fR \fB=\fR \fI$pool\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
978 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
979 \fIchksum\fR \fB=\fR \fIpool\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
985 Lookup functions\&. Return the data element stored in the specified solvable\&. You should probably use the methods of the Solvable class instead\&.
991 \fBDataiterator Dataiterator(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
992 my \fI$di\fR \fB=\fR \fI$pool\fR\fB\->Dataiterator(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
993 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
994 \fIdi\fR \fB=\fR \fIpool\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1004 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1005 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1006 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1012 Iterate over the matching data elements\&. See the Dataiterator class for more information\&.
1015 The following methods deal with Ids, i\&.e\&. integers representing objects in the pool\&. They are considered \(lqlow level\(rq, in most cases you would not use them but instead the object orientated methods\&.
1021 \fBRepo id2repo(Id\fR \fIid\fR\fB)\fR
1022 \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->id2repo(\fR\fI$id\fR\fB)\fR;
1023 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
1024 \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.id2repo(\fR\fIid\fR\fB)\fR
1030 Lookup an existing Repository by id\&. You can also do this by using the \fBrepos\fR attribute\&.
1036 \fBSolvable id2solvable(Id\fR \fIid\fR\fB)\fR
1037 \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->id2solvable(\fR\fI$id\fR\fB)\fR;
1038 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
1039 \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.id2solvable(\fR\fIid\fR\fB)\fR
1045 Lookup an existing Repository by id\&. You can also do this by using the \fBsolvables\fR attribute\&.
1051 \fBconst char *solvid2str(Id\fR \fIid\fR\fB)\fR
1052 my \fI$str\fR \fB=\fR \fI$pool\fR\fB\->solvid2str(\fR\fI$id\fR\fB)\fR;
1053 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
1054 \fIstr\fR \fB=\fR \fIpool\fR\fB\&.solvid2str(\fR\fIid\fR\fB)\fR
1060 Return a string describing the Solvable with the specified id\&. The string consists of the name, version, and architecture of the Solvable\&.
1066 \fBId str2id(const char *\fR\fIstr\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1067 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->str2id(\fR\fI$string\fR\fB)\fR;
1068 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
1069 \fIid\fR \fB=\fR \fIpool\fR\fB\&.str2id(\fR\fIstring\fR\fB)\fR
1079 \fBconst char *id2str(Id\fR \fIid\fR\fB)\fR
1080 \fI$string\fR \fB=\fR \fIpool\fR\fB\->id2str(\fR\fI$id\fR\fB)\fR;
1081 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
1082 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.id2str(\fR\fIid\fR\fB)\fR
1088 Convert a string into an Id and back\&. If the string is currently not in the pool and \fIcreate\fR is false, zero is returned\&.
1094 \fBId rel2id(Id\fR \fIname\fR\fB, Id\fR \fIevr\fR\fB, int\fR \fIflags\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1095 my \fI$id\fR \fB=\fR \fIpool\fR\fB\->rel2id(\fR\fI$nameid\fR\fB,\fR \fI$evrid\fR\fB,\fR \fI$flags\fR\fB)\fR;
1096 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
1097 \fIid\fR \fB=\fR \fIpool\fR\fB\&.rel2id(\fR\fInameid\fR\fB,\fR \fIevrid\fR\fB,\fR \fIflags\fR\fB)\fR
1103 Create a \(lqrelational\(rq dependency\&. Such dependencies consist of a name part, the \fIflags\fR describing the relation, and a version part\&. The flags are:
1109 \fB$solv::REL_EQ | $solv::REL_GT | $solv::REL_LT\fR
1110 \fBsolv\&.REL_EQ | solv\&.REL_GT | solv\&.REL_LT\fR
1111 \fBSolv::REL_EQ | Solv::REL_GT | Solv::REL_LT\fR
1117 Thus, if you want a \(lq<=\(rq relation, you would use \fBREL_LT | REL_EQ\fR\&.
1123 \fBId id2langid(Id\fR \fIid\fR\fB, const char *\fR\fIlang\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1124 my \fI$id\fR \fB=\fR \fI$pool\fR\fB\->id2langid(\fR\fI$id\fR\fB,\fR \fI$language\fR\fB)\fR;
1125 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
1126 \fIid\fR \fB=\fR \fIpool\fR\fB\&.id2langid(\fR\fIid\fR\fB,\fR \fIlanguage\fR\fB)\fR
1132 Create a language specific Id from some other id\&. This function simply converts the id into a string, appends a dot and the specified language to the string and converts the result back into an Id\&.
1138 \fBconst char *dep2str(Id\fR \fIid\fR\fB)\fR
1139 \fI$string\fR \fB=\fR \fIpool\fR\fB\->dep2str(\fR\fI$id\fR\fB)\fR;
1140 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
1141 \fIstring\fR \fB=\fR \fIpool\fR\fB\&.dep2str(\fR\fIid\fR\fB)\fR
1147 Convert a dependency id into a string\&. If the id is just a string, this function has the same effect as id2str()\&. For relational dependencies, the result is the correct \(lqname relation evr\(rq string\&.
1148 .SH "THE DEPENDENCY CLASS"
1150 The dependency class is an object orientated way to work with strings and dependencies\&. Internally, dependencies are represented as Ids, i\&.e\&. simple numbers\&. Dependency objects can be constructed by using the Pool\(cqs Dep() method\&.
1157 \fBPool *pool;\fR /* read only */
1158 \fI$dep\fR\fB\->{pool}\fR
1159 \fIdep\fR\fB\&.pool\fR
1160 \fIdep\fR\fB\&.pool\fR
1166 Back reference to the pool this dependency belongs to\&.
1172 \fBId id;\fR /* read only */
1173 \fI$dep\fR\fB\->{id}\fR
1174 \fIdep\fR\fB\&.id\fR
1175 \fIdep\fR\fB\&.id\fR
1181 The id of this dependency\&.
1188 \fBDep Rel(int\fR \fIflags\fR\fB, DepId\fR \fIevrid\fR\fB, bool\fR \fIcreate\fR \fB= 1)\fR
1189 my \fI$reldep\fR \fB=\fR \fI$dep\fR\fB\->Rel(\fR\fI$flags\fR\fB,\fR \fI$evrdep\fR\fB)\fR;
1190 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
1191 \fIreldep\fR \fB=\fR \fIdep\fR\fB\&.Rel(\fR\fIflags\fR\fB,\fR \fIevrdep\fR\fB)\fR
1197 Create a relational dependency from to string dependencies and a flags argument\&. See the pool\(cqs rel2id method for a description of the flags\&.
1203 \fBSelection Selection_name(int\fR \fIsetflags\fR \fB= 0)\fR
1204 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_name()\fR;
1205 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
1206 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_name()\fR
1212 Create a Selection from a dependency\&. The selection consists of all packages that have a name equal to the dependency\&. If the dependency is of a relational type, the packages version must also fulfill the dependency\&.
1218 \fBSelection Selection_provides(int\fR \fIsetflags\fR \fB= 0)\fR
1219 my \fI$sel\fR \fB=\fR \fI$dep\fR\fB\->Selection_provides()\fR;
1220 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
1221 \fIsel\fR \fB=\fR \fIdep\fR\fB\&.Selection_provides()\fR
1227 Create a Selection from a dependency\&. The selection consists of all packages that have at least one provides matching the dependency\&.
1233 \fBconst char *str()\fR
1234 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str()\fR;
1235 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
1236 \fIstr\fR \fB=\fR \fI$dep\fR\fB\&.str()\fR
1242 Return a string describing the dependency\&.
1248 \fB<stringification>\fR
1249 my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str\fR;
1250 \fIstr\fR \fB= str(\fR\fIdep\fR\fB)\fR
1251 \fIstr\fR \fB=\fR \fIdep\fR\fB\&.to_s\fR
1257 Same as calling the str() method\&.
1264 \fBif (\fR\fI$dep1\fR \fB==\fR \fI$dep2\fR\fB)\fR
1265 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR\fB:\fR
1266 \fBif\fR \fIdep1\fR \fB==\fR \fIdep2\fR
1272 The dependencies are equal if they are part of the same pool and have the same ids\&.
1273 .SH "THE REPOSITORY CLASS"
1275 A Repository describes a group of packages, normally coming from the same source\&. Repositories are created by the Pool\(cqs add_repo() method\&.
1282 \fBPool *pool;\fR /* read only */
1283 \fI$repo\fR\fB\->{pool}\fR
1284 \fIrepo\fR\fB\&.pool\fR
1285 \fIrepo\fR\fB\&.pool\fR
1291 Back reference to the pool this dependency belongs to\&.
1297 \fBId id;\fR /* read only */
1298 \fI$repo\fR\fB\->{id}\fR
1299 \fIrepo\fR\fB\&.id\fR
1300 \fIrepo\fR\fB\&.id\fR
1306 The id of the repository\&.
1312 \fBconst char *name;\fR /* read/write */
1313 \fI$repo\fR\fB\->{name}\fR
1314 \fIrepo\fR\fB\&.name\fR
1315 \fIrepo\fR\fB\&.name\fR
1321 The repositories name\&. To libsolv, the name is just a string with no specific meaning\&.
1327 \fBint priority;\fR /* read/write */
1328 \fI$repo\fR\fB\->{priority}\fR
1329 \fIrepo\fR\fB\&.priority\fR
1330 \fIrepo\fR\fB\&.priority\fR
1336 The priority of the repository\&. A higher number means that packages of this repository will be chosen over other repositories, even if they have a greater package version\&.
1342 \fBint subpriority;\fR /* read/write */
1343 \fI$repo\fR\fB\->{subpriority}\fR
1344 \fIrepo\fR\fB\&.subpriority\fR
1345 \fIrepo\fR\fB\&.subpriority\fR
1351 The sub\-priority of the repository\&. This value is compared when the priorities of two repositories are the same\&. It is useful to make the library prefer on\-disk repositories to remote ones\&.
1357 \fBint nsolvables;\fR /* read only */
1358 \fI$repo\fR\fB\->{nsolvables}\fR
1359 \fIrepo\fR\fB\&.nsolvables\fR
1360 \fIrepo\fR\fB\&.nsolvables\fR
1366 The number of solvables in this repository\&.
1372 \fBvoid *appdata;\fR /* read/write */
1373 \fI$repo\fR\fB\->{appdata}\fR
1374 \fIrepo\fR\fB\&.appdata\fR
1375 \fIrepo\fR\fB\&.appdata\fR
1381 Application specific data that may be used in any way by the code using the repository\&.
1387 \fBDatapos *meta;\fR /* read only */
1388 \fI$repo\fR\fB\->{meta}\fR
1389 \fIrepo\fR\fB\&.meta\fR
1390 \fIrepo\fR\fB\&.meta\fR
1396 Return a Datapos object of the repodata\(cqs metadata\&. You can use the lookup methods of the Datapos class to lookup metadata attributes, like the repository timestamp\&.
1399 \fBREPO_REUSE_REPODATA\fR
1401 Reuse the last repository data area (\(lqrepodata\(rq) instead of creating a new one\&.
1404 \fBREPO_NO_INTERNALIZE\fR
1406 Do not internalize the added repository data\&. This is useful if you plan to add more data because internalization is a costly operation\&.
1409 \fBREPO_LOCALPOOL\fR
1411 Use the repodata\(cqs pool for Id storage instead of the global pool\&. Useful if you don\(cqt want to pollute the global pool with many unneeded ids, like when storing the filelist\&.
1414 \fBREPO_USE_LOADING\fR
1416 Use the repodata that is currently being loaded instead of creating a new one\&. This only makes sense if used in a load callback\&.
1419 \fBREPO_EXTEND_SOLVABLES\fR
1421 Do not create new solvables for the new data, but match existing solvables and add the data to them\&. Repository metadata is often split into multiple parts, with one primary file describing all packages and other parts holding information that is normally not needed, like the changelog\&.
1424 \fBREPO_USE_ROOTDIR\fR
1426 Prepend the pool\(cqs rootdir to the path when doing file operations\&.
1429 \fBREPO_NO_LOCATION\fR
1431 Do not add a location element to the solvables\&. Useful if the solvables are not in the final position, so you can add the correct location later in your code\&.
1434 \fBSOLV_ADD_NO_STUBS\fR
1436 Do not create stubs for repository parts that can be downloaded on demand\&.
1439 \fBSUSETAGS_RECORD_SHARES\fR
1441 This is specific to the add_susetags() method\&. Susetags allows to refer to already read packages to save disk space\&. If this data sharing needs to work over multiple calls to add_susetags, you need to specify this flag so that the share information is made available to subsequent calls\&.
1449 \fBvoid free(bool\fR \fIreuseids\fR \fB= 0)\fR
1450 \fI$repo\fR\fB\->free()\fR;
1451 \fIrepo\fR\fB\&.free()\fR
1452 \fIrepo\fR\fB\&.free()\fR
1458 Free the repository and all solvables it contains\&. If \fIreuseids\fR is set to true, the solvable ids and the repository id may be reused by the library when added new solvables\&. Thus you should leave it false if you are not sure that somebody holds a reference\&.
1464 \fBvoid empty(bool\fR \fIreuseids\fR \fB= 0)\fR
1465 \fI$repo\fR\fB\->empty()\fR;
1466 \fIrepo\fR\fB\&.empty()\fR
1467 \fIrepo\fR\fB\&.empty()\fR
1473 Free all the solvables in a repository\&. The repository will be empty after this call\&. See the free() method for the meaning of \fIreuseids\fR\&.
1479 \fBbool isempty()\fR
1480 \fI$repo\fR\fB\->isempty()\fR
1481 \fIrepo\fR\fB\&.empty()\fR
1482 \fIrepo\fR\fB\&.empty?\fR
1488 Return true if there are no solvables in this repository\&.
1494 \fBvoid internalize()\fR
1495 \fI$repo\fR\fB\->internalize()\fR;
1496 \fIrepo\fR\fB\&.internalize()\fR
1497 \fIrepo\fR\fB\&.internalize()\fR
1503 Internalize added data\&. Data must be internalized before it is available to the lookup and data iterator functions\&.
1509 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR
1510 \fI$repo\fR\fB\->write(\fR\fI$fp\fR\fB)\fR
1511 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1512 \fIrepo\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
1518 Write a repo as a \(lqsolv\(rq file\&. These files can be read very fast and thus are a good way to cache repository data\&. Returns false if there was some error writing the file\&.
1524 \fBSolvableiterator solvables_iter()\fR
1525 \fBfor my\fR \fI$solvable\fR \fB(\fR\fI@\fR\fB{\fR\fI$repo\fR\fB\->solvables_iter()})\fR
1526 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter():\fR
1527 \fBfor\fR \fIsolvable\fR \fBin\fR \fIrepo\fR\fB\&.solvables_iter()\fR
1533 Iterate over all solvables in a repository\&.
1539 \fBRepodata add_repodata(int\fR \fIflags\fR \fB= 0)\fR
1540 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->add_repodata()\fR;
1541 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1542 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.add_repodata()\fR
1548 Add a new repodata area to the repository\&. This is normally automatically done by the repo_add methods, so you need this method only in very rare circumstances\&.
1554 \fBvoid create_stubs()\fR
1555 \fI$repo\fR\fB\->create_stubs()\fR;
1556 \fIrepo\fR\fB\&.create_stubs()\fR
1557 \fIrepo\fR\fB\&.create_stubs()\fR
1563 Calls the create_stubs() repodata method for the last repodata of the repository\&.
1569 \fBbool iscontiguous()\fR
1570 \fI$repo\fR\fB\->iscontiguous()\fR
1571 \fIrepo\fR\fB\&.iscontiguous()\fR
1572 \fIrepo\fR\fB\&.iscontiguous?\fR
1578 Return true if the solvables of this repository are all in a single block with no holes, i\&.e\&. they have consecutive ids\&.
1584 \fBRepodata first_repodata()\fR
1585 my \fI$repodata\fR \fB=\fR \fI$repo\fR\fB\->first_repodata()\fR;
1586 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1587 \fIrepodata\fR \fB=\fR \fIrepo\fR\fB\&.first_repodata()\fR
1593 Checks if all repodatas but the first repodata are extensions, and return the first repodata if this is the case\&. Useful if you want to do a store/retrieve sequence on the repository to reduce the memory using and enable paging, as this does not work if the repository contains multiple non\-extension repodata areas\&.
1599 \fBSelection Selection(int\fR \fIsetflags\fR \fB= 0)\fR
1600 my \fI$sel\fR \fB=\fR \fI$repo\fR\fB\->Selection()\fR;
1601 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1602 \fIsel\fR \fB=\fR \fIrepo\fR\fB\&.Selection()\fR
1608 Create a Selection consisting of all packages in the repository\&.
1614 \fBDataiterator Dataiterator(Id\fR \fIp\fR\fB, Id\fR \fIkey\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
1615 my \fI$di\fR \fB=\fR \fI$repo\fR\fB\->Dataiterator(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
1616 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1617 \fIdi\fR \fB=\fR \fIrepo\fR\fB\&.Dataiterator(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
1627 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
1628 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
1629 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
1635 Iterate over the matching data elements in this repository\&. See the Dataiterator class for more information\&.
1641 \fB<stringification>\fR
1642 my \fI$str\fR \fB=\fR \fI$repo\fR\fB\->str\fR;
1643 \fIstr\fR \fB= str(\fR\fIrepo\fR\fB)\fR
1644 \fIstr\fR \fB=\fR \fIrepo\fR\fB\&.to_s\fR
1650 Return the name of the repository, or "Repo#<id>" if no name is set\&.
1657 \fBif (\fR\fI$repo1\fR \fB==\fR \fI$repo2\fR\fB)\fR
1658 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR\fB:\fR
1659 \fBif\fR \fIrepo1\fR \fB==\fR \fIrepo2\fR
1665 Two repositories are equal if they belong to the same pool and have the same id\&.
1666 .SS "DATA ADD METHODS"
1672 \fBSolvable add_solvable()\fR
1673 \fI$repo\fR\fB\->add_solvable()\fR;
1674 \fIrepo\fR\fB\&.add_solvable()\fR
1675 \fIrepo\fR\fB\&.add_solvable()\fR
1681 Add a single empty solvable to the repository\&. Returns a Solvable object, see the Solvable class for more information\&.
1687 \fBbool add_solv(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1688 \fI$repo\fR\fB\->add_solv(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1689 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1690 \fIrepo\fR\fB\&.add_solv(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1700 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1701 \fI$repo\fR\fB\->add_solv(\fR\fI$fp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1702 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1703 \fIrepo\fR\fB\&.add_solv(\fR\fIfp\fR\fB,\fR \fIflags\fR\fB)\fR
1709 Read a \(lqsolv\(rq file and add its contents to the repository\&. These files can be written with the write() method and are normally used as fast cache for repository metadata\&.
1715 \fBbool add_rpmdb(int\fR \fIflags\fR \fB= 0)\fR
1716 \fI$repo\fR\fB\->add_rpmdb(\fR\fI$flags\fR\fB)\fR;
1717 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1718 \fIrepo\fR\fB\&.add_rpmdb(\fR\fIflags\fR\fB)\fR
1728 \fBbool add_rpmdb_reffp(FILE *\fR\fIreffp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1729 \fI$repo\fR\fB\->add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fI$flags\fR\fB)\fR;
1730 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1731 \fIrepo\fR\fB\&.add_rpmdb_reffp(\fR\fI$reffp\fR\fB,\fR \fIflags\fR\fB)\fR
1737 Add the contents of the rpm database to the repository\&. If a solv file containing an old version of the database is available, it can be passed as reffp to speed up reading\&.
1743 \fBbool add_rpm(const char *\fR\fIname\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1744 \fI$repo\fR\fB\->add_rpm(\fR\fI$name\fR\fB,\fR \fI$flags\fR\fB)\fR;
1745 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1746 \fIrepo\fR\fB\&.add_rpm(\fR\fIname\fR\fB,\fR \fIflags\fR\fB)\fR
1752 Add the metadata of a single rpm package to the repository\&.
1758 \fBbool add_rpmdb_pubkeys(int\fR \fIflags\fR \fB= 0)\fR
1759 \fI$repo\fR\fB\->add_rpmdb_pubkeys()\fR;
1760 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1761 \fIrepo\fR\fB\&.add_rpmdb_pubkeys()\fR
1767 Add all pubkeys contained in the rpm database to the repository\&. Note that newer rpm versions also allow to store the pubkeys in some directory instead of the rpm database\&.
1773 \fBbool add_pubkey(const char *\fR\fIkeyfile\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1774 \fI$repo\fR\fB\->add_pubkey(\fR\fI$keyfile\fR\fB)\fR;
1775 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1776 \fIrepo\fR\fB\&.add_pubkey(\fR\fI$keyfile\fR\fB)\fR
1782 Add a pubkey from a file to the repository\&.
1788 \fBbool add_rpmmd(FILE *\fR\fIfp\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1789 \fI$repo\fR\fB\->add_rpmmd(\fR\fI$fp\fR\fB,\fR \fI$language\fR\fB)\fR;
1790 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1791 \fIrepo\fR\fB\&.add_rpmmd(\fR\fIfp\fR\fB,\fR \fIlanguage\fR\fB)\fR
1797 Add metadata stored in the "rpm\-md" format (i\&.e\&. from files in the \(lqrepodata\(rq directory) to a repository\&. Supported files are "primary", "filelists", "other", "suseinfo"\&. Do not forget to specify the \fBREPO_EXTEND_SOLVABLES\fR for extension files like "filelists" and "other"\&. Use the \fIlanguage\fR parameter if you have language extension files, otherwise simply use a \fBundef\fR/\fBNone\fR/\fBnil\fR parameter\&.
1803 \fBbool add_repomdxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1804 \fI$repo\fR\fB\->add_repomdxml(\fR\fI$fp\fR\fB)\fR;
1805 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1806 \fIrepo\fR\fB\&.add_repomdxml(\fR\fIfp\fR\fB)\fR
1812 Add the repomd\&.xml meta description from the "rpm\-md" format to the repository\&. This file contains information about the repository like keywords, and also a list of all database files with checksums\&. The data is added the the "meta" section of the repository, i\&.e\&. no package gets created\&.
1818 \fBbool add_updateinfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1819 \fI$repo\fR\fB\->add_updateinfoxml(\fR\fI$fp\fR\fB)\fR;
1820 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1821 \fIrepo\fR\fB\&.add_updateinfoxml(\fR\fIfp\fR\fB)\fR
1827 Add the updateinfo\&.xml file containing available maintenance updates to the repository\&. All updates are created as special packages that have a "patch:" prefix in their name\&.
1833 \fBbool add_deltainfoxml(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1834 \fI$repo\fR\fB\->add_deltainfoxml(\fR\fI$fp\fR\fB)\fR;
1835 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1836 \fIrepo\fR\fB\&.add_deltainfoxml(\fR\fIfp\fR\fB)\fR
1842 Add the deltainfo\&.xml file (also called prestodelta\&.xml) containing available delta\-rpms to the repository\&. The data is added to the "meta" section, i\&.e\&. no package gets created\&.
1848 \fBbool add_debdb(int\fR \fIflags\fR \fB= 0)\fR
1849 \fI$repo\fR\fB\->add_debdb()\fR;
1850 \fIrepo\fR\fB\&.add_debdb()\fR
1851 \fIrepo\fR\fB\&.add_debdb()\fR
1857 Add the contents of the debian installed package database to the repository\&.
1863 \fBbool add_debpackages(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1864 \fI$repo\fR\fB\->add_debpackages(\fR\fI$fp\fR\fB)\fR;
1865 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1866 \fIrepo\fR\fB\&.add_debpackages(\fR\fI$fp\fR\fB)\fR
1872 Add the contents of the debian repository metadata (the "packages" file) to the repository\&.
1878 \fBbool add_deb(const char *\fR\fIfilename\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1879 \fI$repo\fR\fB\->add_deb(\fR\fI$filename\fR\fB)\fR;
1880 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1881 \fIrepo\fR\fB\&.add_deb(\fR\fIfilename\fR\fB)\fR
1887 Add the metadata of a single deb package to the repository\&.
1893 \fBbool add_mdk(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1894 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1895 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1896 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1902 Add the contents of the mageia/mandriva repository metadata (the "synthesis\&.hdlist" file) to the repository\&.
1908 \fBbool add_mdk_info(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1909 \fI$repo\fR\fB\->add_mdk(\fR\fI$fp\fR\fB)\fR;
1910 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1911 \fIrepo\fR\fB\&.add_mdk(\fR\fI$fp\fR\fB)\fR
1917 Extend the packages from the synthesis file with the info\&.xml and files\&.xml data\&. Do not forget to specify \fBREPO_EXTEND_SOLVABLES\fR\&.
1923 \fBbool add_arch_repo(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1924 \fI$repo\fR\fB\->add_arch_repo(\fR\fI$fp\fR\fB)\fR;
1925 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1926 \fIrepo\fR\fB\&.add_arch_repo(\fR\fI$fp\fR\fB)\fR
1932 Add the contents of the archlinux repository metadata (the "\&.db\&.tar" file) to the repository\&.
1938 \fBbool add_arch_local(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1939 \fI$repo\fR\fB\->add_arch_local(\fR\fI$dir\fR\fB)\fR;
1940 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1941 \fIrepo\fR\fB\&.add_arch_local(\fR\fI$dir\fR\fB)\fR
1947 Add the contents of the archlinux installed package database to the repository\&. The \fIdir\fR parameter is usually set to "/var/lib/pacman/local"\&.
1953 \fBbool add_content(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1954 \fI$repo\fR\fB\->add_content(\fR\fI$fp\fR\fB)\fR;
1955 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1956 \fIrepo\fR\fB\&.add_content(\fR\fIfp\fR\fB)\fR
1962 Add the \(lqcontent\(rq meta description from the susetags format to the repository\&. This file contains information about the repository like keywords, and also a list of all database files with checksums\&. The data is added the the "meta" section of the repository, i\&.e\&. no package gets created\&.
1968 \fBbool add_susetags(FILE *\fR\fIfp\fR\fB, Id\fR \fIdefvendor\fR\fB, const char *\fR\fIlanguage\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1969 \fI$repo\fR\fB\->add_susetags(\fR\fI$fp\fR\fB,\fR \fI$defvendor\fR\fB,\fR \fI$language\fR\fB)\fR;
1970 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1971 \fIrepo\fR\fB\&.add_susetags(\fR\fIfp\fR\fB,\fR \fIdefvendor\fR\fB,\fR \fIlanguage\fR\fB)\fR
1977 Add repository metadata in the susetags format to the repository\&. Like with add_rpmmd, you can specify a language if you have language extension files\&. The \fIdefvendor\fR parameter provides a default vendor for packages with missing vendors, it is usually provided in the content file\&.
1983 \fBbool add_products(const char *\fR\fIdir\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
1984 \fI$repo\fR\fB\->add_products(\fR\fI$dir\fR\fB)\fR;
1985 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1986 \fIrepo\fR\fB\&.add_products(\fR\fIdir\fR\fB)\fR
1992 Add the installed SUSE products database to the repository\&. The \fIdir\fR parameter is usually "/etc/products\&.d"\&.
1993 .SH "THE SOLVABLE CLASS"
1995 A solvable describes all the information of one package\&. Each solvable belongs to one repository, it can be added and filled manually but in most cases solvables will get created by the repo_add methods\&.
2002 \fBRepo *repo;\fR /* read only */
2003 \fI$solvable\fR\fB\->{repo}\fR
2004 \fIsolvable\fR\fB\&.repo\fR
2005 \fIsolvable\fR\fB\&.repo\fR
2011 The repository this solvable belongs to\&.
2017 \fBPool *pool;\fR /* read only */
2018 \fI$solvable\fR\fB\->{pool}\fR
2019 \fIsolvable\fR\fB\&.pool\fR
2020 \fIsolvable\fR\fB\&.pool\fR
2026 The pool this solvable belongs to, same as the pool of the repo\&.
2032 \fBId id;\fR /* read only */
2033 \fI$solvable\fR\fB\->{id}\fR
2034 \fIsolvable\fR\fB\&.id\fR
2035 \fIsolvable\fR\fB\&.id\fR
2041 The specific id of the solvable\&.
2047 \fBchar *name;\fR /* read/write */
2048 \fI$solvable\fR\fB\->{name}\fR
2049 \fIsolvable\fR\fB\&.name\fR
2050 \fIsolvable\fR\fB\&.name\fR
2060 \fBchar *evr;\fR /* read/write */
2061 \fI$solvable\fR\fB\->{evr}\fR
2062 \fIsolvable\fR\fB\&.evr\fR
2063 \fIsolvable\fR\fB\&.evr\fR
2073 \fBchar *arch;\fR /* read/write */
2074 \fI$solvable\fR\fB\->{arch}\fR
2075 \fIsolvable\fR\fB\&.arch\fR
2076 \fIsolvable\fR\fB\&.arch\fR
2086 \fBchar *vendor;\fR /* read/write */
2087 \fI$solvable\fR\fB\->{vendor}\fR
2088 \fIsolvable\fR\fB\&.vendor\fR
2089 \fIsolvable\fR\fB\&.vendor\fR
2095 Easy access to often used attributes of solvables\&. They are internally stored as Ids\&.
2101 \fBId nameid;\fR /* read/write */
2102 \fI$solvable\fR\fB\->{nameid}\fR
2103 \fIsolvable\fR\fB\&.nameid\fR
2104 \fIsolvable\fR\fB\&.nameid\fR
2114 \fBId evrid;\fR /* read/write */
2115 \fI$solvable\fR\fB\->{evrid}\fR
2116 \fIsolvable\fR\fB\&.evrid\fR
2117 \fIsolvable\fR\fB\&.evrid\fR
2127 \fBId archid;\fR /* read/write */
2128 \fI$solvable\fR\fB\->{archid}\fR
2129 \fIsolvable\fR\fB\&.archid\fR
2130 \fIsolvable\fR\fB\&.archid\fR
2140 \fBId vendorid;\fR /* read/write */
2141 \fI$solvable\fR\fB\->{vendorid}\fR
2142 \fIsolvable\fR\fB\&.vendorid\fR
2143 \fIsolvable\fR\fB\&.vendorid\fR
2149 Raw interface to the ids\&. Useful if you want to search for a specific id and want to avoid the string compare overhead\&.
2156 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
2157 my \fI$string\fR \fB=\fR \fI$solvable\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
2158 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
2159 \fIstring\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
2169 \fBId lookup_id(Id\fR \fIkeyname\fR\fB)\fR
2170 my \fI$id\fR \fB=\fR \fI$solvable\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
2171 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB)\fR
2172 \fIid\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_id(\fR\fIsolvid\fR\fB)\fR
2182 \fBunsigned long long lookup_num(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
2183 my \fI$num\fR \fB=\fR \fI$solvable\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
2184 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
2185 \fInum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
2195 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
2196 my \fI$bool\fR \fB=\fR \fI$solvable\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
2197 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
2198 \fIbool\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
2208 \fBChksum lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
2209 my \fI$chksum\fR \fB=\fR \fI$solvable\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
2210 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
2211 \fIchksum\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
2221 \fBId *lookup_idarray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2222 my \fI@ids\fR \fB=\fR \fI$solvable\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
2223 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
2224 \fIids\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
2234 \fBDep *lookup_deparray(Id\fR \fIkeyname\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
2235 my \fI@deps\fR \fB=\fR \fI$solvable\fR\fB\->lookup_deparray(\fR\fI$keyname\fR\fB)\fR;
2236 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
2237 \fIdeps\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_deparray(\fR\fIkeyname\fR\fB)\fR
2243 Generic lookup methods\&. Retrieve data stored for the specific keyname\&. The lookup_idarray() method will return an array of Ids, use lookup_deparray if you want an array of Dependency objects instead\&. Some Id arrays contain two parts of data divided by a specific marker, for example the provides array uses the SOLVABLE_FILEMARKER id to store both the ids provided by the package and the ids added by the addfileprovides method\&. The default, \-1, translates to the correct marker for the keyname and returns the first part of the array, use 1 to select the second part or 0 to retrieve all ids including the marker\&.
2249 \fBconst char *lookup_location(unsigned int *\fR\fIOUTPUT\fR\fB)\fR;
2250 my \fB(\fR\fI$location\fR\fB,\fR \fI$medianr\fR\fB) =\fR \fI$solvable\fR\fB\->lookup_location()\fR;
2251 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
2252 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIsolvable\fR\fB\&.lookup_location()\fR
2258 Return a tuple containing the on\-media location and an optional media number for multi\-part repositories (e\&.g\&. repositories spawning multiple DVDs)\&.
2264 \fBvoid add_deparray(Id\fR \fIkeyname\fR\fB, DepId\fR \fIdep\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR;
2265 \fI$solvable\fR\fB\->add_deparray(\fR\fI$keyname\fR\fB,\fR \fI$dep\fR\fB)\fR;
2266 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2267 \fIsolvable\fR\fB\&.add_deparray(\fR\fIkeyname\fR\fB,\fR \fIdep\fR\fB)\fR
2273 Add a new dependency to the attributes stored in keyname\&.
2279 \fBbool installable()\fR;
2280 \fI$solvable\fR\fB\->installable()\fR
2281 \fIsolvable\fR\fB\&.installable()\fR
2282 \fIsolvable\fR\fB\&.installable?\fR
2288 Return true if the solvable is installable on the system\&. Solvables are not installable if the system does not support their architecture\&.
2294 \fBbool isinstalled()\fR;
2295 \fI$solvable\fR\fB\->isinstalled()\fR
2296 \fIsolvable\fR\fB\&.isinstalled()\fR
2297 \fIsolvable\fR\fB\&.isinstalled?\fR
2303 Return true if the solvable is installed on the system\&.
2309 \fBSelection Selection(int\fR \fIsetflags\fR \fB= 0)\fR
2310 my \fI$sel\fR \fB=\fR \fI$solvable\fR\fB\->Selection()\fR;
2311 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
2312 \fIsel\fR \fB=\fR \fIsolvable\fR\fB\&.Selection()\fR
2318 Create a Selection containing just the single solvable\&.
2324 \fBconst char *str()\fR
2325 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str()\fR;
2326 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
2327 \fIstr\fR \fB=\fR \fI$solvable\fR\fB\&.str()\fR
2333 Return a string describing the solvable\&. The string consists of the name, version, and architecture of the Solvable\&.
2339 \fB<stringification>\fR
2340 my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str\fR;
2341 \fIstr\fR \fB= str(\fR\fIsolvable\fR\fB)\fR
2342 \fIstr\fR \fB=\fR \fIsolvable\fR\fB\&.to_s\fR
2348 Same as calling the str() method\&.
2355 \fBif (\fR\fI$solvable1\fR \fB==\fR \fI$solvable2\fR\fB)\fR
2356 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR\fB:\fR
2357 \fBif\fR \fIsolvable1\fR \fB==\fR \fIsolvable2\fR
2363 Two solvables are equal if they are part of the same pool and have the same ids\&.
2364 .SH "THE DATAITERATOR CLASS"
2366 Dataiterators can be used to do complex string searches or to iterate over arrays\&. They can be created via the constructors in the Pool, Repo, and Solvable classes\&. The Repo and Solvable constructors will limit the search to the repository or the specific package\&.
2371 Return a match if the search string matches the value\&.
2374 \fBSEARCH_STRINGSTART\fR
2376 Return a match if the value starts with the search string\&.
2379 \fBSEARCH_STRINGEND\fR
2381 Return a match if the value ends with the search string\&.
2384 \fBSEARCH_SUBSTRING\fR
2386 Return a match if the search string can be matched somewhere in the value\&.
2391 Do a glob match of the search string against the value\&.
2396 Do a regular expression match of the search string against the value\&.
2401 Ignore case when matching strings\&. Works for all the above match types\&.
2406 Match the complete filenames of the file list, not just the base name\&.
2409 \fBSEARCH_COMPLETE_FILELIST\fR
2411 When matching the file list, check every file of the package not just the subset from the primary metadata\&.
2414 \fBSEARCH_CHECKSUMS\fR
2416 Allow the matching of checksum entries\&.
2424 \fBvoid prepend_keyname(Id\fR \fIkeyname\fR\fB)\fR;
2425 \fI$di\fR\fB\->prepend_keyname(\fR\fI$keyname\fR\fB)\fR;
2426 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2427 \fIdi\fR\fB\&.prepend_keyname(\fR\fIkeyname\fR\fB)\fR
2433 Do a sub\-search in the array stored in keyname\&.
2439 \fBvoid skip_solvable()\fR;
2440 \fI$di\fR\fB\->kip_solvable()\fR;
2441 \fIdi\fR\fB\&.skip_solvable()\fR
2442 \fIdi\fR\fB\&.skip_solvable()\fR
2448 Stop matching the current solvable and advance to the next one\&.
2455 \fBfor my\fR \fI$d\fR \fB(\fR\fI@$di\fR\fB)\fR
2456 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR\fB:\fR
2457 \fBfor\fR \fId\fR \fBin\fR \fIdi\fR
2463 Iterate through the matches\&. If there is a match, the object in d will be of type Datamatch\&.
2464 .SH "THE DATAMATCH CLASS"
2466 Objects of this type will be created for every value matched by a dataiterator\&.
2473 \fBPool *pool;\fR /* read only */
2474 \fI$d\fR\fB\->{pool}\fR
2475 \fId\fR\fB\&.pool\fR
2476 \fId\fR\fB\&.pool\fR
2482 Back pointer to pool\&.
2488 \fBRepo *repo;\fR /* read only */
2489 \fI$d\fR\fB\->{repo}\fR
2490 \fId\fR\fB\&.repo\fR
2491 \fId\fR\fB\&.repo\fR
2497 The repository containing the matched object\&.
2503 \fBSolvable *solvable;\fR /* read only */
2504 \fI$d\fR\fB\->{solvable}\fR
2505 \fId\fR\fB\&.solvable\fR
2506 \fId\fR\fB\&.solvable\fR
2512 The solvable containing the value that was matched\&.
2518 \fBId solvid;\fR /* read only */
2519 \fI$d\fR\fB\->{solvid}\fR
2520 \fId\fR\fB\&.solvid\fR
2521 \fId\fR\fB\&.solvid\fR
2527 The id of the solvable that matched\&.
2535 \fI$d\fR\fB\->key_id()\fR
2536 \fId\fR\fB\&.key_id()\fR
2537 \fId\fR\fB\&.key_id()\fR
2547 \fBconst char *key_idstr()\fR;
2548 \fI$d\fR\fB\->key_idstr()\fR
2549 \fId\fR\fB\&.key_idstr()\fR
2550 \fId\fR\fB\&.key_idstr()\fR
2556 The keyname that matched, either as id or string\&.
2563 \fI$d\fR\fB\->type_id()\fR
2564 \fId\fR\fB\&.type_id()\fR
2565 \fId\fR\fB\&.type_id()\fR
2575 \fBconst char *type_idstr()\fR;
2576 \fI$d\fR\fB\->type_idstr()\fR;
2577 \fId\fR\fB\&.type_idstr()\fR
2578 \fId\fR\fB\&.type_idstr()\fR
2584 The key type of the value that was matched, either as id or string\&.
2591 \fI$d\fR\fB\->id()\fR
2592 \fId\fR\fB\&.id()\fR
2593 \fId\fR\fB\&.id()\fR
2604 \fI$d\fR\fB\->idstr()\fR
2605 \fId\fR\fB\&.idstr()\fR
2606 \fId\fR\fB\&.idstr()\fR
2612 The Id of the value that was matched (only valid for id types), either as id or string\&.
2618 \fBconst char *str()\fR;
2619 \fI$d\fR\fB\->str()\fR
2620 \fId\fR\fB\&.str()\fR
2621 \fId\fR\fB\&.str()\fR
2627 The string value that was matched (only valid for string types)\&.
2633 \fBunsigned long long num()\fR;
2634 \fI$d\fR\fB\->num()\fR
2635 \fId\fR\fB\&.num()\fR
2636 \fId\fR\fB\&.num()\fR
2642 The numeric value that was matched (only valid for numeric types)\&.
2648 \fBunsigned int num2()\fR;
2649 \fI$d\fR\fB\->num2()\fR
2650 \fId\fR\fB\&.num2()\fR
2651 \fId\fR\fB\&.num2()\fR
2657 The secondary numeric value that was matched (only valid for types containing two values)\&.
2663 \fBDatapos pos()\fR;
2664 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->pos()\fR;
2665 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
2666 \fIpos\fR \fB=\fR \fId\fR\fB\&.pos()\fR
2672 The position object of the current match\&. It can be used to do sub\-searches starting at the match (if it is of an array type)\&. See the Datapos class for more information\&.
2678 \fBDatapos parentpos()\fR;
2679 my \fI$pos\fR \fB=\fR \fI$d\fR\fB\->parentpos()\fR;
2680 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
2681 \fIpos\fR \fB=\fR \fId\fR\fB\&.parentpos()\fR
2687 The position object of the array containing the current match\&. It can be used to do sub\-searches, see the Datapos class for more information\&.
2693 \fB<stringification>\fR
2694 my \fI$str\fR \fB=\fR \fI$d\fR\fB\->str\fR;
2695 \fIstr\fR \fB= str(\fR\fId\fR\fB)\fR
2696 \fIstr\fR \fB=\fR \fId\fR\fB\&.to_s\fR
2702 Return the stringification of the matched value\&. Stringification depends on the search flags, for file list entries it will return just the base name unless SEARCH_FILES is used, for checksums it will return an empty string unless SEARCH_CHECKSUMS is used\&. Numeric values are currently stringified to an empty string\&.
2703 .SH "THE SELECTION CLASS"
2705 Selections are a way to easily deal with sets of packages\&. There are multiple constructors to create them, the most useful is probably the select() method in the Pool class\&.
2708 \fBSELECTION_NAME\fR
2710 Create the selection by matching package names
2713 \fBSELECTION_PROVIDES\fR
2715 Create the selection by matching package provides
2718 \fBSELECTION_FILELIST\fR
2720 Create the selection by matching package files
2723 \fBSELECTION_CANON\fR
2725 Create the selection by matching the canonical representation of the package\&. This is normally a combination of the name, the version, and the architecture of a package\&.
2728 \fBSELECTION_DOTARCH\fR
2730 Allow an \(lq\&.<architecture>\(rq suffix when matching names or provides\&.
2735 Allow the specification of a relation when matching names or provides, e\&.g\&. "name >= 1\&.2"\&.
2738 \fBSELECTION_INSTALLED_ONLY\fR
2740 Limit the package search to installed packages\&.
2743 \fBSELECTION_SOURCE_ONLY\fR
2745 Limit the package search to source packages only\&.
2748 \fBSELECTION_WITH_SOURCE\fR
2750 Extend the package search to also match source packages\&. The default is only to match binary packages\&.
2753 \fBSELECTION_GLOB\fR
2755 Allow glob matching for package names, package provides, and file names\&.
2758 \fBSELECTION_NOCASE\fR
2760 Ignore case when matching package names, package provides, and file names\&.
2763 \fBSELECTION_FLAT\fR
2765 Return only one selection element describing the selected packages\&. The default is to create multiple elements for all globbed packages\&. Multiple elements are useful if you want to turn the selection into an install job, in that case you want an install job for every globbed package\&.
2773 \fBPool *pool;\fR /* read only */
2774 \fI$d\fR\fB\->{pool}\fR
2775 \fId\fR\fB\&.pool\fR
2776 \fId\fR\fB\&.pool\fR
2782 Back pointer to pool\&.
2790 my \fI$flags\fR \fB=\fR \fI$sel\fR\fB\->flags()\fR;
2791 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
2792 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
2798 Return the result flags of the selection\&. The flags are a subset of the ones used when creating the selection, they describe which method was used to get the result\&. For example, if you create the selection with \(lqSELECTION_NAME | SELECTION_PROVIDES\(rq, the resulting flags will either be SELECTION_NAME or SELECTION_PROVIDES depending if there was a package that matched the name or not\&. If there was no match at all, the flags will be zero\&.
2804 \fBbool isempty()\fR;
2805 \fI$sel\fR\fB\->isempty()\fR
2806 \fIsel\fR\fB\&.isempty()\fR
2807 \fIsel\fR\fB\&.isempty?\fR
2813 Return true if the selection is empty, i\&.e\&. no package could be matched\&.
2819 \fBvoid filter(Selection *\fR\fIother\fR\fB)\fR
2820 \fI$sel\fR\fB\->filter(\fR\fI$other\fR\fB)\fR;
2821 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
2822 \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR
2828 Intersect two selections\&. Packages will only stay in the selection if there are also included in the other selecting\&. Does an in\-place modification\&.
2834 \fBvoid add(Selection *\fR\fIother\fR\fB)\fR
2835 \fI$sel\fR\fB\->add(\fR\fI$other\fR\fB)\fR;
2836 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
2837 \fIsel\fR\fB\&.add(\fR\fIother\fR\fB)\fR
2843 Build the union of two selections\&. All packages of the other selection will be added to the set of packages of the selection object\&. Does an in\-place modification\&. Note that the selection flags are no longer meaningful after the add operation\&.
2849 \fBvoid add_raw(Id\fR \fIhow\fR\fB, Id\fR \fIwhat\fR\fB)\fR
2850 \fI$sel\fR\fB\->add_raw(\fR\fI$how\fR\fB,\fR \fI$what\fR\fB)\fR;
2851 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
2852 \fIsel\fR\fB\&.add_raw(\fR\fIhow\fR\fB,\fR \fIwhat\fR\fB)\fR
2858 Add a raw element to the selection\&. Check the Job class for information about the how and what parameters\&.
2864 \fBJob *jobs(int\fR \fIaction\fR\fB)\fR
2865 my \fI@jobs\fR \fB=\fR \fI$sel\fR\fB\->jobs(\fR\fI$action\fR\fB)\fR;
2866 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
2867 \fIjobs\fR \fB=\fR \fIsel\fR\fB\&.jobs(\fR\fIaction\fR\fB)\fR
2873 Convert a selection into an array of Job objects\&. The action parameter is or\-ed to the \(lqhow\(rq part of the job, it describes the type of job (e\&.g\&. install, erase)\&. See the Job class for the action and action modifier constants\&.
2879 \fBSolvable *solvables()\fR
2880 my \fI@solvables\fR \fB=\fR \fI$sel\fR\fB\->solvables()\fR;
2881 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
2882 \fIsolvables\fR \fB=\fR \fIsel\fR\fB\&.solvables()\fR
2888 Convert a selection into an array of Solvable objects\&.
2894 \fB<stringification>\fR
2895 my \fI$str\fR \fB=\fR \fI$sel\fR\fB\->str\fR;
2896 \fIstr\fR \fB= str(\fR\fIsel\fR\fB)\fR
2897 \fIstr\fR \fB=\fR \fIsel\fR\fB\&.to_s\fR
2903 Return a string describing the selection\&.
2906 Jobs are the way to specify to the dependency solver what to do\&. Most of the times jobs will get created by calling the jobs() method on a Selection object, but there is also a Job() constructor in the Pool class\&.
2909 Selection constants:
2911 \fBSOLVER_SOLVABLE\fR
2913 The \(lqwhat\(rq part is the id of a solvable\&.
2916 \fBSOLVER_SOLVABLE_NAME\fR
2918 The \(lqwhat\(rq part is the id of a package name\&.
2921 \fBSOLVER_SOLVABLE_PROVIDES\fR
2923 The \(lqwhat\(rq part is the id of a package provides\&.
2926 \fBSOLVER_SOLVABLE_ONE_OF\fR
2928 The \(lqwhat\(rq part is an offset into the \(lqwhatprovides\(rq data, created by calling the towhatprovides() pool method\&.
2931 \fBSOLVER_SOLVABLE_REPO\fR
2933 The \(lqwhat\(rq part is the id of a repository\&.
2936 \fBSOLVER_SOLVABLE_ALL\fR
2938 The \(lqwhat\(rq part is ignored, all packages are selected\&.
2941 \fBSOLVER_SOLVABLE_SELECTMASK\fR
2943 A mask containing all the above selection bits\&.
2953 \fBSOLVER_INSTALL\fR
2955 Install a package of the specified set of packages\&. It tries to install the best matching package (i\&.e\&. the highest version of the packages from the repositories with the highest priority)\&.
2960 Erase all of the packages from the specified set\&. If a package is not installed, erasing it will keep it from getting installed\&.
2965 Update the matching installed packages to their best version\&. If none of the specified packages are installed, try to update the installed packages to the specified versions\&. See the section about targeted updates about more information\&.
2968 \fBSOLVER_WEAKENDEPS\fR
2970 Allow to break the dependencies of the matching packages\&. Handle with care\&.
2973 \fBSOLVER_MULTIVERSION\fR
2975 Mark the matched packages for multiversion install\&. If they get to be installed because of some other job, the installation will keep the old version of the package installed (for rpm by using \(oq`\-i\*(Aq\*(Aq instead of ``\-U\(cq\*(Aq)\&.
2980 Do not change the state of the matched packages, i\&.e\&. when they are installed they stay installed, if not they are not selected for installation\&.
2983 \fBSOLVER_DISTUPGRADE\fR
2985 Update the matching installed packages to the best version included in one of the repositories\&. After this operation, all come from one of the available repositories except orphaned packages\&. Orphaned packages are packages that have no relation to the packages in the repositories, i\&.e\&. no package in the repositories have the same name or obsolete the orphaned package\&. This action brings the installed packages in sync with the ones in the repository\&. It also turns of arch/vendor/version locking for the affected packages to simulate a fresh installation\&. This means that distupgrade can actually downgrade packages if only lower versions of a package are available in the repositories\&.
2988 \fBSOLVER_DROP_ORPHANED\fR
2990 Erase all the matching installed packages if they are orphaned\&. This only makes sense if there is a \(lqdistupgrade all packages\(rq job\&. The default is to erase orphaned packages only if they block the installation of other packages\&.
2995 Fix dependency problems of matching installed packages\&. The default is to ignore dependency problems for installed packages\&.
2998 \fBSOLVER_USERINSTALLED\fR
3000 The matching installed packages are considered to be installed by a user, thus not installed to fulfill some dependency\&. This is needed input for the calculation of unneeded packages for jobs that have the SOLVER_CLEANDEPS flag set\&.
3003 \fBSOLVER_JOBMASK\fR
3005 A mask containing all the above action bits\&.
3008 Action modifier constants:
3012 Makes the job a weak job\&. The solver tries to fulfill weak jobs, but does not report a problem if it is not possible to do so\&.
3015 \fBSOLVER_ESSENTIAL\fR
3017 Makes the job an essential job\&. If there is a problem with the job, the solver will not propose to remove the job as one solution (unless all other solutions are also to remove essential jobs)\&.
3020 \fBSOLVER_CLEANDEPS\fR
3022 The solver will try to also erase all packages dragged in through dependencies when erasing the package\&. This needs SOLVER_USERINSTALLED jobs to maximize user satisfaction\&.
3025 \fBSOLVER_FORCEBEST\fR
3027 Insist on the best package for install, update, and distupgrade jobs\&. If this flag is not used, the solver will use the second\-best package if the best package cannot be installed for some reason\&. When this flag is used, the solver will generate a problem instead\&.
3030 \fBSOLVER_TARGETED\fR
3032 Forces targeted operation update and distupgrade jobs\&. See the section about targeted updates about more information\&.
3039 The job specified the exact epoch and version of the package set\&.
3044 The job specified the exact epoch, version, and release of the package set\&.
3047 \fBSOLVER_SETARCH\fR
3049 The job specified the exact architecture of the packages from the set\&.
3052 \fBSOLVER_SETVENDOR\fR
3054 The job specified the exact vendor of the packages from the set\&.
3057 \fBSOLVER_SETREPO\fR
3059 The job specified the exact repository of the packages from the set\&.
3062 \fBSOLVER_SETNAME\fR
3064 The job specified the exact name of the packages from the set\&.
3067 \fBSOLVER_NOAUTOSET\fR
3069 Turn of automatic set flag generation for SOLVER_SOLVABLE jobs\&.
3072 \fBSOLVER_SETMASK\fR
3074 A mask containing all the above set bits\&.
3077 See the section about set bits for more information\&.
3084 \fBPool *pool;\fR /* read only */
3085 \fI$job\fR\fB\->{pool}\fR
3086 \fId\fR\fB\&.pool\fR
3087 \fId\fR\fB\&.pool\fR
3093 Back pointer to pool\&.
3099 \fBId how;\fR /* read/write */
3100 \fI$job\fR\fB\->{how}\fR
3108 Union of the selection, action, action modifier, and set flags\&. The selection part describes the semantics of the \(lqwhat\(rq Id\&.
3114 \fBId what;\fR /* read/write */
3115 \fI$job\fR\fB\->{what}\fR
3116 \fId\fR\fB\&.what\fR
3117 \fId\fR\fB\&.what\fR
3123 Id describing the set of packages, the meaning depends on the selection part of the \(lqhow\(rq attribute\&.
3130 \fBSolvable *solvables()\fR
3131 my \fI@solvables\fR \fB=\fR \fI$job\fR\fB\->solvables()\fR;
3132 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
3133 \fIsolvables\fR \fB=\fR \fIjob\fR\fB\&.solvables()\fR
3139 Return the set of solvables of the job as an array of Solvable objects\&.
3145 \fBbool isemptyupdate()\fR;
3146 \fI$job\fR\fB\->isemptyupdate()\fR
3147 \fIjob\fR\fB\&.isemptyupdate()\fR
3148 \fIjob\fR\fB\&.isemptyupdate?\fR
3154 Convenience function to find out if the job describes an update job with no matching packages, i\&.e\&. a job that does nothing\&. Some package managers like \(lqzypper\(rq like to turn those jobs into install jobs, i\&.e\&. an update of a not\-installed package will result into the installation of the package\&.
3160 \fB<stringification>\fR
3161 my \fI$str\fR \fB=\fR \fI$job\fR\fB\->str\fR;
3162 \fIstr\fR \fB= str(\fR\fIjob\fR\fB)\fR
3163 \fIstr\fR \fB=\fR \fIjob\fR\fB\&.to_s\fR
3169 Return a string describing the job\&.
3176 \fBif (\fR\fI$job1\fR \fB==\fR \fI$job2\fR\fB)\fR
3177 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR\fB:\fR
3178 \fBif\fR \fIjob1\fR \fB==\fR \fIjob2\fR
3184 Two jobs are equal if they belong to the same pool and both the \(lqhow\(rq and the \(lqwhat\(rq attributes are the same\&.
3185 .SS "TARGETED UPDATES"
3187 Libsolv has two modes for upgrades and distupgrade: targeted and untargeted\&. Untargeted mode means that the installed packages from the specified set will be updated to the best version\&. Targeted means that packages that can be updated to a package in the specified set will be updated to the best package of the set\&.
3189 Here\(cqs an example to explain the subtle difference\&. Suppose that you have package A installed in version "1\&.1", "A\-1\&.2" is available in one of the repositories and there is also package "B" that obsoletes package A\&.
3191 An untargeted update of "A" will update the installed "A\-1\&.1" to package "B", because that is the newest version (B obsoletes A and is thus newer)\&.
3193 A targeted update of "A" will update "A\-1\&.1" to "A\-1\&.2", as the set of packages contains both "A\-1\&.1" and "A\-1\&.2", and "A\-1\&.2" is the newer one\&.
3195 An untargeted update of "B" will do nothing, as "B" is not installed\&.
3197 An targeted update of "B" will update "A\-1\&.1" to "B"\&.
3199 Note that the default is to do "auto\-targeting", thus if the specified set of packages does not include an installed package, the solver will assume targeted operation even if SOLVER_TARGETED is not used\&.
3201 This mostly matches the intent of the user, with one exception: In the example above, an update of "A\-1\&.2" will update "A\-1\&.1" to "A\-1\&.2" (targeted mode), but a second update of "A\-1\&.2" will suddenly update to "B", as untargeted mode is chosen because "A\-1\&.2" is now installed\&.
3203 If you want to have full control over when targeting mode is chosen, turn off auto\-targeting with the SOLVER_FLAG_NO_AUTOTARGET solver option\&. In that case, all updates are considered to be untargeted unless they include the SOLVER_TARGETED flag\&.
3206 Set bits specify which parts of the specified packages where specified by the user\&. It is used by the solver when checking if an operation is allowed or not\&. For example, the solver will normally not allow the downgrade of an installed package\&. But it will not report a problem if the SOLVER_SETEVR flag is used, as it then assumes that the user specified the exact version and thus knows what he is doing\&.
3208 So if a package "screen\-1\-1" is installed for the x86_64 architecture and version "2\-1" is only available for the i586 architecture, installing package "screen\-2\&.1" will ask the user for confirmation because of the different architecture\&. When using the Selection class to create jobs the set bits are automatically added, e\&.g\&. selecting \(lqscreen\&.i586\(rq will automatically add SOLVER_SETARCH, and thus no problem will be reported\&.
3209 .SH "THE SOLVER CLASS"
3211 Dependency solving is what this library is about\&. A solver object is needed for solving to store the result of the solver run\&. The solver object can be used multiple times for different jobs, reusing it allows the solver to re\-use the dependency rules it already computed\&.
3214 Flags to modify some of the solver\(cqs behavior:
3216 \fBSOLVER_FLAG_ALLOW_DOWNGRADE\fR
3218 Allow the solver to downgrade packages without asking for confirmation (i\&.e\&. reporting a problem)\&.
3221 \fBSOLVER_FLAG_ALLOW_ARCHCHANGE\fR
3223 Allow the solver to change the architecture of an installed package without asking for confirmation\&. Note that changes to/from noarch are always considered to be allowed\&.
3226 \fBSOLVER_FLAG_ALLOW_VENDORCHANGE\fR
3228 Allow the solver to change the vendor of an installed package without asking for confirmation\&. Each vendor is part of one or more vendor equivalence classes, normally installed packages may only change their vendor if the new vendor shares at least one equivalence class\&.
3231 \fBSOLVER_FLAG_ALLOW_NAMECHANGE\fR
3233 Allow the solver to change the name of an installed package, i\&.e\&. install a package with a different name that obsoletes the installed package\&. This option is on by default\&.
3236 \fBSOLVER_FLAG_ALLOW_UNINSTALL\fR
3238 Allow the solver to erase installed packages to fulfill the jobs\&. This flag also includes the above flags\&. You may want to set this flag if you only have SOLVER_ERASE jobs, as in that case it\(cqs better for the user to check the transaction overview instead of approving every single package that needs to be erased\&.
3241 \fBSOLVER_FLAG_NO_UPDATEPROVIDE\fR
3243 If multiple packages obsolete an installed package, the solver checks the provides of every such package and ignores all packages that do not provide the installed package name\&. Thus, you can have an official update candidate that provides the old name, and other packages that also obsolete the package but are not considered for updating\&. If you cannot use this feature, you can turn it off by setting this flag\&.
3246 \fBSOLVER_FLAG_SPLITPROVIDES\fR
3248 Make the solver aware of special provides of the form \(lq<packagename>:<path>\(rq used in SUSE systems to support package splits\&.
3251 \fBSOLVER_FLAG_IGNORE_RECOMMENDED\fR
3253 Do not process optional (aka weak) dependencies\&.
3256 \fBSOLVER_FLAG_ADD_ALREADY_RECOMMENDED\fR
3258 Install recommended or supplemented packages even if they have no connection to the current transaction\&. You can use this feature to implement a simple way for the user to install new recommended packages that were not available in the past\&.
3261 \fBSOLVER_FLAG_NO_INFARCHCHECK\fR
3263 Turn off the inferior architecture checking that is normally done by the solver\&. Normally, the solver allows only the installation of packages from the "best" architecture if a package is available for multiple architectures\&.
3266 \fBSOLVER_FLAG_BEST_OBEY_POLICY\fR
3268 Make the SOLVER_FORCEBEST job option consider only packages that meet the policies for installed packages, i\&.e\&. no downgrades, no architecture change, no vendor change (see the first flags of this section)\&. If the flag is not specified, the solver will enforce the installation of the best package ignoring the installed packages, which may conflict with the set policy\&.
3271 \fBSOLVER_FLAG_NO_AUTOTARGET\fR
3273 Do not enable auto\-targeting up update and distupgrade jobs\&. See the section on targeted updates for more information\&.
3278 \fBSOLVER_RULE_UNKNOWN\fR
3280 A rule of an unknown class\&. You should never encounter those\&.
3283 \fBSOLVER_RULE_RPM\fR
3285 A package dependency rule, called rpm rule for historical reasons\&.
3288 \fBSOLVER_RULE_UPDATE\fR
3290 A rule to implement the update policy of installed packages\&. Every installed package has an update rule that consists of the packages that may replace the installed package\&.
3293 \fBSOLVER_RULE_FEATURE\fR
3295 Feature rules are fallback rules used when a update rule is disabled\&. They include all packages that may replace the installed package ignoring the update policy, i\&.e\&. they contain downgrades, arch changes and so on\&. Without them, the solver would simply erase installed packages if their update rule gets disabled\&.
3298 \fBSOLVER_RULE_JOB\fR
3300 Job rules implement the job given to the solver\&.
3303 \fBSOLVER_RULE_DISTUPGRADE\fR
3305 This are simple negative assertions that make sure that only packages are kept that are also available in one of the repositories\&.
3308 \fBSOLVER_RULE_INFARCH\fR
3310 Infarch rules are also negative assertions, they disallow the installation of packages when there are packages of the same name but with a better architecture\&.
3313 \fBSOLVER_RULE_CHOICE\fR
3315 Choice rules are used to make sure that the solver prefers updating to installing different packages when some dependency is provided by multiple packages with different names\&. The solver may always break choice rules, so you will not see them when a problem is found\&.
3318 \fBSOLVER_RULE_LEARNT\fR
3320 These rules are generated by the solver to keep it from running into the same problem multiple times when it has to backtrack\&. They are the main reason why a sat solver is faster then other dependency solver implementations\&.
3323 Special dependency rule types:
3325 \fBSOLVER_RULE_RPM_NOT_INSTALLABLE\fR
3327 This rule was added to prevent the installation of a package of an architecture that does not work on the system\&.
3330 \fBSOLVER_RULE_RPM_NOTHING_PROVIDES_DEP\fR
3332 The package contains a required dependency which was not provided by any package\&.
3335 \fBSOLVER_RULE_RPM_PACKAGE_REQUIRES\fR
3337 Similar to SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, but in this case some packages provided the dependency but none of them could be installed due to other dependency issues\&.
3340 \fBSOLVER_RULE_RPM_SELF_CONFLICT\fR
3342 The package conflicts with itself\&. This is not allowed by older rpm versions\&.
3345 \fBSOLVER_RULE_RPM_PACKAGE_CONFLICT\fR
3347 To fulfill the dependencies two packages need to be installed, but one of the packages contains a conflict with the other one\&.
3350 \fBSOLVER_RULE_RPM_SAME_NAME\fR
3352 The dependencies can only be fulfilled by multiple versions of a package, but installing multiple versions of the same package is not allowed\&.
3355 \fBSOLVER_RULE_RPM_PACKAGE_OBSOLETES\fR
3357 To fulfill the dependencies two packages need to be installed, but one of the packages obsoletes the other one\&.
3360 \fBSOLVER_RULE_RPM_IMPLICIT_OBSOLETES\fR
3362 To fulfill the dependencies two packages need to be installed, but one of the packages has provides a dependency that is obsoleted by the other one\&. See the POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES flag\&.
3365 \fBSOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES\fR
3367 To fulfill the dependencies a package needs to be installed that is obsoleted by an installed package\&. See the POOL_FLAG_NOINSTALLEDOBSOLETES flag\&.
3370 \fBSOLVER_RULE_JOB_NOTHING_PROVIDES_DEP\fR
3372 The user asked for installation of a package providing a specific dependency, but no available package provides it\&.
3375 \fBSOLVER_RULE_JOB_UNKNOWN_PACKAGE\fR
3377 The user asked for installation of a package with a specific name, but no available package has that name\&.
3380 \fBSOLVER_RULE_JOB_PROVIDED_BY_SYSTEM\fR
3382 The user asked for the erasure of a dependency that is provided by the system (i\&.e\&. for special hardware or language dependencies), this cannot be done with a job\&.
3385 \fBSOLVER_RULE_JOB_UNSUPPORTED\fR
3387 The user asked for something that is not yet implemented, e\&.g\&. the installation of all packages at once\&.
3390 Policy error constants
3392 \fBPOLICY_ILLEGAL_DOWNGRADE\fR
3394 The solver ask for permission before downgrading packages\&.
3397 \fBPOLICY_ILLEGAL_ARCHCHANGE\fR
3399 The solver ask for permission before changing the architecture of installed packages\&.
3402 \fBPOLICY_ILLEGAL_VENDORCHANGE\fR
3404 The solver ask for permission before changing the vendor of installed packages\&.
3407 \fBPOLICY_ILLEGAL_NAMECHANGE\fR
3409 The solver ask for permission before replacing an installed packages with a package that has a different name\&.
3412 Solution element type constants
3414 \fBSOLVER_SOLUTION_JOB\fR
3416 The problem can be solved by removing the specified job\&.
3419 \fBSOLVER_SOLUTION_POOLJOB\fR
3421 The problem can be solved by removing the specified job that is defined in the pool\&.
3424 \fBSOLVER_SOLUTION_INFARCH\fR
3426 The problem can be solved by allowing the installation of the specified package with an inferior architecture\&.
3429 \fBSOLVER_SOLUTION_DISTUPGRADE\fR
3431 The problem can be solved by allowing to keep the specified package installed\&.
3434 \fBSOLVER_SOLUTION_BEST\fR
3436 The problem can be solved by allowing to install the specified package that is not the best available package\&.
3439 \fBSOLVER_SOLUTION_ERASE\fR
3441 The problem can be solved by allowing to erase the specified package\&.
3444 \fBSOLVER_SOLUTION_REPLACE\fR
3446 The problem can be solved by allowing to replace the package with some other package\&.
3449 \fBSOLVER_SOLUTION_REPLACE_DOWNGRADE\fR
3451 The problem can be solved by allowing to replace the package with some other package that has a lower version\&.
3454 \fBSOLVER_SOLUTION_REPLACE_ARCHCHANGE\fR
3456 The problem can be solved by allowing to replace the package with some other package that has a different architecture\&.
3459 \fBSOLVER_SOLUTION_REPLACE_VENDORCHANGE\fR
3461 The problem can be solved by allowing to replace the package with some other package that has a different vendor\&.
3464 \fBSOLVER_SOLUTION_REPLACE_NAMECHANGE\fR
3466 The problem can be solved by allowing to replace the package with some other package that has a different name\&.
3474 \fBPool *pool;\fR /* read only */
3475 \fI$job\fR\fB\->{pool}\fR
3476 \fId\fR\fB\&.pool\fR
3477 \fId\fR\fB\&.pool\fR
3483 Back pointer to pool\&.
3490 \fBint set_flag(int\fR \fIflag\fR\fB, int\fR \fIvalue\fR\fB)\fR
3491 my \fI$oldvalue\fR \fB=\fR \fI$pool\fR\fB\->set_flag(\fR\fI$flag\fR\fB,\fR \fI$value\fR\fB)\fR;
3492 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
3493 \fIoldvalue\fR \fB=\fR \fIpool\fR\fB\&.set_flag(\fR\fIflag\fR\fB,\fR \fIvalue\fR\fB)\fR
3503 \fBint get_flag(int\fR \fIflag\fR\fB)\fR
3504 my \fI$value\fR \fB=\fR \fI$pool\fR\fB\->get_flag(\fR\fI$flag\fR\fB)\fR;
3505 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
3506 \fIvalue\fR \fB=\fR \fIpool\fR\fB\&.get_flag(\fR\fIflag\fR\fB)\fR
3512 Set/get a solver specific flag\&. The flags define the policies the solver has to obey\&. The flags are explained in the CONSTANTS section of this class\&.
3518 \fBProblem *solve(Job *\fR\fIjobs\fR\fB)\fR
3519 my \fI@problems\fR \fB=\fR \fI$solver\fR\fB\->solve(\e\fR\fI@jobs\fR\fB)\fR;
3520 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
3521 \fIproblems\fR \fB=\fR \fIsolver\fR\fB\&.solve(\fR\fIjobs\fR\fB)\fR
3527 Solve a problem specified in the job list (plus the jobs defined in the pool)\&. Returns an array of problems that need user interaction, or an empty array if no problems were encountered\&. See the Problem class on how to deal with problems\&.
3533 \fBTransaction transaction()\fR
3534 my \fI$trans\fR \fB=\fR \fI$solver\fR\fB\->transaction()\fR;
3535 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
3536 \fItrans\fR \fB=\fR \fIsolver\fR\fB\&.transaction()\fR
3542 Return the transaction to implement the calculated package changes\&. A transaction is available even if problems were found, this is useful for interactive user interfaces that show both the job result and the problems\&.
3543 .SH "THE PROBLEM CLASS"
3545 Problems are the way of the solver to interact with the user\&. You can simply list all problems and terminate your program, but a better way is to present solutions to the user and let him pick the ones he likes\&.
3552 \fBSolver *solv;\fR /* read only */
3553 \fI$problem\fR\fB\->{solv}\fR
3554 \fIproblem\fR\fB\&.solv\fR
3555 \fIproblem\fR\fB\&.solv\fR
3561 Back pointer to solver object\&.
3567 \fBId id;\fR /* read only */
3568 \fI$problem\fR\fB\->{id}\fR
3569 \fIproblem\fR\fB\&.id\fR
3570 \fIproblem\fR\fB\&.id\fR
3576 Id of the problem\&. The first problem has Id 1, they are numbered consecutively\&.
3583 \fBRule findproblemrule()\fR
3584 my \fI$probrule\fR \fB=\fR \fI$problem\fR\fB\->findproblemrule()\fR;
3585 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
3586 \fIprobrule\fR \fB=\fR \fIproblem\fR\fB\&.findproblemrule()\fR
3592 Return the rule that caused the problem\&. Of course in most situations there is no single responsible rule, but many rules that interconnect with each created the problem\&. Nevertheless, the solver uses some heuristic approach to find a rule that somewhat describes the problem best to the user\&.
3598 \fBRule *findallproblemrules(bool\fR \fIunfiltered\fR \fB= 0)\fR
3599 my \fI@probrules\fR \fB=\fR \fI$problem\fR\fB\->findallproblemrules()\fR;
3600 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrule()\fR
3601 \fIprobrules\fR \fB=\fR \fIproblem\fR\fB\&.findallproblemrule()\fR
3607 Return all rules responsible for the problem\&. The returned set of rules contains all the needed information why there was a problem, but it\(cqs hard to present them to the user in a sensible way\&. The default is to filter out all update and job rules (unless the returned rules only consist of those types)\&.
3613 \fBSolution *solutions()\fR
3614 my \fI@solutions\fR \fB=\fR \fI$problem\fR\fB\->solutions()\fR;
3615 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
3616 \fIsolutions\fR \fB=\fR \fIproblem\fR\fB\&.solutions()\fR
3622 Return an array containing multiple possible solutions to fix the problem\&. See the solution class for more information\&.
3628 \fBint solution_count()\fR
3629 my \fI$cnt\fR \fB=\fR \fI$problem\fR\fB\->solution_count()\fR;
3630 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
3631 \fIcnt\fR \fB=\fR \fIproblem\fR\fB\&.solution_count()\fR
3637 Return the number of solutions without creating solution objects\&.
3638 .SH "THE RULE CLASS"
3640 Rules are the basic block of sat solving\&. Each package dependency gets translated into one or multiple rules\&.
3647 \fBSolver *solv;\fR /* read only */
3648 \fI$rule\fR\fB\->{solv}\fR
3649 \fIrule\fR\fB\&.solv\fR
3650 \fIrule\fR\fB\&.solv\fR
3656 Back pointer to solver object\&.
3662 \fBId id;\fR /* read only */
3663 \fI$rule\fR\fB\->{id}\fR
3664 \fIrule\fR\fB\&.id\fR
3665 \fIrule\fR\fB\&.id\fR
3671 The id of the rule\&.
3677 \fBint type;\fR /* read only */
3678 \fI$rule\fR\fB\->{type}\fR
3679 \fIrule\fR\fB\&.type\fR
3680 \fIrule\fR\fB\&.type\fR
3686 The basic type of the rule\&. See the constant section of the solver class for the type list\&.
3693 \fBRuleinfo info()\fR
3694 my \fI$ruleinfo\fR \fB=\fR \fI$rule\fR\fB\->info()\fR;
3695 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
3696 \fIruleinfo\fR \fB=\fR \fIrule\fR\fB\&.info()\fR
3702 Return a Ruleinfo object that contains information about why the rule was created\&. But see the allinfos() method below\&.
3708 \fBRuleinfo *allinfos()\fR
3709 my \fI@ruleinfos\fR \fB=\fR \fI$rule\fR\fB\->allinfos()\fR;
3710 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
3711 \fIruleinfos\fR \fB=\fR \fIrule\fR\fB\&.allinfos()\fR
3717 As the same dependency rule can get created because of multiple dependencies, one Ruleinfo is not enough to describe the reason\&. Thus the allinfos() method returns an array of all infos about a rule\&.
3724 \fBif (\fR\fI$rule1\fR \fB==\fR \fI$rule2\fR\fB)\fR
3725 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR\fB:\fR
3726 \fBif\fR \fIrule1\fR \fB==\fR \fIrule2\fR
3732 Two rules are equal if they belong to the same solver and have the same id\&.
3733 .SH "THE RULEINFO CLASS"
3735 A Ruleinfo describes one reason why a rule was created\&.
3742 \fBSolver *solv;\fR /* read only */
3743 \fI$ruleinfo\fR\fB\->{solv}\fR
3744 \fIruleinfo\fR\fB\&.solv\fR
3745 \fIruleinfo\fR\fB\&.solv\fR
3751 Back pointer to solver object\&.
3757 \fBint type;\fR /* read only */
3758 \fI$ruleinfo\fR\fB\->{type}\fR
3759 \fIruleinfo\fR\fB\&.type\fR
3760 \fIruleinfo\fR\fB\&.type\fR
3766 The type of the ruleinfo\&. See the constant section of the solver class for the rule type list and the special type list\&.
3772 \fBDep *dep;\fR /* read only */
3773 \fI$ruleinfo\fR\fB\->{dep}\fR
3774 \fIruleinfo\fR\fB\&.dep\fR
3775 \fIruleinfo\fR\fB\&.dep\fR
3781 The dependency leading to the creation of the rule\&.
3787 \fBDep *dep_id;\fR /* read only */
3788 \fI$ruleinfo\fR\fB\->{\*(Aqdep_id\*(Aq}\fR
3789 \fIruleinfo\fR\fB\&.dep_id\fR
3790 \fIruleinfo\fR\fB\&.dep_id\fR
3796 The Id of the dependency leading to the creation of the rule, or zero\&.
3802 \fBSolvable *solvable;\fR /* read only */
3803 \fI$ruleinfo\fR\fB\->{solvable}\fR
3804 \fIruleinfo\fR\fB\&.solvable\fR
3805 \fIruleinfo\fR\fB\&.solvable\fR
3811 The involved Solvable, e\&.g\&. the one containing the dependency\&.
3817 \fBSolvable *othersolvable;\fR /* read only */
3818 \fI$ruleinfo\fR\fB\->{othersolvable}\fR
3819 \fIruleinfo\fR\fB\&.othersolvable\fR
3820 \fIruleinfo\fR\fB\&.othersolvable\fR
3826 The other involved Solvable (if any), e\&.g\&. the one containing providing the dependency for conflicts\&.
3832 \fBconst char *problemstr()\fR;
3833 my \fI$str\fR \fB=\fR \fI$ruleinfo\fR\fB\->problemstr()\fR;
3834 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
3835 \fIstr\fR \fB=\fR \fIruleinfo\fR\fB\&.problemstr()\fR
3841 A string describing the ruleinfo from a problem perspective\&. This probably only makes sense if the rule is part of a problem\&.
3842 .SH "THE SOLUTION CLASS"
3844 A solution solves one specific problem\&. It consists of multiple solution elements that all need to be executed\&.
3851 \fBSolver *solv;\fR /* read only */
3852 \fI$solution\fR\fB\->{solv}\fR
3853 \fIsolution\fR\fB\&.solv\fR
3854 \fIsolution\fR\fB\&.solv\fR
3860 Back pointer to solver object\&.
3866 \fBId problemid;\fR /* read only */
3867 \fI$solution\fR\fB\->{problemid}\fR
3868 \fIsolution\fR\fB\&.problemid\fR
3869 \fIsolution\fR\fB\&.problemid\fR
3875 Id of the problem the solution solves\&.
3881 \fBId id;\fR /* read only */
3882 \fI$solution\fR\fB\->{id}\fR
3883 \fIsolution\fR\fB\&.id\fR
3884 \fIsolution\fR\fB\&.id\fR
3890 Id of the solution\&. The first solution has Id 1, they are numbered consecutively\&.
3897 \fBSolutionelement *elements(bool\fR \fIexpandreplaces\fR \fB= 0)\fR
3898 my \fI@solutionelements\fR \fB=\fR \fI$solution\fR\fB\->elements()\fR;
3899 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
3900 \fIsolutionelements\fR \fB=\fR \fIsolution\fR\fB\&.elements()\fR
3906 Return an array containing the elements describing what needs to be done to implement the specific solution\&. If expandreplaces is true, elements of type SOLVER_SOLUTION_REPLACE will be replaced by one or more elements replace elements describing the policy mismatches\&.
3912 \fBint element_count()\fR
3913 my \fI$cnt\fR \fB=\fR \fI$solution\fR\fB\->solution_count()\fR;
3914 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
3915 \fIcnt\fR \fB=\fR \fIsolution\fR\fB\&.element_count()\fR
3921 Return the number of solution elements without creating objects\&. Note that the count does not match the number of objects returned by the elements() method of expandreplaces is set to true\&.
3922 .SH "THE SOLUTIONELEMENT CLASS"
3924 A solution element describes a single action of a solution\&. The action is always either to remove one specific job or to add a new job that installs or erases a single specific package\&.
3931 \fBSolver *solv;\fR /* read only */
3932 \fI$solutionelement\fR\fB\->{solv}\fR
3933 \fIsolutionelement\fR\fB\&.solv\fR
3934 \fIsolutionelement\fR\fB\&.solv\fR
3940 Back pointer to solver object\&.
3946 \fBId problemid;\fR /* read only */
3947 \fI$solutionelement\fR\fB\->{problemid}\fR
3948 \fIsolutionelement\fR\fB\&.problemid\fR
3949 \fIsolutionelement\fR\fB\&.problemid\fR
3955 Id of the problem the element (partly) solves\&.
3961 \fBId solutionid;\fR /* read only */
3962 \fI$solutionelement\fR\fB\->{solutionid}\fR
3963 \fIsolutionelement\fR\fB\&.solutionid\fR
3964 \fIsolutionelement\fR\fB\&.solutionid\fR
3970 Id of the solution the element is a part of\&.
3976 \fBId id;\fR /* read only */
3977 \fI$solutionelement\fR\fB\->{id}\fR
3978 \fIsolutionelement\fR\fB\&.id\fR
3979 \fIsolutionelement\fR\fB\&.id\fR
3985 Id of the solution element\&. The first element has Id 1, they are numbered consecutively\&.
3991 \fBId type;\fR /* read only */
3992 \fI$solutionelement\fR\fB\->{type}\fR
3993 \fIsolutionelement\fR\fB\&.type\fR
3994 \fIsolutionelement\fR\fB\&.type\fR
4000 Type of the solution element\&. See the constant section of the solver class for the existing types\&.
4006 \fBSolvable *solvable;\fR /* read only */
4007 \fI$solutionelement\fR\fB\->{solvable}\fR
4008 \fIsolutionelement\fR\fB\&.solvable\fR
4009 \fIsolutionelement\fR\fB\&.solvable\fR
4015 The installed solvable that needs to be replaced for replacement elements\&.
4021 \fBSolvable *replacement;\fR /* read only */
4022 \fI$solutionelement\fR\fB\->{replacement}\fR
4023 \fIsolutionelement\fR\fB\&.replacement\fR
4024 \fIsolutionelement\fR\fB\&.replacement\fR
4030 The solvable that needs to be installed to fix the problem\&.
4036 \fBint jobidx;\fR /* read only */
4037 \fI$solutionelement\fR\fB\->{jobidx}\fR
4038 \fIsolutionelement\fR\fB\&.jobidx\fR
4039 \fIsolutionelement\fR\fB\&.jobidx\fR
4045 The index of the job that needs to be removed to fix the problem, or \-1 if the element is of another type\&. Note that it\(cqs better to change the job to SOLVER_NOOP type so that the numbering of other elements does not get disturbed\&. This method works both for types SOLVER_SOLUTION_JOB and SOLVER_SOLUTION_POOLJOB\&.
4052 \fBSolutionelement *replaceelements()\fR
4053 my \fI@solutionelements\fR \fB=\fR \fI$solutionelement\fR\fB\->replaceelements()\fR;
4054 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
4055 \fIsolutionelements\fR \fB=\fR \fIsolutionelement\fR\fB\&.replaceelements()\fR
4061 If the solution element is of type SOLVER_SOLUTION_REPLACE, return an array of elements describing the policy mismatches, otherwise return a copy of the element\&. See also the \(lqexpandreplaces\(rq option in the solution\(cqs elements() method\&.
4067 \fBint illegalreplace()\fR
4068 my \fI$illegal\fR \fB=\fR \fI$solutionelement\fR\fB\->illegalreplace()\fR;
4069 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
4070 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.illegalreplace()\fR
4076 Return an integer that contains the policy mismatch bits or\-ed together, or zero if there was no policy mismatch\&. See the policy error constants in the solver class\&.
4083 my \fI$job\fR \fB=\fR \fI$solutionelement\fR\fB\->Job()\fR;
4084 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
4085 \fIillegal\fR \fB=\fR \fIsolutionelement\fR\fB\&.Job()\fR
4091 Create a job that implements the solution element\&. Add this job to the array of jobs for all elements of type different to SOLVER_SOLUTION_JOB and SOLVER_SOLUTION_POOLJOB\&. For the later two, a SOLVER_NOOB Job is created, you should replace the old job with the new one\&.
4097 \fBconst char *str()\fR
4098 my \fI$str\fR \fB=\fR \fI$solutionelement\fR\fB\->str()\fR;
4099 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
4100 \fIstr\fR \fB=\fR \fIsolutionelement\fR\fB\&.str()\fR
4106 A string describing the change the solution element consists of\&.
4107 .SH "THE TRANSACTION CLASS"
4109 Transactions describe the output of a solver run\&. A transaction contains a number of transaction elements, each either the installation of a new package or the removal of an already installed package\&. The Transaction class supports a classify() method that puts the elements into different groups so that a transaction can be presented to the user in a meaningful way\&.
4112 Transaction element types, both active and passive
4114 \fBSOLVER_TRANSACTION_IGNORE\fR
4116 This element does nothing\&. Used to map element types that do not match the view mode\&.
4119 \fBSOLVER_TRANSACTION_INSTALL\fR
4121 This element installs a package\&.
4124 \fBSOLVER_TRANSACTION_ERASE\fR
4126 This element erases a package\&.
4129 \fBSOLVER_TRANSACTION_MULTIINSTALL\fR
4131 This element installs a package with a different version keeping the other versions installed\&.
4134 \fBSOLVER_TRANSACTION_MULTIREINSTALL\fR
4136 This element reinstalls a installed package keeping the other versions installed\&.
4139 Transaction element types, active view
4141 \fBSOLVER_TRANSACTION_REINSTALL\fR
4143 This element re\-installs a package, i\&.e\&. installs the same package again\&.
4146 \fBSOLVER_TRANSACTION_CHANGE\fR
4148 This element installs a package with same name, version, architecture but different content\&.
4151 \fBSOLVER_TRANSACTION_UPGRADE\fR
4153 This element installs a newer version of an installed package\&.
4156 \fBSOLVER_TRANSACTION_DOWNGRADE\fR
4158 This element installs a older version of an installed package\&.
4161 \fBSOLVER_TRANSACTION_OBSOLETES\fR
4163 This element installs a package that obsoletes an installed package\&.
4166 Transaction element types, passive view
4168 \fBSOLVER_TRANSACTION_REINSTALLED\fR
4170 This element re\-installs a package, i\&.e\&. installs the same package again\&.
4173 \fBSOLVER_TRANSACTION_CHANGED\fR
4175 This element replaces an installed package with one of the same name, version, architecture but different content\&.
4178 \fBSOLVER_TRANSACTION_UPGRADED\fR
4180 This element replaces an installed package with a new version\&.
4183 \fBSOLVER_TRANSACTION_DOWNGRADED\fR
4185 This element replaces an installed package with an old version\&.
4188 \fBSOLVER_TRANSACTION_OBSOLETED\fR
4190 This element replaces an installed package with a package that obsoletes it\&.
4193 Pseudo element types for showing extra information used by classify()
4195 \fBSOLVER_TRANSACTION_ARCHCHANGE\fR
4197 This element replaces an installed package with a package of a different architecture\&.
4200 \fBSOLVER_TRANSACTION_VENDORCHANGE\fR
4202 This element replaces an installed package with a package of a different vendor\&.
4205 Transaction mode flags
4207 \fBSOLVER_TRANSACTION_SHOW_ACTIVE\fR
4209 Filter for active view types\&. The default is to return passive view type, i\&.e\&. to show how the installed packages get changed\&.
4212 \fBSOLVER_TRANSACTION_SHOW_OBSOLETES\fR
4214 Do not map the obsolete view type into INSTALL/ERASE elements\&.
4217 \fBSOLVER_TRANSACTION_SHOW_ALL\fR
4219 If multiple packages replace an installed package, only the best of them is kept as OBSOLETE element, the other ones are mapped to INSTALL/ERASE elements\&. This is because most applications want to show just one package replacing the installed one\&. The SOLVER_TRANSACTION_SHOW_ALL makes the library keep all OBSOLETE elements\&.
4222 \fBSOLVER_TRANSACTION_SHOW_MULTIINSTALL\fR
4224 The library maps MULTIINSTALL elements to simple INSTALL elements\&. This flag can be used to disable the mapping\&.
4227 \fBSOLVER_TRANSACTION_CHANGE_IS_REINSTALL\fR
4229 Use this flag if you want to map CHANGE elements to the REINSTALL type\&.
4232 \fBSOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE\fR
4234 Use this flag if you want to map OBSOLETE elements to the UPGRADE type\&.
4237 \fBSOLVER_TRANSACTION_MERGE_ARCHCHANGES\fR
4239 Do not add extra categories for every architecture change, instead cumulate them in one category\&.
4242 \fBSOLVER_TRANSACTION_MERGE_VENDORCHANGES\fR
4244 Do not add extra categories for every vendor change, instead cumulate them in one category\&.
4247 \fBSOLVER_TRANSACTION_RPM_ONLY\fR
4249 Special view mode that just returns IGNORE, ERASE, INSTALL, MULTIINSTALL elements\&. Useful if you want to find out what to feed to the underlying package manager\&.
4252 Transaction order flags
4254 \fBSOLVER_TRANSACTION_KEEP_ORDERDATA\fR
4256 Do not throw away the dependency graph used for ordering the transaction\&. This flag is needed if you want to do manual ordering\&.
4264 \fBPool *pool;\fR /* read only */
4265 \fI$trans\fR\fB\->{pool}\fR
4266 \fItrans\fR\fB\&.pool\fR
4267 \fItrans\fR\fB\&.pool\fR
4273 Back pointer to pool\&.
4280 \fBbool isempty()\fR;
4281 \fI$trans\fR\fB\->isempty()\fR
4282 \fItrans\fR\fB\&.isempty()\fR
4283 \fItrans\fR\fB\&.isempty?\fR
4289 Returns true if the transaction does not do anything, i\&.e\&. has no elements\&.
4295 \fBSolvable *newsolvables()\fR;
4296 my \fI@newsolvables\fR \fB=\fR \fI$trans\fR\fB\->newsolvables()\fR;
4297 \fInewsolvables\fR \fB=\fR \fItrans\fR\fB\&.newsolvables()\fR
4298 \fInewsolvables\fR \fB=\fR \fItrans\fR\fB\&.newsolvables()\fR
4304 Return all packages that are to be installed by the transaction\&. This are the packages that need to be downloaded from the repositories\&.
4310 \fBSolvable *keptsolvables()\fR;
4311 my \fI@keptsolvables\fR \fB=\fR \fI$trans\fR\fB\->keptsolvables()\fR;
4312 \fIkeptsolvables\fR \fB=\fR \fItrans\fR\fB\&.keptsolvables()\fR
4313 \fIkeptsolvables\fR \fB=\fR \fItrans\fR\fB\&.keptsolvables()\fR
4319 Return all installed packages that the transaction will keep installed\&.
4325 \fBSolvable *steps()\fR;
4326 my \fI@steps\fR \fB=\fR \fI$trans\fR\fB\->steps()\fR;
4327 \fIsteps\fR \fB=\fR \fItrans\fR\fB\&.steps()\fR
4328 \fIsteps\fR \fB=\fR \fItrans\fR\fB\&.steps()\fR
4334 Return all solvables that need to be installed (if the returned solvable is not already installed) or erased (if the returned solvable is installed)\&. A step is also called a transaction element\&.
4340 \fBint steptype(Solvable *\fR\fIsolvable\fR\fB, int\fR \fImode\fR\fB)\fR
4341 my \fI$type\fR \fB=\fR \fI$trans\fR\fB\->steptype(\fR\fI$solvable\fR\fB,\fR \fI$mode\fR\fB)\fR;
4342 \fItype\fR \fB=\fR \fItrans\fR\fB\&.steptype(\fR\fIsolvable\fR\fB,\fR \fImode\fR\fB)\fR
4343 \fItype\fR \fB=\fR \fItrans\fR\fB\&.steptype(\fR\fIsolvable\fR\fB,\fR \fImode\fR\fB)\fR
4349 Return the transaction type of the specified solvable\&. See the CONSTANTS sections for the mode argument flags and the list of returned types\&.
4355 \fBTransactionClass *classify(int\fR \fImode\fR \fB= 0)\fR
4356 my \fI@classes\fR \fB=\fR \fI$trans\fR\fB\->classify()\fR;
4357 \fIclasses\fR \fB=\fR \fItrans\fR\fB\&.classify()\fR
4358 \fIclasses\fR \fB=\fR \fItrans\fR\fB\&.classify()\fR
4364 Group the transaction elements into classes so that they can be displayed in a structured way\&. You can use various mapping mode flags to tweak the result to match your preferences, see the mode argument flag in the CONSTANTS section\&. See the TransactionClass class for how to deal with the returned objects\&.
4370 \fBSolvable othersolvable(Solvable *\fR\fIsolvable\fR\fB)\fR;
4371 my \fI$other\fR \fB=\fR \fI$trans\fR\fB\->othersolvable(\fR\fI$solvable\fR\fB)\fR;
4372 \fIother\fR \fB=\fR \fItrans\fR\fB\&.othersolvable(\fR\fIsolvable\fR\fB)\fR
4373 \fIother\fR \fB=\fR \fItrans\fR\fB\&.othersolvable(\fR\fIsolvable\fR\fB)\fR
4379 Return the \(lqother\(rq solvable for a given solvable\&. For installed packages the other solvable is the best package with the same name that replaces the installed package, or the best package of the obsoleting packages if the package does not get replaced by one with the same name\&.
4381 For to be installed packages, the \(lqother\(rq solvable is the best installed package with the same name that will be replaced, or the best packages of all the packages that are obsoleted if the new package does not replace a package with the same name\&.
4383 Thus, the \(lqother\(rq solvable is normally the package that is also shown for a given package\&.
4389 \fBSolvable *allothersolvables(Solvable *\fR\fIsolvable\fR\fB)\fR;
4390 my \fI@others\fR \fB=\fR \fI$trans\fR\fB\->allothersolvables(\fR\fI$solvable\fR\fB)\fR;
4391 \fIothers\fR \fB=\fR \fItrans\fR\fB\&.allothersolvables(\fR\fIsolvable\fR\fB)\fR
4392 \fIothers\fR \fB=\fR \fItrans\fR\fB\&.allothersolvables(\fR\fIsolvable\fR\fB)\fR
4398 For installed packages, returns all of the packages that replace us\&. For to be installed packages, returns all of the packages that the new package replaces\&. The special \(lqother\(rq solvable is always the first entry of the returned array\&.
4404 \fBint calc_installsizechange()\fR;
4405 my \fI$change\fR \fB=\fR \fI$trans\fR\fB\->calc_installsizechange()\fR;
4406 \fIchange\fR \fB=\fR \fItrans\fR\fB\&.calc_installsizechange()\fR
4407 \fIchange\fR \fB=\fR \fItrans\fR\fB\&.calc_installsizechange()\fR
4413 Return the size change of the installed system in kilobytes (kibibytes)\&.
4419 \fBvoid order(int\fR \fIflags\fR \fB= 0)\fR;
4420 \fI$trans\fR\fB\->order()\fR;
4421 \fItrans\fR\fB\&.order()\fR
4422 \fItrans\fR\fB\&.order()\fR
4428 Order the steps in the transactions so that dependant packages are updated before packages that depend on them\&. For rpm, you can also use rpmlib\(cqs ordering functionality, debian\(cqs dpkg does not provide a way to order a transaction\&.
4429 .SS "ACTIVE/PASSIVE VIEW"
4431 Active view list what new packages get installed, while passive view shows what happens to the installed packages\&. Most often there\(cqs not much difference between the two modes, but things get interesting of multiple package get replaced by one new package\&. Say you have installed package A\-1\-1 and B\-1\-1, and now install A\-2\-1 with has a new dependency that obsoletes B\&. The transaction elements will be
4437 updated A\-1\-1 (other: A\-2\-1)
4438 obsoleted B\-1\-1 (other: A\-2\-1)
4444 in passive mode, but
4450 update A\-2\-1 (other: A\-1\-1)
4457 in active mode\&. If the mode contains SOLVER_TRANSACTION_SHOW_ALL, the passive mode list will be unchanged but the active mode list will just contain A\-2\-1\&.
4458 .SH "THE TRANSACTIONCLASS CLASS"
4460 Objects of this type are returned by the classify() Transaction method\&.
4467 \fBTransaction *transaction;\fR /* read only */
4468 \fI$class\fR\fB\->{transaction}\fR
4469 \fIclass\fR\fB\&.transaction\fR
4470 \fIclass\fR\fB\&.transaction\fR
4476 Back pointer to transaction object\&.
4482 \fBint type;\fR /* read only */
4483 \fI$class\fR\fB\->{type}\fR
4484 \fIclass\fR\fB\&.type\fR
4485 \fIclass\fR\fB\&.type\fR
4491 The type of the transaction elements in the class\&.
4497 \fBint count;\fR /* read only */
4498 \fI$class\fR\fB\->{count}\fR
4499 \fIclass\fR\fB\&.count\fR
4500 \fIclass\fR\fB\&.count\fR
4506 The number of elements in the class\&.
4512 \fBconst char *\fR\fIfromstr\fR;
4513 \fI$class\fR\fB\->{fromstr}\fR
4514 \fIclass\fR\fB\&.fromstr\fR
4515 \fIclass\fR\fB\&.fromstr\fR
4521 The old vendor or architecture\&.
4527 \fBconst char *\fR\fItostr\fR;
4528 \fI$class\fR\fB\->{tostr}\fR
4529 \fIclass\fR\fB\&.tostr\fR
4530 \fIclass\fR\fB\&.tostr\fR
4536 The new vendor or architecture\&.
4542 \fBId\fR \fIfromid\fR;
4543 \fI$class\fR\fB\->{fromid}\fR
4544 \fIclass\fR\fB\&.fromid\fR
4545 \fIclass\fR\fB\&.fromid\fR
4551 The id of the old vendor or architecture\&.
4557 \fBId\fR \fItoid\fR;
4558 \fI$class\fR\fB\->{toid}\fR
4559 \fIclass\fR\fB\&.toid\fR
4560 \fIclass\fR\fB\&.toid\fR
4566 The id of the new vendor or architecture\&.
4573 \fBvoid solvables()\fR;
4574 my \fI@solvables\fR \fB=\fR \fI$class\fR\fB\->solvables()\fR;
4575 \fIsolvables\fR \fB=\fR \fIclass\fR\fB\&.solvables()\fR
4576 \fIsolvables\fR \fB=\fR \fIclass\fR\fB\&.solvables()\fR
4582 Return the solvables for all transaction elements in the class\&.
4585 Checksums (also called hashes) are used to make sure that downloaded data is not corrupt and also as a fingerprint mechanism to check if data has changed\&.
4592 \fBChksum Chksum(Id\fR \fItype\fR\fB)\fR
4593 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB)\fR;
4594 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB)\fR
4595 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB)\fR
4601 Create a checksum object\&. Currently the following types are supported:
4607 \fBREPOKEY_TYPE_MD5\fR
4608 \fBREPOKEY_TYPE_SHA1\fR
4609 \fBREPOKEY_TYPE_SHA256\fR
4615 These keys are constants in the \fBsolv\fR class\&.
4621 \fBChksum Chksum(Id\fR \fItype\fR\fB, const char *\fR\fIhex\fR\fB)\fR
4622 my \fI$chksum\fR \fB= solv::Chksum\->new(\fR\fI$type\fR\fB,\fR \fI$hex\fR\fB)\fR;
4623 \fIchksum\fR \fB= solv\&.Chksum(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
4624 \fIchksum\fR \fB= Solv::Chksum\&.new(\fR\fItype\fR\fB,\fR \fIhex\fR\fB)\fR
4630 Create an already finalized checksum object\&.
4637 \fBId type;\fR /* read only */
4638 \fI$chksum\fR\fB\->{type}\fR
4639 \fIchksum\fR\fB\&.type\fR
4640 \fIchksum\fR\fB\&.type\fR
4646 Return the type of the checksum object\&.
4653 \fBvoid add(const char *\fR\fIstr\fR\fB)\fR
4654 \fI$chksum\fR\fB\->add(\fR\fI$str\fR\fB)\fR;
4655 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
4656 \fIchksum\fR\fB\&.add(\fR\fIstr\fR\fB)\fR
4662 Add a string to the checksum\&.
4668 \fBvoid add_fp(FILE *\fR\fIfp\fR\fB)\fR
4669 \fI$chksum\fR\fB\->add_fp(\fR\fI$file\fR\fB)\fR;
4670 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
4671 \fIchksum\fR\fB\&.add_fp(\fR\fIfile\fR\fB)\fR
4677 Add the contents of a file to the checksum\&.
4683 \fBvoid add_stat(const char *\fR\fIfilename\fR\fB)\fR
4684 \fI$chksum\fR\fB\->add_stat(\fR\fI$filename\fR\fB)\fR;
4685 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
4686 \fIchksum\fR\fB\&.add_stat(\fR\fIfilename\fR\fB)\fR
4692 Stat the file and add the dev/ino/size/mtime member to the checksum\&. If the stat fails, the members are zeroed\&.
4698 \fBvoid add_fstat(int\fR \fIfd\fR\fB)\fR
4699 \fI$chksum\fR\fB\->add_fstat(\fR\fI$fd\fR\fB)\fR;
4700 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
4701 \fIchksum\fR\fB\&.add_fstat(\fR\fIfd\fR\fB)\fR
4707 Same as add_stat, but instead of the filename a file descriptor is used\&.
4713 \fBunsigned char *raw()\fR
4714 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->raw()\fR;
4715 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
4716 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.raw()\fR
4722 Finalize the checksum and return the result as raw bytes\&. This means that the result can contain NUL bytes or unprintable characters\&.
4728 \fBconst char *hex()\fR
4729 my \fI$raw\fR \fB=\fR \fI$chksum\fR\fB\->hex()\fR;
4730 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
4731 \fIraw\fR \fB=\fR \fIchksum\fR\fB\&.hex()\fR
4737 Finalize the checksum and return the result as hex string\&.
4744 \fBif (\fR\fI$chksum1\fR \fB==\fR \fI$chksum2\fR\fB)\fR
4745 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR\fB:\fR
4746 \fBif\fR \fIchksum1\fR \fB==\fR \fIchksum2\fR
4752 Checksums are equal if they are of the same type and the finalized results are the same\&.
4758 \fB<stringification>\fR
4759 my \fI$str\fR \fB=\fR \fI$chksum\fR\fB\->str\fR;
4760 \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR
4761 \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR
4767 If the checksum is finished, the checksum is returned as "<type>:<hex>" string\&. Otherwise "<type>:unfinished" is returned\&.
4768 .SH "FILE MANAGEMENT"
4770 This functions were added because libsolv uses standard \fBFILE\fR pointers to read/write files, but languages like perl have their own implementation of files\&. The libsolv functions also support decompression and compression, the algorithm is selected by looking at the file name extension\&.
4776 \fBFILE *xfopen(char *\fR\fIfn\fR\fB, char *\fR\fImode\fR \fB= "r")\fR
4777 my \fI$file\fR \fB= solv::xfopen(\fR\fI$path\fR\fB)\fR;
4778 \fIfile\fR \fB= solv\&.xfopen(\fR\fIpath\fR\fB)\fR
4779 \fIfile\fR \fB= Solv::xfopen(\fR\fIpath\fR\fB)\fR
4785 Open a file at the specified path\&. The mode argument is passed on to the stdio library\&.
4791 \fBFILE *xfopen_fd(char *\fR\fIfn\fR\fB, int\fR \fIfileno\fR\fB)\fR
4792 my \fI$file\fR \fB= solv::xfopen_fd(\fR\fI$path\fR\fB,\fR \fI$fileno\fR\fB)\fR;
4793 \fIfile\fR \fB= solv\&.xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
4794 \fIfile\fR \fB= Solv::xfopen_fd(\fR\fIpath\fR\fB,\fR \fIfileno\fR\fB)\fR
4800 Create a file handle from the specified file descriptor\&. The path argument is only used to select the correct (de\-)compression algorithm, use an empty path if you want to make sure to read/write raw data\&.
4808 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->fileno()\fR;
4809 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
4810 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.fileno()\fR
4816 Return file file descriptor of the file\&. If the file is not open, \-1 is returned\&.
4823 my \fI$fileno\fR \fB=\fR \fI$file\fR\fB\->dup()\fR;
4824 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
4825 \fIfileno\fR \fB=\fR \fIfile\fR\fB\&.dup()\fR
4831 Return a copy of the descriptor of the file\&. If the file is not open, \-1 is returned\&.
4838 \fI$file\fR\fB\->flush()\fR;
4839 \fIfile\fR\fB\&.flush()\fR
4840 \fIfile\fR\fB\&.flush()\fR
4846 Flush the file\&. Returns false if there was an error\&. Flushing a closed file always returns true\&.
4853 \fI$file\fR\fB\->close()\fR;
4854 \fIfile\fR\fB\&.close()\fR
4855 \fIfile\fR\fB\&.close()\fR
4861 Close the file\&. This is needed for languages like Ruby, that do not destruct objects right after they are no longer referenced\&. In that case, it is good style to close open files so that the file descriptors are freed right away\&. Returns false if there was an error\&.
4862 .SH "THE REPODATA CLASS"
4864 The Repodata stores attributes for packages and the repository itself, each repository can have multiple repodata areas\&. You normally only need to directly access them if you implement lazy downloading of repository data\&. Repodata areas are created by calling the repository\(cqs add_repodata() method or by using repo_add methods without the REPO_REUSE_REPODATA or REPO_USE_LOADING flag\&.
4871 \fBRepo *repo;\fR /* read only */
4872 \fI$data\fR\fB\->{repo}\fR
4873 \fIdata\fR\fB\&.repo\fR
4874 \fIdata\fR\fB\&.repo\fR
4880 Back pointer to repository object\&.
4886 \fBId id;\fR /* read only */
4887 \fI$data\fR\fB\->{id}\fR
4888 \fIdata\fR\fB\&.id\fR
4889 \fIdata\fR\fB\&.id\fR
4895 The id of the repodata area\&. Repodata ids of different repositories overlap\&.
4902 \fBinternalize()\fR;
4903 \fI$data\fR\fB\->internalize()\fR;
4904 \fIdata\fR\fB\&.internalize()\fR
4905 \fIdata\fR\fB\&.internalize()\fR
4911 Internalize newly added data\&. The lookup functions will only see the new data after it has been internalized\&.
4917 \fBbool write(FILE *\fR\fIfp\fR\fB)\fR;
4918 \fI$data\fR\fB\->write(\fR\fI$fp\fR\fB)\fR;
4919 \fIdata\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
4920 \fIdata\fR\fB\&.write(\fR\fIfp\fR\fB)\fR
4926 Write the contents of the repodata area as solv file\&.
4932 \fBbool add_solv(FILE *\fR\fIfp\fR\fB, int\fR \fIflags\fR \fB= 0)\fR;
4933 \fI$data\fR\fB\->add_solv(\fR\fI$fp\fR\fB)\fR;
4934 \fIdata\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
4935 \fIdata\fR\fB\&.add_solv(\fR\fIfp\fR\fB)\fR
4941 Replace a stub repodata object with the data from a solv file\&. This method automatically adds the REPO_USE_LOADING flag\&. It should only be used from a load callback\&.
4947 \fBvoid create_stubs()\fR;
4948 \fI$data\fR\fB\->create_stubs()\fR
4949 \fIdata\fR\fB\&.create_stubs()\fR
4950 \fIdata\fR\fB\&.create_stubs()\fR
4956 Create stub repodatas from the information stored in the repodata meta area\&.
4962 \fBvoid extend_to_repo()\fR;
4963 \fI$data\fR\fB\->extend_to_repo()\fR;
4964 \fIdata\fR\fB\&.extend_to_repo()\fR
4965 \fIdata\fR\fB\&.extend_to_repo()\fR
4971 Extend the repodata so that it has the same size as the repo it belongs to\&. This method is only needed when switching to a just written repodata extension to make the repodata match the written extension (which is always of the size of the repo)\&.
4978 \fBif (\fR\fI$data1\fR \fB==\fR \fI$data2\fR\fB)\fR
4979 \fBif\fR \fIdata1\fR \fB==\fR \fIdata2\fR\fB:\fR
4980 \fBif\fR \fIdata1\fR \fB==\fR \fIdata2\fR
4986 Two repodata objects are equal if they belong to the same repository and have the same id\&.
4987 .SS "DATA RETRIEVAL METHODS"
4993 \fBconst char *lookup_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
4994 my \fI$string\fR \fB=\fR \fI$data\fR\fB\->lookup_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
4995 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
4996 \fIstring\fR \fB=\fR \fIdata\fR\fB\&.lookup_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5006 \fBId *lookup_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5007 my \fI@ids\fR \fB=\fR \fI$data\fR\fB\->lookup_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5008 \fIids\fR \fB=\fR \fIdata\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5009 \fIids\fR \fB=\fR \fIdata\fR\fB\&.lookup_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5019 \fBChksum lookup_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5020 my \fI$chksum\fR \fB=\fR \fI$data\fR\fB\->lookup_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB)\fR;
5021 \fIchksum\fR \fB=\fR \fIdata\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5022 \fIchksum\fR \fB=\fR \fIdata\fR\fB\&.lookup_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB)\fR
5028 Lookup functions\&. Return the data element stored in the specified solvable\&. The methods probably only make sense to retrieve data from the special SOLVID_META solvid that stores repodata meta information\&.
5029 .SS "DATA STORAGE METHODS"
5035 \fBvoid set_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR;
5036 \fI$data\fR\fB\->set_id(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
5037 \fIdata\fR\fB\&.set_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5038 \fIdata\fR\fB\&.set_id(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5048 \fBvoid set_str(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fIstr\fR\fB)\fR;
5049 \fI$data\fR\fB\->set_str(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$str\fR\fB)\fR;
5050 \fIdata\fR\fB\&.set_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5051 \fIdata\fR\fB\&.set_str(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5061 \fBvoid set_poolstr(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, const char *\fR\fIstr\fR\fB)\fR;
5062 \fI$data\fR\fB\->set_poolstr(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$str\fR\fB)\fR;
5063 \fIdata\fR\fB\&.set_poolstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5064 \fIdata\fR\fB\&.set_poolstr(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIstr\fR\fB)\fR
5074 \fBvoid set_checksum(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Chksum *\fR\fIchksum\fR\fB)\fR;
5075 \fI$data\fR\fB\->set_checksum(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$chksum\fR\fB)\fR;
5076 \fIdata\fR\fB\&.set_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIchksum\fR\fB)\fR
5077 \fIdata\fR\fB\&.set_checksum(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIchksum\fR\fB)\fR
5087 \fBvoid add_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR;
5088 \fI$data\fR\fB\->add_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
5089 \fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5090 \fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
5100 \fBId new_handle()\fR;
5101 my \fI$handle\fR \fB=\fR \fI$data\fR\fB\->new_handle()\fR;
5102 \fIhandle\fR \fB=\fR \fIdata\fR\fB\&.new_handle()\fR
5103 \fIhandle\fR \fB=\fR \fIdata\fR\fB\&.new_handle()\fR
5113 \fBvoid add_flexarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, Id\fR \fIhandle\fR\fB)\fR;
5114 \fI$data\fR\fB\->add_flexarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$handle\fR\fB)\fR;
5115 \fIdata\fR\fB\&.add_flexarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIhandle\fR\fB)\fR
5116 \fIdata\fR\fB\&.add_flexarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIhandle\fR\fB)\fR
5122 Data storage methods\&. Probably only useful to store data in the special SOLVID_META solvid that stores repodata meta information\&. Note that repodata areas can have their own Id pool (see the REPO_LOCALPOOL flag), so be careful if you need to store ids\&. Arrays are created by calling the add function for every element\&. A flexarray is an array of sub\-structures, call new_handle to create a new structure, use the handle as solvid to fill the structure with data and call add_flexarray to put the structure in an array\&.
5123 .SH "THE DATAPOS CLASS"
5125 Datapos objects describe a specific position in the repository data area\&. Thus they are only valid until the repository is modified in some way\&. Datapos objects can be created by the pos() and parentpos() methods of a Datamatch object or by accessing the \(lqmeta\(rq attribute of a repository\&.
5132 \fBRepo *repo;\fR /* read only */
5133 \fI$data\fR\fB\->{repo}\fR
5134 \fIdata\fR\fB\&.repo\fR
5135 \fIdata\fR\fB\&.repo\fR
5141 Back pointer to repository object\&.
5148 \fBDataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
5149 my \fI$di\fR \fB=\fR \fI$datapos\fR\fB\->Dataiterator(\fR\fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
5150 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
5151 \fIdi\fR \fB=\fR \fIdatapos\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
5157 Create a Dataiterator at the position of the datapos object\&.
5163 \fBconst char *lookup_deltalocation(unsigned int *\fR\fIOUTPUT\fR\fB)\fR;
5164 my \fB(\fR\fI$location\fR\fB,\fR \fI$medianr\fR\fB) =\fR \fI$datapos\fR\fB\->lookup_deltalocation()\fR;
5165 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltalocation()\fR
5166 \fIlocation\fR\fB,\fR \fImedianr\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltalocation()\fR
5172 Return a tuple containing the on\-media location and an optional media number for a delta rpm\&. This obviously only works if the data position points to structure describing a delta rpm\&.
5178 \fBconst char *lookup_deltaseq()\fR;
5179 my \fI$seq\fR \fB=\fR \fI$datapos\fR\fB\->lookup_deltaseq()\fR;
5180 \fIseq\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltaseq()\fR;
5181 \fIseq\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_deltaseq()\fR;
5187 Return the delta rpm sequence from the structure describing a delta rpm\&.
5188 .SS "DATA RETRIEVAL METHODS"
5194 \fBconst char *lookup_str(Id\fR \fIkeyname\fR\fB)\fR
5195 my \fI$string\fR \fB=\fR \fI$datapos\fR\fB\->lookup_str(\fR\fI$keyname\fR\fB)\fR;
5196 \fIstring\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
5197 \fIstring\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_str(\fR\fIkeyname\fR\fB)\fR
5207 \fBId lookup_id(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB)\fR
5208 my \fI$id\fR \fB=\fR \fI$datapos\fR\fB\->lookup_id(\fR\fI$keyname\fR\fB)\fR;
5209 \fIid\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
5210 \fIid\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_id(\fR\fIkeyname\fR\fB)\fR
5220 \fBunsigned long long lookup_num(Id\fR \fIkeyname\fR\fB, unsigned long long\fR \fInotfound\fR \fB= 0)\fR
5221 my \fI$num\fR \fB=\fR \fI$datapos\fR\fB\->lookup_num(\fR\fI$keyname\fR\fB)\fR;
5222 \fInum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
5223 \fInum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_num(\fR\fIkeyname\fR\fB)\fR
5233 \fBbool lookup_void(Id\fR \fIkeyname\fR\fB)\fR
5234 my \fI$bool\fR \fB=\fR \fI$datapos\fR\fB\->lookup_void(\fR\fI$keyname\fR\fB)\fR;
5235 \fIbool\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
5236 \fIbool\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_void(\fR\fIkeyname\fR\fB)\fR
5246 \fBId *lookup_idarray(Id\fR \fIkeyname\fR\fB)\fR
5247 my \fI@ids\fR \fB=\fR \fI$datapos\fR\fB\->lookup_idarray(\fR\fI$keyname\fR\fB)\fR;
5248 \fIids\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
5249 \fIids\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_idarray(\fR\fIkeyname\fR\fB)\fR
5259 \fBChksum lookup_checksum(Id\fR \fIkeyname\fR\fB)\fR
5260 my \fI$chksum\fR \fB=\fR \fI$datapos\fR\fB\->lookup_checksum(\fR\fI$keyname\fR\fB)\fR;
5261 \fIchksum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
5262 \fIchksum\fR \fB=\fR \fIdatapos\fR\fB\&.lookup_checksum(\fR\fIkeyname\fR\fB)\fR
5268 Lookup functions\&. Note that the returned Ids are always translated into the Ids of the global pool even if the repodata area contains its own pool\&.
5271 Michael Schroeder <mls@suse\&.de>