Imported Upstream version 0.6.35
[platform/upstream/libsolv.git] / doc / libsolv-bindings.txt
index 1ee699d..5db1116 100644 (file)
@@ -167,7 +167,7 @@ a foreach style:
 
 libsolv's arrays are mapped to tcl's lists:
 
-        TCL set jobs [list $job1 $job2]
+       TCL set jobs [list $job1 $job2]
        TCL set problems [$solver solve $jobs]
        TCL puts "We have [llength $problems] problems..."
 
@@ -504,6 +504,21 @@ string. See the Dataiterator class for the allowed flags.
 create solver jobs working on a specific set of packages. See the Solver class
 for more information.
 
+       void set_namespaceproviders(DepId ns, DepId evr, bool value = 1)
+       $pool->set_namespaceproviders($ns, $evr, 1);
+       pool.set_namespaceproviders(ns, evr, True)
+       pool.set_namespaceproviders(ns, evr, true)
+
+Manually set an namespace provides entry in the whatprovides index.
+
+       void flush_namespaceproviders(DepId ns, DepId evr)
+        $pool->flush_namespaceproviders($ns, $evr);
+        $pool.flush_namespaceproviders(ns, evr)
+        $pool.flush_namespaceproviders(ns, evr)
+
+Flush the cache of all namespacprovudes matching the specified namespace
+dependency. You can use zero as a wildcard argument.
+
        bool isknownarch(DepId id)
        my $bool = $pool->isknownarch($id);
        bool = pool.isknownarch(id)
@@ -551,6 +566,24 @@ 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.
 
+       Selection matchdeps(const char *name, int flags, Id keyname, Id marker = -1)
+       my $sel = $pool->matchdeps($name, $flags, $keyname);
+       sel = pool.matchdeps(name, flags, keyname)
+       sel = pool.matchdeps(name, flags, keyname)
+
+Create a selection by matching package dependencies against the specified string.
+This can be used if you want to match other dependency types than "provides".
+
+       Selection matchdepid(DepId dep, int flags, Id keyname, Id marker = -1)
+       my $sel = $pool->matchdepid(dep, $flags, $keyname);
+       sel = pool.matchdepid(dep, flags, keyname)
+       sel = pool.matchdepid(dep, flags, keyname)
+
+Create a selection by matching package dependencies against the specified
+dependency. This may be faster than matchdeps and also works with complex
+dependencies. The downside is that you cannot use globs or case insensitive
+matching.
+
        void setpooljobs(Jobs *jobs)
        $pool->setpooljobs(\@jobs);
        pool.setpooljobs(jobs)
@@ -1173,9 +1206,9 @@ Add the contents of the mageia/mandriva repository metadata (the
 "synthesis.hdlist" file) to the repository.
 
        bool add_mdk_info(FILE *fp, int flags = 0)
-       $repo->add_mdk($fp);
-       repo.add_mdk(fp)
-       repo.add_mdk(fp)
+       $repo->add_mdk_info($fp);
+       repo.add_mdk_info(fp)
+       repo.add_mdk_info(fp)
 
 Extend the packages from the synthesis file with the info.xml and files.xml
 data. Do not forget to specify *REPO_EXTEND_SOLVABLES*.
@@ -1357,6 +1390,13 @@ Return a tuple containing the on-media location and an optional
 media number for multi-part repositories (e.g. repositories
 spawning multiple DVDs).
 
+       const char *lookup_sourcepkg();
+       my $sourcepkg = $solvable->lookup_sourcepkg();
+       sourcepkg = solvable.lookup_sourcepkg()
+       sourcepkg = solvable.lookup_sourcepkg()
+
+Return a sourcepkg name associated with solvable.
+
        Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
        my $di = $solvable->Dataiterator($keyname, $match, $flags);
        di = solvable.Dataiterator(keyname, match, flags)
@@ -1400,20 +1440,27 @@ Return true if the solvable is installed on the system.
 
        bool identical(Solvable *other)
        $solvable->identical($other)
-       $solvable.identical(other)
-       $solvable.identical?(other)
+       solvable.identical(other)
+       solvable.identical?(other)
 
 Return true if the two solvables are identical.
 
        int evrcmp(Solvable *other)
-       $solvable->evrcmp(other)
-       $solvable.evrcmp(other)
-       $solvable.evrcmp(other)
+       $solvable->evrcmp($other)
+       solvable.evrcmp(other)
+       solvable.evrcmp(other)
 
 Returns -1 if the epoch/version/release of the solvable is less than the
 one from the other solvable, 1 if it is greater, and 0 if they are equal.
 Note that "equal" does not mean that the evr is identical.
 
+       int matchesdep(Id keyname, DepId id, Id marker = -1)
+       $solvable->matchesdep($keyname, $dep)
+       solvable.matchesdep(keyname, dep)
+       solvable.matchesdep?(keyname, dep)
+
+Return true if the dependencies stored in keyname match the specified dependency.
+
        Selection Selection(int setflags = 0)
        my $sel = $solvable->Selection();
        sel = solvable.Selection()
@@ -1496,7 +1543,7 @@ Allow the matching of checksum entries.
 Do a sub-search in the array stored in keyname.
 
        void skip_solvable();
-       $di->kip_solvable();
+       $di->skip_solvable();
        di.skip_solvable()
        di.skip_solvable()
 
@@ -1668,22 +1715,12 @@ of the package. This is normally a combination of the name,
 the version, and the architecture of a package.
 
 *SELECTION_DOTARCH*::
-Allow an ``.<architecture>'' suffix when matching names or
+Allow an ".<architecture>" suffix when matching names or
 provides.
  
 *SELECTION_REL*::
 Allow the specification of a relation when matching names
-or provides, e.g. "name >= 1.2".
-
-*SELECTION_INSTALLED_ONLY*::
-Limit the package search to installed packages.
-
-*SELECTION_SOURCE_ONLY*::
-Limit the package search to source packages only.
-
-*SELECTION_WITH_SOURCE*::
-Extend the package search to also match source packages. The default is
-only to match binary packages.
+or dependencies, e.g. "name >= 1.2".
 
 *SELECTION_GLOB*::
 Allow glob matching for package names, package provides, and file names.
@@ -1698,6 +1735,42 @@ 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.
 
+*SELECTION_SKIP_KIND*::
+Remove a "packagekind:" prefix from the package names.
+
+*SELECTION_MATCH_DEPSTR*::
+When matching dependencies, do a string match on the result of dep2str
+instead of using the normal dependency intersect algorithm.
+
+*SELECTION_INSTALLED_ONLY*::
+Limit the package search to installed packages.
+
+*SELECTION_SOURCE_ONLY*::
+Limit the package search to source packages only.
+
+*SELECTION_WITH_SOURCE*::
+Extend the package search to also match source packages. The default is
+only to match binary packages.
+
+*SELECTION_WITH_DISABLED*::
+Extend the package search to also include disabled packages.
+
+*SELECTION_WITH_BADARCH*::
+Extend the package search to also include packages that are not installable
+on the configured architecture.
+
+*SELECTION_WITH_ALL*::
+Shortcut for selecting the three modifiers above.
+
+*SELECTION_ADD*::
+Add the result of the match to the current selection instead of replacing it.
+
+*SELECTION_SUBTRACT*::
+Remove the result of the match to the current selection instead of replacing it.
+
+*SELECTION_FILTER*::
+Intersect the result of the match to the current selection instead of replacing it.
+
 === ATTRIBUTES ===
 
        Pool *pool;                             /* read only */
@@ -1709,7 +1782,7 @@ Back pointer to pool.
 
 === METHODS ===
 
-       int flags();
+       int flags()
        my $flags = $sel->flags();
        flags = sel.flags()
        flags = sel.flags()
@@ -1722,13 +1795,20 @@ 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.
 
-       bool isempty();
+       bool isempty()
        $sel->isempty()
        sel.isempty()
        sel.isempty?
 
 Return true if the selection is empty, i.e. no package could be matched.
 
+       Selection clone(int flags = 0)
+       my $cloned = $sel->clone();
+       cloned = sel.clone()
+       cloned = sel.clone()
+
+Return a copy of a selection.
+
        void filter(Selection *other)
        $sel->filter($other);
        sel.filter(other)
@@ -1747,13 +1827,22 @@ 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.
 
+       void subtract(Selection *other)
+       $sel->subtract($other);
+       sel.subtract(other)
+       sel.subtract(other)
+
+Remove the packages of the other selection from the packages of the selection
+object. Does an in-place modification.
+
        void add_raw(Id how, Id what)
        $sel->add_raw($how, $what);
        sel.add_raw(how, what)
        sel.add_raw(how, what)
 
 Add a raw element to the selection. Check the Job class for information about
-the how and what parameters.
+the how and what parameters. Note that the selection flags are no longer meaningful
+after the add_raw operation.
 
        Job *jobs(int action)
        my @jobs = $sel->jobs($action);
@@ -1771,6 +1860,30 @@ erase). See the Job class for the action and action modifier constants.
 
 Convert a selection into an array of Solvable objects.
 
+       void select(const char *name, int flags)
+       $sel->select($name, $flags);
+       sel.select(name, flags)
+       sel.select(name, flags)
+
+Do a select operation and combine the result with the current selection. You
+can choose the desired combination method by using either the SELECTION_ADD,
+SELECTION_SUBTRACT, or SELECTION_FILTER flag. If none of the flags are
+used, SELECTION_FILTER|SELECTION_WITH_ALL is assumed.
+
+       void matchdeps(const char *name, int flags, Id keyname, Id marker = -1)
+       $sel->matchdeps($name, $flags, $keyname);
+       sel.matchdeps(name, flags, keyname)
+       sel.matchdeps(name, flags, keyname)
+
+Do a matchdeps operation and combine the result with the current selection.
+
+       void matchdepid(DepId dep, int flags, Id keyname, Id marker = -1)
+       $sel->matchdepid($dep, $flags, $keyname);
+       sel.matchdepid(dep, flags, keyname)
+       sel.matchdepid(dep, flags, keyname)
+
+Do a matchdepid operation and combine the result with the current selection.
+
        <stringification>
        my $str = $sel->str;
        str = str(sel)
@@ -1878,6 +1991,16 @@ Allow the solver to deinstall the matching installed packages if they get
 into the way of resolving a dependency. This is like the
 SOLVER_FLAG_ALLOW_UNINSTALL flag, but limited to a specific set of packages.
 
+*SOLVER_FAVOR*::
+Prefer the specified packages if the solver encounters an alternative. If
+a job contains multiple matching favor/disfavor elements, the last one takes
+precedence.
+
+*SOLVER_DISFAVOR*::
+Avoid the specified packages if the solver encounters an alternative. This
+can also be used to block recommended or supplemented packages from being
+installed.
+
 *SOLVER_JOBMASK*::
 A mask containing all the above action bits.
 
@@ -2110,6 +2233,11 @@ 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.
 
+*SOLVER_FLAG_NEED_UPDATEPROVIDE*::
+This is somewhat the opposite of SOLVER_FLAG_NO_UPDATEPROVIDE: Only
+packages that provide the installed package names are considered
+for updating.
+
 *SOLVER_FLAG_SPLITPROVIDES*::
 Make the solver aware of special provides of the form
 ``<packagename>:<path>'' used in SUSE systems to support package
@@ -2152,11 +2280,31 @@ of resolving non-orphaned ones. Setting the flag might result
 in no longer working packages in case they are orphaned.
 
 *SOLVER_FLAG_FOCUS_INSTALLED*::
-Resolve installed packages before resolving the given job.
+Resolve installed packages before resolving the given jobs.
 Setting this flag means that the solver will prefer picking
 a package version that fits the other installed packages
 over updating installed packages.
 
+*SOLVER_FLAG_FOCUS_BEST*::
+First resolve the given jobs, then the dependencies of the
+resulting packages, then resolve all already installed
+packages. This will result in more packages being updated
+as when the flag is not used.
+
+*SOLVER_FLAG_INSTALL_ALSO_UPDATES*::
+Update the package if a job is already fulfilled by an installed
+package.
+
+*SOLVER_FLAG_YUM_OBSOLETES*::
+Turn on yum-like package split handling. See the yum documentation
+for more details.
+
+*SOLVER_FLAG_URPM_REORDER*::
+Turn on urpm like package reordering for kernel packages. See
+the urpm documentation for more details.
+
+
+
 Basic rule types:
 
 *SOLVER_RULE_UNKNOWN*::
@@ -2415,6 +2563,23 @@ interfaces that show both the job result and the problems.
 Return the reason why a specific solvable was installed or erased. For most of
 the reasons the rule that triggered the decision is also returned.
 
+       Solvable *get_recommended(bool noselected=0);
+       my @solvables = $solver->get_recommended();
+       solvables = solver.get_recommended()
+       solvables = solver.get_recommended()
+
+Return all solvables that are recommended by the solver run result. This includes
+solvables included in the result, set noselected if you want to filter those.
+
+       Solvable *get_suggested(bool noselected=0);
+       my @solvables = $solver->get_suggested();
+       solvables = solver.get_suggested()
+       solvables = solver.get_suggested()
+
+Return all solvables that are suggested by the solver run result. This includes
+solvables included in the result, set noselected if you want to filter those.
+
+
 The Problem Class
 -----------------
 Problems are the way of the solver to interact with the user. You can simply list
@@ -2451,8 +2616,8 @@ that somewhat describes the problem best to the user.
 
        Rule *findallproblemrules(bool unfiltered = 0)
        my @probrules = $problem->findallproblemrules();
-       probrules = problem.findallproblemrule()
-       probrules = problem.findallproblemrule()
+       probrules = problem.findallproblemrules()
+       probrules = problem.findallproblemrules()
 
 Return all rules responsible for the problem. The returned set of rules contains
 all the needed information why there was a problem, but it's hard to present
@@ -2741,7 +2906,7 @@ the solver class.
 
 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,
+SOLVER_SOLUTION_POOLJOB. For the latter two, a SOLVER_NOOB Job is created,
 you should replace the old job with the new one.
 
        const char *str()
@@ -3292,6 +3457,26 @@ after it has been internalized.
 
 Write the contents of the repodata area as solv file.
 
+       Id str2dir(const char *dir, bool create = 1)
+       my $did = data->str2dir($dir);
+       did = data.str2dir(dir)
+       did = data.str2dir(dir)
+
+       const char *dir2str(Id did, const char *suffix = 0)
+       $dir = pool->dir2str($did);
+       dir = pool.dir2str(did)
+       dir = pool.dir2str(did)
+
+Convert a string (directory) into an Id and back. If the string is currently not in the
+pool and _create_ is false, zero is returned.
+
+       void add_dirstr(Id solvid, Id keyname, Id dir, const char *str)
+       $data->add_dirstr($solvid, $keyname, $dir, $string)
+       data.add_dirstr(solvid, keyname, dir, string)
+       data.add_dirstr(solvid, keyname, dir, string)
+
+Add a file path consisting of a dirname Id and a basename string.
+
        bool add_solv(FILE *fp, int flags = 0);
        $data->add_solv($fp);
        data.add_solv(fp)
@@ -3315,9 +3500,10 @@ area.
        data.extend_to_repo()
 
 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).
+This method is needed when setting up a new extension repodata so that it
+matches the repository size. It is also 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).
 
        <equality>
        if ($data1 == $data2)
@@ -3370,6 +3556,11 @@ SOLVID_META solvid that stores repodata meta information.
        data.set_checksum(solvid, keyname, chksum)
        data.set_checksum(solvid, keyname, chksum)
 
+       void set_sourcepkg(Id solvid, const char *sourcepkg);
+       $data.set_sourcepkg($solvid, $sourcepkg);
+       data.set_sourcepkg(solvid, sourcepkg)
+       data.set_sourcepkg(solvid, sourcepkg)
+
        void add_idarray(Id solvid, Id keyname, DepId id);
        $data->add_idarray($solvid, $keyname, $id);
        data.add_idarray(solvid, keyname, id)
@@ -3487,3 +3678,6 @@ Author
 ------
 Michael Schroeder <mls@suse.de>
 
+////
+vim: syntax=asciidoc
+////