Skip to content

Commit e29d8bf

Browse files
author
Patrick Meinecke
committed
Merged PR 30677: Revert changes to packaging.psm1
Merged PR 30675: Revert changes to packaging.psm1 Revert changes to packaging.psm1
1 parent 4dfadc6 commit e29d8bf

File tree

1 file changed

+4
-41
lines changed

1 file changed

+4
-41
lines changed

tools/packaging/packaging.psm1

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -889,54 +889,17 @@ function Update-PSSignedBuildFolder
889889
[string[]] $RemoveFilter = ('*.pdb', '*.zip', '*.r2rmap')
890890
)
891891

892-
$BuildPathNormalized = (Get-Item $BuildPath).FullName
893-
$SignedFilesPathNormalized = (Get-Item $SignedFilesPath).FullName
894-
895-
Write-Verbose -Verbose "BuildPath = $BuildPathNormalized"
896-
Write-Verbose -Verbose "SignedFilesPath = $signedFilesPath"
897-
898892
# Replace unsigned binaries with signed
899-
$signedFilesFilter = Join-Path -Path $SignedFilesPathNormalized -ChildPath '*'
900-
Write-Verbose -Verbose "signedFilesFilter = $signedFilesFilter"
901-
893+
$signedFilesFilter = Join-Path -Path $SignedFilesPath -ChildPath '*'
902894
Get-ChildItem -Path $signedFilesFilter -Recurse -File | Select-Object -ExpandProperty FullName | ForEach-Object -Process {
903-
Write-Verbose -Verbose "Processing $_"
904-
905-
# Agents seems to be on a case sensitive file system
906-
if ($IsLinux) {
907-
$relativePath = $_.Replace($SignedFilesPathNormalized, '')
908-
} else {
909-
$relativePath = $_.ToLowerInvariant().Replace($SignedFilesPathNormalized.ToLowerInvariant(), '')
910-
}
911-
912-
Write-Verbose -Verbose "relativePath = $relativePath"
913-
$destination = (Get-Item (Join-Path -Path $BuildPathNormalized -ChildPath $relativePath)).FullName
914-
Write-Verbose -Verbose "destination = $destination"
895+
$relativePath = $_.ToLowerInvariant().Replace($SignedFilesPath.ToLowerInvariant(),'')
896+
$destination = Join-Path -Path $BuildPath -ChildPath $relativePath
915897
Write-Log "replacing $destination with $_"
916-
917-
if (-not (Test-Path $destination)) {
918-
$parent = Split-Path -Path $destination -Parent
919-
$exists = Test-Path -Path $parent
920-
921-
if ($exists) {
922-
Write-Verbose -Verbose "Parent:"
923-
Get-ChildItem -Path $parent | Select-Object -ExpandProperty FullName | Write-Verbose -Verbose
924-
}
925-
926-
Write-Error "File not found: $destination, parent - $parent exists: $exists"
927-
}
928-
929-
$signature = Get-AuthenticodeSignature -FilePath $_
930-
931-
if ($signature.Status -ne 'Valid') {
932-
Write-Error "Invalid signature for $_"
933-
}
934-
935898
Copy-Item -Path $_ -Destination $destination -Force
936899
}
937900

938901
foreach($filter in $RemoveFilter) {
939-
$removePath = Join-Path -Path $BuildPathNormalized -ChildPath $filter
902+
$removePath = Join-Path -Path $BuildPath -ChildPath $filter
940903
Remove-Item -Path $removePath -Recurse -Force
941904
}
942905
}

0 commit comments

Comments
 (0)