Permalink
Browse files

get perlbrew_lib dependency resolution working

  • Loading branch information...
1 parent 4b5d25a commit c385d1ce1886ecbbd2d1b486dc3b5b055b28e60a @xdg xdg committed Mar 15, 2012
@@ -25,8 +25,10 @@
# XXX must be a fully qualified 'perl-5.X.Y@libname' style name
action :create do
updated = false
- unless @lib.perlbrew_created
- p = perlbrew_perl @lib.perlbrew
+ unless @lib.perlbrew_installed
+ p = perlbrew_perl @lib.perlbrew do
+ action :nothing
+ end
p.run_action(:install)
updated = true
end
@@ -37,6 +39,7 @@
'PERLBREW_HOME' => node['perlbrew']['perlbrew_root']
})
command "#{node['perlbrew']['perlbrew_root']}/bin/perlbrew lib create #{new_resource.name}"
+ action :nothing
end
e.run_action(:run)
updated = true
@@ -53,6 +56,7 @@
'PERLBREW_HOME' => node['perlbrew']['perlbrew_root']
})
command "#{node['perlbrew']['perlbrew_root']}/bin/perlbrew lib delete #{new_resource.name}"
+ action :nothing
end
e.run_action(:run)
new_resource.updated_by_last_action(true)
@@ -61,7 +65,7 @@
def load_current_resource
@lib = Chef::Resource::PerlbrewLib.new(new_resource.name)
- @lib.perlbrew = @lib.name[/[^@]+/]
+ @lib.perlbrew(@lib.name[/[^@]+/])
@lib.perlbrew_installed(::File.exists?("#{node['perlbrew']['perlbrew_root']}/perls/#{@lib.perlbrew}"))
@lib.created(::File.exists?("#{node['perlbrew']['perlbrew_root']}/libs/#{@lib.name}"))
end
@@ -29,6 +29,7 @@
e = 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} #{new_resource.install_options}"
+ action :nothing
end
e.run_action(:run)
@perl.installed(true)
@@ -41,6 +42,7 @@
e = 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}"
+ action :nothing
end
e.run_action(:run)
@perl.installed(false)
@@ -36,6 +36,7 @@
perlbrew use #{new_resource.perlbrew}
#{new_resource.command}
EOC
+ action :nothing
end
b.run_action(:run)
new_resource.updated_by_last_action(true)
@@ -21,7 +21,8 @@
actions :create, :delete
attribute :created, :default => false
-attribute :perlbrew_created, :default => false
+attribute :perlbrew, :kind_of => String
+attribute :perlbrew_installed, :default => false
def initialize(*args)
super

0 comments on commit c385d1c

Please sign in to comment.