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

Unified Diff: tools/make_links.py

Issue 15870012: Add packages as a dependency for dart2js target (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « pkg/pkg.gyp ('k') | utils/compiler/compiler.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/make_links.py
===================================================================
--- tools/make_links.py (revision 23697)
+++ tools/make_links.py (working copy)
@@ -11,15 +11,23 @@
the name of the target link.
Usage:
- python tools/make_links.py TARGET SOURCES...
+ python tools/make_links.py OPTIONS TARGET SOURCES...
'''
+import optparse
import os
import subprocess
import sys
import utils
+def get_options():
+ result = optparse.OptionParser()
+ result.add_option("--timestamp_file", "",
+ help='Create a timestamp file when done creating the links.',
+ default='')
+ return result.parse_args()
+
def make_link(source, target):
if os.path.islink(target):
print 'Removing %s' % target
@@ -39,12 +47,20 @@
else:
return subprocess.call(['ln', '-s', source, target])
+def create_timestamp_file(options):
+ if options.timestamp_file != '':
+ dir_name = os.path.dirname(options.timestamp_file)
+ if not os.path.exists(dir_name):
+ os.mkdir(dir_name)
+ open(options.timestamp_file, 'w').close()
+
def main(argv):
- target = os.path.relpath(argv[1])
+ (options, args) = get_options()
+ target = os.path.relpath(args[0])
if not os.path.exists(target):
os.makedirs(target)
- for source in argv[2:]:
+ for source in args[1:]:
# Assume the source directory is named ".../NAME/lib".
(name, lib) = os.path.split(source)
if lib != 'lib':
@@ -58,6 +74,7 @@
exit_code = make_link(source, os.path.join(target, name))
if exit_code != 0:
return exit_code
+ create_timestamp_file(options)
return 0
« no previous file with comments | « pkg/pkg.gyp ('k') | utils/compiler/compiler.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698