aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2016-02-11 13:45:56 +0000
committerGravatar David Chen <dzc@google.com>2016-02-11 22:21:06 +0000
commit96202b17df83f61c5c0ddf39dc42c1db177f9162 (patch)
treea76ef045b22c81d607fa9b5c11e363213951a05b /src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
parent18dbcd6011d61bbe1d9ccb071dd50d99062f0cf9 (diff)
Make local_repository and new_local_repository work on Windows.
This makes it possible to compile //third_party/ijar with a bootstrapped Bazel on Windows in dslomov's tree. -- MOS_MIGRATED_REVID=114428109
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java b/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
index 55dd402411..900f6dbae2 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
@@ -583,8 +583,7 @@ public class FileSystemUtils {
/**
* Copies all dir trees under a given 'from' dir to location 'to', while overwriting
- * all files in the potentially existing 'to'. Does not follow any symbolic links,
- * but copies them instead.
+ * all files in the potentially existing 'to'. Resolves symbolic links.
*
* <p>The source and the destination must be non-overlapping, otherwise an
* IllegalArgumentException will be thrown. This method cannot be used to copy
@@ -602,16 +601,13 @@ public class FileSystemUtils {
Collection<Path> entries = from.getDirectoryEntries();
for (Path entry : entries) {
- if (entry.isDirectory(Symlinks.NOFOLLOW)) {
+ if (entry.isFile()) {
+ Path newEntry = to.getChild(entry.getBaseName());
+ copyFile(entry, newEntry);
+ } else {
Path subDir = to.getChild(entry.getBaseName());
subDir.createDirectory();
copyTreesBelow(entry, subDir);
- } else if (entry.isSymbolicLink()) {
- Path newLink = to.getChild(entry.getBaseName());
- newLink.createSymbolicLink(entry.readSymbolicLinkUnchecked());
- } else {
- Path newEntry = to.getChild(entry.getBaseName());
- copyFile(entry, newEntry);
}
}
}