diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-17T20·55-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-17T20·55-0400 |
commit | 220818f758d2facc194f567f35ca677ef79393bd (patch) | |
tree | 7186b0dfbdeda8d81247b394c0e7a1e8e35181f5 /perl/lib | |
parent | 3a9fdf2747bc7436fc3c1fd5f9accd5675d4295e (diff) |
queryPathInfo(): return hash in base-32 if desired
Cherry-picked from the no-manifests branch.
Diffstat (limited to 'perl/lib')
-rw-r--r-- | perl/lib/Nix/Store.xs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/perl/lib/Nix/Store.xs b/perl/lib/Nix/Store.xs index 8ca72b62a31f..2ebff5575616 100644 --- a/perl/lib/Nix/Store.xs +++ b/perl/lib/Nix/Store.xs @@ -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); |