aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-02-21 11:03:20 +0100
committerGitHub <noreply@github.com>2022-02-21 11:03:20 +0100
commitf22b9e72f51f97f8f2d334748d3e97123940a146 (patch)
tree66a2633a7f9ebfeedb9bb6cdc5e765c096469aa8
parent9bc03adbba5334663901c1136203bc07e4776be9 (diff)
parentdbdc63bc41d33a33e75d5fc8efa8e6520f9e6494 (diff)
Merge pull request #6120 from mayflower/print-full-names
path-info: use full store paths when we have them
-rw-r--r--src/libstore/store-api.cc3
-rw-r--r--src/nix/path-info.cc2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 84767e917..8fcdc8b57 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -761,11 +761,11 @@ void Store::pathInfoToJSON(JSONPlaceholder & jsonOut, const StorePathSet & store
for (auto & storePath : storePaths) {
auto jsonPath = jsonList.object();
- jsonPath.attr("path", printStorePath(storePath));
try {
auto info = queryPathInfo(storePath);
+ jsonPath.attr("path", printStorePath(info->path));
jsonPath
.attr("narHash", info->narHash.to_string(hashBase, true))
.attr("narSize", info->narSize);
@@ -819,6 +819,7 @@ void Store::pathInfoToJSON(JSONPlaceholder & jsonOut, const StorePathSet & store
}
} catch (InvalidPath &) {
+ jsonPath.attr("path", printStorePath(storePath));
jsonPath.attr("valid", false);
}
}
diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc
index 3743d7504..d690fe594 100644
--- a/src/nix/path-info.cc
+++ b/src/nix/path-info.cc
@@ -97,7 +97,7 @@ struct CmdPathInfo : StorePathsCommand, MixJSON
for (auto & storePath : storePaths) {
auto info = store->queryPathInfo(storePath);
- auto storePathS = store->printStorePath(storePath);
+ auto storePathS = store->printStorePath(info->path);
std::cout << storePathS;