]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
edit-readme-alpha: generate the "stable" README properly
authorPavel Raiskup <praiskup@redhat.com>
Wed, 17 Feb 2016 15:27:25 +0000 (16:27 +0100)
committerPavel Raiskup <praiskup@redhat.com>
Wed, 17 Feb 2016 23:14:07 +0000 (00:14 +0100)
Fixes bug#20196.  Reported by Peter Johansson and KO Myung-Hun

* build-aux/edit-readme-alpha: Invert the order of checks
and exit sooner if the file was already edited.  Also fix the
typo 's/sed -n/sed/' (to print the rest of the file).
* Makefile.am ($(readme)): Double-quote the `cmd` to let test -n
work correctly.

Makefile.am
NO-THANKS
build-aux/edit-readme-alpha

index 5a4a802f252400f2e9060a4761fd55f509096dba..d8ccfaeaafe196c4cee7169c67d1cd18f8155fda 100644 (file)
@@ -599,7 +599,7 @@ $(dotversion):
 EXTRA_DIST += $(edit_readme_alpha)
 re_alpha_version = '\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[-\.][-\.0-9a-z]*\)'
 $(readme): FORCE
-       @if test -n `expr $(VERSION) : $(re_alpha_version)`; then \
+       @if test -n "`expr $(VERSION) : $(re_alpha_version)`"; then \
          if test 0 = '$(AM_DEFAULT_VERBOSITY)' && test 1 != '$(V)'; \
            then echo "  GEN     " $@; \
          else echo "$(SHELL) $(edit_readme_alpha) $@"; fi; \
index 090c863835350009db5dca1087e7ded5397e8cfd..6b83e603f566be816ee500807db86143ae2cda96 100644 (file)
--- a/NO-THANKS
+++ b/NO-THANKS
@@ -121,6 +121,7 @@ Pavel Raiskup                       praiskup@redhat.com
 Paweł Daniluk                 pawel@bioexploratorium.pl
 Peter Fritzsche                        peter.fritzsche@gmx.de
 Peter Jeremy                   peterjeremy@optushome.com.au
+Peter Johansson                        trojkan@gmail.com
 Peter Kjellerstedt             peter.kjellerstedt@axis.com
 Pádraig Brady                 P@draigBrady.com
 Richard B. Kreckel             kreckel@ginac.de
index 3291fd0442f87b7205de1658a499cecea443d99e..6bf708270ef3d5fd322f355cdde46b68d8627b9c 100755 (executable)
@@ -62,16 +62,18 @@ for file in "$@"; do
     continue
   }
 
+  # Did we already in-place edited this file?
+  matched=`sed -n -e '/^This is an alpha testing release/,/a consistent, portable interface\.$/p' $file \
+           |wc -l |sed 's|^ *||'`
+  test 3 = "$matched" && {
+    echo "$progname: $file already edited" >&2
+    continue
+  }
+
   # Make sure the paragraph we are matching has not been edited since
   # this script was written.
   matched=`sed -n -e '/^\[GNU Libtool\]\[libtool\] is/,/^consistent, portable 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/,/a consistent, portable interface\.$/p' $file \
-                  |wc -l |sed 's|^ *||'`
-
   test 3 = "$matched" \
       || func_fatal_error "$file format has changed, please fix '$0'"
 
@@ -79,7 +81,7 @@ for file in "$@"; do
   trap 'x=$?; rm $file.T; exit $x' 1 2 13 15
 
   # Edit the first paragraph to be suitable for an alpha release.
-  sed -n '/^\[GNU Libtool\]\[libtool\] is/,/^consistent, portable interface\.$/c\
+  sed '/^\[GNU Libtool\]\[libtool\] is/,/^consistent, portable interface\.$/c\
 This is an alpha testing release of [GNU Libtool][libtool], a generic\
 library support script.  [Libtool][] hides the complexity of using shared\
 libraries behind a consistent, portable interface.' $file > $file.T