mirror of
https://github.com/NixOS/nix.git
synced 2025-11-27 04:30:59 +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:
parent
341b2de643
commit
bcc3862331
7 changed files with 38 additions and 8 deletions
21
configure.ac
21
configure.ac
|
|
@ -16,7 +16,7 @@ if test "$STABLE" != "1"; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED(NIX_VERSION, ["$VERSION"], [version])
|
AC_DEFINE_UNQUOTED(NIX_VERSION, ["$VERSION"], [Nix version.])
|
||||||
|
|
||||||
AC_PREFIX_DEFAULT(/nix)
|
AC_PREFIX_DEFAULT(/nix)
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ case $sys_name in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AC_ARG_WITH(system, AC_HELP_STRING([--with-system=SYSTEM],
|
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}")
|
system=$withval, system="${machine_name}-${sys_name}")
|
||||||
AC_MSG_RESULT($system)
|
AC_MSG_RESULT($system)
|
||||||
AC_SUBST(system)
|
AC_SUBST(system)
|
||||||
|
|
@ -94,7 +94,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
static char buf[1024];]],
|
static char buf[1024];]],
|
||||||
[[cerr.rdbuf()->pubsetbuf(buf, sizeof(buf));]])],
|
[[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_MSG_RESULT(no))
|
||||||
AC_LANG_POP(C++)
|
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')
|
storedir=$withval, storedir='${prefix}/store')
|
||||||
AC_SUBST(storedir)
|
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],
|
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=)
|
bdb=$withval, bdb=)
|
||||||
AM_CONDITIONAL(HAVE_BDB, test -n "$bdb")
|
AM_CONDITIONAL(HAVE_BDB, test -n "$bdb")
|
||||||
if test -z "$bdb"; then
|
if test -z "$bdb"; then
|
||||||
|
|
@ -187,6 +192,12 @@ else
|
||||||
bdb_lib="-L$bdb/lib -ldb_cxx"
|
bdb_lib="-L$bdb/lib -ldb_cxx"
|
||||||
bdb_include="-I$bdb/include"
|
bdb_include="-I$bdb/include"
|
||||||
fi
|
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_lib)
|
||||||
AC_SUBST(bdb_include)
|
AC_SUBST(bdb_include)
|
||||||
|
|
||||||
|
|
@ -215,7 +226,7 @@ if test -n "$openssl"; then
|
||||||
LDFLAGS="-L$openssl/lib -lcrypto $LDFLAGS"
|
LDFLAGS="-L$openssl/lib -lcrypto $LDFLAGS"
|
||||||
CFLAGS="-I$openssl/include $CFLAGS"
|
CFLAGS="-I$openssl/include $CFLAGS"
|
||||||
CXXFLAGS="-I$openssl/include $CXXFLAGS"
|
CXXFLAGS="-I$openssl/include $CXXFLAGS"
|
||||||
AC_DEFINE(HAVE_OPENSSL, 1, [whether to use OpenSSL])
|
AC_DEFINE(HAVE_OPENSSL, 1, [Whether to use OpenSSL.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2=PATH],
|
AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2=PATH],
|
||||||
|
|
|
||||||
8
externals/Makefile.am
vendored
8
externals/Makefile.am
vendored
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
DB = db-4.5.20
|
DB = db-4.5.20
|
||||||
|
|
||||||
|
if OLD_DB_COMPAT
|
||||||
|
|
||||||
$(DB).tar.gz:
|
$(DB).tar.gz:
|
||||||
@echo "Nix requires Berkeley DB to build."
|
@echo "Nix requires Berkeley DB to build."
|
||||||
@echo "Please download version 4.5.20 from"
|
@echo "Please download version 4.5.20 from"
|
||||||
|
|
@ -32,6 +34,12 @@ build-db: have-db
|
||||||
touch build-db
|
touch build-db
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
build-db:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
# CWI ATerm
|
# CWI ATerm
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifdef OLD_DB_COMPAT
|
||||||
|
|
||||||
#include "db.hh"
|
#include "db.hh"
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
#include "pathlocks.hh"
|
#include "pathlocks.hh"
|
||||||
|
|
@ -466,3 +470,5 @@ void Database::clearTable(const Transaction & txn, TableId table)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ Hash parseHashField(const Path & path, const string & s);
|
||||||
meta-information in files. */
|
meta-information in files. */
|
||||||
void LocalStore::upgradeStore12()
|
void LocalStore::upgradeStore12()
|
||||||
{
|
{
|
||||||
|
#if OLD_DB_COMPAT
|
||||||
|
|
||||||
if (!lockFile(globalLock, ltWrite, false)) {
|
if (!lockFile(globalLock, ltWrite, false)) {
|
||||||
printMsg(lvlError, "waiting for exclusive access to the Nix store...");
|
printMsg(lvlError, "waiting for exclusive access to the Nix store...");
|
||||||
lockFile(globalLock, ltWrite, true);
|
lockFile(globalLock, ltWrite, true);
|
||||||
|
|
@ -88,6 +90,12 @@ void LocalStore::upgradeStore12()
|
||||||
writeFile(schemaPath, (format("%1%") % nixSchemaVersion).str());
|
writeFile(schemaPath, (format("%1%") % nixSchemaVersion).str());
|
||||||
|
|
||||||
lockFile(globalLock, ltRead, true);
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
#include "common-opts.hh"
|
#include "common-opts.hh"
|
||||||
#include "xml-writer.hh"
|
#include "xml-writer.hh"
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "db.hh"
|
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#include "dotgraph.hh"
|
#include "dotgraph.hh"
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "db.hh"
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
#include "shared.hh"
|
#include "shared.hh"
|
||||||
#include "dotgraph.hh"
|
#include "dotgraph.hh"
|
||||||
#include "local-store.hh"
|
#include "local-store.hh"
|
||||||
#include "db.hh"
|
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
#include "help.txt.hh"
|
#include "help.txt.hh"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue