Permalink
Browse files

fix bugs in perl provider

  • Loading branch information...
1 parent 0f2aa9a commit 6b454fc237ad999cfb4eb372422a94fa37dcb5d0 @xdg xdg committed Jan 6, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 cookbooks/perlbrew/providers/perl.rb
@@ -24,8 +24,9 @@
action :install do
unless @perl.installed
- new_resource.version = new_resource.name if not defined? new_resource.version
+ new_resource.version(new_resource.name) if not new_resource.version
execute "Install perlbrew perl #{new_resource.name}" do
+ environment ({'PERLBREW_ROOT' => node['perlbrew']['perlbrew_root']})
command "#{node['perlbrew']['perlbrew_root']}/bin/perlbrew install #{new_resource.version} --as #{new_resource.name}"
end
new_resource.updated_by_last_action(true)
@@ -35,6 +36,7 @@
action :remove do
if @perl.installed
execute "Remove perlbrew perl #{new_resource.name}" do
+ environment ({'PERLBREW_ROOT' => node['perlbrew']['perlbrew_root']})
command "#{node['perlbrew']['perlbrew_root']}/bin/perlbrew uninstall #{new_resource.name}"
end
new_resource.updated_by_last_action(true)
@@ -43,6 +45,6 @@
def load_current_resource
@perl = Chef::Resource::PerlbrewPerl.new(new_resource.name)
- @perl.installed = ::File.exists?("#{node['perlbrew']['perlbrew_root']}/perls/#{@perl.name}")
+ @perl.installed(::File.exists?("#{node['perlbrew']['perlbrew_root']}/perls/#{@perl.name}"))
end

0 comments on commit 6b454fc

Please sign in to comment.