[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
235/376: createDirs(): Handle ‘path’ being a symlink
From: |
Ludovic Courtès |
Subject: |
235/376: createDirs(): Handle ‘path’ being a symlink |
Date: |
Wed, 28 Jan 2015 22:05:17 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit 3800f441e49af78b95d403014459dbb9bb646e8a
Author: Eelco Dolstra <address@hidden>
Date: Fri Oct 3 16:53:28 2014 +0200
createDirs(): Handle ‘path’ being a symlink
In particular, this fixes "nix-build -o /tmp/result" on Mac OS X
(where /tmp is a symlink).
---
src/libutil/util.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 0729bf6..4365806 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -383,6 +383,9 @@ Paths createDirs(const Path & path)
created.push_back(path);
}
+ if (S_ISLNK(st.st_mode) && stat(path.c_str(), &st) == -1)
+ throw SysError(format("statting symlink ‘%1%’") % path);
+
if (!S_ISDIR(st.st_mode)) throw Error(format("‘%1%’ is not a directory") %
path);
return created;
- 221/376: Remove release notes Hydra product, (continued)
- 221/376: Remove release notes Hydra product, Ludovic Courtès, 2015/01/28
- 218/376: Make forceValueDeep work on values with cycles, Ludovic Courtès, 2015/01/28
- 229/376: Remove bash requirement, Ludovic Courtès, 2015/01/28
- 231/376: nix-daemon: Close unnecessary fd, Ludovic Courtès, 2015/01/28
- 230/376: Bindings: Remove copy constructor, Ludovic Courtès, 2015/01/28
- 222/376: Add missing static, Ludovic Courtès, 2015/01/28
- 223/376: manual: add a note that lists are strict in length, Ludovic Courtès, 2015/01/28
- 232/376: printMissing(): Print derivations in approximate build order, Ludovic Courtès, 2015/01/28
- 234/376: printValue(): Don't print <CYCLE> for repeated values, Ludovic Courtès, 2015/01/28
- 233/376: Support control characters in JSON output, Ludovic Courtès, 2015/01/28
- 235/376: createDirs(): Handle ‘path’ being a symlink,
Ludovic Courtès <=
- 238/376: Add test for readDir primop, Ludovic Courtès, 2015/01/28
- 240/376: Remove some duplicate code, Ludovic Courtès, 2015/01/28
- 239/376: Add readDir primop, Ludovic Courtès, 2015/01/28
- 224/376: add manpage for nix-generate-patches, Ludovic Courtès, 2015/01/28
- 246/376: Typo, Ludovic Courtès, 2015/01/28
- 245/376: Get rid of some unnecessary ExprConcatStrings nodes in dynamic attrs, Ludovic Courtès, 2015/01/28
- 243/376: Add primop ‘catAttrs’, Ludovic Courtès, 2015/01/28
- 249/376: nix-copy-closure: Use strict, Ludovic Courtès, 2015/01/28
- 241/376: Tweak, Ludovic Courtès, 2015/01/28
- 304/376: Combine introduction / quick start parts, Ludovic Courtès, 2015/01/28