3 # edit-readme-alpha - edit README file for alpha releases
4 # Copyright (C) 2010 Free Software Foundation, Inc.
5 # Written by Gary V. Vaughan, 2010
7 # This file is part of GNU Libtool.
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING. If not, a copy
21 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 # We used to maintain separate (but extremely similiar!) README and
27 # README.alpha files, and had `make dist' include the right one in a
28 # distribution based on the contests of `$(VERSION)'.
30 # Now, we have `make dist' call this script to tweak the first paragraph
31 # of README in situ, to be more suitable for an alpha quality release.
36 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
37 # is ksh but when the shell is invoked as "sh" and the current value of
38 # the _XPG environment variable is not equal to 1 (one), the special
39 # positional parameter $0, within a function call, is the name of the
43 # The name of this program:
44 progname=`echo "$progpath" |sed 's|^.*/||'`
47 # func_fatal_error ARG...
48 # -----------------------
49 # Echo program name prefixed message to standard error, and exit.
52 echo "$progname: $*" >&2
58 # Assume that read-only README indicates that we are running inside
59 # the latter part of a `make distcheck'.
61 echo "$progname: not editing non-writeable \`$file' (distcheck?)" >&2
65 # Make sure the paragraph we are matching has not been edited since
66 # this script was written.
67 matched=`sed -n -e '/^This is GNU Libtool,/,/^interface\.$/p' $file \
68 |wc -l |sed 's|^ *||'`
70 # Unless, of course, it was edited by this script already.
72 || matched=`sed -n -e '/^This is an alpha testing release/,/behind a consistent, portable interface\.$/p' $file \
73 |wc -l |sed 's|^ *||'`
76 || func_fatal_error "$file format has changed, please fix \`$0'"
78 # Don't leave file droppings.
79 trap 'x=$?; rm $file.T; exit $x' 1 2 13 15
81 # Edit the first paragraph to be suitable for an alpha release.
82 sed -e '/^This is GNU Libtool,/,/^interface.$/c\
83 This is an alpha testing release of GNU Libtool, a generic library\
84 support script. Libtool hides the complexity of using shared libraries\
85 behind a consistent, portable interface.' $file > $file.T
87 # Diagnose redirection failure.
88 test -f $file.T || func_fatal_error "Unable to write $file.T"
90 # Overwrite the original file with our edited version.
91 mv $file.T $file || func_fatal_error "Unable to edit $file"