From f296ec0346b655bbacdee5b0d96fefcb6bc439a9 Mon Sep 17 00:00:00 2001 From: Tad Date: Sat, 16 Oct 2021 13:51:54 -0400 Subject: [PATCH] Support refreshing patches Signed-off-by: Tad --- Scripts/Common/Functions.sh | 7 +++++++ Scripts/init.sh | 1 + 2 files changed, 8 insertions(+) diff --git a/Scripts/Common/Functions.sh b/Scripts/Common/Functions.sh index 28c8896b..04e78bdb 100644 --- a/Scripts/Common/Functions.sh +++ b/Scripts/Common/Functions.sh @@ -58,6 +58,13 @@ applyPatchReal() { firstLine=$(head -n1 "$currentWorkingPatch"); if [[ "$firstLine" = *"Mon Sep 17 00:00:00 2001"* ]] || [[ "$firstLine" = *"Thu Jan 1 00:00:00 1970"* ]]; then git am "$@"; + if [ "$?" -eq 0 ]; then + if [ "$DOS_REFRESH_PATCHES" = true ]; then + if [[ "$currentWorkingPatch" == $DOS_PATCHES* ]]; then + git format-patch -1 HEAD --zero-commit --output="$currentWorkingPatch"; + fi; + fi; + fi; else git apply "$@"; echo "Applying (as diff): $currentWorkingPatch"; diff --git a/Scripts/init.sh b/Scripts/init.sh index 02c1604b..04cf4b12 100644 --- a/Scripts/init.sh +++ b/Scripts/init.sh @@ -35,6 +35,7 @@ export CCACHE_COMPRESSLEVEL=1; #export DOS_TOR_WRAPPER="torsocks"; #Uncomment to perform select build operations over Tor export DOS_MALWARE_SCAN_ENABLED=true; #Set true to perform a fast scan on patchWorkspace() and a through scan on buildAll() export DOS_MALWARE_SCAN_SETTING="quick"; #buildAll() scan speed. Options: quick, extra, slow, full +export DOS_REFRESH_PATCHES=true; #Set true to refresh branch-specific patches on apply #Deblobber export DOS_DEBLOBBER_REMOVE_ACCESSORIES=true; #Set false to allow use of external accessories that depend on blobs