mirror of
https://github.com/NixOS/nix.git
synced 2025-02-21 11:22:35 +00:00
fixed some hard links
This commit is contained in:
parent
53c907ca09
commit
05297240ea
@ -46,9 +46,15 @@ else
|
||||
init-state:
|
||||
endif
|
||||
|
||||
init-ext3cow-header-hack:
|
||||
@echo "Symlinking ext3cow header file into src"
|
||||
ln -sf $(ext3cowheader) src/libext3cow/
|
||||
|
||||
svn-revision:
|
||||
svnversion . > svn-revision
|
||||
|
||||
all: init-ext3cow-header-hack
|
||||
|
||||
all-local: NEWS
|
||||
|
||||
NEWS: doc/manual/NEWS.txt
|
||||
|
15
configure.ac
15
configure.ac
@ -169,11 +169,6 @@ AC_ARG_WITH(store-state-dir, AC_HELP_STRING([--with-store-state-dir=PATH],
|
||||
storestatedir=$withval, storestatedir='${prefix}/state')
|
||||
AC_SUBST(storestatedir)
|
||||
|
||||
AC_ARG_WITH(store-state-repos-dir, AC_HELP_STRING([--with-store-state-repos-dir=PATH],
|
||||
[path of the Nix state store repository]),
|
||||
storestatereposdir=$withval, storestatereposdir='${prefix}/staterepos')
|
||||
AC_SUBST(storestatereposdir)
|
||||
|
||||
AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb=PATH],
|
||||
[prefix of Berkeley DB]),
|
||||
bdb=$withval, bdb=)
|
||||
@ -188,11 +183,11 @@ fi
|
||||
AC_SUBST(bdb_lib)
|
||||
AC_SUBST(bdb_include)
|
||||
|
||||
NEED_PROG(svn, svn)
|
||||
AC_ARG_WITH(svn-bin, AC_HELP_STRING([--with-svn-bin=PATH],
|
||||
[path of svn, svnadmin]),
|
||||
subversion=$withval, subversion=$(dirname $svn))
|
||||
AC_SUBST(subversion)
|
||||
AC_ARG_WITH(ext3cow-header, AC_HELP_STRING([--with-ext3cow-header=PATH],
|
||||
[path of the header ext3cow header ext3cow_fs.h]),
|
||||
ext3cowheader=$withval, ext3cowheader=)
|
||||
AC_SUBST(ext3cowheader)
|
||||
AC_CHECK_HEADER(${ext3cowheader})
|
||||
|
||||
AC_ARG_WITH(aterm, AC_HELP_STRING([--with-aterm=PATH],
|
||||
[prefix of CWI ATerm library]),
|
||||
|
@ -13,7 +13,9 @@ mkdir "$out", 0755 || die "error creating $out";
|
||||
|
||||
my $symlinks = 0;
|
||||
my %path_identifier;
|
||||
my $srcDirSlashes = 3;
|
||||
|
||||
my $nixBinDir = $ENV{"nixBinDir"};
|
||||
my $nixStore = $ENV{"nixStore"};
|
||||
|
||||
# For each activated package, create symlinks.
|
||||
|
||||
@ -22,14 +24,9 @@ sub createLinks {
|
||||
|
||||
#Lookup each $stateIdentifiers in $path_identifier
|
||||
#we strip $srcDir to its rootdir e.g. /nix/store/......./
|
||||
my @srcDirParts = split /\// , $srcDir;
|
||||
my $srcDirRoot = "";
|
||||
my $srcDirCounter=1;
|
||||
while ($srcDirCounter <= $srcDirSlashes) {
|
||||
$srcDirRoot = $srcDirRoot . "/" . $srcDirParts[$srcDirCounter];
|
||||
$srcDirCounter++;
|
||||
}
|
||||
#print "srcDirRoot $srcDirRoot \n";
|
||||
my @srcDirParts = split /\// , substr($srcDir, length ($nixStore), length ($srcDir));
|
||||
my $srcDirRoot = $nixStore . "/" . $srcDirParts[1];
|
||||
# print "srcDirRoot $srcDirRoot \n";
|
||||
my $pkgStateIdentifier = $path_identifier{$srcDirRoot};
|
||||
|
||||
my $dstDir = shift;
|
||||
@ -118,7 +115,7 @@ sub createLinks {
|
||||
|
||||
sysopen (DSTFILEHANDLE, $new_dstFile, O_RDWR|O_EXCL|O_CREAT, 0755);
|
||||
printf DSTFILEHANDLE "#! @shell@ \n";
|
||||
printf DSTFILEHANDLE "/nixstate/nix/bin/nix-state --run --identifier=$new_stateIdentifier $srcFile \"\$@\" \n"; #TODO !!!!!!!!!! fix hard link
|
||||
printf DSTFILEHANDLE "$nixBinDir/nix-state --run --identifier=$new_stateIdentifier $srcFile \"\$@\" \n";
|
||||
close (DSTFILEHANDLE);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{system, derivations, stateIdentifiers, manifest}:
|
||||
{system, derivations, stateIdentifiers, manifest, nixBinDir, nixStore}:
|
||||
|
||||
derivation {
|
||||
name = "user-environment";
|
||||
@ -7,4 +7,5 @@ derivation {
|
||||
derivations = derivations;
|
||||
stateIdentifiers = stateIdentifiers;
|
||||
manifest = manifest;
|
||||
inherit nixBinDir nixStore;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ if [ "$1" = "full" ]; then
|
||||
nix-env-all-pkgs.sh -i docbook5-xsl
|
||||
nix-env-all-pkgs.sh -i bison
|
||||
nix-env-all-pkgs.sh -i gdb #optional for debugging
|
||||
nix-env-all-pkgs.sh -i e3cfsprogs
|
||||
fi
|
||||
|
||||
if [ "$1" = "full" ] || [ "$1" = "auto" ]; then
|
||||
@ -42,8 +43,8 @@ fi
|
||||
--with-docbook-xsl=/root/.nix-profile/xml/xsl/docbook \
|
||||
--prefix=$nixstatepath \
|
||||
--with-store-dir=/nix/store \
|
||||
--with-store-state-dir=/nix/state \
|
||||
--with-store-state-repos-dir=/nix/staterepos \
|
||||
--with-store-state-dir=/nix/state \
|
||||
--with-ext3cow-header=/nix/store/8nirllv1w6qv6c5srjgah2m82bfi1d6k-linux-2.6.21.5/lib/modules/2.6.21.5-default/build/include/linux/ext3cow_fs.h \
|
||||
--localstatedir=/nix/var
|
||||
|
||||
|
||||
|
@ -24,11 +24,8 @@ $storeDir = "@storedir@" unless defined $storeDir;
|
||||
my $storeStateDir = $ENV{"NIX_STORE_STATE_DIR"};
|
||||
$storeStateDir = "@storestatedir@" unless defined $storeStateDir;
|
||||
|
||||
my $storeStateReposDir = $ENV{"NIX_STORE_STATE_REPOS_DIR"};
|
||||
$storeStateReposDir = "@storestatereposdir@" unless defined $storeStateReposDir;
|
||||
|
||||
my $subversion = $ENV{"NIX_SVN_BIN_DIR"};
|
||||
$subversion = "@subversion@" unless defined $subversion;
|
||||
my $ext3cowheader = $ENV{"NIX_EXT3_COW_HEADER"};
|
||||
$ext3cowheader = "@ext3cowheader@" unless defined $ext3cowheader;
|
||||
|
||||
# Prevent access problems in shared-stored installations.
|
||||
umask 0022;
|
||||
|
@ -1,6 +1,6 @@
|
||||
pkglib_LTLIBRARIES = libext3cow.la
|
||||
|
||||
libext3cow_la_SOURCES = epoch2date.c snapshot.cc tt.c ext3cow_tools.h
|
||||
libext3cow_la_SOURCES = epoch2date.c snapshot.cc tt.c ext3cow_tools.h ext3cow_fs.h
|
||||
|
||||
pkginclude_HEADERS = snapshot.hh
|
||||
|
||||
@ -14,4 +14,4 @@ AM_CXXFLAGS = -Wall \
|
||||
-I$(srcdir)/../libutil
|
||||
|
||||
AM_CFLAGS = \
|
||||
${aterm_include}
|
||||
${aterm_include}
|
||||
|
@ -7,4 +7,4 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include </nix/store/8nirllv1w6qv6c5srjgah2m82bfi1d6k-linux-2.6.21.5/lib/modules/2.6.21.5-default/build/include/linux/ext3cow_fs.h>
|
||||
#include "ext3cow_fs.h"
|
||||
|
@ -5,8 +5,7 @@ libmain_la_SOURCES = shared.cc shared.hh
|
||||
AM_CXXFLAGS = \
|
||||
-DNIX_STORE_DIR=\"$(storedir)\" \
|
||||
-DNIX_STORE_STATE_DIR=\"$(storestatedir)\" \
|
||||
-DNIX_STORE_STATE_REPOS_DIR=\"$(storestatereposdir)\" \
|
||||
-DNIX_SVN_BIN_DIR=\"$(subversion)\" \
|
||||
-DNIX_EXT3_COW_HEADER=\"$(ext3cowheader)\" \
|
||||
-DNIX_DATA_DIR=\"$(datadir)\" \
|
||||
-DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
|
||||
-DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
|
||||
|
@ -92,7 +92,7 @@ static void initAndRun(int argc, char * * argv)
|
||||
nixLogDir = canonPath(getEnv("NIX_LOG_DIR", NIX_LOG_DIR));
|
||||
nixStateDir = canonPath(getEnv("NIX_STATE_DIR", NIX_STATE_DIR)); //nix global state dir
|
||||
nixDBPath = getEnv("NIX_DB_DIR", nixStateDir + "/db");
|
||||
nixSVNPath = getEnv("NIX_SVN_BIN_DIR", NIX_SVN_BIN_DIR);
|
||||
nixExt3CowHeader = getEnv("NIX_EXT3_COW_HEADER", NIX_EXT3_COW_HEADER);
|
||||
nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR));
|
||||
nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR));
|
||||
nixBinDir = canonPath(getEnv("NIX_BIN_DIR", NIX_BIN_DIR));
|
||||
|
@ -14,7 +14,7 @@ string nixDataDir = "/UNINIT";
|
||||
string nixLogDir = "/UNINIT";
|
||||
string nixStateDir = "/UNINIT";
|
||||
string nixDBPath = "/UNINIT";
|
||||
string nixSVNPath = "/UNINIT";
|
||||
string nixExt3CowHeader = "/UNINIT";
|
||||
string nixConfDir = "/UNINIT";
|
||||
string nixLibexecDir = "/UNINIT";
|
||||
string nixBinDir = "/UNINIT";
|
||||
|
@ -27,8 +27,8 @@ extern string nixStateDir;
|
||||
/* nixDBPath is the path name of our Berkeley DB environment. */
|
||||
extern string nixDBPath;
|
||||
|
||||
/* nixSVNPath is the path name of our SVN environment. */
|
||||
extern string nixSVNPath;
|
||||
/* nixExt3CowHeader is the header file used to communicate with ext3cow. */
|
||||
extern string nixExt3CowHeader;
|
||||
|
||||
/* nixConfDir is the directory where configuration files are
|
||||
stored. */
|
||||
|
@ -212,7 +212,7 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
|
||||
it for future modifications of the environment. */
|
||||
Path manifestFile = store->addTextToStore("env-manifest", atPrint(canonicaliseExpr(makeList(ATreverse(manifest)))), references);
|
||||
|
||||
Expr topLevel = makeCall(envBuilder, makeAttrs(ATmakeList4(
|
||||
Expr topLevel = makeCall(envBuilder, makeAttrs(ATmakeList6(
|
||||
makeBind(toATerm("system"),
|
||||
makeStr(thisSystem), makeNoPos()),
|
||||
makeBind(toATerm("derivations"),
|
||||
@ -220,7 +220,11 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
|
||||
makeBind(toATerm("stateIdentifiers"),
|
||||
makeList(ATreverse(stateIdentifiers)), makeNoPos()),
|
||||
makeBind(toATerm("manifest"),
|
||||
makeStr(manifestFile, singleton<PathSet>(manifestFile)), makeNoPos())
|
||||
makeStr(manifestFile, singleton<PathSet>(manifestFile)), makeNoPos()),
|
||||
makeBind(toATerm("nixBinDir"),
|
||||
makeStr(nixBinDir), makeNoPos()),
|
||||
makeBind(toATerm("nixStore"),
|
||||
makeStr(nixStore), makeNoPos())
|
||||
)));
|
||||
|
||||
/* Instantiate it. */
|
||||
|
@ -481,9 +481,6 @@ static void opRunComponent(Strings opFlags, Strings opArgs)
|
||||
//WARNING: we need to watch out for deadlocks!
|
||||
//add locks ... ?
|
||||
//svn lock ... ?
|
||||
|
||||
//TODO maybe also scan the parameters for state or component hashes?
|
||||
//program_args
|
||||
|
||||
//TODO
|
||||
Transaction txn;
|
||||
@ -501,6 +498,9 @@ static void opRunComponent(Strings opFlags, Strings opArgs)
|
||||
printMsg(lvlError, format("%1%") % padd("", '-', 100));
|
||||
//printMsg(lvlError, format("ARG %1%") % *i);
|
||||
root_args += " \"" + *i + "\"";
|
||||
|
||||
//TODO also scan the parameters for state or component hashes?
|
||||
//program_args
|
||||
}
|
||||
|
||||
printMsg(lvlError, format("Command: '%1%'") % (root_componentPath + root_binary + root_args));
|
||||
@ -689,9 +689,10 @@ void run(Strings args)
|
||||
printMsg(lvlError, format("P: '%1%'") % *j );
|
||||
return;
|
||||
|
||||
// */
|
||||
|
||||
|
||||
printMsg(lvlError, format("header: '%1%'") % nixExt3CowHeader);
|
||||
return;
|
||||
|
||||
*/
|
||||
|
||||
/* test */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user