aboutsummaryrefslogtreecommitdiff
path: root/libs/common
diff options
context:
space:
mode:
authorSwift Geek <swiftgeek@gmail.com>2019-03-19 02:35:51 +0000
committerGogs <gogitservice@gmail.com>2019-03-19 02:35:51 +0000
commit834ad955ad7407b842546422c711034fe0c4ace2 (patch)
tree397ec0c98fa814f8105c1038dac2a984337ab4cc /libs/common
parent8d50c4b231ebc02f0f1b9586097a9e9a22cf906f (diff)
parent4a493108d1aefe3151096c3b22234d0c8cf893d9 (diff)
downloadlibrebootfr-834ad955ad7407b842546422c711034fe0c4ace2.tar.gz
librebootfr-834ad955ad7407b842546422c711034fe0c4ace2.zip
Merge branch 'patch' of and_who/libreboot into master
Diffstat (limited to 'libs/common')
-rwxr-xr-xlibs/common19
1 files changed, 4 insertions, 15 deletions
diff --git a/libs/common b/libs/common
index a27ff785..06b411e1 100755
--- a/libs/common
+++ b/libs/common
@@ -110,22 +110,11 @@ download_wrapper() {
fi
}
-diff_patch_file() {
- local repository_path="$1"
- local patch_file_path="$2"
+diff_patch() {
+ local sources_path=$1
+ local patch_path=$2
- # TODO: Improve handling of filenames to avoid gotchas w/ \n, \t, etc.
- local filename_in_diff="$(sed -rne 's/^-{3}\s+([^ \r\n]*).*/\1/p' "$patch_file_path")"
-
- local source_file_path
-
- if ! ( grep -E '^-{3}.*/' "$patch_file_path" >/dev/null 2>&1 ); then
- source_file_path="$repository_path/$filename_in_diff"
- else
- source_file_path="$repository_path/${filename_in_diff##*/}"
- fi
-
- patch "$source_file_path" "$patch_file_path"
+ patch -fd "$sources_path" -r - < "$patch_path"
}
path_wildcard_expand() {