Chromium Code Reviews| Index: dart/tools/make_links.py |
| diff --git a/dart/tools/make_links.py b/dart/tools/make_links.py |
| index 66f94e6b134d2a6b24f0c7ef1eeb51a878ccb025..90092d19314c278e55cb8ace7989ee8d8dd20f3e 100644 |
| --- a/dart/tools/make_links.py |
| +++ b/dart/tools/make_links.py |
| @@ -10,6 +10,9 @@ 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. |
| +Before creating any links, the old entries of the TARGET directory will be |
| +removed. |
| + |
| Usage: |
| python tools/make_links.py OPTIONS TARGET SOURCES... |
| ''' |
| @@ -58,7 +61,13 @@ def create_timestamp_file(options): |
| def main(argv): |
| (options, args) = get_options() |
| target = os.path.relpath(args[0]) |
| - if not os.path.exists(target): |
| + if os.path.exists(target): |
|
ricow1
2013/10/23 07:45:44
why not just simplify to:
if os.path.exists(target
kustermann
2013/10/23 07:57:40
I thought about it as well -- I was just worried t
|
| + # If the packages directory already exists, delete the current links inside |
| + # it. This is necessary, otherwise we can end up having links in there |
| + # pointing to directories which no longer exist (on incremental builds). |
| + for link in os.listdir(target): |
| + os.remove(os.path.join(target, link)) |
| + else: |
| os.makedirs(target) |
| for source in args[1:]: |
| # Assume the source directory is named ".../NAME/lib". |