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

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

Issue 745153002: Make pub's binstubs resilient to changes in snapshot format. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
Index: sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart b/sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart
index ee16741b513fcba1edeb188f443270d51a07b9f7..a6b8f890889fef7fb1cf3d9e347b76ebf27426f1 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/entrypoint.dart
@@ -50,6 +50,12 @@ class Entrypoint {
/// the installed packages.
final bool _packageSymlinks;
+ /// Whether this entrypoint is in-memory and doesn't correspond to a user's
+ /// package directory on disk (for example, a globally activated package).
+ ///
+ /// In-memory entrypoints' lockfiles are always considered up-to-date.
+ final bool _inMemory;
+
/// The lockfile for the entrypoint.
///
/// If not provided to the entrypoint, it will be laoded lazily from disc.
@@ -66,11 +72,13 @@ class Entrypoint {
Entrypoint(String rootDir, SystemCache cache, {bool packageSymlinks: true})
: root = new Package.load(null, rootDir, cache.sources),
cache = cache,
- _packageSymlinks = packageSymlinks;
+ _packageSymlinks = packageSymlinks,
+ _inMemory = false;
/// Creates an entrypoint given package and lockfile objects.
Entrypoint.inMemory(this.root, this._lockFile, this.cache)
- : _packageSymlinks = false;
+ : _packageSymlinks = false,
+ _inMemory = true;
/// The path to the entrypoint's "packages" directory.
String get packagesDir => root.path('packages');
@@ -562,6 +570,8 @@ class Entrypoint {
/// contains dependencies that are not in the lockfile or that don't match
/// what's in there.
bool _isLockFileUpToDate(LockFile lockFile) {
+ if (_inMemory) return true;
+
return root.immediateDependencies.every((package) {
var locked = lockFile.packages[package.name];
if (locked == null) return false;

Powered by Google App Engine
This is Rietveld 408576698