1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-25 11:49:35 +01:00

* Configure option --disable-old-db-compat to build without Berkeley

DB, which is only needed for converting old databases.
This commit is contained in:
Eelco Dolstra 2008-03-09 20:30:34 +00:00
parent 341b2de643
commit bcc3862331
7 changed files with 38 additions and 8 deletions

View file

@ -16,7 +16,7 @@ if test "$STABLE" != "1"; then
fi
fi
AC_DEFINE_UNQUOTED(NIX_VERSION, ["$VERSION"], [version])
AC_DEFINE_UNQUOTED(NIX_VERSION, ["$VERSION"], [Nix version.])
AC_PREFIX_DEFAULT(/nix)
@ -54,7 +54,7 @@ case $sys_name in
esac
AC_ARG_WITH(system, AC_HELP_STRING([--with-system=SYSTEM],
[platform identifier (e.g., `i686-linux')]),
[Platform identifier (e.g., `i686-linux').]),
system=$withval, system="${machine_name}-${sys_name}")
AC_MSG_RESULT($system)
AC_SUBST(system)
@ -94,7 +94,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
using namespace std;
static char buf[1024];]],
[[cerr.rdbuf()->pubsetbuf(buf, sizeof(buf));]])],
[AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PUBSETBUF, 1, [whether pubsetbuf is available])],
[AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PUBSETBUF, 1, [Whether pubsetbuf is available.])],
AC_MSG_RESULT(no))
AC_LANG_POP(C++)
@ -176,8 +176,13 @@ AC_ARG_WITH(store-dir, AC_HELP_STRING([--with-store-dir=PATH],
storedir=$withval, storedir='${prefix}/store')
AC_SUBST(storedir)
AC_ARG_ENABLE(old-db-compat, AC_HELP_STRING([--disable-old-db-compat],
[disable support for converting from old Berkeley DB-based Nix stores]),
old_db_compat=$enableval, old_db_compat=yes)
AM_CONDITIONAL(OLD_DB_COMPAT, test "$old_db_compat" = "yes")
AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb=PATH],
[prefix of Berkeley DB]),
[prefix of Berkeley DB (for Nix <= 0.11 compatibility)]),
bdb=$withval, bdb=)
AM_CONDITIONAL(HAVE_BDB, test -n "$bdb")
if test -z "$bdb"; then
@ -187,6 +192,12 @@ else
bdb_lib="-L$bdb/lib -ldb_cxx"
bdb_include="-I$bdb/include"
fi
if test "$old_db_compat" = "no"; then
bdb_lib=
bdb_include=
else
AC_DEFINE(OLD_DB_COMPAT, 1, [Whether to support converting from old Berkeley DB-based Nix stores.])]
fi
AC_SUBST(bdb_lib)
AC_SUBST(bdb_include)
@ -215,7 +226,7 @@ if test -n "$openssl"; then
LDFLAGS="-L$openssl/lib -lcrypto $LDFLAGS"
CFLAGS="-I$openssl/include $CFLAGS"
CXXFLAGS="-I$openssl/include $CXXFLAGS"
AC_DEFINE(HAVE_OPENSSL, 1, [whether to use OpenSSL])
AC_DEFINE(HAVE_OPENSSL, 1, [Whether to use OpenSSL.])
fi
AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2=PATH],

View file

@ -2,6 +2,8 @@
DB = db-4.5.20
if OLD_DB_COMPAT
$(DB).tar.gz:
@echo "Nix requires Berkeley DB to build."
@echo "Please download version 4.5.20 from"
@ -32,6 +34,12 @@ build-db: have-db
touch build-db
endif
else
build-db:
endif
# CWI ATerm

View file

@ -1,3 +1,7 @@
#include "config.h"
#ifdef OLD_DB_COMPAT
#include "db.hh"
#include "util.hh"
#include "pathlocks.hh"
@ -466,3 +470,5 @@ void Database::clearTable(const Transaction & txn, TableId table)
}
#endif

View file

@ -19,6 +19,8 @@ Hash parseHashField(const Path & path, const string & s);
meta-information in files. */
void LocalStore::upgradeStore12()
{
#if OLD_DB_COMPAT
if (!lockFile(globalLock, ltWrite, false)) {
printMsg(lvlError, "waiting for exclusive access to the Nix store...");
lockFile(globalLock, ltWrite, true);
@ -88,6 +90,12 @@ void LocalStore::upgradeStore12()
writeFile(schemaPath, (format("%1%") % nixSchemaVersion).str());
lockFile(globalLock, ltRead, true);
#else
throw Error(
"Your Nix store has a database in Berkeley DB format. To convert\n"
"to the new format, please compile Nix with Berkeley DB support.");
#endif
}

View file

@ -13,7 +13,6 @@
#include "common-opts.hh"
#include "xml-writer.hh"
#include "store-api.hh"
#include "db.hh"
#include "util.hh"
#include <cerrno>

View file

@ -1,7 +1,6 @@
#include "dotgraph.hh"
#include "util.hh"
#include "store-api.hh"
#include "db.hh"
#include <iostream>

View file

@ -7,7 +7,6 @@
#include "shared.hh"
#include "dotgraph.hh"
#include "local-store.hh"
#include "db.hh"
#include "util.hh"
#include "help.txt.hh"