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

Unified Diff: lib/src/global_packages.dart

Issue 1534093002: Improve the detection lockfile freshness. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years 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: lib/src/global_packages.dart
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index c90e8dd2746cf757e877abf360c4d2b39f2f5721..6a813a172d4f3dcd0ca994621113aca567588a93 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -168,13 +168,14 @@ class GlobalPackages {
// Make sure all of the dependencies are locally installed.
await Future.wait(result.packages.map(_cacheDependency));
- var lockFile = new LockFile(result.packages, cache.sources);
// Load the package graph from [result] so we don't need to re-parse all
// the pubspecs.
var entrypoint = new Entrypoint.fromSolveResult(root, cache, result,
isGlobal: true);
var snapshots = await _precompileExecutables(entrypoint, dep.name);
+
+ var lockFile = result.lockFile;
_writeLockFile(dep.name, lockFile);
writeTextFile(_getPackagesFilePath(dep.name), lockFile.packagesFile());
@@ -309,10 +310,8 @@ class GlobalPackages {
if (source is CachedSource) {
// For cached sources, the package itself is in the cache and the
// lockfile is the one we just loaded.
- var dir = cache.sources[id.source].getDirectory(id);
- var package = new Package.load(name, dir, cache.sources);
entrypoint = new Entrypoint.inMemory(
- package, lockFile, cache, isGlobal: true);
+ cache.sources.load(id), lockFile, cache, isGlobal: true);
} else {
// For uncached sources (i.e. path), the ID just points to the real
// directory for the package.

Powered by Google App Engine
This is Rietveld 408576698