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

Unified Diff: lib/src/global_packages.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/command/cache_repair.dart ('k') | lib/src/source/cached.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/global_packages.dart
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index 335cf8e241a79d5771711d6a0d04f54651093b30..be7bad935599c67c50dad56a330d530ff349053e 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -410,9 +410,10 @@ class GlobalPackages {
/// Repairs any corrupted globally-activated packages and their binstubs.
///
- /// Returns a pair of two [int]s. The first indicates how many packages were
- /// successfully re-activated; the second indicates how many failed.
- Future<Pair<int, int>> repairActivatedPackages() async {
+ /// Returns a pair of two lists of strings. The first indicates which packages
+ /// were successfully re-activated; the second indicates which failed.
+ Future<Pair<List<String>, List<String>>> repairActivatedPackages()
+ async {
var executables = {};
if (dirExists(_binStubDir)) {
for (var entry in listDir(_binStubDir)) {
@@ -440,8 +441,8 @@ class GlobalPackages {
}
}
- var successes = 0;
- var failures = 0;
+ var successes = [];
+ var failures = [];
if (dirExists(_directory)) {
for (var entry in listDir(_directory)) {
var id;
@@ -458,7 +459,7 @@ class GlobalPackages {
_updateBinStubs(graph.packages[id.name], packageExecutables,
overwriteBinStubs: true, snapshots: snapshots,
suggestIfNotOnPath: false);
- successes++;
+ successes.add(id.name);
} catch (error, stackTrace) {
var message = "Failed to reactivate "
"${log.bold(p.basenameWithoutExtension(entry))}";
@@ -468,7 +469,7 @@ class GlobalPackages {
}
log.error(message, error, stackTrace);
- failures++;
+ failures.add(p.basenameWithoutExtension(entry));
tryDeleteEntry(entry);
}
« no previous file with comments | « lib/src/command/cache_repair.dart ('k') | lib/src/source/cached.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698