Currently script uses Perl to get the machine architecture. This can be erroneous since Perl uses the architecture of the machine that Perl was compiled on not the architecture of the running machine. We should use the systems `uname` command instead. Use `uname -m` instead of Perl to get the machine architecture.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -142,10 +142,10 @@ if (!is_supported_architecture()) { · 141 unmodified lines | ||
| 142 | 142 | foreach(@SUPPORTED_ARCHITECTURES) { |
| 143 | 143 | printf "\t%s\n", $_; |
| 144 | 144 | } |
| 145 | + printf("\n"); | |
| 145 | 146 | |
| 146 | − my $archname = $Config{archname}; | |
| 147 | − printf "\n\$ perl -MConfig -e \'print \"\$Config{archname}\\n\"\'\n"; | |
| 148 | − printf "%s\n", $archname; | |
| 147 | + my $archname = `uname -m`; | |
| 148 | + printf("Machine hardware name (`uname -m`): %s\n", $archname); | |
| 149 | 149 | |
| 150 | 150 | exit(129); |
| 151 | 151 | } |
| @@ -172,7 +172,7 @@ sub is_supported_architecture · 20 unmodified lines | ||
| 172 | 172 | |
| 173 | 173 | sub is_x86_64 |
| 174 | 174 | { |
| 175 | − my $archname = $Config{archname}; | |
| 175 | + my $archname = `uname -m`; | |
| 176 | 176 | |
| 177 | 177 | if ($archname =~ m/x86_64/) { |
| 178 | 178 | return 1; |
| @@ -182,9 +182,9 @@ sub is_x86_64 · 3 unmodified lines | ||
| 182 | 182 | |
| 183 | 183 | sub is_ppc64 |
| 184 | 184 | { |
| 185 | − my $archname = $Config{archname}; | |
| 185 | + my $archname = `uname -m`; | |
| 186 | 186 | |
| 187 | − if ($archname =~ m/powerpc/ and $archname =~ m/64/) { | |
| 187 | + if ($archname =~ m/ppc64/) { | |
| 188 | 188 | return 1; |
| 189 | 189 | } |
| 190 | 190 | return 0; |