diff options
author | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2024-04-21 20:04:29 +0200 |
---|---|---|
committer | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2024-04-21 21:44:20 +0200 |
commit | 7151eeec4819222c181df80696f1bf43547bca51 (patch) | |
tree | 2be5ef52a0dc57f1ea10d799c356196d1d688cf8 | |
parent | b8af6d814ded5e1f07be53f338b9d0e5ac397d64 (diff) |
treewide: `--replace` -> `--replace-fail`
Hardening the packages I maintain. We use `--replace-fail` in every case except for `python3Packages.remi`, which does a glob `--replace-quiet` to reduce warnings
-rw-r--r-- | pkgs/by-name/no/normcap/package.nix | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/gnu-cim/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/libraries/librealsense/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/python-modules/birch/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/python-modules/cachier/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/python-modules/ffmpy/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/python-modules/pymongo-inmemory/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/python-modules/pyrender/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/python-modules/pyunpack/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/python-modules/remi/default.nix | 8 | ||||
-rw-r--r-- | pkgs/development/python-modules/strct/default.nix | 4 | ||||
-rw-r--r-- | pkgs/tools/misc/pokemonsay/default.nix | 14 | ||||
-rw-r--r-- | pkgs/tools/misc/remote-exec/default.nix | 2 | ||||
-rw-r--r-- | pkgs/tools/misc/rmate-sh/default.nix | 2 |
14 files changed, 26 insertions, 26 deletions
diff --git a/pkgs/by-name/no/normcap/package.nix b/pkgs/by-name/no/normcap/package.nix index 7018cc5657805..b9276d0abf8b2 100644 --- a/pkgs/by-name/no/normcap/package.nix +++ b/pkgs/by-name/no/normcap/package.nix @@ -40,7 +40,7 @@ ps.buildPythonApplication rec { postPatch = '' # disable coverage testing substituteInPlace pyproject.toml \ - --replace "addopts = [" "addopts_ = [" + --replace-fail "addopts = [" "addopts_ = [" ''; pythonRemoveDeps = [ diff --git a/pkgs/development/compilers/gnu-cim/default.nix b/pkgs/development/compilers/gnu-cim/default.nix index b1cb9f08597e0..54ba6cffff130 100644 --- a/pkgs/development/compilers/gnu-cim/default.nix +++ b/pkgs/development/compilers/gnu-cim/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { postPatch = '' for fname in lib/{simulation,simset}.c; do substituteInPlace "$fname" \ - --replace \ + --replace-fail \ '#include "../../lib/cim.h"' \ '#include "../lib/cim.h"' done diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix index fe35759da63a9..cb69770f054a0 100644 --- a/pkgs/development/libraries/librealsense/default.nix +++ b/pkgs/development/libraries/librealsense/default.nix @@ -74,7 +74,7 @@ stdenv.mkDerivation rec { # ( https://github.com/IntelRealSense/meta-intel-realsense/issues/20 ) postInstall = '' substituteInPlace $out/lib/cmake/realsense2/realsense2Targets.cmake \ - --replace "\''${_IMPORT_PREFIX}/include" "$dev/include" + --replace-fail "\''${_IMPORT_PREFIX}/include" "$dev/include" '' + lib.optionalString enablePython '' cp ../wrappers/python/pyrealsense2/__init__.py $out/${pythonPackages.python.sitePackages}/pyrealsense2 ''; diff --git a/pkgs/development/python-modules/birch/default.nix b/pkgs/development/python-modules/birch/default.nix index 1dd4848427e52..4c6c855993453 100644 --- a/pkgs/development/python-modules/birch/default.nix +++ b/pkgs/development/python-modules/birch/default.nix @@ -31,13 +31,13 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pytest.ini \ - --replace \ + --replace-fail \ "--cov" \ "#--cov" # configure correct version, which fails due to missing .git substituteInPlace versioneer.py birch/_version.py \ - --replace '"0+unknown"' '"${version}"' + --replace-fail '"0+unknown"' '"${version}"' ''; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/cachier/default.nix b/pkgs/development/python-modules/cachier/default.nix index 037f02b4d3ee1..572cda49eaab0 100644 --- a/pkgs/development/python-modules/cachier/default.nix +++ b/pkgs/development/python-modules/cachier/default.nix @@ -42,7 +42,7 @@ buildPythonPackage rec { preCheck = '' substituteInPlace pyproject.toml \ - --replace \ + --replace-fail \ '"--cov' \ '#"--cov' ''; diff --git a/pkgs/development/python-modules/ffmpy/default.nix b/pkgs/development/python-modules/ffmpy/default.nix index 8e00a4678ebff..974e2bcd8fdac 100644 --- a/pkgs/development/python-modules/ffmpy/default.nix +++ b/pkgs/development/python-modules/ffmpy/default.nix @@ -25,7 +25,7 @@ buildPythonPackage rec { postPatch = '' # default to store ffmpeg substituteInPlace ffmpy.py \ - --replace 'executable="ffmpeg",' 'executable="${ffmpeg-headless}/bin/ffmpeg",' + --replace-fail 'executable="ffmpeg",' 'executable="${ffmpeg-headless}/bin/ffmpeg",' # The tests test a mock that does not behave like ffmpeg. If we default to the nix-store ffmpeg they fail. for fname in tests/*.py; do diff --git a/pkgs/development/python-modules/pymongo-inmemory/default.nix b/pkgs/development/python-modules/pymongo-inmemory/default.nix index 604f0c1c3cd32..28b52dd9a3ee4 100644 --- a/pkgs/development/python-modules/pymongo-inmemory/default.nix +++ b/pkgs/development/python-modules/pymongo-inmemory/default.nix @@ -25,13 +25,13 @@ buildPythonPackage rec { postPatch = '' # move cache location from nix store to home substituteInPlace pymongo_inmemory/context.py \ - --replace \ + --replace-fail \ 'CACHE_FOLDER = path.join(path.dirname(__file__), "..", ".cache")' \ 'CACHE_FOLDER = os.environ.get("XDG_CACHE_HOME", os.environ["HOME"] + "/.cache") + "/pymongo-inmemory"' # fix a broken assumption arising from the above fix substituteInPlace pymongo_inmemory/_utils.py \ - --replace \ + --replace-fail \ 'os.mkdir(current_path)' \ 'os.makedirs(current_path)' ''; diff --git a/pkgs/development/python-modules/pyrender/default.nix b/pkgs/development/python-modules/pyrender/default.nix index eb1d5d17ee47b..0916608b8ac0f 100644 --- a/pkgs/development/python-modules/pyrender/default.nix +++ b/pkgs/development/python-modules/pyrender/default.nix @@ -45,7 +45,7 @@ buildPythonPackage rec { # the commit does not apply as a patch when cherry picked, hence the substituteInPlace postPatch = '' substituteInPlace tests/unit/test_meshes.py \ - --replace \ + --replace-fail \ "bm = trimesh.load('tests/data/WaterBottle.glb').dump()[0]" \ 'bm = trimesh.load("tests/data/WaterBottle.glb").geometry["WaterBottle"]' ''; diff --git a/pkgs/development/python-modules/pyunpack/default.nix b/pkgs/development/python-modules/pyunpack/default.nix index ea7ad7d416a3a..cc529f86032cc 100644 --- a/pkgs/development/python-modules/pyunpack/default.nix +++ b/pkgs/development/python-modules/pyunpack/default.nix @@ -23,7 +23,7 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pyunpack/__init__.py \ - --replace \ + --replace-fail \ '_exepath("patool")' \ '"${lib.getBin patool}/bin/.patool-wrapped"' ''; diff --git a/pkgs/development/python-modules/remi/default.nix b/pkgs/development/python-modules/remi/default.nix index b1f28e269099e..490a7361613ee 100644 --- a/pkgs/development/python-modules/remi/default.nix +++ b/pkgs/development/python-modules/remi/default.nix @@ -23,19 +23,19 @@ buildPythonPackage rec { preCheck = '' # for some reason, REMI already deal with these using try blocks, but they fail substituteInPlace test/test_widget.py \ - --replace \ + --replace-fail \ "from html_validator import " \ "from .html_validator import " substituteInPlace test/test_examples_app.py \ - --replace \ + --replace-fail \ "from mock_server_and_request import " \ "from .mock_server_and_request import " \ - --replace \ + --replace-fail \ "from html_validator import " \ "from .html_validator import " # Halves number of warnings substituteInPlace test/test_*.py \ - --replace \ + --replace-quiet \ "self.assertEquals(" \ "self.assertEqual(" ''; diff --git a/pkgs/development/python-modules/strct/default.nix b/pkgs/development/python-modules/strct/default.nix index 061e2a90c07c8..c5f9bc2f994b4 100644 --- a/pkgs/development/python-modules/strct/default.nix +++ b/pkgs/development/python-modules/strct/default.nix @@ -30,13 +30,13 @@ buildPythonPackage rec { postPatch = '' substituteInPlace pytest.ini \ - --replace \ + --replace-fail \ "--cov" \ "#--cov" # configure correct version, which fails due to missing .git substituteInPlace versioneer.py strct/_version.py \ - --replace '"0+unknown"' '"${version}"' + --replace-fail '"0+unknown"' '"${version}"' ''; nativeBuildInputs = [ diff --git a/pkgs/tools/misc/pokemonsay/default.nix b/pkgs/tools/misc/pokemonsay/default.nix index 7053e4ba80733..669fa6a494134 100644 --- a/pkgs/tools/misc/pokemonsay/default.nix +++ b/pkgs/tools/misc/pokemonsay/default.nix @@ -28,27 +28,27 @@ stdenvNoCC.mkDerivation rec { postPatch = '' substituteInPlace pokemonsay.sh \ - --replace \ + --replace-fail \ 'INSTALL_PATH=''${HOME}/.bin/pokemonsay' \ "" \ - --replace \ + --replace-fail \ 'POKEMON_PATH=''${INSTALL_PATH}/pokemons' \ 'POKEMON_PATH=${placeholder "out"}/share/pokemonsay' \ - --replace \ + --replace-fail \ '$(find ' \ '$(${findutils}/bin/find ' \ - --replace \ + --replace-fail \ '$(basename ' \ '$(${coreutils}/bin/basename ' \ - --replace \ + --replace-fail \ 'cowsay -f ' \ '${cowsay}/bin/cowsay -f ' \ - --replace \ + --replace-fail \ 'cowthink -f ' \ '${cowsay}/bin/cowthink -f ' substituteInPlace pokemonthink.sh \ - --replace \ + --replace-fail \ './pokemonsay.sh' \ "${placeholder "out"}/bin/pokemonsay" ''; diff --git a/pkgs/tools/misc/remote-exec/default.nix b/pkgs/tools/misc/remote-exec/default.nix index 979f0f53bae0d..ec5ad043272be 100644 --- a/pkgs/tools/misc/remote-exec/default.nix +++ b/pkgs/tools/misc/remote-exec/default.nix @@ -34,7 +34,7 @@ buildPythonApplication rec { # remove legacy endpoints, we use --multi now postPatch = '' substituteInPlace setup.py \ - --replace '"mremote' '#"mremote' + --replace-fail '"mremote' '#"mremote' ''; propagatedBuildInputs = [ diff --git a/pkgs/tools/misc/rmate-sh/default.nix b/pkgs/tools/misc/rmate-sh/default.nix index bc93c6e437fe2..81189a1cd6c7c 100644 --- a/pkgs/tools/misc/rmate-sh/default.nix +++ b/pkgs/tools/misc/rmate-sh/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { runHook preBuild substituteInPlace rmate \ - --replace \ + --replace-fail \ 'echo "hostname"' \ 'echo "${hostname}/bin/hostname"' patsh -f rmate -s ${builtins.storeDir} |