From 56c41c99aff6be60ea2440066cedf852ce15c69a Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Tue, 22 Jan 2008 23:35:57 +0100 Subject: [PATCH] Prefer generated manpages over distributed ones. * lib/am/mans.am (install-man%SECTION%): Prefer generated manpages over distributed ones. Report and patch by Peter Breitenlohner. * tests/man3.test: New test. * tests/Makefile.am: Update. --- ChangeLog | 8 ++++++++ lib/am/mans.am | 6 +++--- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/man3.test | 44 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 3 deletions(-) create mode 100755 tests/man3.test diff --git a/ChangeLog b/ChangeLog index 7ccca023e..7b1f1501f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-01-22 Ralf Wildenhues + + * lib/am/mans.am (install-man%SECTION%): Prefer generated manpages + over distributed ones. + Report and patch by Peter Breitenlohner. + * tests/man3.test: New test. + * tests/Makefile.am: Update. + 2008-01-21 Ralf Wildenhues * tests/tar.test: Skip if no appropriate tar was found. diff --git a/lib/am/mans.am b/lib/am/mans.am index b3e9053c4..42812543c 100644 --- a/lib/am/mans.am +++ b/lib/am/mans.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1998, 2001, 2003, 2004, 2006 Free Software Foundation, Inc. +## Copyright (C) 1998, 2001, 2003, 2004, 2006, 2008 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -42,8 +42,8 @@ install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS) done; \ for i in $$list; do \ ## Find the file. - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ + if test -f $$i; then file=$$i; \ + else file=$(srcdir)/$$i; fi; \ ## Change the extension if needed. ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ diff --git a/tests/Makefile.am b/tests/Makefile.am index db40acc9f..796a34dd8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -371,6 +371,7 @@ makej.test \ makevars.test \ man.test \ man2.test \ +man3.test \ mclean.test \ mdate.test \ mdate2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index ceff3f404..219d4dd00 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -520,6 +520,7 @@ makej.test \ makevars.test \ man.test \ man2.test \ +man3.test \ mclean.test \ mdate.test \ mdate2.test \ diff --git a/tests/man3.test b/tests/man3.test new file mode 100755 index 000000000..2527e9ccc --- /dev/null +++ b/tests/man3.test @@ -0,0 +1,44 @@ +#! /bin/sh +# Copyright (C) 2008 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# PR 516: Prefer generated manpages to distributed ones. + +. ./defs || exit 1 + +set -e + +cat > Makefile.am << 'END' +dist_man_MANS = foo.1 +installcheck-local: + grep bar "$(mandir)/man1/foo.1" +END + +cat >>configure.in <<'END' +: ${foo=foo} +AC_SUBST([foo]) +AC_CONFIG_FILES([foo.1]) +AC_OUTPUT +END + +cat > foo.1.in <<'END' +@foo@ +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF +./configure +$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS=foo=bar -- 2.47.2