This repository was archived by the owner on Oct 2, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121default [ '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+
2331if 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"
3039else
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
3347end
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'
Original file line number Diff line number Diff line change 2525
2626if node [ 'python' ] [ 'install_method' ] == 'source'
2727 pip_binary = "#{ node [ 'python' ] [ 'prefix_dir' ] } /bin/pip"
28- major_minor_version = node [ 'python' ] [ 'version' ] [ /\d \. \d / ]
2928elsif platform_family? ( "rhel" )
3029 pip_binary = "/usr/bin/pip"
3130elsif platform_family? ( "smartos" )
5453 not_if "#{ node [ 'python' ] [ 'binary' ] } -c 'import setuptools'"
5554end
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-
6656execute "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 ) }
7262end
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
You can’t perform that action at this time.
0 commit comments