1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

* nix-store --import': import an archive created by nix-store

--export' into the Nix store, and optionally check the cryptographic
  signatures against /nix/etc/nix/signing-key.pub.  (TODO: verify
  against a set of public keys.)
This commit is contained in:
Eelco Dolstra 2007-02-21 15:45:32 +00:00
parent 46e0919ced
commit 43c4d18c6a
8 changed files with 142 additions and 10 deletions

View file

@ -317,19 +317,19 @@ void makePathReadOnly(const Path & path)
}
static Path tempName()
static Path tempName(const Path & tmpRoot)
{
static int counter = 0;
Path tmpRoot = canonPath(getEnv("TMPDIR", "/tmp"), true);
return (format("%1%/nix-%2%-%3%") % tmpRoot % getpid() % counter++).str();
Path tmpRoot2 = canonPath(tmpRoot.empty() ? getEnv("TMPDIR", "/tmp") : tmpRoot, true);
return (format("%1%/nix-%2%-%3%") % tmpRoot2 % getpid() % counter++).str();
}
Path createTempDir()
Path createTempDir(const Path & tmpRoot)
{
while (1) {
checkInterrupt();
Path tmpDir = tempName();
Path tmpDir = tempName(tmpRoot);
if (mkdir(tmpDir.c_str(), 0777) == 0) {
/* Explicitly set the group of the directory. This is to
work around around problems caused by BSD's group

View file

@ -70,7 +70,7 @@ void deletePath(const Path & path, unsigned long long & bytesFreed);
void makePathReadOnly(const Path & path);
/* Create a temporary directory. */
Path createTempDir();
Path createTempDir(const Path & tmpRoot = "");
/* Create a directory and all its parents, if necessary. */
void createDirs(const Path & path);