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

KO Myung-Hun <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.