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

Unified Diff: utils/pub/entrypoint.dart

Issue 10916190: Support both new and old style package layouts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 8 years, 3 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 | « no previous file | utils/pub/io.dart » ('j') | utils/pub/io.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/entrypoint.dart
diff --git a/utils/pub/entrypoint.dart b/utils/pub/entrypoint.dart
index f32e9a595c1b679323d0decda1d90980ebef7c0e..22d04ab0a3fb78826274cde74f7ca221d3b97d8c 100644
--- a/utils/pub/entrypoint.dart
+++ b/utils/pub/entrypoint.dart
@@ -31,9 +31,6 @@
* but may be the entrypoint when you're running its tests.
*/
class Entrypoint {
- // TODO(rnystrom): Get rid of this when #4820 is fixed.
- static bool installSelfLink = false;
-
/**
* The root package this entrypoint is associated with.
*/
@@ -88,7 +85,7 @@ class Entrypoint {
}).chain((_) {
if (id.source.shouldCache) {
return cache.install(id).chain(
- (pkg) => createSymlink(pkg.dir, packageDir));
+ (pkg) => createPackageSymlink(id.name, pkg.dir, packageDir));
} else {
return id.source.install(id, packageDir).transform((found) {
if (found) return null;
@@ -226,18 +223,11 @@ class Entrypoint {
Future _installSelfReference(_) {
var linkPath = join(path, root.name);
return exists(linkPath).chain((exists) {
- if (installSelfLink) {
- // Create the symlink if it doesn't exist.
- if (exists) return new Future.immediate(null);
- return ensureDir(path).chain((_) => createSymlink(root.dir, linkPath));
- } else {
- // TODO(rnystrom): Get rid of this branch when #4820 is fixed.
- // Delete the old one if it's there.
- return ensureDir(path).chain((_) {
- if (!exists) return new Future.immediate(null);
- return deleteDir(linkPath);
- });
- }
+ // Create the symlink if it doesn't exist.
+ if (exists) return new Future.immediate(null);
+ return ensureDir(path).chain(
+ (_) => createPackageSymlink(root.name, root.dir, linkPath,
+ isSelfLink: true));
});
}
« no previous file with comments | « no previous file | utils/pub/io.dart » ('j') | utils/pub/io.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698