From 2b723a33ec62e3446bed8cbfb76cb58bd14a4782 Mon Sep 17 00:00:00 2001 From: Guilhem Lettron Date: Thu, 11 Oct 2012 17:08:55 +0200 Subject: [PATCH 1/3] Debian 6.0 use /usr/bin (and not /usr/local as Ubuntu. Need someone with squeeze to test this behaviour. --- attributes/default.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 794d873..82bf847 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -27,9 +27,9 @@ end case platform -when "redhat","centos","scientific","fedora","suse","amazon" +when "redhat","centos","scientific","fedora","suse","amazon","debian" set['python']['pip']['prefix_dir'] = '/usr' -when "debian","ubuntu" +when "ubuntu" set['python']['pip']['prefix_dir'] = '/usr/local' else set['python']['pip']['prefix_dir'] = '/usr/local' From bc8947d4ab266faeec4463860417e5e054592030 Mon Sep 17 00:00:00 2001 From: Guilhem Lettron Date: Thu, 11 Oct 2012 17:30:11 +0200 Subject: [PATCH 2/3] use which to find if pip is installed --- recipes/pip.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipes/pip.rb b/recipes/pip.rb index ecb97c2..752038b 100644 --- a/recipes/pip.rb +++ b/recipes/pip.rb @@ -28,14 +28,15 @@ remote_file "#{Chef::Config[:file_cache_path]}/distribute_setup.py" do source "http://python-distribute.org/distribute_setup.py" mode "0644" - not_if { ::File.exists?("#{pip_bindir}/pip") } + notifies :run, "bash[install-pip]", :immediately + not_if "which pip" end bash "install-pip" do cwd Chef::Config[:file_cache_path] code <<-EOF #{python_bindir}/python distribute_setup.py - #{pip_bindir}/easy_install pip + easy_install pip EOF - not_if { ::File.exists?("#{pip_bindir}/pip") } + action :nothing end From 141c6a864fa2c5e12eb64a82a9ae6f40a099d899 Mon Sep 17 00:00:00 2001 From: Guilhem Lettron Date: Mon, 10 Dec 2012 17:41:20 +0100 Subject: [PATCH 3/3] use "default" instead of "set" --- attributes/default.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 82bf847..4190d2a 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -28,11 +28,11 @@ case platform when "redhat","centos","scientific","fedora","suse","amazon","debian" - set['python']['pip']['prefix_dir'] = '/usr' + default['python']['pip']['prefix_dir'] = '/usr' when "ubuntu" - set['python']['pip']['prefix_dir'] = '/usr/local' + default['python']['pip']['prefix_dir'] = '/usr/local' else - set['python']['pip']['prefix_dir'] = '/usr/local' + default['python']['pip']['prefix_dir'] = '/usr/local' end default['python']['url'] = 'http://www.python.org/ftp/python'