From a59672abc9002e302af1ab64285d276534c2e908 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Fri, 27 Jul 2018 11:24:01 +0200 Subject: [PATCH] Handle non-git patches Detecting $striplevel relies on a git-specific line, so it is now made to not depend on a git-specific match that is reliably present in all patch formats. Fixes #1159 --- bin/ruby-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ruby-build b/bin/ruby-build index 0a3272ddb9..5a348052bc 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -1151,7 +1151,7 @@ apply_ruby_patch() { cat "${2:--}" >"$patchfile" local striplevel=0 - grep -q '^diff --git a/' "$patchfile" && striplevel=1 + grep -q '^--- a/' "$patchfile" && striplevel=1 patch -p$striplevel --force -i "$patchfile" ;; esac