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

Unified Diff: build/symlink.py

Issue 11862016: Make use_system_mesa switch work: make symlinks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no debugging code Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/khronos/khronos.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/symlink.py
diff --git a/build/symlink.py b/build/symlink.py
new file mode 100755
index 0000000000000000000000000000000000000000..e5257316d724b70b7c6d8bcd236e49aa90d56fec
--- /dev/null
+++ b/build/symlink.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Make a symlink and optionally touch a file (to handle dependencies)."""
+
+
+import errno
+import optparse
+import os.path
+import sys
+
+
+def Main(argv):
+ parser = optparse.OptionParser()
+ parser.add_option('-f', '--force', action='store_true')
+ parser.add_option('--touch')
+
+ options, args = parser.parse_args(argv)
+ if len(args) < 2:
+ parser.error('at least two arguments required.')
+
+ target = args[-1]
+ sources = args[:-1]
+ for s in sources:
+ t = os.path.join(target, os.path.basename(s))
+ try:
+ os.symlink(s, t)
+ except OSError, e:
+ if e.errno == errno.EEXIST and options.force:
+ os.remove(t)
+ os.symlink(s, t)
+ else:
+ raise
+
+
+ if options.touch:
+ with open(options.touch, 'w') as f:
+ pass
+
+
+if __name__ == '__main__':
+ sys.exit(Main(sys.argv))
« no previous file with comments | « no previous file | third_party/khronos/khronos.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698