2 # Copyright (c) 2013 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.
6 """Make a symlink and optionally touch a file (to handle dependencies)."""
17 parser
= optparse
.OptionParser()
18 parser
.add_option('-f', '--force', action
='store_true')
19 parser
.add_option('--touch')
21 options
, args
= parser
.parse_args(argv
[1:])
23 parser
.error('at least two arguments required.')
28 t
= os
.path
.join(target
, os
.path
.basename(s
))
32 if e
.errno
== errno
.EEXIST
and options
.force
:
34 shutil
.rmtree(t
, ignore_errors
=True)
43 with
open(options
.touch
, 'w') as f
:
47 if __name__
== '__main__':
48 sys
.exit(Main(sys
.argv
))