Hallo Ralf, On 21 Sep 2010, at 00:34, Ralf Wildenhues wrote: > a regression: this code will cause 'make distcheck' to > fail, because at 'make dist' time the file will be rewritten before > being added to the tarball (if the version doesn't indicate a stable > release), then when distcheck tries to create yet another tarball, the > above check will catch: > > | case 2.2.11a in \ > | *[a-z]) /bin/sh ../libltdl/config/edit-readme-alpha > libtool-2.2.11a/README ;; \ > | esac > | edit-readme-alpha: libtool-2.2.11a/README format has changed, please fix > `../libltdl/config/edit-readme-alpha' > | make[3]: *** [dist-hook] Error 1 > | make[3]: *** Waiting for unfinished jobs....
Ah. D'oh. Well, it does at least show that the script interacts correctly with an error for make to help catch the case where someone commits a change to the first paragraph of README without a matching edit to the sed expressions in edit-readme-alpha. Here is (an overkill) patch to not exit with an error, so that `make distcheck' can complete. Okay to push? * libltdl/config/edit-readme-alpha: If README is non-writable assume that it is being run from distcheck, and bail out with a warning (to help diagnose cases where the heuristic is not correct). However, if README has already been edited to the alpha text, quietly skip without an error message. --- ChangeLog | 9 +++++++++ libltdl/config/edit-readme-alpha | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index ceb193c..342c2ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-21 Gary V. Vaughan <g...@gnu.org> + + maint: edit-readme-alpha shouldn't try to re-edit during dist. + * libltdl/config/edit-readme-alpha: If README is non-writable + assume that it is being run from distcheck, and bail out with + a warning (to help diagnose cases where the heuristic is not + correct). However, if README has already been edited to the + alpha text, quietly skip without an error message. + 2010-09-20 Eric Blake <ebl...@redhat.com> maint: drop autobuild requirement diff --git a/libltdl/config/edit-readme-alpha b/libltdl/config/edit-readme-alpha index 6070a31..c60fbc0 100755 --- a/libltdl/config/edit-readme-alpha +++ b/libltdl/config/edit-readme-alpha @@ -55,10 +55,23 @@ func_fatal_error () for file in "$@"; do + # Assume that read-only README indicates that we are running inside + # the latter part of a `make distcheck'. + test -w $file || { + echo "$progname: not editing non-writeable \`$file' (distcheck?)" + continue + } + # Make sure the paragraph we are matching has not been edited since # this script was written. - matched=`sed -n -e '/^This is GNU Libtool,/,/^interface.$/p' $file \ + matched=`sed -n -e '/^This is GNU Libtool,/,/^interface\.$/p' $file \ |wc -l |sed 's|^ *||'` + + # Unless, of course, it was edited by this script already. + test 3 = "$matched" \ + || matched=`sed -n -e '/^This is an alpha testing release/,/behind a consistent, portable interface\.$/p' $file \ + |wc -l |sed 's|^ *||'` + test 3 = "$matched" \ || func_fatal_error "$file format has changed, please fix \`$0'" -- 1.7.2.2