Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

only call add_products if the method exists

  • Loading branch information...
commit a9bc7b08e9fb6dd1dd18d922d90fb773ca6ecdf8 1 parent ee4fa1b
@mlschroe mlschroe authored
Showing with 8 additions and 3 deletions.
  1. +3 −1 examples/p5solv
  2. +2 −1  examples/pysolv
  3. +3 −1 examples/rbsolv
View
4 examples/p5solv
@@ -476,7 +476,9 @@ sub load {
return 1;
}
print "reading\n";
- $self->{'handle'}->add_products("/etc/products.d", $solv::Repo::REPO_NO_INTERNALIZE);
+ if (defined(&solv::Repo::add_products)) {
+ $self->{'handle'}->add_products("/etc/products.d", $solv::Repo::REPO_NO_INTERNALIZE);
+ }
$self->{'handle'}->add_rpmdb(undef, $solv::Repo::REPO_REUSE_REPODATA);
$self->writecachedrepo();
return 1;
View
3  examples/pysolv
@@ -550,7 +550,8 @@ class repo_system(repo_generic):
print "cached"
return True
print "reading"
- self.handle.add_products("/etc/products.d", Repo.REPO_NO_INTERNALIZE)
+ if hasattr(self.handle.__class__, 'add_products'):
+ self.handle.add_products("/etc/products.d", Repo.REPO_NO_INTERNALIZE)
self.handle.add_rpmdb(None, Repo.REPO_REUSE_REPODATA)
self.writecachedrepo(None)
return True
View
4 examples/rbsolv
@@ -484,7 +484,9 @@ class Repo_system < Repo_generic
return true
end
puts "reading"
- @handle.add_products("/etc/products.d", Solv::Repo::REPO_NO_INTERNALIZE)
+ if @handle.respond_to? :add_products
+ @handle.add_products("/etc/products.d", Solv::Repo::REPO_NO_INTERNALIZE)
+ end
@handle.add_rpmdb(nil, Solv::Repo::REPO_REUSE_REPODATA)
writecachedrepo(nil)
return true
Please sign in to comment.
Something went wrong with that request. Please try again.