Edit

kc3-lang/angle/scripts/remove_file_if_exists.py

Branch :

  • Show log

    Commit

  • Author : Shahbaz Youssefi
    Date : 2019-02-13 21:21:13
    Hash : 3805122b
    Message : Revert "Roll Vulkan repos" This reverts commit 55ea947c3bdd6c0ef68fc4b9ddbda26889f62622. Reason for revert: Seems to be causing a memory corruption on Windows/Intel bots. Original change's description: > Roll Vulkan repos > > Bug: angleproject:3095 > Change-Id: I6ae9d61304981223f9e2f1869ed32612aa38952c > Reviewed-on: https://chromium-review.googlesource.com/c/1405714 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Yuly Novikov <ynovikov@chromium.org> TBR=ynovikov@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I61879770c9bb16ac2231b081bda08e6211ba6831 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3095 Reviewed-on: https://chromium-review.googlesource.com/c/1470605 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>

  • scripts/remove_file_if_exists.py
  • #!/usr/bin/python2
    #
    # Copyright 2017 The ANGLE Project Authors. All rights reserved.
    # Use of this source code is governed by a BSD-style license that can be
    # found in the LICENSE file.
    #
    # remove_file_if_exists.py:
    #   This special action is needed to remove generated headers.
    #   Otherwise ANGLE will pick up the old file(s) and the build will fail.
    #
    
    import sys
    import os
    
    if len(sys.argv) < 3:
        print("Usage: " + sys.argv[0] + " <remove_file> <stamp_file>")
    
    remove_file = sys.argv[1]
    if os.path.isfile(remove_file):
        os.remove(remove_file)
    
    # touch a dummy file to keep a timestamp
    with open(sys.argv[2], "w") as f:
        f.write("blah")
        f.close()