Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: tools/make_links.py

Issue 11308094: Delete symbolic links on Windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/make_links.py
diff --git a/tools/make_links.py b/tools/make_links.py
index e053d834941bc8ccad0f86fdfc45443cce5e70e1..6a410707815f73e8622154c7ed1739a8b3a9a679 100644
--- a/tools/make_links.py
+++ b/tools/make_links.py
@@ -30,16 +30,25 @@ def make_link(source, target):
# End of temporary code.
if os.path.islink(target):
+ print 'Removing %s' % target
+ sys.stdout.flush()
os.unlink(target)
+ if os.path.isdir(target):
+ print 'Removing %s' % target
+ sys.stdout.flush()
+ os.rmdir(target)
+
if utils.GuessOS() == 'win32':
- return subprocess.call(['mklink', '/j', target, source])
+ source = os.path.relpath(source)
+ return subprocess.call(['mklink', '/j', target, source], shell=True)
else:
+ source = os.path.relpath(source, start=target)
return subprocess.call(['ln', '-s', source, target])
def main(argv):
- target = argv[1]
+ target = os.path.relpath(argv[1])
for source in argv[2:]:
# Assume the source directory is named ".../TARGET_NAME/lib".
(name, lib) = os.path.split(source)
@@ -47,8 +56,7 @@ def main(argv):
name = source
# Remove any addtional path components preceding TARGET_NAME.
(path, name) = os.path.split(name)
- exit_code = make_link(os.path.relpath(source, start=target),
- os.path.join(target, name))
+ exit_code = make_link(source, os.path.join(target, name))
if exit_code != 0:
return exit_code
return 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698