Commit ea2ddf44 authored by Julien Muchembled's avatar Julien Muchembled

NEO: add a helper script to easily open a sqlite3 DB with cksumvfs enabled

parent 94b3d67e
......@@ -20,6 +20,11 @@ configure-options =
--with-readline-inc=-I${readline:location}/include
post-install =
gcc -I%(location)s/include -fPIC -shared ext/misc/cksumvfs.c -o %(location)s/lib/cksumvfs.so
set %(location)s/bin/sqlite3-cksumvfs
cat <<TEMPLATE >$1
%(cksumvfs)s
TEMPLATE
chmod +x $1
# Increase MAX_VARIABLE_NUMBER like many os. For example:
# https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/sqlite
# NEO needs SQLITE_ENABLE_UPDATE_DELETE_LIMIT to drop partitions.
......@@ -27,3 +32,18 @@ environment =
CPPFLAGS=-I${zlib:location}/include -DSQLITE_MAX_VARIABLE_NUMBER=250000 -DSQLITE_ENABLE_RTREE=1
LDFLAGS=-Wl,-rpath=@@LOCATION@@/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
PATH=${tcl:location}/bin:${xz-utils:location}/bin:%(PATH)s
cksumvfs =
#!/bin/sh -e
if [ \$# = 0 ]; then
x=
else
[ "\$${1%%-*}" ]; [ -f "\$1" ] # options not supported
x=".open \\"\$(printf %s "\$1" |sed 's/[\\\\"]/\\\\\\0/g')\\""
shift
fi
y=/proc/self/fd/3
[ ! -e \$y ]
exec @@LOCATION@@/bin/sqlite3 -init \$y '' "\$@" 3<<EOF
.load cksumvfs.so
\$x
EOF
......@@ -30,7 +30,7 @@ md5sum = 9f27195d770b2f57461c60a82c851ab9
[instance-neo]
filename = instance-neo.cfg.in
md5sum = d8a62f4a2b68fe97146871d07a500443
md5sum = 14322bc623dd84b27f3c0a4bf75bec3f
[template-neo-my-cnf]
filename = my.cnf.in
......
......@@ -88,6 +88,12 @@ command = mysql
{% endif -%}
{% set query_string = urllib.urlencode(extra_dict) -%}
[{{ section('sqlite3-cksumvfs') }}]
recipe = slapos.recipe.build
location = ${directory:bin}/sqlite3
source = {{sqlite3_location}}/bin/${:_buildout_section_name_}
install = import os; os.symlink(options['source'], location)
{% else -%}
{% do assert(not storage_count) -%}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment