Please review pull request #740: get eix cachefile location from eix opened by (hairmare)
Description:
I want to keep the eix cache file in a single location for a vserver setup I'm doing. This commit helps by allowing me to decide where I want to store the cache through default eix mechanisms. I can then configure eix using puppet however i need.
- Opened: Fri May 04 10:20:34 UTC 2012
- Based on: puppetlabs:master (c9386b541e9ecf6c0daffde2825bad385ea4da2b)
- Requested merge: hairmare:patch-1 (9cb36770fef1bae1dca27dff6c45cc8a834d5872)
Diff follows:
diff --git a/lib/puppet/provider/package/portage.rb b/lib/puppet/provider/package/portage.rb
index 591e9ea..4496db1 100644
--- a/lib/puppet/provider/package/portage.rb
+++ b/lib/puppet/provider/package/portage.rb
@@ -18,9 +18,10 @@ def self.instances
version_format = "{last}<version>{}"
search_format = "<category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] <homepage> <description>\n"
-
+ eix_cachefile = (eix "--print", "EIX_CACHEFILE").rstrip
+
begin
- update_eix if !FileUtils.uptodate?("/var/cache/eix", %w{/usr/bin/eix /usr/portage/metadata/timestamp})
+ update_eix if !FileUtils.uptodate?(eix_cachefile, %w{/usr/bin/eix /usr/portage/metadata/timestamp})
search_output = nil
Puppet::Util.withenv :LASTVERSION => version_format do
@@ -76,12 +77,13 @@ def query
version_format = "{last}<version>{}"
search_format = "<category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] <homepage> <description>\n"
-
+ eix_cachefile = (eix "--print", "EIX_CACHEFILE").rstrip
+
search_field = package_name.count('/') > 0 ? "--category-name" : "--name"
search_value = package_name
begin
- update_eix if !FileUtils.uptodate?("/var/cache/eix", %w{/usr/bin/eix /usr/portage/metadata/timestamp})
+ update_eix if !FileUtils.uptodate?(eix_cachefile, %w{/usr/bin/eix /usr/portage/metadata/timestamp})
search_output = nil
Puppet::Util.withenv :LASTVERSION => version_format do
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
