Commit 8f298807 authored by Weilun Shi's avatar Weilun Shi Committed by Commit Bot

Force all OSes to use '/' as the separator

Replace os.sep to '/' in histogram_paths.py to make sure that any
OS should output the same histogram index file.

Bug: 1126500
Change-Id: I5362321237723abda63cc8b2b3d30d0327a9b8a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2402761
Auto-Submit: Weilun Shi <sweilun@chromium.org>
Commit-Queue: Jesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806335}
parent fe56db93
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Copyright 2020 The Chromium Authors. All rights reserved. # Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
"""Paths to description XML files in this directory.""" """Paths to description XML files in this directory."""
import os import os
...@@ -20,8 +19,8 @@ def _FindHistogramsXmlFiles(): ...@@ -20,8 +19,8 @@ def _FindHistogramsXmlFiles():
if (filename == 'histograms.xml' if (filename == 'histograms.xml'
or filename == 'histogram_suffixes_list.xml'): or filename == 'histogram_suffixes_list.xml'):
# Compute the relative path of the histograms xml file. # Compute the relative path of the histograms xml file.
file_path = os.path.relpath( file_path = os.path.relpath(os.path.join(dirName, filename),
os.path.join(dirName, filename), PATH_TO_HISTOGRAMS_XML_DIR) PATH_TO_HISTOGRAMS_XML_DIR)
file_list.append( file_list.append(
os.path.join('tools/metrics/histograms/histograms_xml', file_path)) os.path.join('tools/metrics/histograms/histograms_xml', file_path))
return sorted(file_list) return sorted(file_list)
...@@ -69,7 +68,9 @@ HISTOGRAMS_INDEX = path_util.GetInputFile( ...@@ -69,7 +68,9 @@ HISTOGRAMS_INDEX = path_util.GetInputFile(
def main(): def main():
with open(HISTOGRAMS_INDEX, 'w+') as f: with open(HISTOGRAMS_INDEX, 'w+') as f:
f.write("\n".join(HISTOGRAMS_XMLS_RELATIVE)) # Force all OSes to use '/' as the separator.
f.write("\n".join(
[path.replace(os.sep, '/') for path in HISTOGRAMS_XMLS_RELATIVE]))
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment