diff options
author | Silvan Mosberger <contact@infinisil.com> | 2024-06-03 15:50:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-03 15:50:33 +0200 |
commit | a3fad6299c4e463de494db1fda458b07b3ed99d0 (patch) | |
tree | 82040f87fa049ca5359305a643581e9b082d1f67 /pkgs/stdenv | |
parent | 1e902c10ad61764be0302b00ea786a412da54abc (diff) | |
parent | 1949b0d16bbab48228392c590457069693edadee (diff) |
Merge pull request #314553 from gefla/annotate-substitutestream
Annotate substituteStream deprecation warning
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 45c73d7709c66..d7521b1ad5da7 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -830,7 +830,7 @@ substituteStream() { # deprecated 2023-11-22 # this will either get removed, or switch to the behaviour of --replace-fail in the future if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream(): WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" >&2 + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" >&2 _substituteStream_has_warned_replace_deprecation=true fi replace_mode='--replace-warn' @@ -845,9 +845,9 @@ substituteStream() { if [ "$pattern" != "$replacement" ]; then if [ "${!var}" == "$savedvar" ]; then if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream(): WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" >&2 + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" >&2 elif [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream(): ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" >&2 + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" >&2 return 1 fi fi @@ -859,11 +859,11 @@ substituteStream() { shift 2 # check if the used nix attribute name is a valid bash name if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." >&2 + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." >&2 return 1 fi if [ -z ${!varName+x} ]; then - echo "substituteStream(): ERROR: variable \$$varName is unset" >&2 + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" >&2 return 1 fi pattern="@$varName@" @@ -879,7 +879,7 @@ substituteStream() { ;; *) - echo "substituteStream(): ERROR: Invalid command line argument: $1" >&2 + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" >&2 return 1 ;; esac |