Chromium Code Reviews| Index: utils/pub/command_lish.dart |
| diff --git a/utils/pub/command_lish.dart b/utils/pub/command_lish.dart |
| index 420952c95a879fd98e9780457f2f833a9b8cbdec..3e61ba2e255f6dfdefafd8cbbecb74f1a4458b30 100644 |
| --- a/utils/pub/command_lish.dart |
| +++ b/utils/pub/command_lish.dart |
| @@ -164,7 +164,18 @@ class LishCommand extends PubCommand { |
| // Should instead only make these relative right before generating |
| // the tree display (which is what really needs them to be). |
| // Make it relative to the package root. |
| - return relativeTo(entry, rootDir); |
| + entry = relativeTo(entry, rootDir); |
| + |
| + // TODO(rnystrom): dir.list() will paths with resolved symlinks. |
|
Jennifer Messerly
2012/12/12 23:49:25
"will include paths" ?
Siggi Cherem (dart-lang)
2012/12/12 23:53:56
woah - I wrote something about this and when I hit
|
| + // In particular, we'll get paths to symlinked files from "packages" |
| + // that reach outside of this package. Since the path has already |
| + // been resolved, we don't even see "packages" in that path anymore. |
| + // These should not be included in the archive. As a hack, ignore |
| + // any file whose relative path is backing out of the root |
| + // directory. Should do something cleaner. |
| + if (entry.length > 1 && entry.startsWith('..')) return null; |
|
Jennifer Messerly
2012/12/12 23:49:25
entry.startsWith('..') implies entry.length > 1 ri
|
| + |
| + return entry; |
| }); |
| })); |
| }); |