X-Git-Url: http://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/da205696048844a53e536cfe179b09b02b9f3f18..e5cf340e0235a578efb05d004ec1a230d3ddb987:/m4/cmdout.m4 diff --git a/m4/cmdout.m4 b/m4/cmdout.m4 index 5aa3925..90aa13e 100644 --- a/m4/cmdout.m4 +++ b/m4/cmdout.m4 @@ -1,4 +1,4 @@ -dnl Copyright © 2014 Nick Bowler +dnl Copyright © 2014-2015 Nick Bowler dnl dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2. dnl This is free software: you are free to do what the fuck you want to. @@ -7,30 +7,30 @@ dnl There is NO WARRANTY, to the extent permitted by law. dnl DX_COMMAND_OUTPUT(variable, command, [action-if-ok], [action-if-failed]) dnl dnl Helper to capture standard output of a shell command. If the command -dnl is successful then variable is assigned with its output (with newlines -dnl converted to spaces), and action-if-ok is performed. Otherwise, if -dnl the command is unsuccessful, then variable is not changed, and -dnl action-if-failed is performed. +dnl is successful then variable is assigned with its output, and action-if-ok +dnl is performed. Otherwise, if the command is unsuccessful, then variable +dnl is not changed, and action-if-failed is performed. AC_DEFUN([DX_COMMAND_OUTPUT], [AC_REQUIRE([_DX_COMMAND_OUTPUT_SETUP])dnl -AS_IF([$2 >conftest.out 2>&AS_MESSAGE_LOG_FD], - [m4_do([dx_fn_cmdout_collect_output $1], - [m4_ifnblank([$3], [m4_newline([$3])])])], - [$4]) -rm -f conftest.out -]) +AS_IF([$2 >conftest.do0 2>&AS_MESSAGE_LOG_FD], + [m4_do([dx_fn_cmdout_collect_output $1], + [m4_ifnblank([$3], [m4_newline([$3])])])], + [$4]) +rm -f conftest.do0 conftest.do1]) AC_DEFUN_ONCE([_DX_COMMAND_OUTPUT_SETUP], [m4_divert_push([INIT_PREPARE])dnl -# Helper function to store the contents of conftest.out into a shell variable. +# Helper function to store the contents of conftest.do0 into a shell variable. dx_fn_cmdout_collect_output () { AS_UNSET([$][1]) - exec 3conftest.do1 || return + exec 3