use add_rpmdb_reffp in examples
authorMichael Schroeder <mls@suse.de>
Wed, 24 Apr 2013 10:20:50 +0000 (12:20 +0200)
committerMichael Schroeder <mls@suse.de>
Wed, 24 Apr 2013 10:20:50 +0000 (12:20 +0200)
examples/p5solv
examples/pysolv
examples/rbsolv

index 7d964ce..77b26c7 100755 (executable)
@@ -478,7 +478,8 @@ sub load {
   if (defined(&solv::Repo::add_products)) {
     $self->{'handle'}->add_products("/etc/products.d", $solv::Repo::REPO_NO_INTERNALIZE);
   }
-  $self->{'handle'}->add_rpmdb($solv::Repo::REPO_REUSE_REPODATA);
+  my $f = solv::xfopen($self->cachepath());
+  $self->{'handle'}->add_rpmdb_reffp($f, $solv::Repo::REPO_REUSE_REPODATA);
   $self->writecachedrepo();
   return 1;
 }
index b47b859..060e6d5 100755 (executable)
@@ -550,7 +550,8 @@ class repo_system(repo_generic):
         print "reading"
         if hasattr(self.handle.__class__, 'add_products'):
             self.handle.add_products("/etc/products.d", Repo.REPO_NO_INTERNALIZE)
-        self.handle.add_rpmdb(Repo.REPO_REUSE_REPODATA)
+        f = solv.xfopen(self.cachepath())
+        self.handle.add_rpmdb_reffp(f, Repo.REPO_REUSE_REPODATA)
         self.writecachedrepo(None)
         return True
 
index e1ca45a..ad57e4d 100755 (executable)
@@ -492,7 +492,9 @@ class Repo_system < Repo_generic
     if @handle.respond_to? :add_products
       @handle.add_products("/etc/products.d", Solv::Repo::REPO_NO_INTERNALIZE)
     end
-    @handle.add_rpmdb(Solv::Repo::REPO_REUSE_REPODATA)
+    f = Solv::xfopen(cachepath())
+    @handle.add_rpmdb_reffp(f, Solv::Repo::REPO_REUSE_REPODATA)
+    f.close
     writecachedrepo(nil)
     return true
   end