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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user