librpc: Make finding newest pidl file more portable
authorVolker Lendecke <vl@samba.org>
Thu, 19 Apr 2012 07:03:18 +0000 (09:03 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 19 Apr 2012 15:37:39 +0000 (17:37 +0200)
FreeBSD find does not support the -printf argument.

David, please check if this still work for you!

librpc/build_idl.sh

index e028bc68311dd036fd724782e1cfa3ce2fd9d92c..35acd1f24e2bce1b87da5adf52bc9bf6b231a61b 100755 (executable)
@@ -28,15 +28,7 @@ fi
 ## Find newer files rather than rebuild all of them. Also handle the case
 ## where the pidl compiler itself is newer.
 ##
-PIDL_NEWEST=`find $PIDL_DIR -type f -printf "%p\0%T@\n" \
-       | perl -e '$ts_newest = 0;
-                  while (<STDIN>) {
-                          ($f, $ts) = split(/\0/);
-                          next if ($ts <= $ts_newest);
-                          $ts_newest = $ts;
-                          $f_newest = $f;
-                  }
-                  print $f_newest'` || exit 1
+PIDL_NEWEST=$(ls -rt $(find $PIDL_DIR -type f) | tail -n -1)
 
 list=""
 for f in ${IDL_FILES}; do