Subject: Re: bug#15773: grep-2.15 bug report

From: Jim Meyering <[email-masked]>
Date: Sat, 2 Nov 2013 08:20:51 -0700

On Fri, Nov 1, 2013 at 8:55 AM, Stefano Lattarini
<[email-masked]> wrote:
> This probably calls for a two patch series: the first introducing the test
> as
> an XFAIL, the second fixing the bug without touching the tests, and
> verifying
> that the test succeeds.

That seems like overkill, and unnecessary churn in git.  Usually, once I
have a complete(including test case) and committed-but-not-pushed patch ,
I either arrange to run the test against the previous binary by replacing
src/grep with the grep from my path, or (probably better) temporarily
backing out the fix, e.g., with "git log -1 -p src/dfa.c|patch -R -p1"
and ensuring that "make check" fails.

> Maybe you could even amend the test to run with all of the default locale,
> the
> en_US.UTF-8 locale, and the C locale.  Possibly overly paranoid, but the
> enhancement would be trivial, so why not get the extra coverage anyway?

That seems worthwhile.
The default locale is set via tests/Makefile.am to LC_ALL=C, so I have
done this:
From 4c2f17d2a671eb6fc6ae318647040598f67705cc Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email-masked]>
Date: Sat, 26 Oct 2013 19:26:13 -0700
Subject: [PATCH] maint.mk: fix "release" target to build _version

This fixes a bug in README-release whereby following the outlined
steps, one would publish a tarball whose programs would report
--version output not consistent with the package version number.
This bug caused grep-2.15 to produce a grep program whose
--version option made it print 2.14.56-1e3d rather than 2.15.
* top/maint.mk (release): Making this target build "_version"
ensures that the new version number is reflected in configure.
---
 ChangeLog    | 11 +++++++++++
 top/maint.mk |  1 +
 2 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 8992e91..ba3d83a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-10-26  Jim Meyering  <[email-masked]>
+
+	maint.mk: fix "release" target to build _version
+	This fixes a bug in README-release whereby following the outlined
+	steps, one would publish a tarball whose programs would report
+	--version output not consistent with the package version number.
+	This bug caused grep-2.15 to produce a grep program whose
+	--version option made it print 2.14.56-1e3d rather than 2.15.
+	* top/maint.mk (release): Making this target build "_version"
+	ensures that the new version number is reflected in configure.
+
 2013-10-21  Ben Pfaff  <[email-masked]>

 	install-reloc: Support multi-binary installation.
diff --git a/top/maint.mk b/top/maint.mk
index c9f8cc8..bf8f53a 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1424,6 +1424,7 @@ alpha beta stable: $(local-check) writable-files $(submodule-checks)
 	$(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@

 release:
+	$(AM_V_GEN)$(MAKE) _version
 	$(AM_V_GEN)$(MAKE) $(release-type)

 # Override this in cfg.mk if you follow different procedures.
-- 
1.8.4.1.600.g3d092bf