|
10 | 10 | # +----------------------------------------------------------------------+ |
11 | 11 | # | Licensed Materials - Property of IBM | |
12 | 12 | # | | |
13 | | -# | (C) Copyright IBM Corporation 2006 - 2016 | |
| 13 | +# | (C) Copyright IBM Corporation 2006 - 2024 | |
14 | 14 | # +----------------------------------------------------------------------+ |
15 | 15 |
|
16 | 16 | TAR_LONGLINK = '././@LongLink' |
@@ -90,8 +90,11 @@ def suppress_warnings |
90 | 90 | DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd32_odbc_cli.tar.gz" |
91 | 91 | end |
92 | 92 | elsif (RUBY_PLATFORM =~ /darwin/i) |
93 | | - if(is64Bit) |
94 | | - puts "Detected platform - MacOS darwin64" |
| 93 | + if (RUBY_PLATFORM =~ /arm64/i) |
| 94 | + puts "Detected platform - MacOS darwin arm64" |
| 95 | + DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macarm64_odbc_cli.tar.gz" |
| 96 | + elsif(RUBY_PLATFORM =~ /x86_64/i || is64Bit) |
| 97 | + puts "Detected platform - MacOS darwin x86_64" |
95 | 98 | DOWNLOADLINK = "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz" |
96 | 99 | else |
97 | 100 | puts "Mac OS 32 bit not supported. Please use an x64 architecture." |
@@ -151,11 +154,17 @@ def untarCLIPackage(archive,destination) |
151 | 154 | FileUtils.mkdir_p file, :mode => entry.header.mode, :verbose => false |
152 | 155 | elsif entry.file? |
153 | 156 | FileUtils.rm_rf file if File.directory? file |
| 157 | + if (RUBY_PLATFORM =~ /darwin/i) && (RUBY_PLATFORM =~ /arm64/i) && File.exist?(file) |
| 158 | + FileUtils.chmod 755, file, :verbose => false |
| 159 | + end |
154 | 160 | File.open file, "wb" do |f| |
155 | 161 | f.print entry.read |
156 | 162 | end |
157 | 163 | FileUtils.chmod entry.header.mode, file, :verbose => false |
158 | 164 | elsif entry.header.typeflag == '2' #Symlink! |
| 165 | + if (RUBY_PLATFORM =~ /darwin/i) && (RUBY_PLATFORM =~ /arm64/i) && File.exist?(file) |
| 166 | + File.delete file if File.file? file |
| 167 | + end |
159 | 168 | File.symlink entry.header.linkname, file |
160 | 169 | end |
161 | 170 | end |
|
0 commit comments