Re: [PATCH 6/6] maint: use sed instead of maintaining 2 README files.
Hello Gary, * Gary V. Vaughan wrote on Sun, Sep 19, 2010 at 05:46:25AM CEST: On 18 Sep 2010, at 13:40, Ralf Wildenhues wrote: * Gary V. Vaughan wrote on Sat, Sep 18, 2010 at 07:20:18AM CEST: + sed -e '/^This is GNU Libtool,/,/^interface.$/c\ +This is an alpha testing release of GNU Libtool, a generic library\ +support script. Libtool hides the complexity of using shared libraries\ +behind a consistent, portable interface.' $file $file.T \ this script will wrongly exit with status 0 if the stdout redirection fails at this point. Ah, true. I was trying to keep the script simple, and overdid it a bit. In light of that, and my having noticed that the script also didn't complain if sed was unable to match any text to edit, I've now improved the script thus: Well, your improvements: # 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|^ *||'` test 3 = $matched \ || func_fatal_error $file format has changed, please fix \`$0' actually caused 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 Cheers, Ralf
Re: [PATCH 6/6] maint: use sed instead of maintaining 2 README files.
* Gary V. Vaughan wrote on Sat, Sep 18, 2010 at 07:20:18AM CEST: * README.alpha: Deleted. It was mostly identical to README. * libltdl/config/edit-readme-alpha: New script to edit the contents of README in the dist tree prior to tarring up. * Makefile.am (dist-hook): Run it before rolling alpha release tarball. For what it's worth ... --- /dev/null +++ b/libltdl/config/edit-readme-alpha +for file in $@; do + trap 'x=$?; rm $file.T; exit $x' 1 2 13 15 + + sed -e '/^This is GNU Libtool,/,/^interface.$/c\ +This is an alpha testing release of GNU Libtool, a generic library\ +support script. Libtool hides the complexity of using shared libraries\ +behind a consistent, portable interface.' $file $file.T \ this script will wrongly exit with status 0 if the stdout redirection fails at this point. + mv -f $file.T $file + + test -f $file.T { +rm $file.T +echo $0: unable to edit $file +exit 1 + } +done + +exit 0 Cheers, Ralf
Re: [PATCH 6/6] maint: use sed instead of maintaining 2 README files.
On 18 Sep 2010, at 13:40, Ralf Wildenhues wrote: * Gary V. Vaughan wrote on Sat, Sep 18, 2010 at 07:20:18AM CEST: * README.alpha: Deleted. It was mostly identical to README. * libltdl/config/edit-readme-alpha: New script to edit the contents of README in the dist tree prior to tarring up. * Makefile.am (dist-hook): Run it before rolling alpha release tarball. For what it's worth ... --- /dev/null +++ b/libltdl/config/edit-readme-alpha +for file in $@; do + trap 'x=$?; rm $file.T; exit $x' 1 2 13 15 + + sed -e '/^This is GNU Libtool,/,/^interface.$/c\ +This is an alpha testing release of GNU Libtool, a generic library\ +support script. Libtool hides the complexity of using shared libraries\ +behind a consistent, portable interface.' $file $file.T \ this script will wrongly exit with status 0 if the stdout redirection fails at this point. Ah, true. I was trying to keep the script simple, and overdid it a bit. In light of that, and my having noticed that the script also didn't complain if sed was unable to match any text to edit, I've now improved the script thus: EXIT_SUCCESS=0 EXIT_FAILURE=1 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as sh and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program: progname=`echo $progpath |sed 's|^.*/||'` # func_fatal_error ARG... # --- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { echo $progname: $* 2 exit $EXIT_FAILURE } for file in $@; do # 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|^ *||'` test 3 = $matched \ || func_fatal_error $file format has changed, please fix \`$0' # Don't leave file droppings. trap 'x=$?; rm $file.T; exit $x' 1 2 13 15 # Edit the first paragraph to be suitable for an alpha release. sed -e '/^This is GNU Libtool,/,/^interface.$/c\ This is an alpha testing release of GNU Libtool, a generic library\ support script. Libtool hides the complexity of using shared libraries\ behind a consistent, portable interface.' $file $file.T # Diagnose redirection failure. test -f $file.T || func_fatal_error Unable to write $file.T # Overwrite the original file with our edited version. mv $file.T $file || func_fatal_error Unable to edit $file done exit $EXIT_SUCCESS Retested with version 2.2.11a and version 2.4.0 before pushing. Cheers, -- Gary V. Vaughan (g...@gnu.org) PGP.sig Description: This is a digitally signed message part
[PATCH 6/6] maint: use sed instead of maintaining 2 README files.
* README.alpha: Deleted. It was mostly identical to README. * libltdl/config/edit-readme-alpha: New script to edit the contents of README in the dist tree prior to tarring up. * Makefile.am (dist-hook): Run it before rolling alpha release tarball. --- ChangeLog|7 + Makefile.am | 11 +- README.alpha | 324 -- libltdl/config/edit-readme-alpha | 49 ++ 4 files changed, 63 insertions(+), 328 deletions(-) delete mode 100644 README.alpha create mode 100755 libltdl/config/edit-readme-alpha diff --git a/ChangeLog b/ChangeLog index a4781d9..05c4466 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2010-09-18 Gary V. Vaughan g...@gnu.org + maint: use sed instead of maintaining 2 README files. + * README.alpha: Deleted. It was mostly identical to README. + * libltdl/config/edit-readme-alpha: New script to edit the + contents of README in the dist tree prior to tarring up. + * Makefile.am (dist-hook): Run it before rolling alpha release + tarball. + maint: improve README's `Obtaining the Latest Sources'. * README (Obtaining the Latest Sources): Add instructions for obtaining stable, alpha and nightly snapshot tarballs. diff --git a/Makefile.am b/Makefile.am index dcd0876..6e29a29 100644 --- a/Makefile.am +++ b/Makefile.am @@ -406,6 +406,10 @@ install-data-local: libltdl/Makefile.in ## Distribution. ## ## - ## +edit_readme_alpha = $(auxdir)/edit-readme-alpha + +EXTRA_DIST += $(edit_readme_alpha) + uninstall-hook: @$(NORMAL_UNINSTALL) @list='$(ltdldatafiles) $(auxfiles)'; for f in $$list; do \ @@ -419,11 +423,10 @@ uninstall-hook: done dist-hook: -## Ship README.alpha only in alpha release, but renamed to README - @if test -f $(srcdir)/README.alpha; then \ +## Edit the README file for alpha releases. case $(VERSION) in \ - *[a-z]) cp -p $(srcdir)/README.alpha $(distdir)/README ;; \ - esac; else :; fi + *[a-z]) $(SHELL) $(srcdir)/$(edit_readme_alpha) $(distdir)/README ;; \ + esac ## Ensure aclocal has not wrongly picked up old macro definitions. for macro in LT_INIT AC_PROG_LIBTOOL AM_PROG_LIBTOOL; do \ if grep $$macro $(srcdir)/aclocal.m4 $(srcdir)/libltdl/aclocal.m4; then \ diff --git a/README.alpha b/README.alpha deleted file mode 100644 index 1771124..000 --- a/README.alpha +++ /dev/null @@ -1,324 +0,0 @@ -GNU Libtool -*** - -1. Introduction -=== - -This is an alpha testing release of GNU Libtool, a generic library -support script. Libtool hides the complexity of using shared libraries -behind a consistent, portable interface. - -Libtool's home page is: - -http://www.gnu.org/software/libtool/libtool.html - -See the file NEWS for a description of recent changes to Libtool. - -See the file INSTALL for generic instructions on how to build and -install Libtool. Please see the file doc/notes.txt for some platform- -specific information. Please note that you need GNU make to build -Libtool. - -See the info node (libtool)Tested Platforms. (or the file doc/PLATFORMS) -for a list of platforms that Libtool already supports. - -Please try it on all the platforms you have access to: - - * If it builds and passes the test suite (`gmake check'), please send - a short note to the libtool mailing list libt...@gnu.org with a - subject line including the string `[PLATFORM]', and containing the - details from the end of `./libtool --help' in the body. - * Otherwise, see `Reporting Bugs' below for how to help us fix any - problems you discover. - -To use Libtool, add the new generic library building commands to your -Makefile, Makefile.in, or Makefile.am. See the documentation for -details. - - -2. Reporting Bugs -= - -If this distribution doesn't work for you, before you report the -problem, at least try upgrading to the latest released version first, -and see whether the issue persists. If you feel able, you can also -check whether the issue has been fixed in the development sources for -the next release (see `Obtaining the Latest Sources' below). - -Once you've determined that your bug is still not fixed in the latest -version, please send a full report to bug-libt...@gnu.org, including: - - 1. the information from the end of the help message given by - `./libtool --help', and the verbose output of any failed tests - (see `The Test Suites' immediately below); - 2. complete instructions for how to reproduce your bug, along with - the results you were expecting, and how they differ from what you - actually see; - 3. a workaround or full fix for the bug, if you have it; - 4. a copy of `tests/testuite.log' if you are experiencing failures - in the Autotest testsuite. - 5. new test cases for the testsuite that demonstrate the bug are - especially welcome, and