diff options
author | Michael Schroeder <mls@suse.de> | 2013-09-20 15:15:59 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2013-09-20 15:15:59 +0200 |
commit | 5752066d0711c7956c1944c4e47c3d7718b49c27 (patch) | |
tree | a8734405be63df65a3770056d107b796f93aabdf /bindings/solv.i | |
parent | b3ff8425e36a641ef13405e1db7be5484e3df5cb (diff) | |
download | libsolv-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.i | 11 |
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 { |