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

Commit 817d9de

Browse files
committed
Merge pull request #2 from daptiv/cook-2809-windows-support
Added python 2.7.1 msi checksums for Windows.
2 parents 3952e90 + 2bb4ecb commit 817d9de

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

attributes/default.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,14 @@
3535

3636
default['python']['url'] = 'http://www.python.org/ftp/python'
3737
default['python']['version'] = '2.7.1'
38-
default['python']['checksum'] = '80e387bcf57eae8ce26726753584fd63e060ec11682d1145af921e85fd612292'
3938
default['python']['configure_options'] = %W{--prefix=#{python['prefix_dir']}}
39+
40+
if platform?('windows')
41+
if kernel['machine'] =~ /x86_64/
42+
default['python']['checksum'] = '48ad736ec1bd74115df47f56c4ea770bc39dcde96a3f94270a549167e7f4dc65'
43+
else
44+
default['python']['checksum'] = '0af8bc05a5f9ed15df120150c6a6ddd0fc50d018e35b891cba22040e0404dfb6'
45+
end
46+
else
47+
default['python']['checksum'] = '80e387bcf57eae8ce26726753584fd63e060ec11682d1145af921e85fd612292'
48+
end

recipes/windows.rb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,22 @@
1818
# limitations under the License.
1919
#
2020

21-
msi_checksum = node['python']['checksum']
21+
checksum = node['python']['checksum']
2222
version = node['python']['version']
2323

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

28-
msi_url = "#{node['python']['url']}/#{version}/#{msi_file_name}"
29-
msi_local = cached_file(msi_url, msi_checksum)
30+
package_name = "Python #{version}"
31+
url = "#{node['python']['url']}/#{version}/#{msi_file_name}"
3032

31-
windows_package "Python #{version}" do
33+
windows_package package_name do
3234
action :install
33-
source msi_local
34-
checksum msi_checksum
35+
source url
36+
checksum checksum
3537
options 'ALLUSERS=1' #Workaround for http://bugs.python.org/issue16188
3638
installer_type :msi
3739
end

0 commit comments

Comments
 (0)