mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
Annotate substituteStream deprecation warning
This adds the derivation name to the warning to make debugging easier.
This commit is contained in:
parent
cf6daa4ff8
commit
1949b0d16b
@ -830,7 +830,7 @@ substituteStream() {
|
|||||||
# deprecated 2023-11-22
|
# deprecated 2023-11-22
|
||||||
# this will either get removed, or switch to the behaviour of --replace-fail in the future
|
# this will either get removed, or switch to the behaviour of --replace-fail in the future
|
||||||
if ! "$_substituteStream_has_warned_replace_deprecation"; then
|
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
|
_substituteStream_has_warned_replace_deprecation=true
|
||||||
fi
|
fi
|
||||||
replace_mode='--replace-warn'
|
replace_mode='--replace-warn'
|
||||||
@ -845,9 +845,9 @@ substituteStream() {
|
|||||||
if [ "$pattern" != "$replacement" ]; then
|
if [ "$pattern" != "$replacement" ]; then
|
||||||
if [ "${!var}" == "$savedvar" ]; then
|
if [ "${!var}" == "$savedvar" ]; then
|
||||||
if [ "$replace_mode" == --replace-warn ]; 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
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -859,11 +859,11 @@ substituteStream() {
|
|||||||
shift 2
|
shift 2
|
||||||
# check if the used nix attribute name is a valid bash name
|
# check if the used nix attribute name is a valid bash name
|
||||||
if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
if [ -z ${!varName+x} ]; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
pattern="@$varName@"
|
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
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user