[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] edit-readme-alpha: do not edit again a file already edit
From: |
KO Myung-Hun |
Subject: |
Re: [PATCH 1/2] edit-readme-alpha: do not edit again a file already edited |
Date: |
Tue, 29 Dec 2015 23:55:08 +0900 |
User-agent: |
Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.6esrpre) Gecko/20120715 Firefox/10.0.6esrpre SeaMonkey/2.7.2 |
Ping ?
KO Myung-Hun wrote:
> 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
--
KO Myung-Hun
Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM
Korean OS/2 User Community : http://www.ecomstation.co.kr