Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ValidPath (nar) hash optional if ca field is present #4059

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix narSize usage in Perl bindings too
  • Loading branch information
Ericson2314 committed Sep 24, 2020
commit 04ecf5c0bc8c22f0bd7267fe2c8f24db65273eb0
11 changes: 7 additions & 4 deletions perl/lib/Nix/Store.xs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,17 @@ SV * queryPathInfo(char * path, int base32)
XPUSHs(&PL_sv_undef);
else
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(*info->deriver).c_str(), 0)));
if (auto optHash = info->optNarHash()) {
auto s = optHash->to_string(base32 ? Base32 : Base16, true);
if (auto optHashSize = *info->viewHashResultConst()) {
auto [narHash, narSize] = *optHashSize;
auto s = narHash.to_string(base32 ? Base32 : Base16, true);
XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
mXPUSHi(info->registrationTime);
mXPUSHi(narSize);
} else {
XPUSHs((SV *) NULL);
mXPUSHi(info->registrationTime);
mXPUSHi(0);
}
mXPUSHi(info->registrationTime);
mXPUSHi(info->narSize);
AV * arr = newAV();
for (auto & i : info->references)
av_push(arr, newSVpv(store()->printStorePath(i).c_str(), 0));
Expand Down