From badd7d25de18685c92759e1629dcf7a7ceb7d484 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 26 Jul 2021 18:03:53 -0700 Subject: [PATCH] cosmetics: py-compile consistently use test, not [ ... ]; indentation. * lib/py-compile: consistently use test rather than [ ... ]; use consistent sh indentation; check exit status consistently. --- lib/py-compile | 20 ++++++++++---------- 1 file 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 or send patches to # . -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 -- 2.47.2