Tighten parsing for drv files and pathinfo
This commit is contained in:
parent
b6b10b1d4c
commit
1fc835aa22
|
@ -68,7 +68,7 @@ ContentAddress parseContentAddress(std::string_view rawCa) {
|
|||
throw Error("text content address hash should use %s, but instead uses %s",
|
||||
printHashType(htSHA256), printHashType(hashType));
|
||||
return TextHash {
|
||||
.hash = Hash::parseAny(rest, std::move(hashType)),
|
||||
.hash = Hash::parseNonSRIUnprefixed(rest, std::move(hashType)),
|
||||
};
|
||||
} else if (prefix == "fixed") {
|
||||
// Parse method
|
||||
|
@ -80,7 +80,7 @@ ContentAddress parseContentAddress(std::string_view rawCa) {
|
|||
HashType hashType = parseHashType_();
|
||||
return FixedOutputHash {
|
||||
.method = method,
|
||||
.hash = Hash::parseAny(rest, std::move(hashType)),
|
||||
.hash = Hash::parseNonSRIUnprefixed(rest, std::move(hashType)),
|
||||
};
|
||||
} else
|
||||
throw UsageError("content address prefix \"%s\" is unrecognized. Recogonized prefixes are \"text\" or \"fixed\"", prefix);
|
||||
|
|
|
@ -118,7 +118,7 @@ static DerivationOutput parseDerivationOutput(const Store & store, istringstream
|
|||
const HashType hashType = parseHashType(hashAlgo);
|
||||
fsh = FixedOutputHash {
|
||||
.method = std::move(method),
|
||||
.hash = Hash::parseAny(hash, hashType),
|
||||
.hash = Hash::parseNonSRIUnprefixed(hash, hashType),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,7 @@ static DerivationOutput readDerivationOutput(Source & in, const Store & store)
|
|||
auto hashType = parseHashType(hashAlgo);
|
||||
fsh = FixedOutputHash {
|
||||
.method = std::move(method),
|
||||
.hash = Hash::parseAny(hash, hashType),
|
||||
.hash = Hash::parseNonSRIUnprefixed(hash, hashType),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue