You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by fr...@apache.org on 2024/09/26 19:24:54 UTC

svn commit: r71907 - /dev/logging/log4net/3.0.1/verify-release.ps1

Author: freeandnil
Date: Thu Sep 26 19:24:53 2024
New Revision: 71907

Log:
added ps-script for windows verification

Added:
    dev/logging/log4net/3.0.1/verify-release.ps1

Added: dev/logging/log4net/3.0.1/verify-release.ps1
==============================================================================
--- dev/logging/log4net/3.0.1/verify-release.ps1 (added)
+++ dev/logging/log4net/3.0.1/verify-release.ps1 Thu Sep 26 19:24:53 2024
@@ -0,0 +1,59 @@
+Param (
+  [Parameter()]
+  [System.IO.DirectoryInfo]$Directory
+)
+
+Set-StrictMode -Version Latest
+$ErrorActionPreference = 'Stop'
+if (!$Directory)
+{
+  $Directory = $PSScriptRoot
+}
+
+function Verify-Hash
+{
+  param
+  (
+    [Parameter(Mandatory=$true, HelpMessage='The file containing the hash.')]
+    [System.IO.FileInfo]$File
+  ) 
+  $Line = @(Get-Content $File.FullName)[0]
+  $Fields = $Line -split '\s+'
+  $Hash = $Fields[0].Trim().ToUpper()
+  $Filename = $Fields[1].Trim()
+  if ($Filename.StartsWith("*"))
+  {
+    $Filename = $Filename.Substring(1).Trim()
+  }
+
+  $ComputedHash = (Get-FileHash -Algorithm 'SHA512' "$($File.DirectoryName)/$Filename").Hash.ToUpper()
+
+  if($Hash -eq $ComputedHash)
+  {
+    "$($Filename): Passed"
+  }
+  else
+  {
+    Write-Error "$($Filename): Not Passed" -ErrorAction Continue
+    Write-Error "Read from file: $Hash" -ErrorAction Continue
+    Write-Error "Computed: $ComputedHash"  -ErrorAction Continue
+  }
+}
+
+foreach ($File in Get-ChildItem $Directory *.sha512)
+{
+  Verify-Hash $File
+}
+
+Invoke-WebRequest https://downloads.apache.org/logging/KEYS -OutFile $Directory/KEYS
+gpg --import $Directory/KEYS
+
+foreach ($File in Get-ChildItem $Directory *.asc)
+{
+  gpg --verify $File
+}
+
+Expand-Archive $Directory/*source*.zip -DestinationPath $Directory/src
+$VersionDirectory = "$Directory/src/$(@(Get-ChildItem $Directory/src)[0])"
+$VersionDirectory
+pushd $VersionDirectory
\ No newline at end of file