···230230231231 postInstall = ''
232232 substituteInPlace $out/bin/solo5-virtio-mkimage \
233233- --replace "/usr/lib/syslinux" "${syslinux}/share/syslinux" \
234234- --replace "/usr/share/syslinux" "${syslinux}/share/syslinux" \
235235- --replace "cp " "cp --no-preserve=mode "
233233+ --replace-fail "/usr/lib/syslinux" "${syslinux}/share/syslinux" \
234234+ --replace-fail "/usr/share/syslinux" "${syslinux}/share/syslinux" \
235235+ --replace-fail "cp " "cp --no-preserve=mode "
236236237237 wrapProgram $out/bin/solo5-virtio-mkimage \
238238 --prefix PATH : ${lib.makeBinPath [ dosfstools mtools parted syslinux ]}
···1253125312541254Performs string substitution on the contents of \<infile\>, writing the result to \<outfile\>. The substitutions in \<subs\> are of the following form:
1255125512561256-#### `--replace` \<s1\> \<s2\> {#fun-substitute-replace}
12561256+#### `--replace-fail` \<s1\> \<s2\> {#fun-substitute-replace-fail}
12571257+12581258+Replace every occurrence of the string \<s1\> by \<s2\>.
12591259+Will error if no change is made.
12601260+12611261+#### `--replace-warn` \<s1\> \<s2\> {#fun-substitute-replace-warn}
12621262+12631263+Replace every occurrence of the string \<s1\> by \<s2\>.
12641264+Will print a warning if no change is made.
12651265+12661266+#### `--replace-quiet` \<s1\> \<s2\> {#fun-substitute-replace-quiet}
1257126712581268Replace every occurrence of the string \<s1\> by \<s2\>.
12691269+Will do nothing if no change can be made.
1259127012601271#### `--subst-var` \<varName\> {#fun-substitute-subst-var}
12611272···1269128012701281```shell
12711282substitute ./foo.in ./foo.out \
12721272- --replace /usr/bin/bar $bar/bin/bar \
12731273- --replace "a string containing spaces" "some other text" \
12831283+ --replace-fail /usr/bin/bar $bar/bin/bar \
12841284+ --replace-fail "a string containing spaces" "some other text" \
12741285 --subst-var someVar
12751286```
12761287
+2
nixos/doc/manual/release-notes/rl-2405.section.md
···160160- The option [`services.nextcloud.config.dbport`] of the Nextcloud module was removed to match upstream.
161161 The port can be specified in [`services.nextcloud.config.dbhost`](#opt-services.nextcloud.config.dbhost).
162162163163+- `stdenv`: The `--replace` flag in `substitute`, `substituteInPlace`, `substituteAll`, `substituteAllStream`, and `substituteStream` is now deprecated if favor of the new `--replace-fail`, `--replace-warn` and `--replace-quiet`. The deprecated `--replace` equates to `--replace-warn`.
164164+163165- The Yama LSM is now enabled by default in the kernel, which prevents ptracing
164166 non-child processes. This means you will not be able to attach gdb to an
165167 existing process, but will need to start that process from gdb (so it is a
+26-1
pkgs/stdenv/generic/setup.sh
···815815######################################################################
816816# Textual substitution functions.
817817818818+# only log once, due to max logging limit on hydra
819819+_substituteStream_has_warned_replace_deprecation=""
818820819821substituteStream() {
820822 local var=$1
···822824 shift 2
823825824826 while (( "$#" )); do
827827+ local is_required=1
828828+ local is_quiet=""
825829 case "$1" in
830830+ --replace-quiet)
831831+ is_quiet=1
832832+ ;&
826833 --replace)
834834+ # deprecated 2023-11-22
835835+ # this will either get removed, or switch to the behaviour of --replace-fail in the future
836836+ if [ -z "$_substituteStream_has_warned_replace_deprecation" ]; then
837837+ echo "substituteStream(): WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" >&2
838838+ _substituteStream_has_warned_replace_deprecation=1
839839+ fi
840840+ ;&
841841+ --replace-warn)
842842+ is_required=""
843843+ ;&
844844+ --replace-fail)
827845 pattern="$2"
828846 replacement="$3"
829847 shift 3
···832850 eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'
833851 if [ "$pattern" != "$replacement" ]; then
834852 if [ "${!var}" == "$savedvar" ]; then
835835- echo "substituteStream(): WARNING: pattern '$pattern' doesn't match anything in $description" >&2
853853+ if [ -z "$is_required" ]; then
854854+ if [ -z "$is_quiet" ]; then
855855+ echo "substituteStream(): WARNING: pattern '$pattern' doesn't match anything in $description" >&2
856856+ fi
857857+ else
858858+ echo "substituteStream(): ERROR: pattern '$pattern' doesn't match anything in $description" >&2
859859+ return 1
860860+ fi
836861 fi
837862 fi
838863 ;;