s3-idl: update the 2nd build_idl.sh script
authorAndrew Tridgell <tridge@samba.org>
Tue, 4 May 2010 05:48:54 +0000 (07:48 +0200)
committerAndrew Tridgell <tridge@samba.org>
Tue, 4 May 2010 11:47:08 +0000 (13:47 +0200)
source3/script/build_idl.sh

index 0f4908114edba03311050e72f4b5f0247d812ff7..72d44add61f87f660658ce2d343b86d6b2a7a730 100755 (executable)
@@ -16,16 +16,20 @@ PIDL="$PIDL $ARGS"
 
 list=""
 for f in ${IDL_FILES}; do
-       basename=`basename $f .idl`
-       ndr="$PIDL_OUTPUTDIR/ndr_$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.h srv_$b.c"
+       outfiles="$outfiles cli_$b.h ndr_$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
 
 ##