Skip to content

Commit

Permalink
Refactor innostore backend module to use new backend API.
Browse files Browse the repository at this point in the history
Fixes: az710

This change will bring the innostore backend into sync with the rest
of the backends with regard to the API including support for
asynchronous folds and the delete/4 function.

Additionally, the test suite has been replaced with a suite of tests
that are similar to those used by the other backends.
  • Loading branch information
kellymclaughlin committed Sep 20, 2011
1 parent 7041710 commit 9311415
Show file tree
Hide file tree
Showing 4 changed files with 583 additions and 237 deletions.
49 changes: 39 additions & 10 deletions Makefile
@@ -1,25 +1,54 @@
INNOSTORE_TAG = $(shell hg identify -t) INNOSTORE_TAG = $(shell git describe --tags)


all: # Innostore only works with the SMP runtime, force it on uniprocessors .PHONY: rel deps package pkgclean
ERL_FLAGS="-smp enable" ./rebar compile eunit verbose=1


clean: distclean all: deps compile test

compile:
./rebar compile

clean:
./rebar clean ./rebar clean


test:
./rebar eunit

install: install:
./rebar install ./rebar install


# Release tarball creation
# Generates a tarball that includes all the deps sources so no checkouts are necessary
archivegit = git archive --format=tar --prefix=$(1)/ HEAD | (cd $(2) && tar xf -)
archivehg = hg archive $(2)/$(1)
archive = if [ -d ".git" ]; then \
$(call archivegit,$(1),$(2)); \
else \
$(call archivehg,$(1),$(2)); \
fi

buildtar = mkdir distdir && \
git clone . distdir/$(REPO)-clone && \
cd distdir/$(REPO)-clone && \
git checkout $(INNOSTORE_TAG) && \
$(call archive,$(INNOSTORE_TAG),..) && \
mkdir ../$(INNOSTORE_TAG)/deps && \
make deps; \
for dep in deps/*; do cd $${dep} && $(call archive,$${dep},../../../$(INNOSTORE_TAG)); cd ../..; done

distdir: distdir:
$(if $(findstring tip,$(INNOSTORE_TAG)),$(error "You can't generate a release tarball from tip")) $(if $(INNOSTORE_TAG), $(call buildtar), $(error "You can't generate a release tarball from a non-tagged revision. Run 'git checkout <tag>', then 'make dist'"))
mkdir distdir
hg clone -u $(INNOSTORE_TAG) . distdir/innostore-clone
cd distdir/innostore-clone; \
hg archive ../$(INNOSTORE_TAG)


dist $(INNOSTORE_TAG).tar.gz: distdir dist $(INNOSTORE_TAG).tar.gz: distdir
cd distdir; \ cd distdir; \
tar czf ../$(INNOSTORE_TAG).tar.gz $(INNOSTORE_TAG) tar czf ../$(INNOSTORE_TAG).tar.gz $(INNOSTORE_TAG)


distclean: ballclean:
rm -rf $(INNOSTORE_TAG).tar.gz distdir rm -rf $(INNOSTORE_TAG).tar.gz distdir


package: dist
$(MAKE) -C package package

pkgclean:
$(MAKE) -C package pkgclean

export INNOSTORE_TAG PKG_VERSION REPO REVISION
Binary file modified rebar
Binary file not shown.
9 changes: 6 additions & 3 deletions rebar.config
@@ -1,3 +1,7 @@
{so_name, "innostore_drv.so"}.
{erl_opts, [debug_info, warnings_as_errors]}.
{deps, []}.

{port_envs, [ {port_envs, [
{"DRV_CFLAGS", "$DRV_CFLAGS -Werror -I c_src/innodb/include"}, {"DRV_CFLAGS", "$DRV_CFLAGS -Werror -I c_src/innodb/include"},
{"DRV_LDFLAGS", "$DRV_LDFLAGS c_src/innodb/lib/libinnodb.a"}, {"DRV_LDFLAGS", "$DRV_LDFLAGS c_src/innodb/lib/libinnodb.a"},
Expand All @@ -15,9 +19,8 @@
{"darwin10.*-32$", "LDFLAGS", "-arch i386"} {"darwin10.*-32$", "LDFLAGS", "-arch i386"}
]}. ]}.


{port_pre_script, {"c_src/build_deps.sh", {pre_hooks, [{compile, "c_src/build_deps.sh"}]}.
"c_src/innodb/lib/libinnodb.a"}}.


{port_cleanup_script, "c_src/build_deps.sh clean"}. {post_hooks, [{clean, "c_src/build_deps.sh clean"}]}.


{cover_enabled, true}. {cover_enabled, true}.

0 comments on commit 9311415

Please sign in to comment.