Skip to content

Instantly share code, notes, and snippets.

@scottwb scottwb/pear.rb.diff
Last active Jan 3, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.