Skip to content

Instantly share code, notes, and snippets.

@scottwb
Last active January 3, 2016 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottwb/8513105 to your computer and use it in GitHub Desktop.
Save scottwb/8513105 to your computer and use it in GitHub Desktop.
Illustrates bug (and fix) in the php::module_apc cookbook from https://github.com/opscode-cookbooks/php/blob/master/providers/pear.rb that occurs on centos.
diff --git a/cookbooks/php/providers/pear.rb b/cookbooks/php/providers/pear.rb
index ca473b5..db90e17 100644
--- a/cookbooks/php/providers/pear.rb
+++ b/cookbooks/php/providers/pear.rb
@@ -258,13 +258,13 @@ def pecl?
@pecl ||= begin
# search as a pear first since most 3rd party channels will report pears as pecls!
search_cmd = "#{node['php']['pear']} -d"
- search_cmd << " preferred_state=#{can_haz(@new_resource, preferred_state)}"
+ search_cmd << " preferred_state=#{can_haz(@new_resource, "preferred_state")}"
search_cmd << " search#{expand_channel(can_haz(@new_resource, "channel"))} #{@new_resource.package_name}"
if grep_for_version(shell_out(search_cmd).stdout, @new_resource.package_name).nil?
# fall back and search as a pecl
search_cmd = "#{node['php']['pecl']} -d"
- search_cmd << " preferred_state=#{can_haz(@new_resource, preferred_state)}"
+ search_cmd << " preferred_state=#{can_haz(@new_resource, "preferred_state")}"
search_cmd << " search#{expand_channel(can_haz(@new_resource, "channel"))} #{@new_resource.package_name}"
else
false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment