about summary refs log tree commit diff
path: root/perl/lib/Nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-17T20·55-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-17T20·55-0400
commit220818f758d2facc194f567f35ca677ef79393bd (patch)
tree7186b0dfbdeda8d81247b394c0e7a1e8e35181f5 /perl/lib/Nix
parent3a9fdf2747bc7436fc3c1fd5f9accd5675d4295e (diff)
queryPathInfo(): return hash in base-32 if desired
Cherry-picked from the no-manifests branch.
Diffstat (limited to 'perl/lib/Nix')
-rw-r--r--perl/lib/Nix/Store.xs4
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);