]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
bindings: add a selection clone method
authorMichael Schroeder <mls@suse.de>
Wed, 15 Nov 2017 14:14:20 +0000 (15:14 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 15 Nov 2017 14:14:20 +0000 (15:14 +0100)
bindings/solv.i

index b1d9cc7086f0331dd7a97ea788f25df5962fa7bb..319a85bfffdaed06e725a0dc0d9291e76a736813 100644 (file)
@@ -1293,6 +1293,15 @@ typedef struct {
   bool isempty() {
     return $self->q.count == 0;
   }
+  %newobject clone;
+  Selection *clone(Selection *from, int flags = 0) { 
+    Selection *s;
+    s = solv_calloc(1, sizeof(*s));
+    s->pool = from->pool;
+    s->flags = from->flags;
+    queue_init_clone(&s->q, &from->q);
+    return s;
+  }
   void filter(Selection *lsel) {
     if ($self->pool != lsel->pool)
       queue_empty(&$self->q);