From 5e596a07c4953605d6ede45b94e79c404fa12711 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 27 Jun 2025 11:01:32 +0100 Subject: [PATCH] fix(build-variants): make build variant matching more restrictive In practice, build variants will be numbers, so to avoid issues with possible naming conflicts, let's enforce them to be numbers. --- Casks/emacs-app-pretest.rb | 2 +- Casks/emacs-app.rb | 2 +- templates/emacs-app-pretest.rb.tpl | 2 +- templates/emacs-app.rb.tpl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Casks/emacs-app-pretest.rb b/Casks/emacs-app-pretest.rb index 75661764..711b47fa 100644 --- a/Casks/emacs-app-pretest.rb +++ b/Casks/emacs-app-pretest.rb @@ -22,7 +22,7 @@ cask 'emacs-app-pretest' do url 'https://github.com/jimeh/emacs-builds.git' strategy :git do |tags| tags.map do |tag| - m = /^Emacs-(.+-pretest(-.+)?)$/.match(tag) + m = /^Emacs-(.+-pretest(-\d+)?)$/.match(tag) next unless m m[1] diff --git a/Casks/emacs-app.rb b/Casks/emacs-app.rb index 4b7a4877..a13e0842 100644 --- a/Casks/emacs-app.rb +++ b/Casks/emacs-app.rb @@ -22,7 +22,7 @@ cask 'emacs-app' do url 'https://github.com/jimeh/emacs-builds.git' strategy :git do |tags| tags.map do |tag| - m = /^Emacs-(\d+\.\d+[a-z]*(-.+)?)$/.match(tag) + m = /^Emacs-(\d+\.\d+[a-z]*(-\d+)?)$/.match(tag) next unless m m[1] diff --git a/templates/emacs-app-pretest.rb.tpl b/templates/emacs-app-pretest.rb.tpl index ad2a844a..91644cdf 100644 --- a/templates/emacs-app-pretest.rb.tpl +++ b/templates/emacs-app-pretest.rb.tpl @@ -12,7 +12,7 @@ cask 'emacs-app-pretest' do url 'https://github.com/jimeh/emacs-builds.git' strategy :git do |tags| tags.map do |tag| - m = /^Emacs-(.+-pretest(-.+)?)$/.match(tag) + m = /^Emacs-(.+-pretest(-\d+)?)$/.match(tag) next unless m m[1] diff --git a/templates/emacs-app.rb.tpl b/templates/emacs-app.rb.tpl index a801c3d6..fbe64a65 100644 --- a/templates/emacs-app.rb.tpl +++ b/templates/emacs-app.rb.tpl @@ -12,7 +12,7 @@ cask 'emacs-app' do url 'https://github.com/jimeh/emacs-builds.git' strategy :git do |tags| tags.map do |tag| - m = /^Emacs-(\d+\.\d+[a-z]*(-.+)?)$/.match(tag) + m = /^Emacs-(\d+\.\d+[a-z]*(-\d+)?)$/.match(tag) next unless m m[1]