libsolv/0001-bindings-expose-sourcepkg-functions.patch
Igor Gnatenko d65902fab1 Backport few fixes for bindings
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-05-29 12:28:58 +02:00

117 lines
4.5 KiB
Diff

From 3b200475c1c3904e38a38f26c6ee24a0dcd6fcf2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Wed, 17 May 2017 22:06:21 +0200
Subject: [PATCH] bindings: expose sourcepkg functions
Closes: https://github.com/openSUSE/libsolv/issues/197
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
bindings/solv.i | 6 ++++++
doc/libsolv-bindings.3 | 28 ++++++++++++++++++++++++++++
doc/libsolv-bindings.txt | 12 ++++++++++++
3 files changed, 46 insertions(+)
diff --git a/bindings/solv.i b/bindings/solv.i
index 7302d3a..96e5d23 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -2830,6 +2830,9 @@ rb_eval_string(
const char *lookup_location(unsigned int *OUTPUT) {
return solvable_lookup_location($self->pool->solvables + $self->id, OUTPUT);
}
+ const char *lookup_sourcepkg() {
+ return solvable_lookup_sourcepkg($self->pool->solvables + $self->id);
+ }
%newobject Dataiterator;
Dataiterator *Dataiterator(Id key, const char *match = 0, int flags = 0) {
return new_Dataiterator($self->pool, 0, $self->id, key, match, flags);
@@ -3792,6 +3795,9 @@ rb_eval_string(
if (buf)
repodata_set_bin_checksum(repo_id2repodata($self->repo, $self->id), solvid, keyname, solv_chksum_get_type(chksum), buf);
}
+ void set_sourcepkg(Id solvid, const char *sourcepkg) {
+ repodata_set_sourcepkg(repo_id2repodata($self->repo, $self->id), solvid, sourcepkg);
+ }
const char *lookup_str(Id solvid, Id keyname) {
return repodata_lookup_str(repo_id2repodata($self->repo, $self->id), solvid, keyname);
}
diff --git a/doc/libsolv-bindings.3 b/doc/libsolv-bindings.3
index 477a6e4..f2d8e8d 100644
--- a/doc/libsolv-bindings.3
+++ b/doc/libsolv-bindings.3
@@ -2425,6 +2425,21 @@ Return a tuple containing the on\-media location and an optional media number fo
.RS 4
.\}
.nf
+\fBconst char *lookup_sourcepkg()\fR;
+my \fR\fI$sourcepkg\fR\fB =\fR \fI$solvable\fR\fB\->lookup_sourcepkg()\fR;
+\fIsourcepkg\fR\fB \fB=\fR \fIsolvable\fR\fB\&.lookup_sourcepkg()\fR
+\fIsourcepkg\fR\fB \fB=\fR \fIsolvable\fR\fB\&.lookup_sourcepkg()\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Return a sourcepkg name associated with solvable\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
\fBDataiterator Dataiterator(Id\fR \fIkeyname\fR\fB, const char *\fR\fImatch\fR \fB= 0, int\fR \fIflags\fR \fB= 0)\fR
my \fI$di\fR \fB=\fR \fI$solvable\fR\fB\->Dataiterator(\fR\fI$keyname\fR\fB,\fR \fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
\fIdi\fR \fB=\fR \fIsolvable\fR\fB\&.Dataiterator(\fR\fIkeyname\fR\fB,\fR \fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
@@ -5557,6 +5572,19 @@ Lookup functions\&. Return the data element stored in the specified solvable\&.
.RS 4
.\}
.nf
+\fBvoid set_sourcepkg(Id\fR \fIsolvid\fR\fB, const char *\fR\fIsourcepkg\fR\fB)\fR;
+\fI$data\fR\fB\->set_sourcepkg(\fR\fI$solvid\fR\fB, \fI$sourcepkg\fR\fB)\fR;
+\fIdata\fR\fB\&.set_sourcepkg(\fR\fIsolvid\fR\fB,\fR \fIsourcepkg\fR\fB)\fR
+\fIdata\fR\fB\&.set_sourcepkg(\fR\fIsolvid\fR\fB,\fR \fIsourcepkg\fR\fB)\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
\fBvoid add_idarray(Id\fR \fIsolvid\fR\fB, Id\fR \fIkeyname\fR\fB, DepId\fR \fIid\fR\fB)\fR;
\fI$data\fR\fB\->add_idarray(\fR\fI$solvid\fR\fB,\fR \fI$keyname\fR\fB,\fR \fI$id\fR\fB)\fR;
\fIdata\fR\fB\&.add_idarray(\fR\fIsolvid\fR\fB,\fR \fIkeyname\fR\fB,\fR \fIid\fR\fB)\fR
diff --git a/doc/libsolv-bindings.txt b/doc/libsolv-bindings.txt
index e44d53a..4de090f 100644
--- a/doc/libsolv-bindings.txt
+++ b/doc/libsolv-bindings.txt
@@ -1357,6 +1357,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)
@@ -3412,6 +3419,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)
--
2.13.0