Skip to content

Commit

Permalink
GH-21: Workflow experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
negrutiu committed Jun 8, 2024
1 parent 9862a2e commit fea5e30
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion _build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ echo.
echo --------------------------------------------------------
echo.

py -3 _versions.py --indent=2 --curl=%vcpkginstall%\tools\curl\curl.exe --gcc=gcc.exe> "%bindir%\versions.json"
py -3 _versions.py --indent=2 --curl=%curldir%\curl.exe --gcc=gcc.exe> "%bindir%\versions.json"
type %bindir%\versions.json
:end_versions

Expand Down
41 changes: 19 additions & 22 deletions _versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,26 @@ def get_gcc_version(gccPath):
return ""

def get_curl_engines_versions(curlPath):
try:
process = Popen([curlPath, "--version"], stdout=PIPE, stderr=PIPE)
(cout, cerr) = process.communicate()
exit_code = process.wait()
process = Popen([curlPath, "--version"], stdout=PIPE, stderr=PIPE)
(cout, cerr) = process.communicate()
exit_code = process.wait()

# possible outputs:
# "curl 7.70.0 (x86_64-pc-win32) libcurl/7.70.0 OpenSSL/1.1.1g (Schannel) zlib/1.2.11 brotli/1.0.7 WinIDN libssh2/1.9.0 nghttp2/1.41.0"
# "curl 8.8.0 (x86_64-windows-gnu) libcurl/8.8.0 OpenSSL/3.3.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 nghttp2/1.62.1"
# "curl 8.4.0 (Windows) libcurl/8.4.0 Schannel WinIDN"
if cout != None:
for line in cout.decode('utf-8').split("\r\n"):
# print(f"out: {line}")
if re.match(r'^curl [\d\.]+\s', line) != None:
versions = {}
for group in re.findall(r'(\S+\/\S+)', line):
versions[group.split('/')[0].lower()] = group.split('/')[1]
return versions
if cerr != None:
for line in cerr.decode('utf-8').split("\r\n"):
print(f"err: {line}")
return {}
except:
return {}
# possible outputs:
# "curl 7.70.0 (x86_64-pc-win32) libcurl/7.70.0 OpenSSL/1.1.1g (Schannel) zlib/1.2.11 brotli/1.0.7 WinIDN libssh2/1.9.0 nghttp2/1.41.0"
# "curl 8.8.0 (x86_64-windows-gnu) libcurl/8.8.0 OpenSSL/3.3.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 nghttp2/1.62.1"
# "curl 8.4.0 (Windows) libcurl/8.4.0 Schannel WinIDN"
if cout != None:
for line in cout.decode('utf-8').split("\r\n"):
# print(f"out: {line}")
if re.match(r'^curl [\d\.]+\s', line) != None:
versions = {}
for group in re.findall(r'(\S+\/\S+)', line):
versions[group.split('/')[0].lower()] = group.split('/')[1]
return versions
if cerr != None:
for line in cerr.decode('utf-8').split("\r\n"):
print(f"err: {line}")
return {}

def get_curl_versions(curlPath, markdown=False):
versions = ''
Expand Down

0 comments on commit fea5e30

Please sign in to comment.