bindings: Add best_solvables/whatmatchessolvable
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
parent
79c9bf8596
commit
4358b5aada
101
0001-bindings-Add-pool.best_solvables.patch
Normal file
101
0001-bindings-Add-pool.best_solvables.patch
Normal file
@ -0,0 +1,101 @@
|
||||
From 5ddb0ce955faacaaaee03b22407049e10a2317ea Mon Sep 17 00:00:00 2001
|
||||
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
Date: Sat, 9 Feb 2019 18:30:29 +0100
|
||||
Subject: [PATCH 1/2] bindings: Add pool.best_solvables()
|
||||
|
||||
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
---
|
||||
bindings/solv.i | 9 +++++++++
|
||||
doc/gen/libsolv-bindings.3 | 19 +++++++++++++++++--
|
||||
doc/libsolv-bindings.txt | 7 +++++++
|
||||
3 files changed, 33 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/bindings/solv.i b/bindings/solv.i
|
||||
index adaf1a37..cbfddb73 100644
|
||||
--- a/bindings/solv.i
|
||||
+++ b/bindings/solv.i
|
||||
@@ -381,6 +381,7 @@ typedef struct {
|
||||
|
||||
%typemap(in) Queue Array2Queue(SWIG_AsVal_int, "integers")
|
||||
%typemap(in) Queue solvejobs ObjArray2Queue(Job *, queue_push2(&$1, obj->how, obj->what))
|
||||
+%typemap(in) Queue solvables ObjArray2Queue(XSolvable *, queue_push(&$1, obj->id))
|
||||
|
||||
|
||||
|
||||
@@ -1945,6 +1946,14 @@ typedef struct {
|
||||
queue_push(&q, p);
|
||||
return q;
|
||||
}
|
||||
+ %typemap(out) Queue best_solvables Queue2Array(XSolvable *, 1, new_XSolvable(arg1, id));
|
||||
+ %newobject best_solvables;
|
||||
+ Queue best_solvables(Queue solvables, int flags=0) {
|
||||
+ Queue q;
|
||||
+ queue_init_clone(&q, &solvables);
|
||||
+ pool_best_solvables($self, &q, flags);
|
||||
+ return q;
|
||||
+ }
|
||||
|
||||
Id towhatprovides(Queue q) {
|
||||
return pool_queuetowhatprovides($self, &q);
|
||||
diff --git a/doc/gen/libsolv-bindings.3 b/doc/gen/libsolv-bindings.3
|
||||
index 9f84c77e..a6cf3588 100644
|
||||
--- a/doc/gen/libsolv-bindings.3
|
||||
+++ b/doc/gen/libsolv-bindings.3
|
||||
@@ -2,12 +2,12 @@
|
||||
.\" Title: Libsolv-Bindings
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
|
||||
-.\" Date: 12/06/2018
|
||||
+.\" Date: 02/13/2019
|
||||
.\" Manual: LIBSOLV
|
||||
.\" Source: libsolv
|
||||
.\" Language: English
|
||||
.\"
|
||||
-.TH "LIBSOLV\-BINDINGS" "3" "12/06/2018" "libsolv" "LIBSOLV"
|
||||
+.TH "LIBSOLV\-BINDINGS" "3" "02/13/2019" "libsolv" "LIBSOLV"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
@@ -851,6 +851,21 @@ Return all solvables that provide the specified dependency\&. You can use either
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
+\fBSolvable *best_solvables(Solvable *\fR\fIsolvables\fR\fB, int\fR \fIflags\fR \fB= 0)\fR
|
||||
+my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->best_solvables(\fR\fI$solvables\fR\fB)\fR;
|
||||
+\fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.best_solvables(\fR\fIsolvables\fR\fB)\fR
|
||||
+\fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.best_solvables(\fR\fIsolvables\fR\fB)\fR
|
||||
+.fi
|
||||
+.if n \{\
|
||||
+.RE
|
||||
+.\}
|
||||
+.sp
|
||||
+Filter list of solvables by repo priority, architecture and version\&.
|
||||
+.sp
|
||||
+.if n \{\
|
||||
+.RS 4
|
||||
+.\}
|
||||
+.nf
|
||||
\fBId *matchprovidingids(const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
|
||||
my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->matchprovidingids(\fR\fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
|
||||
\fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
|
||||
diff --git a/doc/libsolv-bindings.txt b/doc/libsolv-bindings.txt
|
||||
index 3839ed96..450ed41c 100644
|
||||
--- a/doc/libsolv-bindings.txt
|
||||
+++ b/doc/libsolv-bindings.txt
|
||||
@@ -488,6 +488,13 @@ the call to addfileprovides().
|
||||
Return all solvables that provide the specified dependency. You can use either
|
||||
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.
|
||||
+
|
||||
Id *matchprovidingids(const char *match, int flags)
|
||||
my @ids = $pool->matchprovidingids($match, $flags);
|
||||
ids = pool.matchprovidingids(match, flags)
|
||||
--
|
||||
2.20.1
|
||||
|
106
0002-bindings-Add-pool.whatmatchessolvable.patch
Normal file
106
0002-bindings-Add-pool.whatmatchessolvable.patch
Normal file
@ -0,0 +1,106 @@
|
||||
From 8bb3b58fcc63fce73f6d3f3cd09e793fa3903ec2 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
Date: Sat, 9 Feb 2019 21:51:32 +0100
|
||||
Subject: [PATCH 2/2] bindings: Add pool.whatmatchessolvable()
|
||||
|
||||
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
---
|
||||
bindings/solv.i | 17 +++++++++++++++++
|
||||
doc/gen/libsolv-bindings.3 | 15 +++++++++++++++
|
||||
doc/libsolv-bindings.txt | 8 ++++++++
|
||||
3 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/bindings/solv.i b/bindings/solv.i
|
||||
index cbfddb73..b5074497 100644
|
||||
--- a/bindings/solv.i
|
||||
+++ b/bindings/solv.i
|
||||
@@ -663,6 +663,12 @@ SWIG_AsValDepId(void *obj, int *val) {
|
||||
%typemaps_asval(%checkcode(POINTER), SWIG_AsValSolvFpPtr, "SWIG_AsValSolvFpPtr", FILE*);
|
||||
%typemaps_asval(%checkcode(INT32), SWIG_AsValDepId, "SWIG_AsValDepId", DepId);
|
||||
|
||||
+%define SamePool(pool1,pool2) %{ {
|
||||
+ if (pool1 != pool2)
|
||||
+ SWIG_exception_fail(SWIG_ArgError(EINVAL), "pool of argument $argnum must be same as pool in method's object");
|
||||
+}
|
||||
+%}
|
||||
+%enddef
|
||||
|
||||
/**
|
||||
** the C declarations
|
||||
@@ -1067,10 +1073,12 @@ typedef struct {
|
||||
Id what;
|
||||
} Job;
|
||||
|
||||
+%typemap(check) XSolvable *pool_solvable SamePool($1->pool, arg1)
|
||||
%nodefaultctor Pool;
|
||||
%nodefaultdtor Pool;
|
||||
typedef struct {
|
||||
} Pool;
|
||||
+%typemap(check) XSolvable *pool_solvable;
|
||||
|
||||
%nodefaultctor Repo;
|
||||
%nodefaultdtor Repo;
|
||||
@@ -1978,6 +1986,15 @@ typedef struct {
|
||||
return q;
|
||||
}
|
||||
|
||||
+ %typemap(out) Queue whatmatchessolvable Queue2Array(XSolvable *, 1, new_XSolvable(arg1, id));
|
||||
+ %newobject whatmatchessolvable;
|
||||
+ Queue whatmatchessolvable(Id keyname, XSolvable *pool_solvable, Id marker = -1) {
|
||||
+ Queue q;
|
||||
+ queue_init(&q);
|
||||
+ pool_whatmatchessolvable($self, keyname, pool_solvable->id, &q, marker);
|
||||
+ return q;
|
||||
+ }
|
||||
+
|
||||
#ifdef SWIGRUBY
|
||||
%rename("isknownarch?") isknownarch;
|
||||
#endif
|
||||
diff --git a/doc/gen/libsolv-bindings.3 b/doc/gen/libsolv-bindings.3
|
||||
index a6cf3588..47bf7dd7 100644
|
||||
--- a/doc/gen/libsolv-bindings.3
|
||||
+++ b/doc/gen/libsolv-bindings.3
|
||||
@@ -866,6 +866,21 @@ Filter list of solvables by repo priority, architecture and version\&.
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
+\fBSolvable *whatmatchessolvable(Id\fR \fIkeyname\fR\fB, Solvable\fR \fIsolvable\fR\fB, Id\fR \fImarker\fR \fB= \-1)\fR
|
||||
+my \fI@solvables\fR \fB=\fR \fI$pool\fR\fB\->whatmatchessolvable(\fR\fI$keyname\fR\fB,\fR \fI$solvable\fR\fB)\fR
|
||||
+\fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatmatchessolvable(\fR\fIkeyname\fR\fB,\fR \fIsolvable\fR\fB)\fR
|
||||
+\fIsolvables\fR \fB=\fR \fIpool\fR\fB\&.whatmatchessolvable(\fR\fIkeyname\fR\fB,\fR \fIsolvable\fR\fB)\fR
|
||||
+.fi
|
||||
+.if n \{\
|
||||
+.RE
|
||||
+.\}
|
||||
+.sp
|
||||
+Return all solvables that match package dependencies in against solvable\(cqs provides\&.
|
||||
+.sp
|
||||
+.if n \{\
|
||||
+.RS 4
|
||||
+.\}
|
||||
+.nf
|
||||
\fBId *matchprovidingids(const char *\fR\fImatch\fR\fB, int\fR \fIflags\fR\fB)\fR
|
||||
my \fI@ids\fR \fB=\fR \fI$pool\fR\fB\->matchprovidingids(\fR\fI$match\fR\fB,\fR \fI$flags\fR\fB)\fR;
|
||||
\fIids\fR \fB=\fR \fIpool\fR\fB\&.matchprovidingids(\fR\fImatch\fR\fB,\fR \fIflags\fR\fB)\fR
|
||||
diff --git a/doc/libsolv-bindings.txt b/doc/libsolv-bindings.txt
|
||||
index 450ed41c..f3020c54 100644
|
||||
--- a/doc/libsolv-bindings.txt
|
||||
+++ b/doc/libsolv-bindings.txt
|
||||
@@ -495,6 +495,14 @@ a Dep object or a simple Id as argument.
|
||||
|
||||
Filter list of solvables by repo priority, architecture and version.
|
||||
|
||||
+ 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 in against solvable's
|
||||
+provides.
|
||||
+
|
||||
Id *matchprovidingids(const char *match, int flags)
|
||||
my @ids = $pool->matchprovidingids($match, $flags);
|
||||
ids = pool.matchprovidingids(match, flags)
|
||||
--
|
||||
2.20.1
|
||||
|
@ -42,13 +42,17 @@
|
||||
|
||||
Name: lib%{libname}
|
||||
Version: 0.7.3
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: Package dependency solver
|
||||
|
||||
License: BSD
|
||||
URL: https://github.com/openSUSE/libsolv
|
||||
Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
# https://github.com/openSUSE/libsolv/pull/298
|
||||
Patch0001: 0001-bindings-Add-pool.best_solvables.patch
|
||||
Patch0002: 0002-bindings-Add-pool.whatmatchessolvable.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: ninja-build
|
||||
@ -297,6 +301,9 @@ Python 3 version.
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Feb 13 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.7.3-3
|
||||
- bindings: Add best_solvables/whatmatchessolvable
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user