Changed check_new_version to more lightweight format. Inform only, no download

This commit is contained in:
2026-06-16 15:04:53 +02:00
parent fc0d515a42
commit d0fd8e9996
3 changed files with 8 additions and 44 deletions
-37
View File
@@ -1,11 +1,7 @@
@echo off @echo off
setlocal EnableExtensions EnableDelayedExpansion setlocal EnableExtensions EnableDelayedExpansion
set UPDATE_DIR=%~dp0updates
if not exist "%UPDATE_DIR%" mkdir "%UPDATE_DIR%"
set TMP_OUT=%TEMP%\update_check_%RANDOM%.txt set TMP_OUT=%TEMP%\update_check_%RANDOM%.txt
set TMP_OUT_2=%TEMP%\update_check_%RANDOM%.txt
python check_new_version.py > "%TMP_OUT%" python check_new_version.py > "%TMP_OUT%"
set EXITCODE=%ERRORLEVEL% set EXITCODE=%ERRORLEVEL%
@@ -23,39 +19,6 @@ if %EXITCODE%==0 (
echo. echo.
type "%TMP_OUT%" type "%TMP_OUT%"
choice /c jn /m "Wollen Sie die Updates-Packages herunterladen?"
if errorlevel 2 goto :END
if exist "%TMP_OUT%" (
findstr /b "PYTHON_DOWNLOAD=" "%TMP_OUT%" >nul
if not errorlevel 1 (
for /f "tokens=1,* delims==" %%a in (
'findstr /b "PYTHON_DOWNLOAD=" "%TMP_OUT%"'
) do (
echo Downloading Python update from PYTHON_DOWNLOAD
powershell -NoProfile -Command ^
"Invoke-WebRequest '%%b' -OutFile '%UPDATE_DIR%\python-embed.zip'"
)
)
findstr /b "CAESIUM_DOWNLOAD=" "%TMP_OUT_2%" >nul
if not errorlevel 1 (
for /f "tokens=1,* delims==" %%a in (
'findstr /b "CAESIUM_DOWNLOAD=" "%TMP_OUT_2%"'
) do (
echo Downloading caesiumclt update from CAESIUM_DOWNLOAD
powershell -NoProfile -Command ^
"Invoke-WebRequest '%%b' -OutFile '%UPDATE_DIR%\caesiumclt.zip'"
)
)
)
:END :END
del "%TMP_OUT%" >nul 2>&1 del "%TMP_OUT%" >nul 2>&1
del "%TMP_OUT_2%" >nul 2>&1
endlocal endlocal
+2 -2
View File
@@ -1,6 +1,6 @@
[DEFAULT] [DEFAULT]
python_used_version = 3.14.5 python_used_version = 3.14.6
python_latest_version = 3.14.5 python_latest_version = 3.14.6
caesiumclt_used_version = v1.3.0 caesiumclt_used_version = v1.3.0
caesiumclt_latest_version = v1.3.0 caesiumclt_latest_version = v1.3.0
+4 -3
View File
@@ -2,10 +2,11 @@ import argparse
import configparser import configparser
import json import json
import sys import sys
import os
import urllib.request import urllib.request
from pathlib import Path from pathlib import Path
INI_FILE = Path("latestversion.ini") INI_FILE = Path("check_new_version.ini")
PYTHON_API = "https://endoflife.date/api/v1/products/python" PYTHON_API = "https://endoflife.date/api/v1/products/python"
CAESIUM_API = "https://api.github.com/repos/Lymphatus/caesium-clt/tags" CAESIUM_API = "https://api.github.com/repos/Lymphatus/caesium-clt/tags"
@@ -79,7 +80,6 @@ def check_caesium(cfg, result):
) )
}) })
def main(): def main():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--yes", action="store_true") parser.add_argument("--yes", action="store_true")
@@ -104,9 +104,10 @@ def main():
for u in result["updates"]: for u in result["updates"]:
print( print(
f"{u['tool'].capitalize()}: aktuell genutzt {u['used']}, " f"{u['tool'].capitalize()}: aktuell genutzt {u['used']}, "
f"neu {u['latest']}, download?" f"neu {u['latest']}"
) )
print(f"{u['tool'].upper()}_DOWNLOAD={u['url']}") print(f"{u['tool'].upper()}_DOWNLOAD={u['url']}")
print(f"{u['tool'].upper()}_LATEST_VERSION={u['latest']}")
if not u["maintained"]: if not u["maintained"]:
print( print(