Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,14 @@

default['python']['url'] = 'http://www.python.org/ftp/python'
default['python']['version'] = '2.7.1'
default['python']['checksum'] = '80e387bcf57eae8ce26726753584fd63e060ec11682d1145af921e85fd612292'
default['python']['configure_options'] = %W{--prefix=#{python['prefix_dir']}}

if platform?('windows')
if kernel['machine'] =~ /x86_64/
default['python']['checksum'] = '48ad736ec1bd74115df47f56c4ea770bc39dcde96a3f94270a549167e7f4dc65'
else
default['python']['checksum'] = '0af8bc05a5f9ed15df120150c6a6ddd0fc50d018e35b891cba22040e0404dfb6'
end
else
default['python']['checksum'] = '80e387bcf57eae8ce26726753584fd63e060ec11682d1145af921e85fd612292'
end
20 changes: 11 additions & 9 deletions recipes/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@
# limitations under the License.
#

msi_checksum = node['python']['checksum']
checksum = node['python']['checksum']
version = node['python']['version']

is_64_bit = ENV.has_key?('ProgramFiles(x86)')
msi_file_name = "python-#{version}.amd64.msi" if is_64_bit
msi_file_name = "python-#{version}.msi" unless is_64_bit
if kernel['machine'] =~ /x86_64/
msi_file_name = "python-#{version}.amd64.msi"
else
msi_file_name = "python-#{version}.msi"
end

msi_url = "#{node['python']['url']}/#{version}/#{msi_file_name}"
msi_local = cached_file(msi_url, msi_checksum)
package_name = "Python #{version}"
url = "#{node['python']['url']}/#{version}/#{msi_file_name}"

windows_package "Python #{version}" do
windows_package package_name do
action :install
source msi_local
checksum msi_checksum
source url
checksum checksum
options 'ALLUSERS=1' #Workaround for http://bugs.python.org/issue16188
installer_type :msi
end