Chromium Code Reviews| 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 940efab97d5c5a9a67b311dca22ec2048c0a278f..10d5a6f42c09547731a20e5226dca5366b98b2eb 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart |
| +++ b/sdk/lib/_internal/pub/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; |
|
Bob Nystrom
2014/11/21 19:13:40
Can we determine this from the root package? Will
nweiz
2014/11/22 02:32:55
Good idea. Done.
|
| + |
| /// 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'); |
| @@ -348,6 +356,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; |