summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-01 18:21:51 -0700
committerKarl Berry <karl@freefriends.org>2021-07-01 18:21:51 -0700
commit16569085c531e884faa2124c5b02404a996921c8 (patch)
tree3aa480039a38c7b836611797dd61a8ac11153c80 /t
parente7724fb1b7b97f662caf154414e6f71ffcbd966c (diff)
downloadautomake-16569085c531e884faa2124c5b02404a996921c8.tar.gz
dist: accept .md versions for README et al.
This change was suggested by madmurphy; some ideas were taken from the patch he provided. https://lists.gnu.org/archive/html/automake-patches/2021-06/msg00005.html * bin/automake.in (@toplevelmd_ok): new global, listing the files for which we will accept .md versions. (@common_files): remove those files from there. (handle_dist): check for .md if non-.md is absent. (handle_minor_options): check for README-alpha.md. (check_gnu_standards): accept .md version if present. (check_gnits_standards): likewise. (usage): output list of .md-accepted files. * doc/automake.texi (Basics of Distribution): document. * t/toplevelmd.sh: new test. * t/list-of-tests.mk (handwritten_tests): add it. * NEWS: mention new feature.
Diffstat (limited to 't')
-rw-r--r--t/list-of-tests.mk3
-rw-r--r--t/toplevelmd.sh68
2 files changed, 70 insertions, 1 deletions
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 51456ef51..934930b50 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -2,7 +2,7 @@
## testsuite. This fragment is meant to be included by the Makefile.am,
## but also to be executed directly by make when bootstrapping automake.
-## Copyright (C) 2011-2020 Free Software Foundation, Inc.
+## Copyright (C) 2011-2021 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
@@ -848,6 +848,7 @@ t/test-trs-recover.sh \
t/test-trs-recover2.sh \
t/test-extensions.sh \
t/test-extensions-cond.sh \
+t/toplevelmd.sh \
t/parse.sh \
t/percent.sh \
t/percent2.sh \
diff --git a/t/toplevelmd.sh b/t/toplevelmd.sh
new file mode 100644
index 000000000..0634c7490
--- /dev/null
+++ b/t/toplevelmd.sh
@@ -0,0 +1,68 @@
+#! /bin/sh
+# Copyright (C) 2003-2021 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 2, 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 <https://www.gnu.org/licenses/>.
+
+# Check that the top-level files (INSTALL, NEWS, README-alpha, etc.)
+# can be .md, or not. (Based on alpha2.sh.)
+
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT([alpha], [1.0b])
+AM_INIT_AUTOMAKE([readme-alpha])
+AC_CONFIG_FILES([Makefile sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+check-local: distdir
+ for f in AUTHORS ChangeLog INSTALL NEWS README THANKS; do \
+ test -f $(distdir)/$$f.md; done
+ test -f $(distdir)/COPYING
+ test -f $(distdir)/README-alpha.md
+ test ! -f $(distdir)/sub/README.md
+ test ! -f $(distdir)/sub/README-alpha.md # not distributed
+ : > works
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+# do both md and non-md.
+: > README-alpha.md
+: > sub/README-alpha.md
+: > sub/README
+
+# top level
+: > AUTHORS.md
+: > ChangeLog.md
+: > INSTALL.md
+: > NEWS.md
+: > README.md
+: > THANKS.md
+
+# not md
+: > COPYING
+
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE check
+test -f works
+
+exit 33