Skip to content

Commit 5e8a8c1

Browse files
committed
Fix regexes
I missed fixing up several regexes, now that we are only defining the Ruby x.y version and omitting the z to make bumping the version easier.
1 parent af90c84 commit 5e8a8c1

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

configs/components/_base-ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Condensed version, e.g. '2.4.3' -> '243'
66
ruby_version_condensed = pkg.get_version.tr('.', '')
77
# Y version, e.g. '2.4.3' -> '2.4'
8-
ruby_version_y = pkg.get_version.gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2')
8+
ruby_version_y = pkg.get_version.gsub(/(\d+)\.(\d+)(\.\d+)?/, '\1.\2')
99

1010
pkg.mirror "#{settings[:buildsources_url]}/ruby-#{pkg.get_version}.tar.gz"
1111
pkg.url "https://cache.ruby-lang.org/pub/ruby/#{ruby_version_y}/ruby-#{pkg.get_version}.tar.gz"

configs/components/libxml2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
pkg.version '2.13.8'
88
pkg.sha256sum '277294cb33119ab71b2bc81f2f445e9bc9435b893ad15bb2cd2b0e859a0ee84a'
99

10-
libxml2_version_y = pkg.get_version.gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2')
10+
libxml2_version_y = pkg.get_version.gsub(/(\d+)\.(\d+)(\.\d+)?/, '\1.\2')
1111
pkg.url "https://download.gnome.org/sources/libxml2/#{libxml2_version_y}/libxml2-#{pkg.get_version}.tar.xz"
1212
pkg.mirror "#{settings[:buildsources_url]}/libxml2-#{pkg.get_version}.tar.xz"
1313

configs/components/libxslt.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
pkg.version '1.1.43'
88
pkg.sha256sum '5a3d6b383ca5afc235b171118e90f5ff6aa27e9fea3303065231a6d403f0183a'
99

10-
libxslt_version_y = pkg.get_version.gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2')
10+
libxslt_version_y = pkg.get_version.gsub(/(\d+)\.(\d+)(\.\d+)?/, '\1.\2')
1111
pkg.url "https://download.gnome.org/sources/libxslt/#{libxslt_version_y}/libxslt-#{pkg.get_version}.tar.xz"
1212
pkg.mirror "#{settings[:buildsources_url]}/libxslt-#{pkg.get_version}.tar.xz"
1313

configs/components/pl-ruby-patch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
component "pl-ruby-patch" do |pkg, settings, platform|
1010
if platform.is_cross_compiled?
1111

12-
ruby_version_y = settings[:ruby_version].gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2')
12+
ruby_version_y = settings[:ruby_version].gsub(/(\d+)\.(\d+)(\.\d+)?/, '\1.\2')
1313

1414
pkg.add_source("file://resources/files/ruby/patch-hostruby.rb")
1515

configs/projects/_shared-agent-settings.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
proj.setting(:ruby_bindir, proj.bindir)
7979

8080
raise "Couldn't find a :ruby_version setting in the project file" unless proj.ruby_version
81-
ruby_base_version = proj.ruby_version.gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2.0')
82-
ruby_version_y = proj.ruby_version.gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2')
83-
ruby_version_x = proj.ruby_version.gsub(/(\d+)\.(\d+)\.(\d+)/, '\1')
81+
ruby_base_version = proj.ruby_version.gsub(/(\d+)\.(\d+)(\.\d+)?/, '\1.\2.0')
82+
ruby_version_y = proj.ruby_version.gsub(/(\d+)\.(\d+)(\.\d+)?/, '\1.\2')
83+
ruby_version_x = proj.ruby_version.gsub(/(\d+)\.(\d+)(\.\d+)?/, '\1')
8484

8585
proj.setting(:gem_home, File.join(proj.libdir, 'ruby', 'gems', ruby_base_version))
8686
proj.setting(:ruby_vendordir, File.join(proj.libdir, "ruby", "vendor_ruby"))

configs/projects/bolt-runtime.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
proj.setting(:host_gem, File.join(proj.ruby_bindir, "gem"))
6464
end
6565

66-
ruby_base_version = proj.ruby_version.gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2.0')
66+
ruby_base_version = proj.ruby_version.gsub(/(\d+)\.(\d+)(\.\d+)?/, '\1.\2.0')
6767
proj.setting(:gem_home, File.join(proj.libdir, 'ruby', 'gems', ruby_base_version))
6868
proj.setting(:gem_install, "#{proj.host_gem} install --no-document --local --bindir=#{proj.ruby_bindir}")
6969

0 commit comments

Comments
 (0)