From b5d2c5e7112e49f0fc924e67e32f001ee16f67b4 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 25 Oct 2024 14:34:00 +0200 Subject: [PATCH] (inkscape) Disable package update The 32bit installer is missing from the latest version of InkScape, and the error that is thrown is currently preventing our update gist to be updated properly. As such we throw a minimized error message to continue allowing the gist to be updated, as well as preventing an update until a decision has been made of whether 32bit support will be dropped or not. --- automatic/inkscape/update.ps1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/automatic/inkscape/update.ps1 b/automatic/inkscape/update.ps1 index d5dc2613928..f1edb039f21 100644 --- a/automatic/inkscape/update.ps1 +++ b/automatic/inkscape/update.ps1 @@ -1,4 +1,4 @@ -Import-Module Chocolatey-AU +Import-Module Chocolatey-AU Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1" $domain = 'https://inkscape.org' @@ -31,12 +31,22 @@ function global:au_SearchReplace { } function global:au_GetLatest { - $redirUrl = Get-RedirectedUrl "$domain/en/release/" + # We know the 32bit executable is currently missing, as such + # we will prevent package update for this package until it has + # been decided whether 32bit support will be dropped or not. + throw "Updating of inkscape is disabled until it has been decided whether 32bit support will be dropped or not." + + $redirUrl = Get-RedirectedUrl "$domain/release/" $version = $redirUrl -split '\/(inkscape-)?' | Select-Object -last 1 -skip 1 - $32bit_page = Invoke-WebRequest "$redirUrl/windows/32-bit/msi/dl/" -UseBasicParsing - $64bit_page = Invoke-WebRequest "$redirUrl/windows/64-bit/msi/dl/" -UseBasicParsing + try { + $32bit_page = Invoke-WebRequest "$redirUrl/windows/32-bit/msi/dl/" -UseBasicParsing + $64bit_page = Invoke-WebRequest "$redirUrl/windows/64-bit/msi/dl/" -UseBasicParsing + } + catch { + throw "Failed to download 32bit or 64bit executeble. Throwing minimized error to allow gist to be updated." + } $re = '\.msi$' $url32 = $32bit_page.links | Where-Object href -match $re | Select-Object -first 1 -expand href | ForEach-Object { $domain + $_ }