--- quilt-0.40/configure.ac.orig	Fri Apr 29 09:35:01 2005
+++ quilt-0.40/configure.ac	Tue May 24 12:58:59 2005
@@ -200,6 +200,30 @@
 using the '--with-diffstat' option.
 ])
     DIFFSTAT="diffstat"
+else
+    # We need diffstat version 1.32 or better, else quilt refresh --diffstat
+    # will show progress data you don't want to see.  This is only a warning
+    # and we continue even if version is older, as this is only a minor annoyance.
+    AC_MSG_CHECKING([for diffstat version])
+    diffstat_major_version=`$DIFFSTAT -V 2>/dev/null | \
+       sed 's/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+    diffstat_minor_version=`$DIFFSTAT -V 2>/dev/null | \
+       sed 's/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+    if test -z "$diffstat_major_version" -o -z "$diffstat_minor_version"; then
+        AC_MSG_RESULT(unknown)
+            AC_MSG_WARN([
+diffstat utility version couldn't be checked; chances are good that the
+--diffstat option of the refresh and diff commands will not work properly.
+])
+    else
+        AC_MSG_RESULT($diffstat_major_version.$diffstat_minor_version)
+        if test "$diffstat_major_version" -lt 1 -o "$diffstat_minor_version" -lt 32; then
+            AC_MSG_WARN([
+diffstat utility is too old; the --diffstat option of the refresh command
+will not work correctly until a newer version (>= 1.32) is installed.
+])
+        fi
+    fi
 fi
 
 dnl Check for sendmail
