Subject: bug#21023: [bug-diffutils] bug#21023: bug#21023: --no-dereference

From: Jim Meyering <[email-masked]>
Date: Mon, 31 Aug 2015 23:14:02 -0700

On Mon, Aug 31, 2015 at 1:42 PM, Jim Meyering <[email-masked]> wrote:
> reopen 21023
> tags 21023 -notabug
> thanks
>
> On Mon, Aug 31, 2015 at 1:04 PM, Rodrigo Valiña Gutiérrez
> <[email-masked]> wrote:
>> On 8/31/15, Jim Meyering <[email-masked]> wrote:
>>> tags 21023 notabug
>>> thanks
>>>
>>> On Mon, Aug 31, 2015 at 9:59 AM, Rodrigo Valiña Gutiérrez
>>> <[email-masked]> wrote:
>>>> --no-dereference appears in 'diff --help' and 'info diffutils', but
>>>> not in 'man diff'.
>>>
>>> Thanks for the report, but that is unlikely to be a problem with this
>>> upstream diffutils package, since the man page (diff.1) is
>>> automatically generated from the output of diff --help, and the build
>>> machinery to do that has been in place for over a decade. I would
>>> suspect whatever installed your diff man pages or the configuration of
>>> your "man(1)" program -- maybe it is searching in the wrong place.
>>
>> Thanks for the reply.
>> I downloaded diffutils-3.3.tar.xz and in diffutils-3.3/man/diff.1 does
>> not appear the --no-dereference option. I don't know whether it is
>> re-generated at compile or install time... but at the moment that file
>> does not have the said option.
>
> Oh, I see that you are right! So this *is* a bug. Reopening and untagging.
> It looks like I managed to include a stale diff.1 (not including the
> then-new --no-dereference description) in the distribution tarball.
> That makes me think there is or was a missing dependency.  I'll
> investigate and report back here.

Found the bug. Here's the fix:
From 6bef3f16440d8311924411125db8ee5d4d56e287 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email-masked]>
Date: Mon, 31 Aug 2015 23:12:43 -0700
Subject: [PATCH] build: correct man-page generation rule
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The PATH was set incorrectly, so that the diff used by
help2man was the one from $PATH, rather than the just-built
one.
* man/Makefile.am (dist_man1_MANS): Prepend ../src to PATH,
not just "..".  In http://debbugs.gnu.org/21023, Rodrigo Valiña
Gutiérrez reported that diff.1 from the diffutils-3.3 tarball
contained no description of the then-new --no-dereference option.
---
 man/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/Makefile.am b/man/Makefile.am
index fd136d2..bd18808 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -29,6 +29,6 @@ sdiff.1: $S/sdiff.c sdiff.x
 $(dist_man1_MANS): $(SRC_VERSION_C) help2man
 	$(AM_V_GEN)base=`expr $@ : '\(.*\).1'`				\
 	  && (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) \
-	     | PATH="..$(PATH_SEPARATOR)$$PATH"				\
+	     | PATH="../src$(PATH_SEPARATOR)$$PATH"			\
 	       $(srcdir)/help2man -i - -i $(srcdir)/$$base.x		\
 		 -S '$(PACKAGE) $(VERSION)' $$base > $@-t && mv $@-t $@
-- 
2.3.7