mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix computation of SHA512 checksum (#15736)
This commit is contained in:
@@ -2204,10 +2204,14 @@ function New-ReferenceAssembly
|
||||
|
||||
$sourceProjectRoot = Join-Path $PSScriptRoot "projects/reference/$assemblyName"
|
||||
$sourceProjectFile = Join-Path $sourceProjectRoot "$assemblyName.csproj"
|
||||
Copy-Item -Path $sourceProjectFile -Destination "$projectFolder/$assemblyName.csproj" -Force
|
||||
Copy-Item -Path (Join-Path -Path $PSScriptRoot -ChildPath "../../nuget.config") -Destination $projectFolder
|
||||
|
||||
Write-Host "##vso[artifact.upload containerfolder=artifact;artifactname=artifact]$projectFolder/$assemblyName.csproj"
|
||||
$destProjectFile = Join-Path $projectFolder "$assemblyName.csproj"
|
||||
$nugetConfigFile = Join-Path $PSScriptRoot "../../nuget.config"
|
||||
|
||||
Copy-Item -Path $sourceProjectFile -Destination $destProjectFile -Force -Verbose
|
||||
Copy-Item -Path $nugetConfigFile -Destination $projectFolder -Verbose
|
||||
|
||||
Write-Host "##vso[artifact.upload containerfolder=artifact;artifactname=artifact]$destProjectFile"
|
||||
Write-Host "##vso[artifact.upload containerfolder=artifact;artifactname=artifact]$generatedSource"
|
||||
|
||||
$arguments = GenerateBuildArguments -AssemblyName $assemblyName -RefAssemblyVersion $RefAssemblyVersion -SnkFilePath $SnkFilePath -SMAReferencePath $SMAReferenceAssembly
|
||||
|
||||
@@ -201,16 +201,18 @@ jobs:
|
||||
$packagePathList = Get-ChildItem $packagePath -Recurse | Select-Object -ExpandProperty FullName | Out-String
|
||||
Write-Verbose -Verbose $packagePathList
|
||||
|
||||
Get-ChildItem -Path $packagePath |
|
||||
$checksums = Get-ChildItem -Path $packagePath |
|
||||
ForEach-Object {
|
||||
Write-Verbose -Verbose "Generating checksum file for $($_.FullName)"
|
||||
$packageName = $_.Name
|
||||
$hash = (Get-FileHash -Path $_.FullName -Algorithm SHA512).Hash.ToLower()
|
||||
Write-Verbose -Verbose "Generating checksum file for $($_.FullName)"
|
||||
$packageName = $_.Name
|
||||
$hash = (Get-FileHash -Path $_.FullName -Algorithm SHA512).Hash.ToLower()
|
||||
|
||||
# the '*' before the packagename signifies it is a binary
|
||||
"$hash *$packageName"
|
||||
}
|
||||
|
||||
$checksums | Out-File -FilePath "$packagePath\SHA512SUMS" -Force
|
||||
|
||||
# the '*' before the packagename signifies it is a binary
|
||||
"$hash *$packageName"
|
||||
} |
|
||||
Out-File -FilePath "$packagePath\SHA512SUMS" -Force
|
||||
|
||||
$fileContent = Get-Content -Path "$packagePath\SHA512SUMS" -Raw | Out-String
|
||||
Write-Verbose -Verbose -Message $fileContent
|
||||
|
||||
Reference in New Issue
Block a user