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

Unified Diff: lib/src/source/hosted.dart

Issue 1239623005: "pub cache repair" prints a more detailed summary. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 5 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 | « lib/src/source/git.dart ('k') | test/cache/repair/handles_corrupted_global_lockfile_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/source/hosted.dart
diff --git a/lib/src/source/hosted.dart b/lib/src/source/hosted.dart
index ad1b74f839abe4101429cd2c50ff9487905988b1..5d3017b2f33a5d8e4787025412f3ed20a44b25a6 100644
--- a/lib/src/source/hosted.dart
+++ b/lib/src/source/hosted.dart
@@ -125,11 +125,11 @@ class HostedSource extends CachedSource {
/// Re-downloads all packages that have been previously downloaded into the
/// system cache from any server.
- Future<Pair<int, int>> repairCachedPackages() async {
- if (!dirExists(systemCacheRoot)) return new Pair(0, 0);
+ Future<Pair<List<PackageId>, List<PackageId>>> repairCachedPackages() async {
+ if (!dirExists(systemCacheRoot)) return new Pair([], []);
- var successes = 0;
- var failures = 0;
+ var successes = [];
+ var failures = [];
for (var serverDir in listDir(systemCacheRoot)) {
var url = _directoryToUrl(path.basename(serverDir));
@@ -137,11 +137,13 @@ class HostedSource extends CachedSource {
packages.sort(Package.orderByNameAndVersion);
for (var package in packages) {
+ var id = new PackageId(package.name, this.name, package.version, null);
+
try {
await _download(url, package.name, package.version, package.dir);
- successes++;
+ successes.add(id);
} catch (error, stackTrace) {
- failures++;
+ failures.add(id);
var message = "Failed to repair ${log.bold(package.name)} "
"${package.version}";
if (url != defaultUrl) message += " from $url";
« no previous file with comments | « lib/src/source/git.dart ('k') | test/cache/repair/handles_corrupted_global_lockfile_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698