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)."""
16 parser = optparse.OptionParser()
17 parser.add_option('-f', '--force', action='store_true')
18 parser.add_option('--touch')
20 options, args = parser.parse_args(argv[1:])
22 parser.error('at least two arguments required.')
27 t = os.path.join(target, os.path.basename(s))
31 if e.errno == errno.EEXIST and options.force:
39 with open(options.touch, 'w') as f:
43 if __name__ == '__main__':
44 sys.exit(Main(sys.argv))