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

Unified Diff: utils/pub/entrypoint.dart

Issue 12879015: Provisionally stop working around issues 9252 and 9253. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 9 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 | « pkg/scheduled_test/test/utils.dart ('k') | utils/pub/hosted_source.dart » ('j') | no next file with comments »
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 a6afb14a2109bce79ffd3a9b0aef6481ef243e1c..a190c1ba3cdb6be618a7f8a270ffc4909d47a96c 100644
--- a/utils/pub/entrypoint.dart
+++ b/utils/pub/entrypoint.dart
@@ -73,13 +73,14 @@ class Entrypoint {
var packageDir = path.join(packagesDir, id.name);
var future = defer(() {
ensureDir(path.dirname(packageDir));
- if (!dirExists(packageDir)) return;
- // TODO(nweiz): figure out when to actually delete the directory, and when
- // we can just re-use the existing symlink.
- log.fine("Deleting package directory for ${id.name} before install.");
- return deleteDir(packageDir);
- }).then((_) {
+ if (dirExists(packageDir)) {
+ // TODO(nweiz): figure out when to actually delete the directory, and
+ // when we can just re-use the existing symlink.
+ log.fine("Deleting package directory for ${id.name} before install.");
+ deleteDir(packageDir);
+ }
+
if (id.source.shouldCache) {
return cache.install(id).then(
(pkg) => createPackageSymlink(id.name, pkg.dir, packageDir));
@@ -130,7 +131,8 @@ class Entrypoint {
/// Removes the old packages directory, installs all dependencies listed in
/// [packageVersions], and writes a [LockFile].
Future _installDependencies(List<PackageId> packageVersions) {
- return cleanDir(packagesDir).then((_) {
+ return new Future.of(() {
+ cleanDir(packagesDir);
return Future.wait(packageVersions.map((id) {
if (id.isRoot) return new Future.immediate(id);
return install(id);
@@ -296,13 +298,12 @@ class Entrypoint {
Future _linkSecondaryPackageDir(String dir) {
return defer(() {
var symlink = path.join(dir, 'packages');
- return new Future.of(() {
- if (fileExists(symlink)) {
- deleteFile(symlink);
- } else if (dirExists(symlink)) {
- return deleteDir(symlink);
- }
- }).then((_) => createSymlink(packagesDir, symlink, relative: true));
+ if (fileExists(symlink)) {
+ deleteFile(symlink);
+ } else if (dirExists(symlink)) {
+ deleteDir(symlink);
+ }
+ return createSymlink(packagesDir, symlink, relative: true);
});
}
}
« no previous file with comments | « pkg/scheduled_test/test/utils.dart ('k') | utils/pub/hosted_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698