@@ -46,43 +46,41 @@ void printGCWarning()
46
46
47
47
void printMissing (ref<Store> store, const std::vector<DerivedPath> & paths, Verbosity lvl)
48
48
{
49
- uint64_t downloadSize, narSize;
50
- StorePathSet willBuild, willSubstitute, unknown;
51
- store->queryMissing (paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
52
- printMissing (store, willBuild, willSubstitute, unknown, downloadSize, narSize, lvl);
49
+ printMissing (store, store->queryMissing (paths), lvl);
53
50
}
54
51
55
52
56
- void printMissing (ref<Store> store, const StorePathSet & willBuild,
57
- const StorePathSet & willSubstitute, const StorePathSet & unknown,
58
- uint64_t downloadSize, uint64_t narSize, Verbosity lvl)
53
+ void printMissing (
54
+ ref<Store> store,
55
+ const MissingPaths & missing,
56
+ Verbosity lvl)
59
57
{
60
- if (!willBuild.empty ()) {
61
- if (willBuild.size () == 1 )
58
+ if (!missing. willBuild .empty ()) {
59
+ if (missing. willBuild .size () == 1 )
62
60
printMsg (lvl, " this derivation will be built:" );
63
61
else
64
- printMsg (lvl, " these %d derivations will be built:" , willBuild.size ());
65
- auto sorted = store->topoSortPaths (willBuild);
62
+ printMsg (lvl, " these %d derivations will be built:" , missing. willBuild .size ());
63
+ auto sorted = store->topoSortPaths (missing. willBuild );
66
64
reverse (sorted.begin (), sorted.end ());
67
65
for (auto & i : sorted)
68
66
printMsg (lvl, " %s" , store->printStorePath (i));
69
67
}
70
68
71
- if (!willSubstitute.empty ()) {
72
- const float downloadSizeMiB = downloadSize / (1024 .f * 1024 .f );
73
- const float narSizeMiB = narSize / (1024 .f * 1024 .f );
74
- if (willSubstitute.size () == 1 ) {
69
+ if (!missing. willSubstitute .empty ()) {
70
+ const float downloadSizeMiB = missing. downloadSize / (1024 .f * 1024 .f );
71
+ const float narSizeMiB = missing. narSize / (1024 .f * 1024 .f );
72
+ if (missing. willSubstitute .size () == 1 ) {
75
73
printMsg (lvl, " this path will be fetched (%.2f MiB download, %.2f MiB unpacked):" ,
76
74
downloadSizeMiB,
77
75
narSizeMiB);
78
76
} else {
79
77
printMsg (lvl, " these %d paths will be fetched (%.2f MiB download, %.2f MiB unpacked):" ,
80
- willSubstitute.size (),
78
+ missing. willSubstitute .size (),
81
79
downloadSizeMiB,
82
80
narSizeMiB);
83
81
}
84
82
std::vector<const StorePath *> willSubstituteSorted = {};
85
- std::for_each (willSubstitute.begin (), willSubstitute.end (),
83
+ std::for_each (missing. willSubstitute .begin (), missing. willSubstitute .end (),
86
84
[&](const StorePath &p) { willSubstituteSorted.push_back (&p); });
87
85
std::sort (willSubstituteSorted.begin (), willSubstituteSorted.end (),
88
86
[](const StorePath *lhs, const StorePath *rhs) {
@@ -95,10 +93,10 @@ void printMissing(ref<Store> store, const StorePathSet & willBuild,
95
93
printMsg (lvl, " %s" , store->printStorePath (*p));
96
94
}
97
95
98
- if (!unknown.empty ()) {
96
+ if (!missing. unknown .empty ()) {
99
97
printMsg (lvl, " don't know how to build these paths%s:" ,
100
98
(settings.readOnlyMode ? " (may be caused by read-only store access)" : " " ));
101
- for (auto & i : unknown)
99
+ for (auto & i : missing. unknown )
102
100
printMsg (lvl, " %s" , store->printStorePath (i));
103
101
}
104
102
}
0 commit comments