Skip to content

Commit

Permalink
Add new patch infra. (#1239)
Browse files Browse the repository at this point in the history
* Add new patch infra. See #1208 and #1238

* add patches to CODEOWNERS

* revert CODEOWNERS addition
  • Loading branch information
mceachen authored Aug 29, 2024
1 parent 7896456 commit f396b5b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions deps/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 15 additions & 0 deletions deps/patches/1208.patch
Original file line number Diff line number Diff line change
@@ -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 },
};

/*

0 comments on commit f396b5b

Please sign in to comment.