From 312ca3cc530a33de621d9f5cb06ec8dfab1565fc Mon Sep 17 00:00:00 2001 From: Patrick Linnane Date: Wed, 7 Aug 2024 10:06:14 -0700 Subject: [PATCH 1/4] wiso-steuer-2024 31.09.4100 --- Casks/w/wiso-steuer-2024.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Casks/w/wiso-steuer-2024.rb b/Casks/w/wiso-steuer-2024.rb index 1e14b505c797..ccbd65ece7e8 100644 --- a/Casks/w/wiso-steuer-2024.rb +++ b/Casks/w/wiso-steuer-2024.rb @@ -1,9 +1,9 @@ cask "wiso-steuer-2024" do # NOTE: "2024" is not a version number, but an intrinsic part of the product name - version "31.08.4050" - sha256 "0b5fb4a649bc7212e77ed5b04dc59368eb7990440f1849dacc3d988f156577d5" + version "31.09.4100,-RC1" + sha256 "3b21d169989dd7a799c318879839a6f2bfb0e0703021f13a5e9cba3c3d32d897" - url "https://update.buhl-data.com/Updates/Steuer/2024/Mac/Files/#{version}-HF1/SteuerMac2024-#{version}.dmg", + url "https://update.buhl-data.com/Updates/Steuer/2024/Mac/Files/#{version.csv.first}#{version.csv.second}/SteuerMac2024-#{version.csv.first}.dmg", verified: "update.buhl-data.com/Updates/Steuer/" name "WISO Steuer 2024" desc "Tax declaration for the fiscal year 2023" @@ -11,7 +11,13 @@ livecheck do url "https://update.buhl-data.com/Updates/Steuer/2024/Mac/Aktuell/appcast-steuer.xml" - strategy :sparkle + regex(%r{/Files/(\d+(?:\.\d+)+)(-\w+\d)/SteuerMac2024[._-]v?(\d+(?:\.\d+)+).dmg}i) + strategy :sparkle do |item, regex| + match = item.url.match(regex) + next if match.blank? + + "#{match[1]},#{match[2]}" + end end auto_updates true From 192fd76bbfd4c45ae292a65e2605aa73ca77ba37 Mon Sep 17 00:00:00 2001 From: Patrick Linnane Date: Wed, 7 Aug 2024 11:10:02 -0700 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Klaus Hipp --- Casks/w/wiso-steuer-2024.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Casks/w/wiso-steuer-2024.rb b/Casks/w/wiso-steuer-2024.rb index ccbd65ece7e8..cc83f443fd0b 100644 --- a/Casks/w/wiso-steuer-2024.rb +++ b/Casks/w/wiso-steuer-2024.rb @@ -11,9 +11,9 @@ livecheck do url "https://update.buhl-data.com/Updates/Steuer/2024/Mac/Aktuell/appcast-steuer.xml" - regex(%r{/Files/(\d+(?:\.\d+)+)(-\w+\d)/SteuerMac2024[._-]v?(\d+(?:\.\d+)+).dmg}i) + regex(%r{/Files/(\d+(?:\.\d+)+)([_-]\w+\d+)/SteuerMac2024[._-]v?(\d+(?:\.\d+)+)\.dmg}i) strategy :sparkle do |item, regex| - match = item.url.match(regex) + match = item.url&.match(regex) next if match.blank? "#{match[1]},#{match[2]}" From 0bd04d490a18c97504563f09bae322637ffb2597 Mon Sep 17 00:00:00 2001 From: Patrick Linnane Date: Wed, 7 Aug 2024 14:03:52 -0700 Subject: [PATCH 3/4] Update Casks/w/wiso-steuer-2024.rb Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com> --- Casks/w/wiso-steuer-2024.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Casks/w/wiso-steuer-2024.rb b/Casks/w/wiso-steuer-2024.rb index cc83f443fd0b..5a4fd7397f8f 100644 --- a/Casks/w/wiso-steuer-2024.rb +++ b/Casks/w/wiso-steuer-2024.rb @@ -11,12 +11,12 @@ livecheck do url "https://update.buhl-data.com/Updates/Steuer/2024/Mac/Aktuell/appcast-steuer.xml" - regex(%r{/Files/(\d+(?:\.\d+)+)([_-]\w+\d+)/SteuerMac2024[._-]v?(\d+(?:\.\d+)+)\.dmg}i) + regex(%r{/v?(\d+(?:\.\d+)+)([^/]+)?/SteuerMac2024[._-]v?(\d+(?:\.\d+)+)\.dmg}i) strategy :sparkle do |item, regex| match = item.url&.match(regex) next if match.blank? - "#{match[1]},#{match[2]}" + match[2] ? "#{match[1]},#{match[2]}" : match[1] end end From 1b06b6248cba8f239fc6b5013ed3ce7eceb4184b Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:36:05 -0400 Subject: [PATCH 4/4] wiso-steuer-2024: update version, url, livecheck This takes a different approach to handling an optional suffix in the `version` and `livecheck` block, using the full version without any commas. --- Casks/w/wiso-steuer-2024.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Casks/w/wiso-steuer-2024.rb b/Casks/w/wiso-steuer-2024.rb index 5a4fd7397f8f..d2fbcd32ef3f 100644 --- a/Casks/w/wiso-steuer-2024.rb +++ b/Casks/w/wiso-steuer-2024.rb @@ -1,9 +1,9 @@ cask "wiso-steuer-2024" do # NOTE: "2024" is not a version number, but an intrinsic part of the product name - version "31.09.4100,-RC1" + version "31.09.4100-RC1" sha256 "3b21d169989dd7a799c318879839a6f2bfb0e0703021f13a5e9cba3c3d32d897" - url "https://update.buhl-data.com/Updates/Steuer/2024/Mac/Files/#{version.csv.first}#{version.csv.second}/SteuerMac2024-#{version.csv.first}.dmg", + url "https://update.buhl-data.com/Updates/Steuer/2024/Mac/Files/#{version}/SteuerMac2024-#{version.split("-").first}.dmg", verified: "update.buhl-data.com/Updates/Steuer/" name "WISO Steuer 2024" desc "Tax declaration for the fiscal year 2023" @@ -11,12 +11,12 @@ livecheck do url "https://update.buhl-data.com/Updates/Steuer/2024/Mac/Aktuell/appcast-steuer.xml" - regex(%r{/v?(\d+(?:\.\d+)+)([^/]+)?/SteuerMac2024[._-]v?(\d+(?:\.\d+)+)\.dmg}i) + regex(%r{/v?(\d+(?:\.\d+)+[^/]*)/SteuerMac2024[._-]v?(\d+(?:\.\d+)+)\.dmg}i) strategy :sparkle do |item, regex| match = item.url&.match(regex) next if match.blank? - match[2] ? "#{match[1]},#{match[2]}" : match[1] + match[1] end end