diff options
author | Karl Berry <karl@freefriends.org> | 2021-07-26 18:03:53 -0700 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-07-26 18:03:53 -0700 |
commit | badd7d25de18685c92759e1629dcf7a7ceb7d484 (patch) | |
tree | bc5e60956eb295ec07846197d99997e61053ced8 | |
parent | 770b012b61c68591d53399fc9e3c98808fabb4ef (diff) | |
download | automake-badd7d25de18685c92759e1629dcf7a7ceb7d484.tar.gz |
cosmetics: py-compile consistently use test, not [ ... ]; indentation.
* lib/py-compile: consistently use test rather than [ ... ];
use consistent sh indentation; check exit status consistently.
-rwxr-xr-x | lib/py-compile | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/py-compile b/lib/py-compile index c45a77de2..81b122b0a 100755 --- a/lib/py-compile +++ b/lib/py-compile @@ -1,7 +1,7 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2020-02-19.23; # UTC +scriptversion=2021-02-27.01; # UTC # Copyright (C) 2000-2021 Free Software Foundation, Inc. @@ -27,7 +27,7 @@ scriptversion=2020-02-19.23; # UTC # bugs to <bug-automake@gnu.org> or send patches to # <automake-patches@gnu.org>. -if [ -z "$PYTHON" ]; then +if test -z "$PYTHON"; then PYTHON=python fi @@ -96,23 +96,23 @@ done files=$* if test -z "$files"; then - usage_error "no files given" + usage_error "no files given" fi # if basedir was given, then it should be prepended to filenames before # byte compilation. -if [ -z "$basedir" ]; then - pathtrans="path = file" +if test -z "$basedir"; then + pathtrans="path = file" else - pathtrans="path = os.path.join('$basedir', file)" + pathtrans="path = os.path.join('$basedir', file)" fi # if destdir was given, then it needs to be prepended to the filename to # byte compile but not go into the compiled file. -if [ -z "$destdir" ]; then - filetrans="filepath = path" +if test -z "$destdir"; then + filetrans="filepath = path" else - filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" + filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" fi python_major=`$PYTHON -V 2>&1 | sed -e 's/.* //;s/\..*$//;1q'` @@ -176,7 +176,7 @@ for file in files.split(): py_compile.compile(filepath, $import_call(filepath$import_arg2), path) else: py_compile.compile(filepath, filepath + 'o', path) -sys.stdout.write('\n')" 2>/dev/null || : +sys.stdout.write('\n')" 2>/dev/null || exit $? # Local Variables: # mode: shell-script |