From: Michael Schroeder Date: Wed, 24 Oct 2018 08:23:37 +0000 (+0200) Subject: Bindings: make Selection-flags an attribute X-Git-Tag: 0.7.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6b300573f9974706db9dfd061b6e6c5b0e81bf8;p=thirdparty%2Flibsolv.git Bindings: make Selection-flags an attribute Incompatible API change! I hope this doesn't bite too many bindings users. But better late than never, having a flags() function does not make much sense. --- diff --git a/TODO_1.0 b/TODO_1.0 index 81758a4f..d77df67e 100644 --- a/TODO_1.0 +++ b/TODO_1.0 @@ -13,11 +13,6 @@ - write more manpages -- bindings: selection.flags() should be a attribute and not a method - -- rename repodata_lookup_id_uninternalized to repodata_lookup_id_voidid_uninternalized - and add a notfound argument - IDEAS: drop SEARCH_FILES and add SEARCH_BASENAME instead? diff --git a/bindings/solv.i b/bindings/solv.i index 1188142a..1a88917a 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -954,6 +954,7 @@ typedef int Id; typedef struct { Pool* const pool; + int const flags; } Selection; typedef struct { @@ -1288,9 +1289,6 @@ typedef struct { queue_free(&$self->q); solv_free($self); } - int flags() { - return $self->flags; - } #ifdef SWIGRUBY %rename("isempty?") isempty; #endif diff --git a/examples/p5solv b/examples/p5solv index 9e90670b..6f542475 100755 --- a/examples/p5solv +++ b/examples/p5solv @@ -582,8 +582,8 @@ for my $arg (@ARGV) { print "[ignoring case for '$arg']\n" unless $sel->isempty(); } die("nothing matches '$arg'\n") if $sel->isempty(); - print "[using file list match for '$arg']\n" if $sel->flags() & $solv::Selection::SELECTION_FILELIST; - print "[using capability match for '$arg']\n" if $sel->flags() & $solv::Selection::SELECTION_PROVIDES; + print "[using file list match for '$arg']\n" if $sel->{flags} & $solv::Selection::SELECTION_FILELIST; + print "[using capability match for '$arg']\n" if $sel->{flags} & $solv::Selection::SELECTION_PROVIDES; push @jobs, $sel->jobs($cmdactionmap{$cmd}); } diff --git a/examples/pysolv b/examples/pysolv index 891c2371..75067f2e 100755 --- a/examples/pysolv +++ b/examples/pysolv @@ -717,9 +717,9 @@ for arg in args: if sel.isempty(): print("nothing matches '%s'" % arg) sys.exit(1) - if sel.flags() & solv.Selection.SELECTION_FILELIST: + if sel.flags & solv.Selection.SELECTION_FILELIST: print("[using file list match for '%s']" % arg) - if sel.flags() & solv.Selection.SELECTION_PROVIDES: + if sel.flags & solv.Selection.SELECTION_PROVIDES: print("[using capability match for '%s']" % arg) jobs += sel.jobs(cmdactionmap[cmd])