]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
bindings: Add pool.best_solvables()
authorIgor Gnatenko <i.gnatenko.brain@gmail.com>
Sat, 9 Feb 2019 17:30:29 +0000 (18:30 +0100)
committerIgor Gnatenko <i.gnatenko.brain@gmail.com>
Wed, 13 Feb 2019 09:08:14 +0000 (10:08 +0100)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
bindings/solv.i
doc/gen/libsolv-bindings.3
doc/libsolv-bindings.txt

index adaf1a37db5a177e305914aedab9b944efb343cc..cbfddb730e5e92eec0cad5e9a125f7fa32f264ef 100644 (file)
@@ -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);
index 9f84c77efe6c4f8c3b29d101a6e4dcf7a9fe834b..a6cf3588f7a0cb759b4ccd64b5a9455e9e44e33f 100644 (file)
@@ -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
index 3839ed9676ef22170775f6cc578c171f27c1240d..450ed41c36ecbff49e7b43ed763f8a9d9daeef15 100644 (file)
@@ -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)