#!/usr/bin/python21#2# Copyright 2019 The ANGLE Project Authors. All rights reserved.3# Use of this source code is governed by a BSD-style license that can be4# found in the LICENSE file.5#6# remove_files.py:7# This special action is used to cleanup old files from the build directory.8# Otherwise ANGLE will pick up the old file(s), causing build or runtime errors.9#1011import glob12import os13import sys1415if len(sys.argv) < 3:16print("Usage: " + sys.argv[0] + " <stamp_file> <remove_patterns>")1718stamp_file = sys.argv[1]1920for i in range(2, len(sys.argv)):21remove_pattern = sys.argv[i]22remove_files = glob.glob(remove_pattern)23for f in remove_files:24if os.path.isfile(f):25os.remove(f)2627# touch an unused file to keep a timestamp28with open(stamp_file, "w") as f:29f.write("blah")30f.close()313233