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

Unified Diff: lib/src/entrypoint.dart

Issue 1956543002: Fix a lockfile freshness checking bug. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 7 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 | lib/src/package.dart » ('j') | test/must_pub_get_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/entrypoint.dart
diff --git a/lib/src/entrypoint.dart b/lib/src/entrypoint.dart
index dc1a4a445f6f95eacab95ac2e73ee75c5f2fddd2..bbca8f10c4e459533a7a5b19f7588e69c34aa4c7 100644
--- a/lib/src/entrypoint.dart
+++ b/lib/src/entrypoint.dart
@@ -11,6 +11,7 @@ import 'package:path/path.dart' as p;
import 'package:pub_semver/pub_semver.dart';
import 'barback/asset_environment.dart';
+import 'exceptions.dart';
import 'io.dart';
import 'lock_file.dart';
import 'log.dart' as log;
@@ -511,10 +512,15 @@ class Entrypoint {
// since they're mutable and may have changed since the last get.
return lockFile.packages.values.every((id) {
var source = cache.sources[id.name];
- if (source is! CachedSource) return true;
+ if (source is CachedSource) return true;
- return cache.sources.load(id).dependencies.every((dep) =>
- overrides.contains(dep.name) || _isDependencyUpToDate(dep));
+ try {
+ return cache.sources.load(id).dependencies.every((dep) =>
+ overrides.contains(dep.name) || _isDependencyUpToDate(dep));
+ } on FileException {
+ // If we can't load the pubpsec, the user needs to re-run "pub get".
+ return false;
+ }
});
}
« no previous file with comments | « no previous file | lib/src/package.dart » ('j') | test/must_pub_get_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698