From 0201777b3379d09cfb91628520130c2628bfc12a Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 17 Jul 2015 15:41:40 -0700 Subject: [PATCH] Fix build issues related to symlink.py There are actually two uses cases for symlink.py. This CL restores //build/symlink.py to match the version in Chromium and adds a new version in ////sky/build/symlink.py that works properly for the material-design-icons. --- engine/src/flutter/build/symlink.py | 8 +++++++- engine/src/flutter/sky/tools/roll/roll.py | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/build/symlink.py b/engine/src/flutter/build/symlink.py index aade2f865c..75a3e4e6d1 100755 --- a/engine/src/flutter/build/symlink.py +++ b/engine/src/flutter/build/symlink.py @@ -9,6 +9,7 @@ import errno import optparse import os.path +import shutil import sys @@ -25,11 +26,16 @@ def Main(argv): sources = args[:-1] for s in sources: t = os.path.join(target, os.path.basename(s)) + if len(sources) == 1 and not os.path.isdir(target): + t = target try: os.symlink(s, t) except OSError, e: if e.errno == errno.EEXIST and options.force: - os.remove(t) + if os.path.isdir(t): + shutil.rmtree(t, ignore_errors=True) + else: + os.remove(t) os.symlink(s, t) else: raise diff --git a/engine/src/flutter/sky/tools/roll/roll.py b/engine/src/flutter/sky/tools/roll/roll.py index e1bab7925a..af26105420 100755 --- a/engine/src/flutter/sky/tools/roll/roll.py +++ b/engine/src/flutter/sky/tools/roll/roll.py @@ -97,7 +97,6 @@ files_not_to_roll = [ 'build/config/ui.gni', 'build/ls.py', 'build/module_args/mojo.gni', - 'build/symlink.py', 'tools/android/VERSION_LINUX_NDK', 'tools/android/VERSION_LINUX_SDK', 'tools/android/VERSION_MACOSX_NDK',