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

Unified Diff: sdk/lib/_internal/pub/lib/src/entrypoint.dart

Issue 1087053003: Clear out outdated binary snapshots when installing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Bunch of fixes Created 5 years, 8 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 | sdk/lib/_internal/pub/test/run/runs_from_a_dependency_override_after_dependency_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/entrypoint.dart
diff --git a/sdk/lib/_internal/pub/lib/src/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
index d207147aeed15babcfe3ff90b79fd611b33c3b62..e97f688e5b66d96da849a773965c4ecbc53be991 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -255,6 +255,20 @@ class Entrypoint {
if (!sdkMatches) changed = null;
var graph = await loadPackageGraph();
+
+ // Clean out any outdated snapshots.
+ if (dirExists(binDir)) {
+ for (var entry in listDir(binDir)) {
+ if (!dirExists(entry)) continue;
+
+ var package = path.basename(entry);
+ if (!graph.packages.containsKey(package) ||
+ graph.isPackageMutable(package)) {
+ deleteEntry(entry);
+ }
+ }
+ }
+
var executables = new Map.fromIterable(root.immediateDependencies,
key: (dep) => dep.name,
value: (dep) => _executablesForPackage(graph, dep.name, changed));
@@ -319,7 +333,7 @@ class Entrypoint {
return executables;
}
- // If any executables doesn't exist, precompile them regardless of what
+ // If any executables don't exist, precompile them regardless of what
// changed. Since we delete the bin directory before recompiling, we need to
// recompile all executables.
var executablesExist = executables.every((executable) =>
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/run/runs_from_a_dependency_override_after_dependency_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698