summary refs log tree commit diff
path: root/src/nix-store
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-04-07 14:33:32 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-04-07 14:33:32 +0000
commitf9848d4f3122b8a43b69d53277b606806bdba9dd (patch)
treeb796169055517a52717648a17a45596c4073d5d4 /src/nix-store
parentc815aff21b668f5fe7bbd04086a988df51281840 (diff)
downloadguix-f9848d4f3122b8a43b69d53277b606806bdba9dd.tar.gz
* Support base-32 hash representations.
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/main.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc
index a8720ce6fb..6de26dabc9 100644
--- a/src/nix-store/main.cc
+++ b/src/nix-store/main.cc
@@ -132,9 +132,13 @@ static void opPrintFixedPath(Strings opFlags, Strings opArgs)
     string hash = *i++;
     string name = *i++;
 
+    HashType ht(parseHashType(hashAlgo));
+    Hash h = hash.size() == Hash(ht).hashSize * 2
+        ? parseHash(ht, hash)
+        : parseHash32(ht, hash);
+    
     cout << format("%1%\n") %
-        makeFixedOutputPath(recursive, hashAlgo,
-            parseHash(parseHashType(hashAlgo), hash), name);
+        makeFixedOutputPath(recursive, hashAlgo, h, name);
 }