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: Tue, 19 Sep 2006 15:35:06 +0200

Quoting myself:
> > > 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?
> > 
> > On inspection, this patch doesnt appear to work correctly; the program
> > supplied to --with-diffstat wont be hardwired into the quilt source.
> 
> Ah, yes, good point. I only tested the case where diffstat is found,
> and the case where it is not - not the case where a specific path is
> provided by the user. I need to fix this. Any idea how I can do that?
> Your QUILT_COMPAT_PROG_PATH macro doesn't appear to support optional
> binaries, and I would like to avoid duplicating code if possible.

It appears that all I have to do is add
  COMPAT_SYMLINKS="$COMPAT_SYMLINKS diffstat"
to my previous patch:

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        19 Sep 2006 13:30:02 -0000
@@ -296,9 +296,25 @@
 ])
 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"
+       COMPAT_SYMLINKS="$COMPAT_SYMLINKS diffstat"
+       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  19 Sep 2006 13:30:02 -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   19 Sep 2006 13:30:02 -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

Seems to work for me in all cases, is it OK with you?

Not too sure if I must keep AC_SUBST(DIFFSTAT) or not, it works both
with and without it.

Any reason to not do the same for rpmbuild? I don't care much about
rpmbuild myself, but while I'm here...

Thanks,
-- 
Jean Delvare




reply via email to

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