Merge branch 'stable-2.14' into stable-2.15

* stable-2.14:
  download_file.py: Fix root workspace directory detection

Change-Id: Ia4d2ff89ea3aa17683b947cb7cc74ba9dda94a7d
diff --git a/tools/download_file.py b/tools/download_file.py
index 534a6d5..8f790be 100755
--- a/tools/download_file.py
+++ b/tools/download_file.py
@@ -84,9 +84,9 @@
 args, _ = opts.parse_args()
 
 root_dir = args.o
-while root_dir and root_dir != "/":
+while root_dir and path.dirname(root_dir) != root_dir:
   root_dir, n = path.split(root_dir)
-  if n == 'buck-out':
+  if n == 'WORKSPACE':
     break
 
 redirects = download_properties(root_dir)