[CalendarServer-changes] [13049] CalendarServer/trunk/bin/_build.sh

source_changes at macosforge.org source_changes at macosforge.org
Sun Mar 30 03:33:35 PDT 2014


Revision: 13049
          http://trac.calendarserver.org//changeset/13049
Author:   dre at apple.com
Date:     2014-03-30 03:33:35 -0700 (Sun, 30 Mar 2014)
Log Message:
-----------
Error checking when finding headers for C deps

Modified Paths:
--------------
    CalendarServer/trunk/bin/_build.sh

Modified: CalendarServer/trunk/bin/_build.sh
===================================================================
--- CalendarServer/trunk/bin/_build.sh	2014-03-30 10:11:09 UTC (rev 13048)
+++ CalendarServer/trunk/bin/_build.sh	2014-03-30 10:33:35 UTC (rev 13049)
@@ -55,6 +55,14 @@
   fi;
 
   # Check for presence of a header of specified version
+  # First do an exit-status test without capturing output; if we try to get output with tail
+  # and cc exits non-zero, tail would eat the exit status.
+  printf "#include <${sys_header}>\n${version_macro}\n" | cc -x c -E - &> /dev/null;
+  if [ $? -ne 0 ]; then
+    return 1;
+  fi;
+
+  # Again, this time capture output.
   local found_version="$(printf "#include <${sys_header}>\n${version_macro}\n" | cc -x c -E - | tail -1)";
 
   if [ "${found_version}" == "${version_macro}" ]; then
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140330/decc8679/attachment.html>


More information about the calendarserver-changes mailing list