From: Michael Schroeder Date: Thu, 7 Sep 2017 14:12:34 +0000 (+0200) Subject: Expose solver_get_recommendations in bindings X-Git-Tag: 0.6.29~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b44e970cb090ffaec817fe25fc6b119cd948738;p=thirdparty%2Flibsolv.git Expose solver_get_recommendations in bindings --- diff --git a/bindings/solv.i b/bindings/solv.i index 0b90da54..6313d9bb 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -3514,6 +3514,23 @@ rb_eval_string( } return q; } + + %typemap(out) Queue get_recommended Queue2Array(XSolvable *, 1, new_XSolvable(arg1->pool, id)); + %newobject get_recommended; + Queue get_recommended(bool noselected=0) { + Queue q; + queue_init(&q); + solver_get_recommendations($self, &q, NULL, noselected); + return q; + } + %typemap(out) Queue get_suggested Queue2Array(XSolvable *, 1, new_XSolvable(arg1->pool, id)); + %newobject get_suggested; + Queue get_suggested(bool noselected=0) { + Queue q; + queue_init(&q); + solver_get_recommendations($self, NULL, &q, noselected); + return q; + } } %extend Transaction { diff --git a/doc/gen/libsolv-bindings.3 b/doc/gen/libsolv-bindings.3 index e956be67..7350224d 100644 --- a/doc/gen/libsolv-bindings.3 +++ b/doc/gen/libsolv-bindings.3 @@ -1,13 +1,13 @@ '\" t .\" Title: Libsolv-Bindings .\" Author: [see the "Author" section] -.\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 08/27/2017 +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 09/07/2017 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "08/27/2017" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "09/07/2017" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -3968,6 +3968,36 @@ my \fB(\fR\fI$reason\fR\fB,\fR \fI$rule\fR\fB) =\fR \fI$solver\fR\fB\->describe_ .\} .sp 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\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +\fBSolvable *get_recommended(bool\fR \fInoselected\fR\fB=0)\fR; +my \fI@solvables\fR \fB=\fR \fI$solver\fR\fB\->get_recommended()\fR; +\fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_recommended()\fR +\fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_recommended()\fR +.fi +.if n \{\ +.RE +.\} +.sp +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\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +\fBSolvable *get_suggested(bool\fR \fInoselected\fR\fB=0)\fR; +my \fI@solvables\fR \fB=\fR \fI$solver\fR\fB\->get_suggested()\fR; +\fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_suggested()\fR +\fIsolvables\fR \fB=\fR \fIsolver\fR\fB\&.get_suggested()\fR +.fi +.if n \{\ +.RE +.\} +.sp +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\&. .SH "THE PROBLEM CLASS" .sp Problems are the way of the solver to interact with the user\&. You can simply list all problems and terminate your program, but a better way is to present solutions to the user and let him pick the ones he likes\&. diff --git a/doc/libsolv-bindings.txt b/doc/libsolv-bindings.txt index fcae1ada..83ae6c29 100644 --- a/doc/libsolv-bindings.txt +++ b/doc/libsolv-bindings.txt @@ -2464,6 +2464,23 @@ interfaces that show both the job result and the problems. 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