]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix sed/awk usage in windows ci jobs
authorNeil Horman <nhorman@openssl.org>
Fri, 28 Jun 2024 19:35:36 +0000 (15:35 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 9 Jul 2024 08:01:44 +0000 (04:01 -0400)
The addition of sed and awk, while available in the windows vm's for CI
in powershell, don't behave as I would expect (though the same commands
work with a local installation on windows using GnuWin32).  In trying to
figure out what was going on I found it was far more stable and
predictable to use the powershell -split and -replace commands instead
of sed and awk

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24450)

.github/workflows/windows.yml
.github/workflows/windows_comp.yml

index a0cb656e36c3f7b9b50ab139d0e3a62ad3f31cbd..fc194ebcbbfece47a709b61b6871c36af5f0b0a8 100644 (file)
@@ -56,9 +56,9 @@ jobs:
       run: |
         $Env:OPENSSL_CONF="apps\openssl.cnf"
         apps/openssl.exe version -v
-        apps/openssl.exe version -v | awk '{print $2}'
-        apps/openssl.exe version -v | awk '{print $2}' | sed -e's/\([0-9]\+\.[0-9]\+\)\(\.[0-9]\+\)\(-*.*$\)/\1/'
-        echo "OSSL_VERSION=$(apps/openssl.exe version -v | awk '{print $2}' | sed -e's/\([0-9]\+\.[0-9]\+\)\(\.[0-9]\+\)\(-*.*$\)/\1/')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
+        apps/openssl.exe version -v | %{($_ -split '\s+')[1]} 
+        apps/openssl.exe version -v | %{($_ -split '\s+')[1] -replace '([0-9]+\.[0-9]+)(\..*)','$1'} 
+        echo "OSSL_VERSION=$(apps/openssl.exe version -v | %{($_ -split '\s+')[1] -replace '([0-9]+\.[0-9]+)(\..*)','$1'})" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
     - name: Set registry keys
       working-directory: _build
       run: |
index a65a6b5244d5fe9508e3c7c2a5b228810fa2de8a..36f4caf084ad8498a3515ca843e68f6da0035679 100644 (file)
@@ -38,9 +38,9 @@ jobs:
       run: |
         $Env:OPENSSL_CONF="apps\openssl.cnf"
         apps/openssl.exe version -v
-        apps/openssl.exe version -v | awk '{print $2}'
-        apps/openssl.exe version -v | awk '{print $2}' | sed -e's/\([0-9]\+\.[0-9]\+\)\(\.[0-9]\+\)\(-*.*$\)/\1/'
-        echo "OSSL_VERSION=$(apps/openssl.exe version -v | awk '{print $2}' | sed -e's/\([0-9]\+\.[0-9]\+\)\(\.[0-9]\+\)\(-*.*$\)/\1/')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
+        apps/openssl.exe version -v | %{($_ -split '\s+')[1]}
+        apps/openssl.exe version -v | %{($_ -split '\s+')[1] -replace '([0-9]+\.[0-9]+)(\..*)','$1'} 
+        echo "OSSL_VERSION=$(apps/openssl.exe version -v | %{($_ -split '\s+')[1] -replace '([0-9]+\.[0-9]+)(\..*)','$1'})" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
     - name: Set registry keys
       working-directory: _build
       run: |