[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
132/376: nix-shell: Use $XDG_RUNTIME_DIR
From: |
Ludovic Courtès |
Subject: |
132/376: nix-shell: Use $XDG_RUNTIME_DIR |
Date: |
Wed, 28 Jan 2015 22:04:32 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit 3e5dbb24337d8416cfe46484eb2692811546a9c1
Author: Eelco Dolstra <address@hidden>
Date: Wed Aug 13 23:16:08 2014 +0200
nix-shell: Use $XDG_RUNTIME_DIR
This prevents collisions with other users.
Fixes #262.
---
scripts/nix-build.in | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index cf7efa8..ef86cb9 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -204,6 +204,7 @@ foreach my $expr (@exprs) {
or die "$0: failed to build all dependencies\n";
# Set the environment.
+ my $tmp = $ENV{"TMPDIR"} // $ENV{"XDG_RUNTIME_DIR"} // "/tmp";
if ($pure) {
foreach my $name (keys %ENV) {
next if grep { $_ eq $name } ("HOME", "USER", "LOGNAME",
"DISPLAY", "PATH", "TERM", "IN_NIX_SHELL", "TZ", "PAGER");
@@ -212,7 +213,7 @@ foreach my $expr (@exprs) {
# NixOS hack: prevent /etc/bashrc from sourcing /etc/profile.
$ENV{'__ETC_PROFILE_SOURCED'} = 1;
}
- $ENV{'NIX_BUILD_TOP'} = $ENV{'TMPDIR'} = $ENV{'TEMPDIR'} = $ENV{'TMP'}
= $ENV{'TEMP'} = $ENV{'TMPDIR'} // "/tmp";
+ $ENV{'NIX_BUILD_TOP'} = $ENV{'TMPDIR'} = $ENV{'TEMPDIR'} = $ENV{'TMP'}
= $ENV{'TEMP'} = $tmp;
$ENV{'NIX_STORE'} = $Nix::Config::storeDir;
$ENV{$_} = $drv->{env}->{$_} foreach keys %{$drv->{env}};
- 116/376: Doh, (continued)
- 116/376: Doh, Ludovic Courtès, 2015/01/28
- 112/376: Add option ‘build-extra-chroot-dirs’, Ludovic Courtès, 2015/01/28
- 111/376: Get rid of "killing <pid>" message for unused build hooks, Ludovic Courtès, 2015/01/28
- 129/376: Remove log2html.xsl and friends, Ludovic Courtès, 2015/01/28
- 122/376: Warn about untrusted binary caches in extra-binary-caches, Ludovic Courtès, 2015/01/28
- 113/376: Update manual, Ludovic Courtès, 2015/01/28
- 126/376: Handle compound single dash options properly, Ludovic Courtès, 2015/01/28
- 124/376: Fix warning about non-existant -I directories, Ludovic Courtès, 2015/01/28
- 127/376: Use regular file GC roots if possible, Ludovic Courtès, 2015/01/28
- 128/376: nix-log2xml: Handle UTF-8 characters, Ludovic Courtès, 2015/01/28
- 132/376: nix-shell: Use $XDG_RUNTIME_DIR,
Ludovic Courtès <=
- 120/376: download-from-binary-cache.pl: Respect $SSL_CERT_FILE, Ludovic Courtès, 2015/01/28
- 123/376: Remove pointless NIX_LOG_TYPE environment variable, Ludovic Courtès, 2015/01/28
- 136/376: Propagate remote timeouts properly, Ludovic Courtès, 2015/01/28
- 131/376: Use $XDG_RUNTIME_DIR for temporary files, Ludovic Courtès, 2015/01/28
- 137/376: Reduce verbosity, Ludovic Courtès, 2015/01/28
- 133/376: Fix download-via-ssh, Ludovic Courtès, 2015/01/28
- 130/376: nix-log2xml: Handle newlines, Ludovic Courtès, 2015/01/28
- 143/376: nix-store -l: Automatically pipe output into $PAGER, Ludovic Courtès, 2015/01/28
- 139/376: Fix --attr parsing, Ludovic Courtès, 2015/01/28
- 142/376: Reduce test verbosity, Ludovic Courtès, 2015/01/28