nix-push: Always generate base-32 hashes
This commit is contained in:
		
							parent
							
								
									6ec7460af1
								
							
						
					
					
						commit
						cf49472d60
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		|  | @ -86,7 +86,7 @@ SV * queryDeriver(char * path) | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| SV * queryPathInfo(char * path) | SV * queryPathInfo(char * path, int base32) | ||||||
|     PPCODE: |     PPCODE: | ||||||
|         try { |         try { | ||||||
|             doInit(); |             doInit(); | ||||||
|  | @ -95,7 +95,7 @@ SV * queryPathInfo(char * path) | ||||||
|                 XPUSHs(&PL_sv_undef); |                 XPUSHs(&PL_sv_undef); | ||||||
|             else |             else | ||||||
|                 XPUSHs(sv_2mortal(newSVpv(info.deriver.c_str(), 0))); |                 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))); |             XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0))); | ||||||
|             mXPUSHi(info.registrationTime); |             mXPUSHi(info.registrationTime); | ||||||
|             mXPUSHi(info.narSize); |             mXPUSHi(info.narSize); | ||||||
|  |  | ||||||
|  | @ -146,7 +146,7 @@ for (my $n = 0; $n < scalar @storePaths; $n++) { | ||||||
|     my $baseName = basename $storePath; |     my $baseName = basename $storePath; | ||||||
| 
 | 
 | ||||||
|     # Get info about the store path. |     # Get info about the store path. | ||||||
|     my ($deriver, $narHash, $time, $narSize, $refs) = queryPathInfo($storePath); |     my ($deriver, $narHash, $time, $narSize, $refs) = queryPathInfo($storePath, 1); | ||||||
| 
 | 
 | ||||||
|     # In some exceptional cases (such as VM tests that use the Nix |     # In some exceptional cases (such as VM tests that use the Nix | ||||||
|     # store of the host), the database doesn't contain the hash.  So |     # store of the host), the database doesn't contain the hash.  So | ||||||
|  | @ -155,7 +155,7 @@ for (my $n = 0; $n < scalar @storePaths; $n++) { | ||||||
|         my $nar = "$tmpDir/nar"; |         my $nar = "$tmpDir/nar"; | ||||||
|         system("$Nix::Config::binDir/nix-store --dump $storePath > $nar") == 0 |         system("$Nix::Config::binDir/nix-store --dump $storePath > $nar") == 0 | ||||||
|             or die "cannot dump $storePath\n"; |             or die "cannot dump $storePath\n"; | ||||||
|         $narHash = `$Nix::Config::binDir/nix-hash --type sha256 --flat $nar`; |         $narHash = `$Nix::Config::binDir/nix-hash --type sha256 --base32 --flat $nar`; | ||||||
|         die "cannot hash `$nar'" if $? != 0; |         die "cannot hash `$nar'" if $? != 0; | ||||||
|         chomp $narHash; |         chomp $narHash; | ||||||
|         $narHash = "sha256:$narHash"; |         $narHash = "sha256:$narHash"; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue