From 7f8a0e4bc1e94db325cd0348c92c6005b6fd84cf Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Tue, 16 Jul 2019 22:43:31 -0500 Subject: Add functions to safely apply patches to non-git sources project_sources_patch() is the equivalent to git_patch() when working with non-git sources. It should not be used with sources under a version control system. --- libs/common | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/common') diff --git a/libs/common b/libs/common index 06b411e1..b1091e4f 100755 --- a/libs/common +++ b/libs/common @@ -117,6 +117,13 @@ diff_patch() { patch -fd "$sources_path" -r - < "$patch_path" } +diff_patch_check() { + local sources_path=$1 + local patch_path=$2 + + patch -sfd "$sources_path" --dry-run < "$patch_path" > /dev/null 2>&1 +} + path_wildcard_expand() { local path=$@ -- cgit v1.2.3-70-g09d2