aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-12-31 21:44:42 +0100
committerMarkus Reiter2017-01-02 12:15:54 +0100
commit2c6516ef59747ae8af91922d289c5ba1f3160ad2 (patch)
tree2953f8d0b5692fae8476af43d1ae8450154dfcfd /Library
parente84e4b5566ac9211481af2ab7c74cd7ad617d958 (diff)
downloadbrew-2c6516ef59747ae8af91922d289c5ba1f3160ad2.tar.bz2
Disallow file separator in version strings.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/audit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/audit.rb b/Library/Homebrew/cask/lib/hbc/audit.rb
index ab2f1bce5..955ecdbb0 100644
--- a/Library/Homebrew/cask/lib/hbc/audit.rb
+++ b/Library/Homebrew/cask/lib/hbc/audit.rb
@@ -60,6 +60,7 @@ module Hbc
def check_version
return unless cask.version
check_no_string_version_latest
+ check_no_file_separator_in_version
end
def check_no_string_version_latest
@@ -68,6 +69,13 @@ module Hbc
add_error "you should use version :latest instead of version 'latest'"
end
+ def check_no_file_separator_in_version
+ odebug "Verifying version does not contain '#{File::SEPARATOR}'"
+ return unless cask.version.raw_version.is_a?(String)
+ return unless cask.version.raw_version.include?(File::SEPARATOR)
+ add_error "version should not contain '#{File::SEPARATOR}'"
+ end
+
def check_sha256
return unless cask.sha256
check_sha256_no_check_if_latest