repodata_swap_attrs: make sure src and dest are in the repodata
[platform/upstream/libsolv.git] / doc / libsolv-bindings.txt
index eed9698..5a65235 100644 (file)
@@ -201,8 +201,10 @@ Repositories, Dependencies, each indexed by Ids.
        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 ===
 
@@ -311,9 +313,18 @@ generates.
        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 betwen 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);
@@ -566,7 +577,12 @@ desired solvable by Id.
 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 = 0, int flags = 0)
+       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)
@@ -576,7 +592,8 @@ You should probably use the methods of the Solvable class instead.
        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 ===
 
@@ -935,17 +952,24 @@ areas.
 
 Create a Selection consisting of all packages in the repository.
 
-       Dataiterator Dataiterator(Id p, Id key, const char *match = 0, int flags = 0)
-       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;
@@ -1466,67 +1490,75 @@ The solvable containing the value that was matched.
 
 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()
@@ -1764,10 +1796,11 @@ 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
+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
@@ -1995,6 +2028,18 @@ flag if you only have SOLVER_ERASE jobs, as in that case it's
 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
@@ -3026,6 +3071,13 @@ result can contain NUL bytes or unprintable characters.
 
 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: