From 850f41781e1c5e98b71457d1375231b1fa581325 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Tue, 21 Sep 2010 07:57:15 +0700 Subject: [PATCH] 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. Signed-off-by: Gary V. Vaughan --- ChangeLog | 9 +++++++++ libltdl/config/edit-readme-alpha | 17 +++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ceb193cd4..4934ce585 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-21 Gary V. Vaughan + + 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 skip the edit + 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 maint: drop autobuild requirement diff --git a/libltdl/config/edit-readme-alpha b/libltdl/config/edit-readme-alpha index 6070a3197..ee6ca6b97 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?)" >&2 + 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 \ - |wc -l |sed 's|^ *||'` + 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'" -- 2.47.2