libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] edit-readme-alpha: do not edit again a file already edited


From: KO Myung-Hun
Subject: [PATCH 1/2] edit-readme-alpha: do not edit again a file already edited
Date: Wed, 16 Dec 2015 12:59:16 +0900

No need to edit again a file already edited. In addition, if editing
the file, a zero-length file is generated.

* build-aux-edit-readme-alpha: Skip a file already edited.
---
 build-aux/edit-readme-alpha | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/build-aux/edit-readme-alpha b/build-aux/edit-readme-alpha
index 4b4d395..4f7c214 100755
--- a/build-aux/edit-readme-alpha
+++ b/build-aux/edit-readme-alpha
@@ -68,12 +68,15 @@ for file in "$@"; do
            |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'"
+  test 3 = "$matched" || {
+    matched=`sed -n -e '/^This is an alpha testing release/,/a consistent, 
portable interface\.$/p' $file \
+             |wc -l |sed 's|^ *||'`
+
+    # if already edited, no need to edit again.
+    test 3 = "$matched" \
+        && continue \
+        || 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
-- 
2.6.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]