Created
April 12, 2024 10:17
-
-
Save harieamjari/f45e8e7652267b11cd2c4ad55c22b7cb to your computer and use it in GitHub Desktop.
generate individual patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set -e | |
#usage old_directory new_directory | |
modfiles=$(find ${2} -type f -exec grep -Iq . {} \; -print) | |
#origfiles=${modfiles//$2/$1} | |
rm patchfiles -rf | |
mkdir patchfiles | |
echo $modfiles | |
for file in $modfiles; do | |
pfile=patchfiles/$(echo $file | sed -e's@'${2}'/@@' -e 's@/@.@g').patch; | |
echo $pfile ; | |
( | |
echo "diff -uNr ${file//$2/$1} $file" | |
diff -uNr ${file//$2/$1} $file | |
) | tee $pfile | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment