mirror of
https://github.com/NixOS/nix
synced 2025-06-29 06:21:14 +02:00
"Downstream placeholders" should not be store paths
Insead they should be opaque `/<hash>` like the placeholders we already have.
This commit is contained in:
parent
27a3f82c0b
commit
3a7b330b64
3 changed files with 7 additions and 9 deletions
|
@ -664,14 +664,12 @@ std::string hashPlaceholder(const std::string & outputName)
|
|||
return "/" + hashString(htSHA256, "nix-output:" + outputName).to_string(Base32, false);
|
||||
}
|
||||
|
||||
StorePath downstreamPlaceholder(const Store & store, const StorePath & drvPath, std::string_view outputName)
|
||||
std::string downstreamPlaceholder(const Store & store, const StorePath & drvPath, std::string_view outputName)
|
||||
{
|
||||
auto drvNameWithExtension = drvPath.name();
|
||||
auto drvName = drvNameWithExtension.substr(0, drvNameWithExtension.size() - 4);
|
||||
return store.makeStorePath(
|
||||
"downstream-placeholder:" + std::string { drvPath.name() } + ":" + std::string { outputName },
|
||||
"compressed:" + std::string { drvPath.hashPart() },
|
||||
outputPathName(drvName, outputName));
|
||||
auto clearText = "nix-upstream-output:" + std::string { drvPath.hashPart() } + ":" + outputPathName(drvName, outputName);
|
||||
return "/" + hashString(htSHA256, clearText).to_string(Base32, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue