Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: build/rm.py

Issue 2362233003: Unbreak mac component build. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | mojo/public/cpp/system/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Delete a file.
7
8 This module works much like the rm posix command.
9 """
10
11 import argparse
12 import os
13 import sys
14
15
16 def Main():
17 parser = argparse.ArgumentParser()
18 parser.add_argument('files', nargs='+')
19 parser.add_argument('-f', '--force', action='store_true',
20 help="don't err on missing")
21 parser.add_argument('--stamp', required=True, help='touch this file')
22 args = parser.parse_args()
23 for f in args.files:
24 try:
25 os.remove(f)
26 except OSError:
27 if not args.force:
28 print >>sys.stderr, "'%s' does not exist" % f
29 return 1
30
31 with open(args.stamp, 'w'):
32 os.utime(args.stamp, None)
33
34 return 0
35
36
37 if __name__ == '__main__':
38 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | mojo/public/cpp/system/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698