From 814b256da43ebdad79fe9544a59f6ae680da7cb9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 6 Apr 2003 22:19:26 +0000 Subject: [PATCH] * Better installation: make directories, create database. * Fixed the register script. --- configure.ac | 3 ++- src/Makefile.am | 7 +++++++ test/register | 18 +++++++++--------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index e488ed78f..22e320a7c 100644 --- a/configure.ac +++ b/configure.ac @@ -10,5 +10,6 @@ AC_CANONICAL_HOST AC_PROG_CC AC_PROG_CXX -AC_CONFIG_FILES(Makefile src/Makefile src/nix-instantiate) +AC_CONFIG_FILES([Makefile src/Makefile]) +AC_CONFIG_FILES([src/nix-instantiate], [chmod +x src/nix-instantiate]) AC_OUTPUT \ No newline at end of file diff --git a/src/Makefile.am b/src/Makefile.am index 17d801fbf..e1db3c4eb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,3 +3,10 @@ bin_PROGRAMS = nix nix_SOURCES = nix.cc md5.c nix_CXXFLAGS = -DSYSTEM=\"@host@\" nix_LDADD = -ldb_cxx-4 -lATerm + +install-data-local: + $(INSTALL) -d $(localstatedir)/nix + $(INSTALL) -d $(localstatedir)/nix/descriptors + $(INSTALL) -d $(localstatedir)/nix/sources + $(INSTALL) -d $(prefix)/pkg + $(bindir)/nix init diff --git a/test/register b/test/register index e03296495..57fe5b6c0 100755 --- a/test/register +++ b/test/register @@ -1,19 +1,19 @@ #! /bin/sh -mkdir -p $NIX/db -mkdir -p $NIX/pkg -mkdir -p $NIX/descr -mkdir -p $NIX/netcache +if test -z "$NIX"; then NIX=/nix; fi -nix init +echo target $NIX -if ! nix-instantiate $NIX/descr $NIX/netcache tmpl/*.nix; then +if ! nix-instantiate $NIX/var/nix/descriptors $NIX/var/nix/sources tmpl/*.nix; then exit 1; fi -for i in $NIX/netcache/*; do nix regfile $i; done -for i in build/*; do nix regfile $i; done -for i in $NIX/descr/*; do +rm -f build/*~ +cp -p build/* $NIX/var/nix/sources + +for i in $NIX/var/nix/sources/*; do nix regfile $i; done + +for i in $NIX/var/nix/descriptors/*; do md5sum $i nix regfile $i done