s3-idl: rebuild IDL files based on all outputs
authorAndrew Tridgell <tridge@samba.org>
Tue, 4 May 2010 05:34:32 +0000 (07:34 +0200)
committerAndrew Tridgell <tridge@samba.org>
Tue, 4 May 2010 11:47:07 +0000 (13:47 +0200)
librpc/build_idl.sh

index ac0fab48014073f3264ab8b289545c129b7e416c..a130d9eb5a52533b9a3c4e54a08c380be2ab767e 100755 (executable)
@@ -29,16 +29,20 @@ fi
 
 list=""
 for f in ${IDL_FILES}; do
-       basename=`basename $f .idl`
-       ndr="$PIDL_OUTPUTDIR/py_$basename.c"
-
-       if [ -f $ndr ]; then
-               if [ "x`find $f -newer $ndr -print`" = "x$f" ]; then
-                       list="$list $f"
-               fi
-       else 
+        b=`basename $f .idl`
+       outfiles="cli_$b.c $b.h ndr_${b}_c.c ndr_$b.h ndr_${b}_s.c srv_$b.c"
+       outfiles="$outfiles cli_$b.h ndr_$b.c ndr_${b}_c.h py_$b.c srv_$b.h"
+
+       for o in $outfiles; do
+           [ -f $PIDL_OUTPUTDIR/$o ] || {
+               list="$list $f"
+               break
+           }
+           [ $f -nt $PIDL_OUTPUTDIR/$o ] && {
                list="$list $f"
-       fi
+               break
+           }
+       done
 done
 
 ##