aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/patch.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-09-24 20:48:03 +0100
committerMike McQuaid2016-09-24 20:48:03 +0100
commite767fd3df9d179fca0445cc0bc0fdc061ad857d6 (patch)
tree93e9db33313b36eebe7d7fb3aedf0f92cc2c3918 /Library/Homebrew/patch.rb
parent7fc241765e3654718235791c32e5638bf7f8e15a (diff)
parent232078df57418004bb9bf7abef877e734fcf7005 (diff)
downloadbrew-e767fd3df9d179fca0445cc0bc0fdc061ad857d6.tar.bz2
Merge branch 'master' into mkdir_with_intermediates
Diffstat (limited to 'Library/Homebrew/patch.rb')
-rw-r--r--Library/Homebrew/patch.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb
index 1148389cf..1b7751ba3 100644
--- a/Library/Homebrew/patch.rb
+++ b/Library/Homebrew/patch.rb
@@ -89,7 +89,7 @@ class DATAPatch < EmbeddedPatch
path.open("rb") do |f|
begin
line = f.gets
- end until line.nil? || /^__END__$/ === line
+ end until line.nil? || line =~ /^__END__$/
data << line while line = f.gets
end
data
@@ -130,14 +130,13 @@ class ExternalPatch
patch_dir = Pathname.pwd
if patch_files.empty?
children = patch_dir.children
- if children.length == 1 && children.first.file?
- patch_files << children.first.basename
- else
+ if children.length != 1 || !children.first.file?
raise MissingApplyError, <<-EOS.undent
There should be exactly one patch file in the staging directory unless
the "apply" method was used one or more times in the patch-do block.
EOS
end
+ patch_files << children.first.basename
end
dir.cd do
patch_files.each do |patch_file|