Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

windows/packaging.py: Don't use % variables

Freya Lupen6a9db1d3e5d3
diff --git a/packaging/windows/msix/build_msix.py b/packaging/windows/msix/build_msix.py
index 757fec389a..90d9940f22 100644
--- a/packaging/windows/msix/build_msix.py
+++ b/packaging/windows/msix/build_msix.py
@@ -168,7 +168,7 @@ if os.path.isfile(fr"{environ['KRITA_DIR']}\uninstall.exe*"):
print("\n=== Step 1: Generate resources.pri ===")
-commandToRun = r'"%MAKEPRI%" new /pr "%SCRIPT_DIR%\pkg" /mn "%SCRIPT_DIR%\manifest.xml" /cf "%SCRIPT_DIR%\priconfig.xml" /o /of "%OUTPUT_DIR%\resources.pri"'
+commandToRun = fr'"{environ["MAKEPRI"]}" new /pr "{environ["SCRIPT_DIR"]}\pkg" /mn "{environ["SCRIPT_DIR"]}\manifest.xml" /cf "{environ["SCRIPT_DIR"]}\priconfig.xml" /o /of "{environ["OUTPUT_DIR"]}\resources.pri"'
try:
subprocess.check_call(commandToRun, stdout=sys.stdout, stderr=sys.stderr, shell=True)
except subprocess.CalledProcessError:
@@ -230,7 +230,7 @@ The arguments stands for:
/p <output package name>: Specifies the app package or bundle.
"""
-commandToRun = r'"%MAKEAPPX%" pack /v /f "%OUTPUT_DIR%\mapping.txt" /p "%OUTPUT_DIR%\krita.msix" /o'
+commandToRun = fr'"{environ["MAKEAPPX"]}" pack /v /f "{environ["OUTPUT_DIR"]}\mapping.txt" /p "{environ["OUTPUT_DIR"]}\krita.msix" /o'
try:
subprocess.check_call(commandToRun, stdout=sys.stdout, stderr=sys.stderr, shell=True)
except subprocess.CalledProcessError:
@@ -241,7 +241,7 @@ print(f"\nMSIX generated as {environ['OUTPUT_DIR']}\\krita.msix")
if environ.get('SIGNTOOL_SIGN_FLAGS'):
print("Signing MSIX...")
- commandToRun = r'"%SIGNTOOL%" sign %SIGNTOOL_SIGN_FLAGS% /fd sha256 "%OUTPUT_DIR%\krita.msix"'
+ commandToRun = fr'"{environ["SIGNTOOL"]}" sign {environ["SIGNTOOL_SIGN_FLAGS"]} /fd sha256 "{environ["OUTPUT_DIR"]}\krita.msix"'
try:
subprocess.check_call(commandToRun, stdout=sys.stdout, stderr=sys.stderr, shell=True)
except subprocess.CalledProcessError:
diff --git a/packaging/windows/sign-package.py b/packaging/windows/sign-package.py
index 329bca929b..522d1875ca 100644
--- a/packaging/windows/sign-package.py
+++ b/packaging/windows/sign-package.py
@@ -45,14 +45,14 @@ for rootPath, dirs, files in os.walk(pkg_root):
if fileName.endswith(('.exe', '.com', '.dll', '.pyd')):
filePath = os.path.join(rootPath, fileName)
# Check for existing signature
- commandToRun = f'"%SIGNTOOL%" verify /q /pa "{filePath}"'
+ commandToRun = f'"{environ["SIGNTOOL"]}" verify /q /pa "{filePath}"'
try:
subprocess.check_call(commandToRun, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, shell=True)
except subprocess.CalledProcessError as status:
if status.returncode == 1:
print(f"Signing {filePath}")
try:
- commandToRun = f'"%SIGNTOOL%" sign %SIGNTOOL_SIGN_FLAGS% "{filePath}"'
+ commandToRun = f'"{environ["SIGNTOOL"]}" sign {environ["SIGNTOOL_SIGN_FLAGS"]} "{filePath}"'
subprocess.check_call(commandToRun, stdout=sys.stdout, stderr=sys.stderr, shell=True)
except subprocess.CalledProcessError as status:
print(f"ERROR: Got exit code {status.returncode} from signtool!")