aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-03 16:54:40 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-03 16:59:28 -0400
commit7586095504f238a35937426aa870cb6d2a7b2862 (patch)
tree4cc694fe23f94365523454305e88c91ba5e0215b /src
parenta562d544d8520a0f113ad1a348e28ea00f27b693 (diff)
Remove bin2c
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/bin2c/Makefile.am6
-rw-r--r--src/bin2c/bin2c.c23
-rw-r--r--src/libstore/Makefile.am2
-rw-r--r--src/libstore/local-store.cc2
5 files changed, 4 insertions, 31 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index ec3632773..25ae67996 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = bin2c boost libutil libstore libmain nix-store nix-hash \
+SUBDIRS = boost libutil libstore libmain nix-store nix-hash \
libexpr nix-instantiate nix-env nix-worker nix-setuid-helper \
nix-log2xml bsdiff-4.3
diff --git a/src/bin2c/Makefile.am b/src/bin2c/Makefile.am
deleted file mode 100644
index bba3c3e3a..000000000
--- a/src/bin2c/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-noinst_PROGRAMS = bin2c
-
-bin2c_SOURCES = bin2c.c
-
-bin2c$(EXEEXT): bin2c.c
- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o bin2c bin2c.c
diff --git a/src/bin2c/bin2c.c b/src/bin2c/bin2c.c
deleted file mode 100644
index 5ed8a5708..000000000
--- a/src/bin2c/bin2c.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-void print(const char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- if (vprintf(format, ap) < 0) abort();
- va_end(ap);
-}
-
-int main(int argc, char * * argv)
-{
- int c;
- if (argc != 2) abort();
- print("static unsigned char %s[] = { ", argv[1]);
- while ((c = getchar()) != EOF) {
- print("0x%02x, ", (unsigned char) c);
- }
- print("0 };\n");
- return 0;
-}
diff --git a/src/libstore/Makefile.am b/src/libstore/Makefile.am
index 335655797..cb522d6bf 100644
--- a/src/libstore/Makefile.am
+++ b/src/libstore/Makefile.am
@@ -29,4 +29,4 @@ AM_CXXFLAGS = -Wall \
local-store.lo: schema.sql.hh
%.sql.hh: %.sql
- ../bin2c/bin2c schema < $< > $@ || (rm $@ && exit 1)
+ sed -e 's/"/\\"/g' -e 's/.*/"\0\\n"/' < $< > $@ || (rm $@ && exit 1)
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 982644af7..251449089 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -374,7 +374,9 @@ void LocalStore::openDB(bool create)
/* Initialise the database schema, if necessary. */
if (create) {
+ const char * schema =
#include "schema.sql.hh"
+ ;
if (sqlite3_exec(db, (const char *) schema, 0, 0, 0) != SQLITE_OK)
throwSQLiteError(db, "initialising database schema");
}