Skip to content
Snippets Groups Projects
Commit 220818f7 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

queryPathInfo(): return hash in base-32 if desired

Cherry-picked from the no-manifests branch.
parent 3a9fdf27
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,7 @@ SV * queryDeriver(char * path)
}
SV * queryPathInfo(char * path)
SV * queryPathInfo(char * path, int base32)
PPCODE:
try {
doInit();
......@@ -95,7 +95,7 @@ SV * queryPathInfo(char * path)
XPUSHs(&PL_sv_undef);
else
XPUSHs(sv_2mortal(newSVpv(info.deriver.c_str(), 0)));
string s = "sha256:" + printHash(info.hash);
string s = "sha256:" + (base32 ? printHash32(info.hash) : printHash(info.hash));
XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
mXPUSHi(info.registrationTime);
mXPUSHi(info.narSize);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment