Skip to content
This repository was archived by the owner on Oct 2, 2018. It is now read-only.

Commit 9c2ccce

Browse files
committed
removed separate sections for installing pip and setuptools with altinstall and instead changed binary for altinstall
1 parent 96f8fc5 commit 9c2ccce

2 files changed

Lines changed: 14 additions & 29 deletions

File tree

‎attributes/default.rb‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,28 @@
2020

2121
default['python']['install_method'] = 'package'
2222

23+
default['python']['url'] = 'http://www.python.org/ftp/python'
24+
default['python']['version'] = '2.7.5'
25+
default['python']['checksum'] = '3b477554864e616a041ee4d7cef9849751770bc7c39adaf78a94ea145c488059'
26+
default['python']['configure_options'] = %W{--prefix=#{python['prefix_dir']}}
27+
28+
default['python']['setuptools_script_url'] = 'https://bitbucket.org/pypa/setuptools/raw/0.8/ez_setup.py'
29+
default['python']['pip_script_url'] = 'https://raw.github.com/pypa/pip/master/contrib/get-pip.py'
30+
2331
if python['install_method'] == 'package'
2432
case platform
2533
when "smartos"
2634
default['python']['prefix_dir'] = '/opt/local'
2735
else
2836
default['python']['prefix_dir'] = '/usr'
2937
end
38+
default['python']['binary'] = "#{python['prefix_dir']}/bin/python"
3039
else
3140
default['python']['prefix_dir'] = '/usr/local'
3241
default['python']['install_type'] = 'install'
42+
if node['python']['install_type'] == 'altinstall'
43+
default['python']['binary'] = "#{python['prefix_dir']}/bin/python#{node['python']['version'].split(/(^\d+\.\d+)/)[1]}"
44+
else
45+
default['python']['binary'] = "#{python['prefix_dir']}/bin/python"
46+
end
3347
end
34-
35-
default['python']['binary'] = "#{python['prefix_dir']}/bin/python"
36-
37-
default['python']['url'] = 'http://www.python.org/ftp/python'
38-
default['python']['version'] = '2.7.5'
39-
default['python']['checksum'] = '3b477554864e616a041ee4d7cef9849751770bc7c39adaf78a94ea145c488059'
40-
default['python']['configure_options'] = %W{--prefix=#{python['prefix_dir']}}
41-
42-
default['python']['setuptools_script_url'] = 'https://bitbucket.org/pypa/setuptools/raw/0.8/ez_setup.py'
43-
default['python']['pip_script_url'] = 'https://raw.github.com/pypa/pip/master/contrib/get-pip.py'

‎recipes/pip.rb‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
if node['python']['install_method'] == 'source'
2727
pip_binary = "#{node['python']['prefix_dir']}/bin/pip"
28-
major_minor_version = node['python']['version'][/\d\.\d/]
2928
elsif platform_family?("rhel")
3029
pip_binary = "/usr/bin/pip"
3130
elsif platform_family?("smartos")
@@ -54,28 +53,10 @@
5453
not_if "#{node['python']['binary']} -c 'import setuptools'"
5554
end
5655

57-
execute "altinstall-setuptools" do
58-
cwd Chef::Config[:file_cache_path]
59-
command <<-EOF
60-
#{node['python']['binary']}#{major_minor_version} ez_setup.py
61-
EOF
62-
not_if "#{node['python']['binary']}#{major_minor_version} -c 'import setuptools'"
63-
only_if {node['python']['install_type'] == "altinstall"}
64-
end
65-
6656
execute "install-pip" do
6757
cwd Chef::Config[:file_cache_path]
6858
command <<-EOF
6959
#{node['python']['binary']} get-pip.py
7060
EOF
7161
not_if { ::File.exists?(pip_binary) }
7262
end
73-
74-
execute "altinstall-pip" do
75-
cwd Chef::Config[:file_cache_path]
76-
command <<-EOF
77-
#{node['python']['binary']}#{major_minor_version} get-pip.py
78-
EOF
79-
not_if { ::File.exists?(pip_binary + "-" + major_minor_version) }
80-
only_if {node['python']['install_type'] == "altinstall"}
81-
end

0 commit comments

Comments
 (0)