mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
queryPathInfo(): return hash in base-32 if desired
Cherry-picked from the no-manifests branch.
This commit is contained in:
parent
3a9fdf2747
commit
220818f758
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue