From f53afbac77762d40b3107fd142d5a0f6a09ef799 Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Tue, 9 Jan 2024 13:30:43 -0600 Subject: [PATCH] (octave.portable) Remove 32 bit support --- .../octave.portable/legal/VERIFICATION.txt | 2 -- .../tools/chocolateyInstall.ps1 | 15 +++------- automatic/octave.portable/update.ps1 | 29 ++++--------------- 3 files changed, 10 insertions(+), 36 deletions(-) diff --git a/automatic/octave.portable/legal/VERIFICATION.txt b/automatic/octave.portable/legal/VERIFICATION.txt index b86083d0d2a..3db78d8106b 100644 --- a/automatic/octave.portable/legal/VERIFICATION.txt +++ b/automatic/octave.portable/legal/VERIFICATION.txt @@ -8,7 +8,6 @@ location on and can be verified by doing the following: 1. Download the following: - 32-bit software: 64-bit software: 2. Get the checksum using one of the following methods: @@ -18,7 +17,6 @@ and can be verified by doing the following: 3. The checksums should match the following: checksum type: sha256 - checksum32: 9d6a81d86d7128775f8e821d89704582da81cee51400071c6d099118c983f37a checksum64: 6c07a7e5cf748e2efc2ae719dd8ad9b07e41cf7abb645b84cf753b6e0cc2bfd4 File 'gpl-3.0.txt' is obtained from diff --git a/automatic/octave.portable/tools/chocolateyInstall.ps1 b/automatic/octave.portable/tools/chocolateyInstall.ps1 index f2648616f5c..7c68ae214f8 100644 --- a/automatic/octave.portable/tools/chocolateyInstall.ps1 +++ b/automatic/octave.portable/tools/chocolateyInstall.ps1 @@ -5,27 +5,20 @@ $version = '8.2.0' $toolsDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition) $progDir = "$toolsDir\octave" -$osBitness = Get-OSArchitectureWidth $packageArgs = @{ PackageName = 'octave.portable' UnzipLocation = $toolsDir - Url = 'https://ftp.gnu.org/gnu/octave/windows/octave-8.2.0-w32.7z' Url64 = 'https://ftp.gnu.org/gnu/octave/windows/octave-8.2.0-w64.7z' - Checksum = '9d6a81d86d7128775f8e821d89704582da81cee51400071c6d099118c983f37a' Checksum64 = '6c07a7e5cf748e2efc2ae719dd8ad9b07e41cf7abb645b84cf753b6e0cc2bfd4' - ChecksumType = 'sha256' ChecksumType64 = 'sha256' } Install-ChocolateyZipPackage @packageArgs # Rename unzipped folder -If (Test-Path "$toolsDir\octave-$version-w$osBitness") { - Rename-Item -Path "$toolsDir\octave-$version-w$osBitness" -NewName 'octave' -} -If (Test-Path "$toolsDir\octave-$version") { - Rename-Item -Path "$toolsDir\octave-$version" -NewName 'octave' +If (Test-Path "$toolsDir\octave-$version-w64") { + Rename-Item -Path "$toolsDir\octave-$version-w64" -NewName 'octave' } # Don't create shims for any executables @@ -35,7 +28,7 @@ foreach ($file in $files) { } # Link batch -$path = "$progDir\mingw$osBitness\bin\octave.bat" +$path = "$progDir\mingw64\bin\octave.bat" Install-BinFile -Name 'octave' -Path $path -Command '--gui' -UseStart Install-BinFile -Name 'octave-cli' -Path $path -Command '--no-gui' @@ -65,7 +58,7 @@ if ($pp.Count -gt 0) { } if ($paths.Count -gt 0) { - $icon = "$progDir\mingw$osBitness\share\octave\$version\imagelib\octave-logo.ico" + $icon = "$progDir\mingw64\share\octave\$version\imagelib\octave-logo.ico" $target = "$progDir\octave.vbs" $paths.GetEnumerator() | foreach-object { diff --git a/automatic/octave.portable/update.ps1 b/automatic/octave.portable/update.ps1 index 1a3463d0b06..037e9b0f410 100644 --- a/automatic/octave.portable/update.ps1 +++ b/automatic/octave.portable/update.ps1 @@ -6,30 +6,21 @@ Import-Module AU $releases = "https://ftp.gnu.org/gnu/octave/windows/?C=M;O=D" function global:au_BeforeUpdate { - $checksumType = 'sha256' - $Latest.ChecksumType64 = $Latest.ChecksumType32 = $checksumType - - $Latest.Checksum32 = Get-RemoteChecksum $Latest.URL32 -Algorithm $checksumType - $Latest.Checksum64 = Get-RemoteChecksum $Latest.URL64 -Algorithm $checksumType + $Latest.Checksum64 = Get-RemoteChecksum $Latest.URL64 -Algorithm $Latest.checksumType64 } function global:au_SearchReplace { @{ ".\legal\VERIFICATION.txt" = @{ - "(?i)(^\s*32\-bit software.*)\<.*\>" = "`${1}<$($Latest.URL32)>" "(?i)(^\s*64\-bit software.*)\<.*\>" = "`${1}<$($Latest.URL64)>" - "(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType32)" - "(?i)(^\s*checksum32?\:).*" = "`${1} $($Latest.Checksum32)" + "(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType64)" "(?i)(^\s*checksum64\:).*" = "`${1} $($Latest.Checksum64)" } ".\tools\chocolateyInstall.ps1" = @{ "(?i)(^\s*\`$version\s*=\s*)('.*')" = "`${1}'$($Latest.Version)'" - "(?i)(^\s*Url\s*=\s*)('.*')" = "`${1}'$($Latest.URL32)'" "(?i)(^\s*Url64\s*=\s*)('.*')" = "`${1}'$($Latest.URL64)'" - "(?i)(^\s*Checksum\s*=\s*)('.*')" = "`${1}'$($Latest.Checksum32)'" "(?i)(^\s*Checksum64\s*=\s*)('.*')" = "`${1}'$($Latest.Checksum64)'" - "(?i)(^\s*ChecksumType\s*=\s*)('.*')" = "`${1}'$($Latest.ChecksumType32)'" "(?i)(^\s*ChecksumType64\s*=\s*)('.*')" = "`${1}'$($Latest.ChecksumType64)'" } @@ -43,30 +34,22 @@ function global:au_SearchReplace { function global:au_GetLatest { $download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing - $re = 'octave-.*-.*w(64|32)\.7z$' - $urls = $download_page.links | where-object href -match $re | select-object -First 2 -expand href | foreach-object{ New-Object uri([uri]$releases, $_) } - - $url32 = $urls -match "w32" | select-object -first 1 - $url64 = $urls -match "w64" | select-object -first 1 + $re = 'octave-.*-.*w64\.7z$' + $url64 = $download_page.links | where-object href -match $re | select-object -First 1 -expand href | foreach-object{ New-Object uri([uri]$releases, $_) } - $version32 = $url32 -split '[-]' | select-object -Last 1 -Skip 1 $version64 = $url64 -split '[-]' | select-object -Last 1 -Skip 1 - if ($version32 -ne $version64) { - throw "32bit and 64bit versions do not match. Please Investigate." - } - $releases_url = "https://www.gnu.org/software/octave/news.html" $releases_page = Invoke-WebRequest -Uri $releases_url -UseBasicParsing $re = 'octave-.*-released' $releaseNotes = $releases_page.links | where-object href -match $re | select-object -First 1 -expand href | foreach-object { New-Object uri([uri]$releases_url, $_) } return @{ - Version = $version32.Replace('_', '.') - URL32 = $url32 + Version = $version64.Replace('_', '.') URL64 = $url64 ReleaseNotes = $releaseNotes UpdateYear = (Get-Date).ToString('yyyy') + ChecksumType64 = 'sha256' } }