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

Unified Diff: tools/make_links.py

Issue 1165473002: Start pulling pub from its own repo. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review changes Created 5 years, 7 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/create_sdk.py ('k') | tools/run_pub.py » ('j') | 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
index b99ef6e25f17be89d82952dbe8bc3ea89851b836..5599e99880a363d5888dfe766282a87f64675ae3 100644
--- a/tools/make_links.py
+++ b/tools/make_links.py
@@ -10,11 +10,15 @@ For each SOURCE in SOURCES create a link from SOURCE to TARGET. If a
SOURCE ends with .../lib, the lib suffix is ignored when determining
the name of the target link.
+If a SOURCE contains ":", the left side is the path and the right side is the
+name of the package symlink.
+
Before creating any links, the old entries of the TARGET directory will be
removed.
Usage:
python tools/make_links.py OPTIONS TARGET SOURCES...
+
"""
import optparse
@@ -84,11 +88,16 @@ def main(argv):
os.makedirs(target)
for source in args[1:]:
# Assume the source directory is named ".../NAME/lib".
- (name, lib) = os.path.split(source)
+ split = source.split(':')
+ name = None
+ if len(split) == 2: (source, name) = split
+
+ (path, lib) = os.path.split(source)
if lib != 'lib':
- name = source
- # Remove any addtional path components preceding NAME.
- (path, name) = os.path.split(name)
+ path = source
+ # Remove any additional path components preceding NAME, if one wasn't
+ # specified explicitly.
+ if not name: (_, name) = os.path.split(path)
orig_source = source
if utils.GuessOS() == 'win32':
source = os.path.relpath(source)
« no previous file with comments | « tools/create_sdk.py ('k') | tools/run_pub.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698