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

Unified Diff: tools/make_links.py

Issue 2259613002: [fuchsia] Fix build. Build packages/ output. Add Directory::Exists(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 | « tools/list_pkg_directories.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/make_links.py
diff --git a/tools/make_links.py b/tools/make_links.py
old mode 100644
new mode 100755
index 157008ace7b4944644e8e4064747afafdaf01602..d49af30c70081582146fbda069926a7258ff1438
--- a/tools/make_links.py
+++ b/tools/make_links.py
@@ -38,26 +38,35 @@ def get_options():
result.add_option("--timestamp_file", "",
help='Create a timestamp file when done creating the links.',
default='')
+ result.add_option("-q", "--quiet",
+ help="Don't print any messages",
+ action="store_true",
+ dest="quiet",
+ default=False)
return result.parse_args()
-def make_link(source, target, orig_source):
+def make_link(quiet, source, target, orig_source):
if os.path.islink(target):
- print 'Removing %s' % target
+ if not quiet:
+ print 'Removing %s' % target
sys.stdout.flush()
os.unlink(target)
if os.path.isdir(target):
- print 'Removing %s' % target
+ if not quiet:
+ print 'Removing %s' % target
sys.stdout.flush()
os.rmdir(target)
if os.path.isfile(orig_source):
- print 'Copying file from %s to %s' % (orig_source, target)
+ if not quiet:
+ print 'Copying file from %s to %s' % (orig_source, target)
sys.stdout.flush()
shutil.copyfile(orig_source, target)
return 0
else:
- print 'Creating link from %s to %s' % (source, target)
+ if not quiet:
+ print 'Creating link from %s to %s' % (source, target)
sys.stdout.flush()
if utils.GuessOS() == 'win32':
@@ -90,7 +99,7 @@ def main(argv):
os.remove(full_link)
else:
os.makedirs(target)
- linked_names = {};
+ linked_names = {};
for source in args[1:]:
# Assume the source directory is named ".../NAME/lib".
split = source.split(':')
@@ -117,7 +126,8 @@ def main(argv):
source = os.path.relpath(source)
else:
source = os.path.relpath(source, start=target)
- exit_code = make_link(source, os.path.join(target, name), orig_source)
+ exit_code = make_link(
+ options.quiet, source, os.path.join(target, name), orig_source)
if exit_code != 0:
return exit_code
create_timestamp_file(options)
« no previous file with comments | « tools/list_pkg_directories.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698