mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 22:32:58 +03:00
stdenv-setup: Pull out and explain 3-part printing of commands
@Dezgeg made the good point that the reasons for doing this were not at all intuitive.
This commit is contained in:
parent
2743078f66
commit
30a1420414
@ -104,6 +104,17 @@ closeNest() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Prints a command such that all word splits are unambiguous. We need
|
||||||
|
# to split the command in three parts because the middle format string
|
||||||
|
# will be, and must be, repeated for each argument. The first argument
|
||||||
|
# goes before the ':' and is just for convenience.
|
||||||
|
echoCmd() {
|
||||||
|
printf "%s:" "$1"
|
||||||
|
shift
|
||||||
|
printf ' %q' "$@"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Error handling.
|
# Error handling.
|
||||||
@ -725,9 +736,7 @@ configurePhase() {
|
|||||||
if [ -n "$configureScript" ]; then
|
if [ -n "$configureScript" ]; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
local flagsArray=($configureFlags "${configureFlagsArray[@]}")
|
local flagsArray=($configureFlags "${configureFlagsArray[@]}")
|
||||||
printf 'configure flags:'
|
echoCmd 'configure flags' "${flagsArray[@]}"
|
||||||
printf ' %q' "${flagsArray[@]}"
|
|
||||||
echo
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
$configureScript "${flagsArray[@]}"
|
$configureScript "${flagsArray[@]}"
|
||||||
unset flagsArray
|
unset flagsArray
|
||||||
@ -754,9 +763,7 @@ buildPhase() {
|
|||||||
$makeFlags "${makeFlagsArray[@]}" \
|
$makeFlags "${makeFlagsArray[@]}" \
|
||||||
$buildFlags "${buildFlagsArray[@]}")
|
$buildFlags "${buildFlagsArray[@]}")
|
||||||
|
|
||||||
printf 'build flags:'
|
echoCmd 'build flags' "${flagsArray[@]}"
|
||||||
printf ' %q' "${flagsArray[@]}"
|
|
||||||
echo
|
|
||||||
make ${makefile:+-f $makefile} "${flagsArray[@]}"
|
make ${makefile:+-f $makefile} "${flagsArray[@]}"
|
||||||
unset flagsArray
|
unset flagsArray
|
||||||
fi
|
fi
|
||||||
@ -774,9 +781,7 @@ checkPhase() {
|
|||||||
$makeFlags "${makeFlagsArray[@]}" \
|
$makeFlags "${makeFlagsArray[@]}" \
|
||||||
${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget:-check})
|
${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget:-check})
|
||||||
|
|
||||||
printf 'check flags:'
|
echoCmd 'check flags' "${flagsArray[@]}"
|
||||||
printf ' %q' "${flagsArray[@]}"
|
|
||||||
echo
|
|
||||||
make ${makefile:+-f $makefile} "${flagsArray[@]}"
|
make ${makefile:+-f $makefile} "${flagsArray[@]}"
|
||||||
unset flagsArray
|
unset flagsArray
|
||||||
|
|
||||||
@ -798,9 +803,7 @@ installPhase() {
|
|||||||
$makeFlags "${makeFlagsArray[@]}" \
|
$makeFlags "${makeFlagsArray[@]}" \
|
||||||
$installFlags "${installFlagsArray[@]}")
|
$installFlags "${installFlagsArray[@]}")
|
||||||
|
|
||||||
printf 'install flags:'
|
echoCmd 'install flags' "${flagsArray[@]}"
|
||||||
printf ' %q' "${flagsArray[@]}"
|
|
||||||
echo
|
|
||||||
make ${makefile:+-f $makefile} "${flagsArray[@]}"
|
make ${makefile:+-f $makefile} "${flagsArray[@]}"
|
||||||
unset flagsArray
|
unset flagsArray
|
||||||
|
|
||||||
@ -879,9 +882,7 @@ installCheckPhase() {
|
|||||||
$makeFlags "${makeFlagsArray[@]}" \
|
$makeFlags "${makeFlagsArray[@]}" \
|
||||||
$installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck})
|
$installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck})
|
||||||
|
|
||||||
printf 'installcheck flags:'
|
echoCmd 'installcheck flags' "${flagsArray[@]}"
|
||||||
printf ' %q' "${flagsArray[@]}"
|
|
||||||
echo
|
|
||||||
make ${makefile:+-f $makefile} "${flagsArray[@]}"
|
make ${makefile:+-f $makefile} "${flagsArray[@]}"
|
||||||
unset flagsArray
|
unset flagsArray
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user