summaryrefslogtreecommitdiff
path: root/dist/s_sql_upgrade
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-02-17 17:25:57 +0000
committer <>2015-03-17 16:26:24 +0000
commit780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch)
tree598f8b9fa431b228d29897e798de4ac0c1d3d970 /dist/s_sql_upgrade
parent7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff)
downloadberkeleydb-master.tar.gz
Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz.HEADdb-6.1.23master
Diffstat (limited to 'dist/s_sql_upgrade')
-rwxr-xr-xdist/s_sql_upgrade35
1 files changed, 25 insertions, 10 deletions
diff --git a/dist/s_sql_upgrade b/dist/s_sql_upgrade
index 756abe9f..e515442c 100755
--- a/dist/s_sql_upgrade
+++ b/dist/s_sql_upgrade
@@ -19,6 +19,29 @@ copy_if_changes()
rm -f $f2
}
+# Check or recheck-and-apply each patch
+try_patches()
+{
+ doit=$1
+ for f in $sqldir/../adapter/sqlite-patches/[0-9][0-9]_*.patch ; do
+ msgs=$( patch -d $sqldir -p0 --dry-run --force < $f 2>&1 )
+ if test $? -ne 0 ; then
+ echo "Patch $f would fail:"
+ echo "$msgs" | sed -e 's/^/ /'
+ echo "Exiting."
+ exit 1
+ else
+ if test $doit = 1 ; then
+ echo "Applying patch $f"
+ patch -d $sqldir -p0 --force --quiet < $f
+ fi
+ fi
+ done
+}
+
+# echo "Testing patch files for the sqlite source tree."
+# try_patches 0
+
# Update the SQLite Makefile to refer to the replaced source files.
MAKEFILE_NAME=$sqldir/Makefile.in
for f in ../lang/sql/adapter/*.[ch]; do
@@ -27,7 +50,7 @@ for f in ../lang/sql/adapter/*.[ch]; do
copy_if_changes $MAKEFILE_NAME $MAKEFILE_NAME.tmp
done
# Update the include path so that headers in sql/adapter dir can be found.
-sed -e '/^TCC/s/-I\. -I${TOP}\/src/& -I${TOP}\/..\/adapter/' $MAKEFILE_NAME > $MAKEFILE_NAME.tmp
+sed -e '/^TCC/s/-I\. -I${TOP}\/src/& -I${TOP}\/..\/adapter -I${TOP}\/ext\/fts3/' $MAKEFILE_NAME > $MAKEFILE_NAME.tmp
copy_if_changes $MAKEFILE_NAME $MAKEFILE_NAME.tmp
# We will be building from a different directory level, update the makefile
@@ -36,15 +59,7 @@ sed -e 's/TOP = \.\.\/sqlite/TOP = \.\.\/\.\.\/sql\/sqlite/' $sqldir/Makefile.li
copy_if_changes $sqldir/Makefile.linux-gcc $sqldir/Makefile.linux-gcc.tmp
echo "Applying patch files to the sqlite source tree."
-for f in $sqldir/../adapter/sqlite-patches/[0-9][0-9]_*.patch ; do
- if (cd $sqldir && patch -p0 --dry-run --force --quiet) < $f > /dev/null; then
- echo "Applying patch $f"
- (cd $sqldir && patch -p0 --force --quiet) < $f
- else
- echo "Patch $f would fail. Exiting."
- exit 1
- fi
-done
+try_patches 1
# Remove files from the SQLite source tree that have been replaced by db.
( cd $sqldir/../adapter &&