From 220818f758d2facc194f567f35ca677ef79393bd Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 17 Jul 2012 16:55:45 -0400
Subject: [PATCH] queryPathInfo(): return hash in base-32 if desired

Cherry-picked from the no-manifests branch.
---
 perl/lib/Nix/Store.xs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/perl/lib/Nix/Store.xs b/perl/lib/Nix/Store.xs
index 8ca72b62a..2ebff5575 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);
-- 
GitLab