quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] diffstat and test suite


From: Jean Delvare
Subject: Re: [Quilt-dev] diffstat and test suite
Date: Mon, 18 Sep 2006 18:14:12 +0200

Quoting myself:
> There is now one test file in the quilt test suite which requires
> diffstat (dir-a-b.test). It causes "make check" to freeze when quilt
> has been configured --without-diffstat. The reason is that we create a
> diffstat wrapper (compat/diffstat) in this case. The wrapper is
> supposed to call the real diffstat, and that would "work" (i.e. fail
> cleanly) when the wrapper is installed. However it does NOT work when
> the wrapper is still in compat, and compat is in the PATH (which is the
> case when running the test suite): the wrapper will call itself in
> loops forever.
> 
> This raises two questions:
> 1* Why do we create a diffstat wrapper when --without-diffstat has been
> passed to configure (or configure simply failed to find diffstat)? I
> don't see the point. I would understand a wrapper saying "Sorry,
> diffstat isn't installed" as we have for sendmail, but a wrapper
> calling a binary we know isn't available, I don't get it.
> 
> 2* Do we really want to use a quilt command which requires diffstat in
> the test suite? It is an optional component, and I believe everyone
> should be able to run the test suite. If we really want to test
> diffstat, I think we should do so in a separate test file, and only run
> it if diffstat was found.

Here is the patch I have come up with, which I'll apply to CVS soon
unless somebody objects. It reverts the first chunk of:
http://cvs.savannah.nongnu.org/viewcvs/quilt/configure.ac?root=quilt&r1=1.55&r2=1.56
and deletes compat/diffstat.in. It also removes the use of diffstat in
the test suite.

With this patch, the test suite passes again on a system I have where
diffstat is not installed.

John, want to comment on this?

Index: configure.ac
===================================================================
RCS file: /cvsroot/quilt/quilt/configure.ac,v
retrieving revision 1.80
diff -u -r1.80 configure.ac
--- configure.ac        24 Jun 2006 10:07:41 -0000      1.80
+++ configure.ac        18 Sep 2006 16:04:31 -0000
@@ -296,9 +296,24 @@
 ])
 fi
 
-QUILT_COMPAT_PROG_PATH(DIFFSTAT, diffstat)
-
-if test -z "$INTERNAL_DIFFSTAT"; then
+AC_ARG_WITH(diffstat, AC_HELP_STRING(
+    [--with-diffstat], [name of the diffstat executable to use]),
+    [
+       DIFFSTAT="$withval"
+       AC_SUBST(DIFFSTAT)
+       AC_MSG_NOTICE([Using diffstat executable $DIFFSTAT])
+    ],[
+       AC_PATH_PROG(DIFFSTAT, diffstat)
+    ])
+if test -z "$DIFFSTAT"; then
+    AC_MSG_WARN([
+diffstat utility not found; the --diffstat option of the refresh command
+will not work correctly until diffstat is installed. If you have diffstat
+in a directory that is not in the search path you can specify its location
+using the '--with-diffstat' option.
+])
+    DIFFSTAT="diffstat"
+elif test "$DIFFSTAT" != no; then
     # We need diffstat version 1.32 or better, else quilt refresh --diffstat
     # will show progress data we don't want to see.  This is only a warning
     # and we continue even if version is older, as this is only a minor
Index: compat/diffstat.in
===================================================================
RCS file: /cvsroot/quilt/quilt/compat/diffstat.in,v
retrieving revision 1.2
diff -u -r1.2 diffstat.in
--- compat/diffstat.in  1 Jun 2006 09:34:30 -0000       1.2
+++ compat/diffstat.in  18 Sep 2006 16:04:31 -0000
@@ -1,6 +0,0 @@
-#! @BASH@
-
address@hidden@/compat
-QUILT_COMPAT=${QUILT_COMPAT//\//\\\/}
-PATH=${PATH//$QUILT_COMPAT/}
-exec "${0##*/}" "$@"
Index: test/dir-a-b.test
===================================================================
RCS file: /cvsroot/quilt/quilt/test/dir-a-b.test,v
retrieving revision 1.2
diff -u -r1.2 dir-a-b.test
--- test/dir-a-b.test   27 Jun 2006 23:32:12 -0000      1.2
+++ test/dir-a-b.test   18 Sep 2006 16:04:31 -0000
@@ -106,14 +106,6 @@
        > @@ -1 +0,0 @@
        > -d
 
-       $ quilt refresh -p ab --diffstat
-       > Refreshed patch patches/ab.diff
-
-       $ sed -n -e 's/ *//' -e 's/ *|.*//p' patches/ab.diff
-       > test.txt
-       > test2.txt
-       > test3.txt
-
        $ quilt pop -qR
        > Removing patch patches/ab.diff
        > No patches applied


-- 
Jean Delvare




reply via email to

[Prev in Thread] Current Thread [Next in Thread]