diff --git a/lib/compilation.sh b/lib/compilation.sh index 15f7a5702..2afc930a9 100644 --- a/lib/compilation.sh +++ b/lib/compilation.sh @@ -688,6 +688,9 @@ process_patch_file() local patch=$1 local status=$2 + # detect and remove files which patch will create + lsdiff -s --strip=1 $patch | grep '^+' | awk '{print $2}' | xargs -I % sh -c 'rm -f %' + echo "Processing file $patch" >> $DEST/debug/patching.log patch --batch --silent -p1 -N < $patch >> $DEST/debug/patching.log 2>&1