From ceef7a0a62b5efd3fcf0c6e8e07a1d048bc03139 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 24 Apr 2013 12:20:50 +0200 Subject: [PATCH] use add_rpmdb_reffp in examples --- examples/p5solv | 3 ++- examples/pysolv | 3 ++- examples/rbsolv | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/p5solv b/examples/p5solv index 7d964ce..77b26c7 100755 --- a/examples/p5solv +++ b/examples/p5solv @@ -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; } diff --git a/examples/pysolv b/examples/pysolv index b47b859..060e6d5 100755 --- a/examples/pysolv +++ b/examples/pysolv @@ -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 diff --git a/examples/rbsolv b/examples/rbsolv index e1ca45a..ad57e4d 100755 --- a/examples/rbsolv +++ b/examples/rbsolv @@ -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 -- 2.7.4