summaryrefslogtreecommitdiff
path: root/bindings/solv.i
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-09-20 15:15:59 +0200
committerMichael Schroeder <mls@suse.de>2013-09-20 15:15:59 +0200
commit5752066d0711c7956c1944c4e47c3d7718b49c27 (patch)
treea8734405be63df65a3770056d107b796f93aabdf /bindings/solv.i
parentb3ff8425e36a641ef13405e1db7be5484e3df5cb (diff)
downloadlibsolv-5752066d0711c7956c1944c4e47c3d7718b49c27.tar.gz
libsolv-5752066d0711c7956c1944c4e47c3d7718b49c27.tar.bz2
libsolv-5752066d0711c7956c1944c4e47c3d7718b49c27.zip
bindings: add stringification shortcut for problems
Also fixes bugs in the rbsolv example.
Diffstat (limited to 'bindings/solv.i')
-rw-r--r--bindings/solv.i11
1 files changed, 11 insertions, 0 deletions
diff --git a/bindings/solv.i b/bindings/solv.i
index 7c0db0a..77d744a 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -2396,6 +2396,17 @@ rb_eval_string(
queue_push(&q, i);
return q;
}
+#if defined(SWIGPERL)
+ %rename("str") __str__;
+#endif
+ const char *__str__() {
+ Id type, source, target, dep;
+ Id r = solver_findproblemrule($self->solv, $self->id);
+ if (!r)
+ return "";
+ type = solver_ruleinfo($self->solv, r, &source, &target, &dep);
+ return solver_problemruleinfo2str($self->solv, type, source, target, dep);
+ }
}
%extend Solution {