mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +01:00
fixed some hard links
This commit is contained in:
parent
53c907ca09
commit
05297240ea
14 changed files with 46 additions and 45 deletions
|
|
@ -46,9 +46,15 @@ else
|
||||||
init-state:
|
init-state:
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
init-ext3cow-header-hack:
|
||||||
|
@echo "Symlinking ext3cow header file into src"
|
||||||
|
ln -sf $(ext3cowheader) src/libext3cow/
|
||||||
|
|
||||||
svn-revision:
|
svn-revision:
|
||||||
svnversion . > svn-revision
|
svnversion . > svn-revision
|
||||||
|
|
||||||
|
all: init-ext3cow-header-hack
|
||||||
|
|
||||||
all-local: NEWS
|
all-local: NEWS
|
||||||
|
|
||||||
NEWS: doc/manual/NEWS.txt
|
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')
|
storestatedir=$withval, storestatedir='${prefix}/state')
|
||||||
AC_SUBST(storestatedir)
|
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],
|
AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb=PATH],
|
||||||
[prefix of Berkeley DB]),
|
[prefix of Berkeley DB]),
|
||||||
bdb=$withval, bdb=)
|
bdb=$withval, bdb=)
|
||||||
|
|
@ -188,11 +183,11 @@ fi
|
||||||
AC_SUBST(bdb_lib)
|
AC_SUBST(bdb_lib)
|
||||||
AC_SUBST(bdb_include)
|
AC_SUBST(bdb_include)
|
||||||
|
|
||||||
NEED_PROG(svn, svn)
|
AC_ARG_WITH(ext3cow-header, AC_HELP_STRING([--with-ext3cow-header=PATH],
|
||||||
AC_ARG_WITH(svn-bin, AC_HELP_STRING([--with-svn-bin=PATH],
|
[path of the header ext3cow header ext3cow_fs.h]),
|
||||||
[path of svn, svnadmin]),
|
ext3cowheader=$withval, ext3cowheader=)
|
||||||
subversion=$withval, subversion=$(dirname $svn))
|
AC_SUBST(ext3cowheader)
|
||||||
AC_SUBST(subversion)
|
AC_CHECK_HEADER(${ext3cowheader})
|
||||||
|
|
||||||
AC_ARG_WITH(aterm, AC_HELP_STRING([--with-aterm=PATH],
|
AC_ARG_WITH(aterm, AC_HELP_STRING([--with-aterm=PATH],
|
||||||
[prefix of CWI ATerm library]),
|
[prefix of CWI ATerm library]),
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,9 @@ mkdir "$out", 0755 || die "error creating $out";
|
||||||
|
|
||||||
my $symlinks = 0;
|
my $symlinks = 0;
|
||||||
my %path_identifier;
|
my %path_identifier;
|
||||||
my $srcDirSlashes = 3;
|
|
||||||
|
my $nixBinDir = $ENV{"nixBinDir"};
|
||||||
|
my $nixStore = $ENV{"nixStore"};
|
||||||
|
|
||||||
# For each activated package, create symlinks.
|
# For each activated package, create symlinks.
|
||||||
|
|
||||||
|
|
@ -22,14 +24,9 @@ sub createLinks {
|
||||||
|
|
||||||
#Lookup each $stateIdentifiers in $path_identifier
|
#Lookup each $stateIdentifiers in $path_identifier
|
||||||
#we strip $srcDir to its rootdir e.g. /nix/store/......./
|
#we strip $srcDir to its rootdir e.g. /nix/store/......./
|
||||||
my @srcDirParts = split /\// , $srcDir;
|
my @srcDirParts = split /\// , substr($srcDir, length ($nixStore), length ($srcDir));
|
||||||
my $srcDirRoot = "";
|
my $srcDirRoot = $nixStore . "/" . $srcDirParts[1];
|
||||||
my $srcDirCounter=1;
|
# print "srcDirRoot $srcDirRoot \n";
|
||||||
while ($srcDirCounter <= $srcDirSlashes) {
|
|
||||||
$srcDirRoot = $srcDirRoot . "/" . $srcDirParts[$srcDirCounter];
|
|
||||||
$srcDirCounter++;
|
|
||||||
}
|
|
||||||
#print "srcDirRoot $srcDirRoot \n";
|
|
||||||
my $pkgStateIdentifier = $path_identifier{$srcDirRoot};
|
my $pkgStateIdentifier = $path_identifier{$srcDirRoot};
|
||||||
|
|
||||||
my $dstDir = shift;
|
my $dstDir = shift;
|
||||||
|
|
@ -118,7 +115,7 @@ sub createLinks {
|
||||||
|
|
||||||
sysopen (DSTFILEHANDLE, $new_dstFile, O_RDWR|O_EXCL|O_CREAT, 0755);
|
sysopen (DSTFILEHANDLE, $new_dstFile, O_RDWR|O_EXCL|O_CREAT, 0755);
|
||||||
printf DSTFILEHANDLE "#! @shell@ \n";
|
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);
|
close (DSTFILEHANDLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{system, derivations, stateIdentifiers, manifest}:
|
{system, derivations, stateIdentifiers, manifest, nixBinDir, nixStore}:
|
||||||
|
|
||||||
derivation {
|
derivation {
|
||||||
name = "user-environment";
|
name = "user-environment";
|
||||||
|
|
@ -7,4 +7,5 @@ derivation {
|
||||||
derivations = derivations;
|
derivations = derivations;
|
||||||
stateIdentifiers = stateIdentifiers;
|
stateIdentifiers = stateIdentifiers;
|
||||||
manifest = manifest;
|
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 docbook5-xsl
|
||||||
nix-env-all-pkgs.sh -i bison
|
nix-env-all-pkgs.sh -i bison
|
||||||
nix-env-all-pkgs.sh -i gdb #optional for debugging
|
nix-env-all-pkgs.sh -i gdb #optional for debugging
|
||||||
|
nix-env-all-pkgs.sh -i e3cfsprogs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "full" ] || [ "$1" = "auto" ]; then
|
if [ "$1" = "full" ] || [ "$1" = "auto" ]; then
|
||||||
|
|
@ -43,7 +44,7 @@ fi
|
||||||
--prefix=$nixstatepath \
|
--prefix=$nixstatepath \
|
||||||
--with-store-dir=/nix/store \
|
--with-store-dir=/nix/store \
|
||||||
--with-store-state-dir=/nix/state \
|
--with-store-state-dir=/nix/state \
|
||||||
--with-store-state-repos-dir=/nix/staterepos \
|
--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
|
--localstatedir=/nix/var
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,8 @@ $storeDir = "@storedir@" unless defined $storeDir;
|
||||||
my $storeStateDir = $ENV{"NIX_STORE_STATE_DIR"};
|
my $storeStateDir = $ENV{"NIX_STORE_STATE_DIR"};
|
||||||
$storeStateDir = "@storestatedir@" unless defined $storeStateDir;
|
$storeStateDir = "@storestatedir@" unless defined $storeStateDir;
|
||||||
|
|
||||||
my $storeStateReposDir = $ENV{"NIX_STORE_STATE_REPOS_DIR"};
|
my $ext3cowheader = $ENV{"NIX_EXT3_COW_HEADER"};
|
||||||
$storeStateReposDir = "@storestatereposdir@" unless defined $storeStateReposDir;
|
$ext3cowheader = "@ext3cowheader@" unless defined $ext3cowheader;
|
||||||
|
|
||||||
my $subversion = $ENV{"NIX_SVN_BIN_DIR"};
|
|
||||||
$subversion = "@subversion@" unless defined $subversion;
|
|
||||||
|
|
||||||
# Prevent access problems in shared-stored installations.
|
# Prevent access problems in shared-stored installations.
|
||||||
umask 0022;
|
umask 0022;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
pkglib_LTLIBRARIES = libext3cow.la
|
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
|
pkginclude_HEADERS = snapshot.hh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,4 @@
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/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 = \
|
AM_CXXFLAGS = \
|
||||||
-DNIX_STORE_DIR=\"$(storedir)\" \
|
-DNIX_STORE_DIR=\"$(storedir)\" \
|
||||||
-DNIX_STORE_STATE_DIR=\"$(storestatedir)\" \
|
-DNIX_STORE_STATE_DIR=\"$(storestatedir)\" \
|
||||||
-DNIX_STORE_STATE_REPOS_DIR=\"$(storestatereposdir)\" \
|
-DNIX_EXT3_COW_HEADER=\"$(ext3cowheader)\" \
|
||||||
-DNIX_SVN_BIN_DIR=\"$(subversion)\" \
|
|
||||||
-DNIX_DATA_DIR=\"$(datadir)\" \
|
-DNIX_DATA_DIR=\"$(datadir)\" \
|
||||||
-DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
|
-DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
|
||||||
-DNIX_LOG_DIR=\"$(localstatedir)/log/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));
|
nixLogDir = canonPath(getEnv("NIX_LOG_DIR", NIX_LOG_DIR));
|
||||||
nixStateDir = canonPath(getEnv("NIX_STATE_DIR", NIX_STATE_DIR)); //nix global state dir
|
nixStateDir = canonPath(getEnv("NIX_STATE_DIR", NIX_STATE_DIR)); //nix global state dir
|
||||||
nixDBPath = getEnv("NIX_DB_DIR", nixStateDir + "/db");
|
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));
|
nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR));
|
||||||
nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR));
|
nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR));
|
||||||
nixBinDir = canonPath(getEnv("NIX_BIN_DIR", NIX_BIN_DIR));
|
nixBinDir = canonPath(getEnv("NIX_BIN_DIR", NIX_BIN_DIR));
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ string nixDataDir = "/UNINIT";
|
||||||
string nixLogDir = "/UNINIT";
|
string nixLogDir = "/UNINIT";
|
||||||
string nixStateDir = "/UNINIT";
|
string nixStateDir = "/UNINIT";
|
||||||
string nixDBPath = "/UNINIT";
|
string nixDBPath = "/UNINIT";
|
||||||
string nixSVNPath = "/UNINIT";
|
string nixExt3CowHeader = "/UNINIT";
|
||||||
string nixConfDir = "/UNINIT";
|
string nixConfDir = "/UNINIT";
|
||||||
string nixLibexecDir = "/UNINIT";
|
string nixLibexecDir = "/UNINIT";
|
||||||
string nixBinDir = "/UNINIT";
|
string nixBinDir = "/UNINIT";
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ extern string nixStateDir;
|
||||||
/* nixDBPath is the path name of our Berkeley DB environment. */
|
/* nixDBPath is the path name of our Berkeley DB environment. */
|
||||||
extern string nixDBPath;
|
extern string nixDBPath;
|
||||||
|
|
||||||
/* nixSVNPath is the path name of our SVN environment. */
|
/* nixExt3CowHeader is the header file used to communicate with ext3cow. */
|
||||||
extern string nixSVNPath;
|
extern string nixExt3CowHeader;
|
||||||
|
|
||||||
/* nixConfDir is the directory where configuration files are
|
/* nixConfDir is the directory where configuration files are
|
||||||
stored. */
|
stored. */
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
|
||||||
it for future modifications of the environment. */
|
it for future modifications of the environment. */
|
||||||
Path manifestFile = store->addTextToStore("env-manifest", atPrint(canonicaliseExpr(makeList(ATreverse(manifest)))), references);
|
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"),
|
makeBind(toATerm("system"),
|
||||||
makeStr(thisSystem), makeNoPos()),
|
makeStr(thisSystem), makeNoPos()),
|
||||||
makeBind(toATerm("derivations"),
|
makeBind(toATerm("derivations"),
|
||||||
|
|
@ -220,7 +220,11 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
|
||||||
makeBind(toATerm("stateIdentifiers"),
|
makeBind(toATerm("stateIdentifiers"),
|
||||||
makeList(ATreverse(stateIdentifiers)), makeNoPos()),
|
makeList(ATreverse(stateIdentifiers)), makeNoPos()),
|
||||||
makeBind(toATerm("manifest"),
|
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. */
|
/* Instantiate it. */
|
||||||
|
|
|
||||||
|
|
@ -482,9 +482,6 @@ static void opRunComponent(Strings opFlags, Strings opArgs)
|
||||||
//add locks ... ?
|
//add locks ... ?
|
||||||
//svn lock ... ?
|
//svn lock ... ?
|
||||||
|
|
||||||
//TODO maybe also scan the parameters for state or component hashes?
|
|
||||||
//program_args
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
Transaction txn;
|
Transaction txn;
|
||||||
//createStoreTransaction(txn);
|
//createStoreTransaction(txn);
|
||||||
|
|
@ -501,6 +498,9 @@ static void opRunComponent(Strings opFlags, Strings opArgs)
|
||||||
printMsg(lvlError, format("%1%") % padd("", '-', 100));
|
printMsg(lvlError, format("%1%") % padd("", '-', 100));
|
||||||
//printMsg(lvlError, format("ARG %1%") % *i);
|
//printMsg(lvlError, format("ARG %1%") % *i);
|
||||||
root_args += " \"" + *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));
|
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 );
|
printMsg(lvlError, format("P: '%1%'") % *j );
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// */
|
printMsg(lvlError, format("header: '%1%'") % nixExt3CowHeader);
|
||||||
|
return;
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
/* test */
|
/* test */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue