diff --git a/nixos/modules/system/boot/loader/limine/limine-install.py b/nixos/modules/system/boot/loader/limine/limine-install.py index 9add26b636c6..dacf4a339d0e 100644 --- a/nixos/modules/system/boot/loader/limine/limine-install.py +++ b/nixos/modules/system/boot/loader/limine/limine-install.py @@ -347,7 +347,7 @@ def config_entry(levels: int, bootspec: BootSpec, label: str, time: str) -> str: os.path.basename(bootspec.toplevel) + "-secrets" ) - if os.system(bootspec.initrdSecrets + " " + initrd_secrets_path_temp) != 0: + if subprocess.run([bootspec.initrdSecrets, initrd_secrets_path_temp]).returncode != 0: print( f'warning: failed to create initrd secrets for "{label}"', file=sys.stderr, diff --git a/pkgs/by-name/mi/microsoft-edge/update.py b/pkgs/by-name/mi/microsoft-edge/update.py index d2298c382e6f..1e6419338fce 100755 --- a/pkgs/by-name/mi/microsoft-edge/update.py +++ b/pkgs/by-name/mi/microsoft-edge/update.py @@ -1,7 +1,7 @@ #! /usr/bin/env nix-shell #! nix-shell -i python3 -p python3Packages.packaging python3Packages.python-debian common-updater-scripts -import os +import subprocess from collections import OrderedDict from os.path import abspath, dirname from urllib import request @@ -39,8 +39,8 @@ def write_expression(): version = Version.re_valid_version.match(latest["stable"]["Version"]).group( "upstream_version" ) - os.system(f'update-source-version microsoft-edge "{version}"') - os.system(f'update-source-version msedgedriver "{version}"') + subprocess.run(["update-source-version", "microsoft-edge", version]) + subprocess.run(["update-source-version", "msedgedriver", version]) write_expression() diff --git a/pkgs/development/python-modules/courlan/default.nix b/pkgs/development/python-modules/courlan/default.nix index d3e63da7213b..86da2f43e917 100644 --- a/pkgs/development/python-modules/courlan/default.nix +++ b/pkgs/development/python-modules/courlan/default.nix @@ -39,7 +39,7 @@ buildPythonPackage (finalAttrs: { substituteInPlace tests/unit_tests.py \ --replace-fail \ 'assert os.system("courlan --help") == 0' \ - 'assert os.system("${courlanBinPath} --help") == 0' \ + 'assert subprocess.run(["${courlanBinPath}", "--help"]).returncode == 0' \ --replace-fail \ 'courlan_bin = "courlan"' \ 'courlan_bin = "${courlanBinPath}"' diff --git a/pkgs/development/python-modules/riscof/make_writeable.patch b/pkgs/development/python-modules/riscof/make_writeable.patch index 938f9913a7ad..c597338cda00 100644 --- a/pkgs/development/python-modules/riscof/make_writeable.patch +++ b/pkgs/development/python-modules/riscof/make_writeable.patch @@ -1,25 +1,33 @@ diff --git a/riscof/cli.py b/riscof/cli.py -index 26af62e..9d0ddbf 100644 +index 26af62e..94051ae 100644 --- a/riscof/cli.py +++ b/riscof/cli.py -@@ -502,6 +502,7 @@ def setup(dutname,refname,work_dir): +@@ -7,6 +7,7 @@ import os + import sys + import pytz + import shutil ++import subprocess + import configparser + import distutils.dir_util + +@@ -502,6 +503,7 @@ def setup(dutname,refname,work_dir): src = os.path.join(constants.root, "Templates/setup/model/") dest = os.path.join(cwd, dutname) distutils.dir_util.copy_tree(src, dest) -+ os.system(f"chmod +w -R '{dest}'") ++ subprcess.run(["chmod", "+w", "-R", dest]) os.rename(cwd+'/'+dutname+'/model_isa.yaml', cwd+'/'+dutname+'/'+dutname+'_isa.yaml') -@@ -525,10 +526,12 @@ def setup(dutname,refname,work_dir): +@@ -525,10 +527,12 @@ def setup(dutname,refname,work_dir): src = os.path.join(constants.root, "Templates/setup/sail_cSim/") dest = os.path.join(cwd, refname) distutils.dir_util.copy_tree(src, dest) -+ os.system(f"chmod +w -R '{dest}'") ++ subprcess.run(["chmod", "+w", "-R", dest]) else: src = os.path.join(constants.root, "Templates/setup/reference/") dest = os.path.join(cwd, refname) distutils.dir_util.copy_tree(src, dest) -+ os.system(f"chmod +w -R '{dest}'") ++ subprcess.run(["chmod", "+w", "-R", dest]) os.rename(cwd+'/'+refname+'/riscof_model.py', cwd+'/'+refname+'/riscof_'+refname+'.py') with open(cwd+'/'+refname+'/riscof_'+refname+'.py', 'r') as file :