From f396b5b60e7ee00ef5631bd3c79479fdf66e895e Mon Sep 17 00:00:00 2001 From: Matthew McEachen Date: Thu, 29 Aug 2024 14:56:34 -0700 Subject: [PATCH] Add new patch infra. (#1239) * Add new patch infra. See #1208 and #1238 * add patches to CODEOWNERS * revert CODEOWNERS addition --- deps/download.sh | 9 +++++++++ deps/patches/1208.patch | 15 +++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 deps/patches/1208.patch diff --git a/deps/download.sh b/deps/download.sh index 743c7da0..78c5d427 100755 --- a/deps/download.sh +++ b/deps/download.sh @@ -88,6 +88,15 @@ make sqlite3.c > /dev/null || exit 1 echo "copying amalgamation..." cp sqlite3.c sqlite3.h sqlite3ext.h "$OUTPUT/" || exit 1 +echo "applying patches..." +cd "$DEPS" || exit 1 +for patch in patches/*.patch; do + # If a patch fails, just skip it an move on. + # By default `patch` tries to be clever and reverse the patch, so we have to specify `--forward`. + # If the patch fails, we # don't write .orig and .rej files, so we have to specify `--no-backup-if-mismatch` and `--reject-file=-`. + patch --batch --forward --no-backup-if-mismatch --reject-file=- -p2 < "$patch" +done + echo "updating gyp configs..." GYP="$DEPS/defines.gypi" printf "# THIS FILE IS AUTOMATICALLY GENERATED BY deps/download.sh (DO NOT EDIT)\n\n{\n 'defines': [\n" > "$GYP" diff --git a/deps/patches/1208.patch b/deps/patches/1208.patch new file mode 100644 index 00000000..08d88ca5 --- /dev/null +++ b/deps/patches/1208.patch @@ -0,0 +1,15 @@ +diff --git a/deps/sqlite3/sqlite3.c b/deps/sqlite3/sqlite3.c +index b1a807f..38bd1e6 100644 +--- a/deps/sqlite3/sqlite3.c ++++ b/deps/sqlite3/sqlite3.c +@@ -24887,8 +24887,8 @@ static const struct { + /* 1 */ { 6, "minute", 7.7379e+12, 60.0 }, + /* 2 */ { 4, "hour", 1.2897e+11, 3600.0 }, + /* 3 */ { 3, "day", 5373485.0, 86400.0 }, +- /* 4 */ { 5, "month", 176546.0, 30.0*86400.0 }, +- /* 5 */ { 4, "year", 14713.0, 365.0*86400.0 }, ++ /* 4 */ { 5, "month", 176546.0, 2592000.0 }, ++ /* 5 */ { 4, "year", 14713.0, 31536000.0 }, + }; + + /*