]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Bindings: make Selection-flags an attribute
authorMichael Schroeder <mls@suse.de>
Wed, 24 Oct 2018 08:23:37 +0000 (10:23 +0200)
committerMichael Schroeder <mls@suse.de>
Wed, 24 Oct 2018 08:23:37 +0000 (10:23 +0200)
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.

TODO_1.0
bindings/solv.i
examples/p5solv
examples/pysolv

index 81758a4f22299360a02ca25874962f3918c499db..d77df67e592dbb56191cf95af4e7567000c1da3b 100644 (file)
--- a/TODO_1.0
+++ b/TODO_1.0
 
 - 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?
index 1188142a939981faa31dbd6bd938877bc4f264ea..1a88917a36d431765a0aeb5d5b81b3444f51f54a 100644 (file)
@@ -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
index 9e90670bf1a30eb919a957f267a547e480c05119..6f5424750bb19c2b51a82127b9b1c7b193f95f94 100755 (executable)
@@ -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});
 }
 
index 891c23713b648e073ec06436a0e2c998ac638d46..75067f2e73ded17f004aa0a2009893ff64386da1 100755 (executable)
@@ -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])