diff --git a/script/release/uploaders/upload-symbols.py b/script/release/uploaders/upload-symbols.py index 6de7dd629157..44773611e4fe 100755 --- a/script/release/uploaders/upload-symbols.py +++ b/script/release/uploaders/upload-symbols.py @@ -5,6 +5,11 @@ import os import shutil import subprocess import sys +import tempfile + +def is_fs_case_sensitive(): + with tempfile.NamedTemporaryFile(prefix='TmP') as tmp_file: + return(not os.path.exists(tmp_file.name.lower())) sys.path.append( os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../..")) @@ -50,15 +55,16 @@ def main(): # The symbol server needs lowercase paths, it will fail otherwise # So lowercase all the file paths here - for f in files: - lower_f = f.lower() - if lower_f != f: - if os.path.exists(lower_f): - shutil.rmtree(lower_f) - lower_dir = os.path.dirname(lower_f) - if not os.path.exists(lower_dir): - os.makedirs(lower_dir) - shutil.copy2(f, lower_f) + if is_fs_case_sensitive(): + for f in files: + lower_f = f.lower() + if lower_f != f: + if os.path.exists(lower_f): + shutil.rmtree(lower_f) + lower_dir = os.path.dirname(lower_f) + if not os.path.exists(lower_dir): + os.makedirs(lower_dir) + shutil.copy2(f, lower_f) files = [f.lower() for f in files] for f in files: assert os.path.exists(f)