diff options
| author | Xu Cheng | 2016-07-13 16:19:51 +0800 |
|---|---|---|
| committer | Xu Cheng | 2016-07-13 19:11:46 +0800 |
| commit | de1049f1f1237a31f8ac6a0b9b31ebdbc78030d4 (patch) | |
| tree | 855fef004b1f4daa618bb922a446bf1e2e183352 /Library/Homebrew | |
| parent | 91fb49d270f0837e851b3e6e6b0f53848f024f6c (diff) | |
| download | brew-de1049f1f1237a31f8ac6a0b9b31ebdbc78030d4.tar.bz2 | |
various: proper escape dot in regex
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/pull.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/dev-cmd/boneyard-formula-pr.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/dev-cmd/bump-formula-pr.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/mac/development_tools.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/mac/formula_cellar_checks.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/sdk.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/version.rb | 4 |
8 files changed, 11 insertions, 11 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index d5ba7df2d..d0b7614e9 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -503,7 +503,7 @@ class FormulaAuditor when %r{^http://[^/]*\.apache\.org}, %r{^http://packages\.debian\.org}, %r{^http://wiki\.freedesktop\.org/}, - %r{^http://((?:www)\.)?gnupg.org/}, + %r{^http://((?:www)\.)?gnupg\.org/}, %r{^http://ietf\.org}, %r{^http://[^/.]+\.ietf\.org}, %r{^http://[^/.]+\.tools\.ietf\.org}, @@ -531,7 +531,7 @@ class FormulaAuditor def audit_github_repository return unless @online - regex = %r{https?://github.com/([^/]+)/([^/]+)/?.*} + regex = %r{https?://github\.com/([^/]+)/([^/]+)/?.*} _, user, repo = *regex.match(formula.stable.url) if formula.stable _, user, repo = *regex.match(formula.homepage) unless user return if !user || !repo diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb index c3d8d1e8f..3b3c68930 100644 --- a/Library/Homebrew/cmd/pull.rb +++ b/Library/Homebrew/cmd/pull.rb @@ -51,7 +51,7 @@ module Homebrew issue = arg url = "https://github.com/Homebrew/homebrew-core/pull/#{arg}" tap = CoreTap.instance - elsif (testing_match = arg.match %r{brew.sh/job/Homebrew.*Testing/(\d+)/}) + elsif (testing_match = arg.match %r{brew\.sh/job/Homebrew.*Testing/(\d+)/}) _, testing_job = *testing_match url = "https://github.com/Homebrew/homebrew-core/compare/master...BrewTestBot:testing-#{testing_job}" tap = CoreTap.instance diff --git a/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb b/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb index c55795619..b478be609 100644 --- a/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb @@ -90,7 +90,7 @@ module Homebrew unless local_only safe_system "hub", "fork", "--no-remote" quiet_system "hub", "fork" - remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists./, 1] + remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists\./, 1] odie "cannot get remote from 'hub'!" unless remote safe_system "git", "push", remote, "#{branch}:#{branch}" pr_message = <<-EOS.undent @@ -134,7 +134,7 @@ module Homebrew unless local_only safe_system "hub", "fork", "--no-remote" quiet_system "hub", "fork" - remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists./, 1] + remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists\./, 1] odie "cannot get remote from 'hub'!" unless remote safe_system "git", "push", remote, "#{branch}:#{branch}" safe_system "hub", "pull-request", "--browse", "-m", <<-EOS.undent diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 10df65860..905169673 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -148,7 +148,7 @@ module Homebrew "--", formula.path safe_system "hub", "fork", "--no-remote" quiet_system "hub", "fork" - remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists./, 1] + remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists\./, 1] odie "cannot get remote from 'hub'!" if remote.to_s.empty? safe_system "git", "push", remote, "#{branch}:#{branch}" safe_system "hub", "pull-request", "--browse", "-m", diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb index 1afab513b..d572bf28e 100644 --- a/Library/Homebrew/extend/os/mac/development_tools.rb +++ b/Library/Homebrew/extend/os/mac/development_tools.rb @@ -26,7 +26,7 @@ class DevelopmentTools case default_cc # if GCC 4.2 is installed, e.g. via Tigerbrew, prefer it # over the system's GCC 4.0 - when /^gcc-4.0/ then gcc_42_build_version ? :gcc : :gcc_4_0 + when /^gcc-4\.0/ then gcc_42_build_version ? :gcc : :gcc_4_0 when /^gcc/ then :gcc when "clang" then :clang else diff --git a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb index b460aca86..cc0372eb1 100644 --- a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb +++ b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb @@ -27,7 +27,7 @@ module FormulaCellarChecks keg = Keg.new(formula.prefix) system_openssl = keg.mach_o_files.select do |obj| dlls = obj.dynamically_linked_libraries - dlls.any? { |dll| %r{/usr/lib/lib(crypto|ssl).(\d\.)*dylib}.match dll } + dlls.any? { |dll| %r{/usr/lib/lib(crypto|ssl)\.(\d\.)*dylib}.match dll } end return if system_openssl.empty? diff --git a/Library/Homebrew/os/mac/sdk.rb b/Library/Homebrew/os/mac/sdk.rb index 85cf8c5a7..bb943bb34 100644 --- a/Library/Homebrew/os/mac/sdk.rb +++ b/Library/Homebrew/os/mac/sdk.rb @@ -46,7 +46,7 @@ module OS paths = {} Dir[File.join(sdk_prefix, "MacOSX*.sdk")].each do |sdk_path| - version = sdk_path[/MacOSX(\d+\.\d+)u?.sdk$/, 1] + version = sdk_path[/MacOSX(\d+\.\d+)u?\.sdk$/, 1] paths[version] = sdk_path unless version.nil? end diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 81abbc324..02f442f5d 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -279,7 +279,7 @@ class Version stem = if spec.directory? spec.basename.to_s - elsif %r{((?:sourceforge.net|sf.net)/.*)/download$}.match(spec_s) + elsif %r{((?:sourceforge\.net|sf\.net)/.*)/download$}.match(spec_s) Pathname.new(spec.dirname).stem else spec.stem @@ -290,7 +290,7 @@ class Version # e.g. https://github.com/sam-github/libnet/tarball/libnet-1.1.4 # e.g. https://github.com/isaacs/npm/tarball/v0.2.5-1 # e.g. https://github.com/petdance/ack/tarball/1.93_02 - m = %r{github.com/.+/(?:zip|tar)ball/(?:v|\w+-)?((?:\d+[-._])+\d*)$}.match(spec_s) + m = %r{github\.com/.+/(?:zip|tar)ball/(?:v|\w+-)?((?:\d+[-._])+\d*)$}.match(spec_s) return m.captures.first unless m.nil? # e.g. https://github.com/erlang/otp/tarball/OTP_R15B01 (erlang style) |
