mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 02:42:59 +00:00
Merge pull request #314553 from gefla/annotate-substitutestream
Annotate substituteStream deprecation warning
This commit is contained in:
commit
a3fad6299c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user