As a downside of this approach, iterator objects cannot have attributes.
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:
+if a method returns an array it returns it on the perl stack:
my @problems = $solver->solve(\@jobs);
constant. Also do not forget to prepend the namespace of the constant:
$pool->set_flag($solv::Pool::POOL_FLAG_OBSOLETEUSESCOLORS, 1);
-
+
Python Specifics
----------------
print dep
print repr(repo)
-Constants are attributes of the classes:
+Constants are attributes of the corresponding classes:
pool.set_flag(solv.Pool.POOL_FLAG_OBSOLETEUSESCOLORS, 1);
Note that boolean methods have an added trailing ``?'', to be consistent with
other ruby modules:
- puts "empty repo" if repo.isempty?
+ puts "empty" if repo.isempty?
+
+
+Tcl Specifics
+-------------
+Libsolv's tcl bindings can be loaded with the following statement:
+
+ TCL package require solv
+
+Objects are either created by calling class name prefixed with ``new_'',
+or they are returned by calling methods on other objects.
+
+ TCL set pool [solv::new_Pool]
+ TCL set repo [$pool add_repo "my_first_repo"]
+
+Swig provides a ``cget'' method to read object attributes, and a
+``configure'' method to write them:
+
+ TCL $pool configure -appdata 42
+ TCL puts "appdata is [$pool cget -appdata]"
+
+The tcl bindings provide a little helper to work with iterators in
+a foreach style:
+
+ TCL set iter [$pool solvables_iter]
+ TCL solv::iter s $iter { ... }
+
+libsolv's arrays are mapped to tcl's lists:
+
+ TCL set jobs [list $job1 $job2]
+ TCL set problems [$solver solve $jobs]
+ TCL puts "We have [llength $problems] problems..."
+
+Stringification is done by calling the object's ``str'' method.
+
+ TCL puts [$dep str]
+
+There is one exception: you have to use ``stringify'' for Datamatch
+objects, as swig reports a clash with the ``str'' attribute.
+Some objects also support a ``=='' method for equality tests, and a
+``!='' method.
+
+Swig implements all constants as numeric variables, constants belonging
+to a libsolv class are prefixed with the class name:
+
+ TCL $pool set_flag $solv::Pool_POOL_FLAG_OBSOLETEUSESCOLORS 1
+ TCL puts [$solvable lookup_str $solv::SOLVABLE_SUMMARY]
The Solv Class
the ``equals to'' bit
*REL_GT*::
-the ``greater then'' bit
+the ``greater than'' bit
*REL_ARCH*::
used for relations that describe an extra architecture filter, the
*SOLVID_POS*::
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.
+abstraction mechanism, so you most likely do not need this constant.
Constant string Ids
-
+
*ID_NULL*::
Always zero
pool = solv.Pool()
pool = Solv::Pool.new()
-Create a new pool instance. In most cases you just need
-one pool.
+Create a new pool instance. In most cases you just need one pool.
+Note that the returned object "owns" the pool, i.e. if the object is
+freed, the pool is also freed. You can use the disown method to
+break this ownership relation.
=== ATTRIBUTES ===
*POOL_FLAG_FORBIDSELFCONFLICTS*::
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.
+them but switched to also allowing them since rpm-4.9.0.
*POOL_FLAG_OBSOLETEUSESPROVIDES*::
Make obsolete type dependency match against provides instead of
providing the same name.
*POOL_FLAG_OBSOLETEUSESCOLORS*::
-Rpm's multilib implementation (used in RedHat and Fedora)
-distinguishes between 32bit and 64bit packages (the terminology
-is that they have a different color). If obsoleteusescolors is
-set, packages with different colors will not obsolete each other.
+Rpm's multilib implementation distinguishes between 32bit and 64bit
+packages (the terminology is that they have a different color).
+If obsoleteusescolors is set, packages with different colors will
+not obsolete each other.
*POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS*::
Same as POOL_FLAG_OBSOLETEUSESCOLORS, but used to find out if
(this is the default if FEDORA is defined when libsolv is compiled).
*POOL_FLAG_NOINSTALLEDOBSOLETES*::
-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
+Since version 4.9.0 rpm considers the obsoletes of installed packages
+when checking for dependency conflicts, thus you may not install a
+package that is obsoleted by some other installed package unless you
also erase the other package.
*POOL_FLAG_HAVEDISTEPOCH*::
are the same.
*POOL_FLAG_NOOBSOLETESMULTIVERSION*::
-If a package is installed in multiversionmode, rpm used to ignore
+If a package is installed in multiversion mode, 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
Make the addfileprovides method only add files from the standard
locations (i.e. the ``bin'' and ``etc'' 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()
+dependencies, but you still want the fast speed that addfileprovides()
generates.
=== METHODS ===
pool.free()
pool.free()
-Free a pool. This is currently done with a method instead of relying on
-reference counting or garbage collection because it's hard to track every
-reference to a pool.
+Force a free of the pool. After this call, you must not access any object
+that still references the pool.
+
+ void disown()
+ $pool->disown();
+ pool.disown()
+ pool.disown()
+
+Break the ownership relation between the binding object and the pool. After
+this call, the pool will not get freed even if the object goes out of
+scope. This also means that you must manually call the free method to free
+the pool data.
void setdebuglevel(int level)
$pool->setdebuglevel($level);
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.
+you want to solve package dependencies for some other system.
void set_rootdir(const char *rootdir)
$pool->set_rootdir(rootdir);
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
+repositories. This method will scan all dependency for file names and then 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
pool.createwhatprovides()
Create the internal ``whatprovides'' hash over all of the provides of all
-packages. This method must be called before doing any lookups on provides.
+installable packages. This method must be called before doing any lookups on
+provides.
It's encouraged to do it right after all repos are set up, usually right after
the call to addfileprovides().
solvables = pool.whatprovides(dep)
Return all solvables that provide the specified dependency. You can use either
-a Dep object or an simple Id as argument.
+a Dep object or a simple Id as argument.
+
+ Solvable *best_solvables(Solvable *solvables, int flags = 0)
+ my @solvables = $pool->best_solvables($solvables);
+ solvables = pool.best_solvables(solvables)
+ solvables = pool.best_solvables(solvables)
+
+Filter list of solvables by repo priority, architecture and version.
+
+ Solvable *whatcontainsdep(Id keyname, DepId dep, Id marker = -1)
+ my @solvables = $pool->whatcontainsdep($keyname, $dep)
+ solvables = pool.whatcontainsdep(keyname, dep)
+ solvables = pool.whatcontainsdep(keyname, dep)
+
+Return all solvables for which keyname contains the dependency.
+
+ Solvable *whatmatchesdep(Id keyname, DepId dep, Id marker = -1)
+ my @solvables = $pool->whatmatchesdep($keyname, $sdep)
+ solvables = pool.whatmatchesdep(keyname, dep)
+ solvables = pool.whatmatchesdep(keyname, dep)
+
+Return all solvables that have dependencies in keyname that match the dependency.
+
+ Solvable *whatmatchessolvable(Id keyname, Solvable solvable, Id marker = -1)
+ my @solvables = $pool->whatmatchessolvable($keyname, $solvable)
+ solvables = pool.whatmatchessolvable(keyname, solvable)
+ solvables = pool.whatmatchessolvable(keyname, solvable)
+
+Return all solvables that match package dependencies against solvable's
+provides.
Id *matchprovidingids(const char *match, int flags)
my @ids = $pool->matchprovidingids($match, $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 a 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 namespaceprovides 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)
job = pool.Job(how, what)
job = pool.Job(how, what)
-Create a new Job object. Kind of low level, in most cases you would use a
-Selection or Dep job constructor instead.
+Create a new Job object. Kind of low level, in most cases you would
+instead use a Selection or Dep job constructor.
Selection Selection()
my $sel = $pool->Selection();
my $sel = $pool->Selection_all();
sel = pool.Selection_all()
sel = pool.Selection_all()
-
+
Create a selection containing all packages. Useful as starting point for
intersecting other selections or for update/distupgrade jobs.
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.
+
+ Selection matchsolvable(Solvable solvable, int flags, Id keyname, Id marker = -1)
+ my $sel = $pool->matchsolvable($solvable, $flags, $keyname);
+ sel = pool.matchsolvable(solvable, flags, keyname)
+ sel = pool.matchsolvable(solvable, flags, keyname)
+
+Create a selection by matching package dependencies against the specified
+solvable's provides.
+
void setpooljobs(Jobs *jobs)
$pool->setpooljobs(\@jobs);
pool.setpooljobs(jobs)
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.
+can be multiversion installed, which packages were userinstalled, or which
+packages must not be erased.
void set_loadcallback(Callable *callback)
$pool->setloadcallback(\&callbackfunction);
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).
+You can then load the data (maybe fetching it first from a remote server).
The callback should return true if the data has been made available.
+ /* bindings only */
+ $pool->appdata_disown()
+ pool.appdata_disown()
+ pool.appdata_disown()
+
+Decrement the reference count of the appdata object. This can be used to break
+circular references (e.g. if the pool's appdata value points to some meta data
+structure that contains a pool handle). If used incorrectly, this method can
+lead to application crashes, so beware. (This method is a no-op for ruby and tcl.)
+
+ Id *get_considered_list()
+ my @ids = $pool->get_considered_list();
+ ids = pool.get_considered_list()
+ ids = pool.get_considered_list()
+
+ void set_considered_list(Id *ids)
+ $pool->set_considered_list(\@ids);
+ pool.set_considered_list(ids)
+ pool.set_considered_list(ids)
+
+Get/set the list of solvables that are eligible for installation. Note that
+you need to recreate the whatprovides hash after changing the list.
+
+ Id *get_disabled_list()
+ my @ids = $pool->get_disabled_list();
+ ids = pool.get_disabled_list()
+ ids = pool.get_disabled_list()
+
+ void set_disabled_list(Id *ids)
+ $pool->set_disabled_list(\@ids);
+ pool.set_disabled_list(ids)
+ pool.set_disabled_list(ids)
+
+Get/set the list of solvables that are not eligible for installation. This is
+basically the inverse of the ``considered'' methods above, i.e. calling
+``set_disabled_list()'' with an empty list will make all solvables eligible for
+installation. Note you need to recreate the whatprovides hash after changing the
+list.
+
=== DATA RETRIEVAL METHODS ===
In the following functions, the _keyname_ argument describes what to retrieve.
Lookup functions. Return the data element stored in the specified solvable.
You should probably use the methods of the Solvable class instead.
- Dataiterator Dataiterator(Id solvid, Id keyname, const char *match, int flags)
+ Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
+ my $di = $pool->Dataiterator($keyname, $match, $flags);
+ di = pool.Dataiterator(keyname, match, flags)
+ di = pool.Dataiterator(keyname, match, flags)
+
+ Dataiterator Dataiterator_solvid(Id solvid, Id keyname, const char *match = 0, int flags = 0)
my $di = $pool->Dataiterator($solvid, $keyname, $match, $flags);
di = pool.Dataiterator(solvid, keyname, match, flags)
di = pool.Dataiterator(solvid, keyname, match, flags)
for d in di
Iterate over the matching data elements. See the Dataiterator class for more
-information.
+information. The Dataiterator method iterates over all solvables in the pool,
+whereas the Dataiterator_solvid only iterates over the specified solvable.
=== ID METHODS ===
id = pool.rel2id(nameid, evrid, flags)
Create a ``relational'' dependency. Such dependencies consist of a name part,
-the _flags_ describing the relation, and a version part. The flags are:
+_flags_ describing the relation, and a version part. The flags are:
$solv::REL_EQ | $solv::REL_GT | $solv::REL_LT
solv.REL_EQ | solv.REL_GT | solv.REL_LT
The id of this dependency.
-== Methods ==
+=== METHODS ===
Dep Rel(int flags, DepId evrid, bool create = 1)
my $reldep = $dep->Rel($flags, $evrdep);
reldep = dep.Rel(flags, evrdep)
reldep = dep.Rel(flags, evrdep)
-Create a relational dependency from to string dependencies and a flags
-argument. See the pool's rel2id method for a description of the flags.
+Create a relational dependency from the caller dependency, the flags,
+and a dependency describing the ``version'' part.
+See the pool's rel2id method for a description of the flags.
Selection Selection_name(int setflags = 0)
my $sel = $dep->Selection_name();
if dep1 == dep2:
if dep1 == dep2
-The dependencies are equal if they are part of the same pool and have the same
+Two dependencies are equal if they are part of the same pool and have the same
ids.
$repo->{name}
repo.name
repo.name
-
+
The repositories name. To libsolv, the name is just a string with no specific
meaning.
*REPO_REUSE_REPODATA*::
Reuse the last repository data area (``repodata'') instead of creating a
-new one.
+new area.
*REPO_NO_INTERNALIZE*::
Do not internalize the added repository data. This is useful if
Do not create stubs for repository parts that can be downloaded on demand.
*SUSETAGS_RECORD_SHARES*::
-This is specific to the add_susetags() method. Susetags allows to refer to
+This is specific to the add_susetags() method. Susetags allows one 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.
Create a Selection consisting of all packages in the repository.
- Dataiterator Dataiterator(Id p, Id key, const char *match, int flags)
- my $di = $repo->Dataiterator($solvid, $keyname, $match, $flags);
- di = repo.Dataiterator(solvid, keyname, match, flags)
- di = repo.Dataiterator(solvid, keyname, match, flags)
+ Dataiterator Dataiterator(Id key, const char *match = 0, int flags = 0)
+ my $di = $repo->Dataiterator($keyname, $match, $flags);
+ di = repo.Dataiterator(keyname, match, flags)
+ di = repo.Dataiterator(keyname, match, flags)
+
+ Dataiterator Dataiterator_meta(Id key, const char *match = 0, int flags = 0)
+ my $di = $repo->Dataiterator_meta($keyname, $match, $flags);
+ di = repo.Dataiterator_meta(keyname, match, flags)
+ di = repo.Dataiterator_meta(keyname, match, flags)
for my $d (@$di)
for d in di:
for d in di
Iterate over the matching data elements in this repository. See the
-Dataiterator class for more information.
+Dataiterator class for more information. The Dataiterator() method
+iterates over all solvables in a repository, whereas the Dataiterator_meta
+method only iterates over the repository's meta data.
<stringification>
my $str = $repo->str;
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"
+list of all database files with checksums. The data is added to the "meta"
section of the repository, i.e. no package gets created.
bool add_updateinfoxml(FILE *fp, int flags = 0)
"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*.
Add the ``content'' 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"
+a list of all database files with checksums. The data is added to the "meta"
section of the repository, i.e. no package gets created.
bool add_susetags(FILE *fp, Id defvendor, const char *language, int flags = 0)
Id lookup_id(Id keyname)
my $id = $solvable->lookup_id($keyname);
- id = solvable.lookup_id(solvid)
- id = solvable.lookup_id(solvid)
+ id = solvable.lookup_id(keyname)
+ id = solvable.lookup_id(keyname)
- unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
+ unsigned long long lookup_num(Id keyname, unsigned long long notfound = 0)
my $num = $solvable->lookup_num($keyname);
num = solvable.lookup_num(keyname)
num = solvable.lookup_num(keyname)
my @deps = $solvable->lookup_deparray($keyname);
deps = solvable.lookup_deparray(keyname)
deps = solvable.lookup_deparray(keyname)
-
+
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.
including the marker.
const char *lookup_location(unsigned int *OUTPUT);
- my ($location, $medianr) = $solvable->lookup_location();
- location, medianr = solvable.lookup_location()
- location, medianr = solvable.lookup_location()
+ my ($location, $mediano) = $solvable->lookup_location();
+ location, mediano = solvable.lookup_location()
+ location, mediano = solvable.lookup_location()
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)
+ di = solvable.Dataiterator(keyname, match, flags)
+
+ for my $d (@$di)
+ for d in di:
+ for d in di
+
+Iterate over the matching data elements. See the Dataiterator class for more
+information.
+
void add_deparray(Id keyname, DepId dep, Id marker = -1);
$solvable->add_deparray($keyname, $dep);
solvable.add_deparray(keyname, dep)
Return true if the solvable is installed on the system.
+ bool identical(Solvable *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)
+
+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()
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()
The id of the solvable that matched.
-=== METHODS ===
-
- Id key_id();
- $d->key_id()
- d.key_id()
- d.key_id()
+ Id key_id;
+ $d->{key_id}
+ d.key_id
+ d.key_id
- const char *key_idstr();
- $d->key_idstr()
- d.key_idstr()
- d.key_idstr()
+ const char *key_idstr;
+ $d->{key_idstr}
+ d.key_idstr
+ d.key_idstr
The keyname that matched, either as id or string.
- Id type_id();
- $d->type_id()
- d.type_id()
- d.type_id()
+ Id type_id;
+ $d->{type_id}
+ d.type_id
+ d.type_id
- const char *type_idstr();
- $d->type_idstr();
- d.type_idstr()
- d.type_idstr()
+ const char *type_idstr;
+ $d->{type_idstr};
+ d.type_idstr
+ d.type_idstr
The key type of the value that was matched, either as id or string.
- Id id();
- $d->id()
- d.id()
- d.id()
+ Id id;
+ $d->{id}
+ d.id
+ d.id
- Id idstr();
- $d->idstr()
- d.idstr()
- d.idstr()
+ Id idstr;
+ $d->{idstr}
+ d.idstr
+ d.idstr
The Id of the value that was matched (only valid for id types),
either as id or string.
- const char *str();
- $d->str()
- d.str()
- d.str()
+ const char *str;
+ $d->{str}
+ d.str
+ d.str
The string value that was matched (only valid for string types).
- unsigned long long num();
- $d->num()
- d.num()
- d.num()
+ unsigned long long num;
+ $d->{num}
+ d.num
+ d.num
The numeric value that was matched (only valid for numeric types).
- unsigned int num2();
- $d->num2()
- d.num2()
- d.num2()
+ unsigned int num2;
+ $d->{num2}
+ d.num2
+ d.num2
The secondary numeric value that was matched (only valid for types
containing two values).
+ unsigned int binary;
+ $d->{binary}
+ d.binary
+ d.binary
+
+The value in binary form, useful for checksums and other data
+that cannot be represented as a string.
+
+=== METHODS ===
+
Datapos pos();
my $pos = $d->pos();
pos = d.pos()
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.
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 */
Back pointer to pool.
-=== METHODS ===
-
- int flags();
- my $flags = $sel->flags();
- flags = sel.flags()
- flags = sel.flags()
+ int flags; /* read only */
+ $sel->{flags}
+ flags = sel.flags
+ flags = sel.flags
-Return the result flags of the selection. The flags are a subset
+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 ``SELECTION_NAME | SELECTION_PROVIDES'', the resulting
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();
+=== METHODS ===
+
+ 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)
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);
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.
+
+ void matchsolvable(Solvable solvable, int flags, Id keyname, Id marker = -1)
+ $sel->matchsolvable($solvable, $flags, $keyname);
+ sel.matchsolvable(solvable, flags, keyname)
+ sel.matchsolvable(solvable, flags, keyname)
+
+Do a matchsolvable operation and combine the result with the current selection.
+
<stringification>
my $str = $sel->str;
str = str(sel)
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.
-
+
*SOLVER_WEAKENDEPS*::
Allow to break the dependencies of the matching packages. Handle with care.
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
+repository. By default 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.
+in the repositories. You can tweak this behavior with the SOLVER_FLAG_DUP_
+solver flags.
*SOLVER_DROP_ORPHANED*::
Erase all the matching installed packages if they are orphaned. This only makes
the calculation of unneeded packages for jobs that have the
SOLVER_CLEANDEPS flag set.
+*SOLVER_ALLOWUNINSTALL*::
+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_EXCLUDEFROMWEAK*::
+Avoid the specified packages to satisfy recommended or supplemented dependencies.
+Unlike SOLVER_DISFAVOR, it does not interfere with other rules.
+
*SOLVER_JOBMASK*::
A mask containing all the above action bits.
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.
-
+
*SOLVER_FLAG_ALLOW_VENDORCHANGE*::
Allow the solver to change the vendor of an installed package
without asking for confirmation. Each vendor is part of one or more
better for the user to check the transaction overview instead of
approving every single package that needs to be erased.
+*SOLVER_FLAG_DUP_ALLOW_DOWNGRADE*::
+Like SOLVER_FLAG_ALLOW_DOWNGRADE, but used in distupgrade mode.
+
+*SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE*::
+Like SOLVER_FLAG_ALLOW_ARCHCHANGE, but used in distupgrade mode.
+
+*SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE*::
+Like SOLVER_FLAG_ALLOW_VENDORCHANGE, but used in distupgrade mode.
+
+*SOLVER_FLAG_DUP_ALLOW_NAMECHANGE*::
+Like SOLVER_FLAG_ALLOW_NAMECHANGE, but used in distupgrade mode.
+
*SOLVER_FLAG_NO_UPDATEPROVIDE*::
If multiple packages obsolete an installed package, the solver checks
the provides of every such package and ignores all packages that
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
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.
-
+
*SOLVER_FLAG_NO_INFARCHCHECK*::
Turn off the inferior architecture checking that is normally done
by the solver. Normally, the solver allows only the installation
Do not enable auto-targeting up update and distupgrade jobs. See
the section on targeted updates for more information.
+*SOLVER_FLAG_KEEP_ORPHANS*::
+Do not allow orphaned packages to be deinstalled if they get
+in the way of resolving other packages.
+
+*SOLVER_FLAG_BREAK_ORPHANS*::
+Ignore dependencies of orphaned packages that get in the way
+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 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*::
A rule of an unknown class. You should never encounter those.
-*SOLVER_RULE_RPM*::
-A package dependency rule, called rpm rule for historical reasons.
+*SOLVER_RULE_PKG*::
+A package dependency rule.
*SOLVER_RULE_UPDATE*::
A rule to implement the update policy of installed packages. Every
that may replace the installed package.
*SOLVER_RULE_FEATURE*::
-Feature rules are fallback rules used when a update rule is disabled. They
+Feature rules are fallback rules used when an 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
Job rules implement the job given to the solver.
*SOLVER_RULE_DISTUPGRADE*::
-This are simple negative assertions that make sure that only packages
+These are simple negative assertions that make sure that only packages
are kept that are also available in one of the repositories.
*SOLVER_RULE_INFARCH*::
*SOLVER_RULE_LEARNT*::
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
+the main reason why a sat solver is faster than other dependency solver
implementations.
Special dependency rule types:
-*SOLVER_RULE_RPM_NOT_INSTALLABLE*::
+*SOLVER_RULE_PKG_NOT_INSTALLABLE*::
This rule was added to prevent the installation of a package of an
architecture that does not work on the system.
-*SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP*::
+*SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP*::
The package contains a required dependency which was not provided by
any package.
-*SOLVER_RULE_RPM_PACKAGE_REQUIRES*::
-Similar to SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, but in this case
+*SOLVER_RULE_PKG_REQUIRES*::
+Similar to SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP, but in this case
some packages provided the dependency but none of them could be
installed due to other dependency issues.
-*SOLVER_RULE_RPM_SELF_CONFLICT*::
+*SOLVER_RULE_PKG_SELF_CONFLICT*::
The package conflicts with itself. This is not allowed by older rpm
versions.
-*SOLVER_RULE_RPM_PACKAGE_CONFLICT*::
+*SOLVER_RULE_PKG_CONFLICTS*::
To fulfill the dependencies two packages need to be installed, but
one of the packages contains a conflict with the other one.
-*SOLVER_RULE_RPM_SAME_NAME*::
+*SOLVER_RULE_PKG_SAME_NAME*::
The dependencies can only be fulfilled by multiple versions of
a package, but installing multiple versions of the same package
is not allowed.
-*SOLVER_RULE_RPM_PACKAGE_OBSOLETES*::
+*SOLVER_RULE_PKG_OBSOLETES*::
To fulfill the dependencies two packages need to be installed, but
one of the packages obsoletes the other one.
-*SOLVER_RULE_RPM_IMPLICIT_OBSOLETES*::
+*SOLVER_RULE_PKG_IMPLICIT_OBSOLETES*::
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.
-*SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES*::
+*SOLVER_RULE_PKG_INSTALLED_OBSOLETES*::
To fulfill the dependencies a package needs to be installed that is
obsoleted by an installed package. See the POOL_FLAG_NOINSTALLEDOBSOLETES
flag.
other package that has a different name.
+Reason constants
+
+*SOLVER_REASON_UNRELATED*::
+The package status did not change as it was not related to any job.
+
+*SOLVER_REASON_UNIT_RULE*::
+The package was installed/erased/kept because of a unit rule, i.e. a rule
+where all literals but one were false.
+
+*SOLVER_REASON_KEEP_INSTALLED*::
+The package was chosen when trying to keep as many packages installed as
+possible.
+
+*SOLVER_REASON_RESOLVE_JOB*::
+The decision happened to fulfill a job rule.
+
+*SOLVER_REASON_UPDATE_INSTALLED*::
+The decision happened to fulfill a package update request.
+
+*SOLVER_REASON_CLEANDEPS_ERASE*::
+The package was erased when cleaning up dependencies from other erased
+packages.
+
+*SOLVER_REASON_RESOLVE*::
+The package was installed to fulfill package dependencies.
+
+*SOLVER_REASON_WEAKDEP*::
+The package was installed because of a weak dependency (Recommends or
+Supplements).
+
+*SOLVER_REASON_RESOLVE_ORPHAN*::
+The decision about the package was made when deciding the fate of orphaned
+packages.
+
+*SOLVER_REASON_RECOMMENDED*::
+This is a special case of SOLVER_REASON_WEAKDEP.
+
+*SOLVER_REASON_SUPPLEMENTED*::
+This is a special case of SOLVER_REASON_WEAKDEP.
+
+
=== ATTRIBUTES ===
Pool *pool; /* read only */
=== METHODS ===
int set_flag(int flag, int value)
- my $oldvalue = $pool->set_flag($flag, $value);
- oldvalue = pool.set_flag(flag, value)
- oldvalue = pool.set_flag(flag, value)
+ my $oldvalue = $solver->set_flag($flag, $value);
+ oldvalue = solver.set_flag(flag, value)
+ oldvalue = solver.set_flag(flag, value)
int get_flag(int flag)
- my $value = $pool->get_flag($flag);
- value = pool.get_flag(flag)
- value = pool.get_flag(flag)
+ my $value = $solver->get_flag($flag);
+ value = solver.get_flag(flag)
+ value = solver.get_flag(flag)
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.
is available even if problems were found, this is useful for interactive user
interfaces that show both the job result and the problems.
+ int reason = describe_decision(Solvable *s, Rule *OUTPUT)
+ my ($reason, $rule) = $solver->describe_decision($solvable);
+ (reason, rule) = solver.describe_decision(solvable)
+ (reason, rule) = solver.describe_decision(solvable)
+
+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
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
Return the number of solutions without creating solution objects.
+ <stringification>
+ my $str = $problem->str;
+ str = str(problem)
+ str = problem.to_s
+
+Return a string describing the problem. This is a convenience function, it is
+a shorthand for calling findproblemrule(), then ruleinfo() on the problem
+rule and problemstr() on the ruleinfo object.
+
The Rule Class
--------------
Rules are the basic block of sat solving. Each package dependency gets translated
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()
versions installed.
*SOLVER_TRANSACTION_MULTIREINSTALL*::
-This element reinstalls a installed package keeping the other versions
+This element reinstalls an installed package keeping the other versions
installed.
Transaction element types, active view
This element installs a newer version of an installed package.
*SOLVER_TRANSACTION_DOWNGRADE*::
-This element installs a older version of an installed package.
+This element installs an older version of an installed package.
*SOLVER_TRANSACTION_OBSOLETES*::
This element installs a package that obsoletes an installed package.
*SOLVER_TRANSACTION_MERGE_ARCHCHANGES*::
Do not add extra categories for every architecture change, instead cumulate
them in one category.
-
+
*SOLVER_TRANSACTION_MERGE_VENDORCHANGES*::
Do not add extra categories for every vendor change, instead cumulate
them in one category.
newsolvables = trans.newsolvables()
newsolvables = trans.newsolvables()
-Return all packages that are to be installed by the transaction. This are
+Return all packages that are to be installed by the transaction. These are
the packages that need to be downloaded from the repositories.
Solvable *keptsolvables();
replaces. The special ``other'' solvable is always the first entry of the
returned array.
- int calc_installsizechange();
+ long long calc_installsizechange();
my $change = $trans->calc_installsizechange();
change = trans.calc_installsizechange()
change = trans.calc_installsizechange()
trans.order()
trans.order()
-Order the steps in the transactions so that dependant packages are updated
+Order the steps in the transactions so that dependent packages are updated
before packages that depend on them. For rpm, you can also use rpmlib's
ordering functionality, debian's dpkg does not provide a way to order a
transaction.
=== ACTIVE/PASSIVE VIEW ===
-Active view list what new packages get installed, while passive view shows
+Active view lists what new packages get installed, while passive view shows
what happens to the installed packages. Most often there's 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
+difference between the two modes, but things get interesting if multiple
+packages get replaced by one new package. Say you have installed packages
+A-1-1 and B-1-1, and now install A-2-1 which has a new dependency that
obsoletes B. The transaction elements will be
updated A-1-1 (other: A-2-1)
update A-2-1 (other: A-1-1)
erase B
-in active mode. If the mode contains SOLVER_TRANSACTION_SHOW_ALL, the
+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.
chksum = solv.Chksum(type, hex)
chksum = Solv::Chksum.new(type, hex)
-Create an already finalized checksum object.
+Create an already finalized checksum object from a hex string.
+
+ Chksum Chksum_from_bin(Id type, char *bin)
+ my $chksum = solv::Chksum->from_bin($type, $bin);
+ chksum = solv.Chksum.from_bin(type, bin)
+ chksum = Solv::Chksum.from_bin(type, bin)
+
+Create an already finalized checksum object from a binary checksum.
=== ATTRIBUTES ===
chksum.add(str)
chksum.add(str)
-Add a string to the checksum.
+Add a (binary) string to the checksum.
void add_fp(FILE *fp)
$chksum->add_fp($file);
chksum.add_fp(file)
Add the contents of a file to the checksum.
-
+
void add_stat(const char *filename)
$chksum->add_stat($filename);
chksum.add_stat(filename)
Finalize the checksum and return the result as hex string.
+ const char *typestr()
+ my $typestr = $chksum->typestr();
+ typestr = chksum.typestr
+ typestr = chksum.typestr
+
+Return the type of the checksum as a string, e.g. "sha256".
+
<equality>
if ($chksum1 == $chksum2)
if chksum1 == chksum2:
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.
+if you want to make sure to read/write raw data. The file descriptor is dup()ed
+before the file handle is created.
=== METHODS ===
Return file file descriptor of the file. If the file is not open, `-1` is
returned.
+ void cloexec(bool state)
+ $file->cloexec($state)
+ file.cloexec(state)
+ file.cloexec(state)
+
+Set the close-on-exec flag of the file descriptor. The xfopen function
+returns files with close-on-exec turned on, so if you want to pass
+a file to some other process you need to call cloexec(0) before calling
+exec.
+
int dup()
my $fileno = $file->dup();
fileno = file.dup()
file.close()
file.close()
-Close the file. This is needed for languages like Ruby, that do not destruct
+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.
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's add_repodata() method
+Repodata areas are created by calling the repository's add_repodata() method
or by using repo_add methods without the REPO_REUSE_REPODATA or REPO_USE_LOADING
flag.
The id of the repodata area. Repodata ids of different repositories overlap.
-=== METHODS ====
+=== METHODS ===
internalize();
$data->internalize();
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)
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)
string = data.lookup_str(solvid, keyname)
string = data.lookup_str(solvid, keyname)
+ const char *lookup_id(Id solvid, Id keyname)
+ my $string = $data->lookup_id($solvid, $keyname);
+ string = data.lookup_id(solvid, keyname)
+ string = data.lookup_id(solvid, keyname)
+
+ unsigned long long lookup_num(Id solvid, Id keyname, unsigned long long notfound = 0)
+ my $num = $data->lookup_num($solvid, $keyname);
+ num = data.lookup_num(solvid, keyname)
+ num = data.lookup_num(solvid, keyname)
+
+ bool lookup_void(Id solvid, Id keyname)
+ my $bool = $data->lookup_void($solvid, $keyname);
+ bool = data.lookup_void(solvid, keyname)
+ bool = data.lookup_void(solvid, keyname)
+
Id *lookup_idarray(Id solvid, Id keyname)
my @ids = $data->lookup_idarray($solvid, $keyname);
ids = data.lookup_idarray(solvid, keyname)
=== DATA STORAGE METHODS ===
+ void set_str(Id solvid, Id keyname, const char *str);
+ $data->set_str($solvid, $keyname, $str);
+ data.set_str(solvid, keyname, str)
+ data.set_str(solvid, keyname, str)
+
void set_id(Id solvid, Id keyname, DepId id);
$data->set_id($solvid, $keyname, $id);
data.set_id(solvid, keyname, id)
data.set_id(solvid, keyname, id)
- void set_str(Id solvid, Id keyname, const char *str);
- $data->set_str($solvid, $keyname, $str);
- data.set_str(solvid, keyname, str)
- data.set_str(solvid, keyname, str)
+ void set_num(Id solvid, Id keyname, unsigned long long num);
+ $data->set_num($solvid, $keyname, $num);
+ data.set_num(solvid, keyname, num)
+ data.set_num(solvid, keyname, num)
+
+ void set_void(Id solvid, Id keyname);
+ $data->set_void($solvid, $keyname);
+ data.set_void(solvid, keyname)
+ data.set_void(solvid, keyname)
void set_poolstr(Id solvid, Id keyname, const char *str);
$data->set_poolstr($solvid, $keyname, $str);
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 set_location(Id solvid, unsigned int mediano, const char *location);
+ $data.set_location($solvid, $mediano, $location);
+ data.set_location(solvid, mediano, location)
+ data.set_location(solvid, mediano, location)
+
void add_idarray(Id solvid, Id keyname, DepId id);
$data->add_idarray($solvid, $keyname, $id);
data.add_idarray(solvid, keyname, id)
data.add_flexarray(solvid, keyname, handle)
data.add_flexarray(solvid, keyname, handle)
+ void unset(Id solvid, Id keyname);
+ $data->unset($solvid, $keyname);
+ data.unset(solvid, keyname)
+ data.unset(solvid, keyname)
+
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),
Create a Dataiterator at the position of the datapos object.
const char *lookup_deltalocation(unsigned int *OUTPUT);
- my ($location, $medianr) = $datapos->lookup_deltalocation();
- location, medianr = datapos.lookup_deltalocation()
- location, medianr = datapos.lookup_deltalocation()
+ my ($location, $mediano) = $datapos->lookup_deltalocation();
+ location, mediano = datapos.lookup_deltalocation()
+ location, mediano = datapos.lookup_deltalocation()
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
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.
+ Dataiterator Dataiterator(Id keyname, const char *match = 0, int flags = 0)
+ my $di = $datapos->Dataiterator($keyname, $match, $flags);
+ di = datapos.Dataiterator(keyname, match, flags)
+ di = datapos.Dataiterator(keyname, match, flags)
+
+ for my $d (@$di)
+ for d in di:
+ for d in di
+
+Iterate over the matching data elements. See the Dataiterator class for more
+information.
+
Author
------
Michael Schroeder <mls@suse.de>
+////
+vim: syntax=asciidoc
+////