Chromium Code Reviews| Index: dart/tools/make_links.py |
| diff --git a/dart/tools/make_links.py b/dart/tools/make_links.py |
| index 6c08144d2f1b4ea1b45b2970d9547877a55a72ff..ca464ff8e5148d4c4d0f27f892194c3001bbc07e 100644 |
| --- a/dart/tools/make_links.py |
| +++ b/dart/tools/make_links.py |
| @@ -63,12 +63,13 @@ def main(argv): |
| (options, args) = get_options() |
| target = os.path.relpath(args[0]) |
| if os.path.exists(target): |
| - # Remove the packages directory if it already exists. |
| - # This is necessary, otherwise we can end up having links in there |
| + # 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). |
| - print 'Removing %s' % target |
| - shutil.rmtree(target) |
| - os.makedirs(target) |
| + for link in os.listdir(target): |
| + os.remove(os.path.join(target, link)) |
|
kustermann
2013/10/23 08:10:29
If os.remove() raises on these pseudo-symlinks, I'
|
| + else: |
| + os.makedirs(target) |
| for source in args[1:]: |
| # Assume the source directory is named ".../NAME/lib". |
| (name, lib) = os.path.split(source) |