Skip to content

Instantly share code, notes, and snippets.

@KushtrimPacaj
Last active July 26, 2019 13:49
Show Gist options
  • Save KushtrimPacaj/ca0eb67765af02e6433a288eeba2132c to your computer and use it in GitHub Desktop.
Save KushtrimPacaj/ca0eb67765af02e6433a288eeba2132c to your computer and use it in GitHub Desktop.
function generateAospPatchScript(){
echo ". build/envsetup.sh > /dev/null" > applyPatches.sh
find . -type f -name "*.patch" | sort -n | xargs -I '{}' sh -c '\
dName=$(dirname {}) ; \
rName=$(realpath {}) ; \
fName=$(basename $rName); \
echo "\n\
cd $dName\n\
echo \"Entering directory: \$PWD\"\n\
echo \"Applying $fName\"\n\
patch -p1 --no-backup-if-mismatch < $rName\n\
croot > /dev/null\n\
echo \"---------------------------------\"\n\n"' \; >> applyPatches.sh
chmod +x applyPatches.sh
}
@KushtrimPacaj
Copy link
Author

Run this in the root of the patches folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment