check-exports: Use the return code of diff rather than the output
authorJan Schmidt <thaytan@noraisin.net>
Mon, 25 May 2009 15:58:51 +0000 (16:58 +0100)
committerJan Schmidt <thaytan@noraisin.net>
Mon, 25 May 2009 15:58:51 +0000 (16:58 +0100)
diff on Solaris prints 'No differences found' for matching files, which
makes the check-exports call fail regardless of whether the exports match
or not. Instead, use the return code of diff, which is 0 when the files match.

check-exports

index cd829b0..c6d3eca 100755 (executable)
@@ -58,10 +58,11 @@ nm $NMARGS $lib_path | awk \
        > $lib_result
 
 diffoutput=`diff -u $def_path $lib_result`
+diffresult=$?
 
 rm $lib_result
 
-if test "x$diffoutput" = "x"; then
+if test "$diffresult" -eq 0; then
   exit 0;
 else
   echo -n "$diffoutput" >&2