datatable.directory codebase https://datatable.directory/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
datatable.directory/patch_vendor.sh

15 lines
518 B

6 years ago
#!/usr/bin/env bash
find 'vendor_patches' -name '*.patch' | sort | while read f; do
# If we could reverse the patch, then it has already been applied; skip it
if patch --dry-run --reverse --force -p0 -N -i "$f" >/dev/null 2>&1; then
echo -e "\e[32m[i] Patch \"$f\" already applied - skipping.\e[m" >&2
else # patch not yet applied
echo -e "\e[33m[i] Applying patch \"$f\"...\e[m"
patch -p0 -N -i "$f" || echo -e "\e[31;1mPatch \"$f\" failed\e[m" >&2
fi
#patch -p0 -N -i "$f"
done;
echo "Patches applied."