bneradt commented on code in PR #9757:
URL: https://github.com/apache/trafficserver/pull/9757#discussion_r1212382979
##########
ci/coverage:
##########
@@ -16,36 +16,43 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+set -o errexit
+set -o pipefail
+
LCOV=${LCOV:-lcov}
GENHTML=${GENHTML:-genhtml}
TMPDIR=${TMPDIR:-/tmp}
BUILDID="org.apache.trafficserver.$$"
-SRCROOT=${SRCROOT:-$(cd $(dirname $0)/.. && pwd)} # where the source lives
+SRCROOT=${SRCROOT:-$(cd "$(dirname "$0")/.." && pwd)} # where the source lives
OBJROOT=${OBJROOT:-"$TMPDIR/$BUILDID/obj"} # where we are building
DSTROOT=${DSTROOT:-"$TMPDIR/$BUILDID/dst"} # where we are installing
# Force low make parallelization so that the build can complete in a VM with
# only a small amount of memory.
NPROCS=${NPROCS:-2}
-mkdir -p $SRCROOT
-mkdir -p $OBJROOT
-mkdir -p $DSTROOT
+mkdir -p "$SRCROOT"
+mkdir -p "$OBJROOT"
+mkdir -p "$DSTROOT"
autogen() {
(
cd "$SRCROOT"
- [ configure -nt configure.ac -a Makefile.in -nt Makefile.am ] ||
autoreconf -fi
+ if [ configure -nt configure.ac ] && [ Makefile.in -nt Makefile.am ] ; then
+ :
+ else
+ autoreconf -fi
+ fi
Review Comment:
I prefer the original.
If not the original, then at least let's reverse the boolean and not have
the empty then.
##########
tools/clang-format.sh:
##########
@@ -46,13 +46,13 @@ function main() {
CURL=${CURL:-curl}
# Default to sha256sum, but honor the env variable just in case
- if [ $(which sha256sum) ] ; then
+ if [ -n "$(which sha256sum)" ] ; then
SHASUM=${SHASUM:-sha256sum}
else
SHASUM=${SHASUM:-shasum -a 256}
fi
- ARCHIVE=$ROOT/$(basename ${URL})
+ ARCHIVE="$ROOT/$(basename "${URL}")"
Review Comment:
Do these two nested quotes work?
##########
tools/git/pre-commit:
##########
@@ -44,19 +49,19 @@ if [ ! -x "$FORMAT" ]; then
fi
source "$GIT_TOP/tools/autopep8.sh"
-if [ ! -d ${AUTOPEP8_VENV} ]; then
+if [ ! -d "${AUTOPEP8_VENV}" ]; then
echo "Run \"make autopep8\""
exit 1
fi
-source ${AUTOPEP8_VENV}/bin/activate
+source "${AUTOPEP8_VENV}/bin/activate"
# Where to store the patch
clang_patch_file=$(mktemp -t clang-format.XXXXXXXXXX)
autopep8_patch_file=$(mktemp -t autopep8.XXXXXXXXXX)
-trap "rm -f $clang_patch_file $autopep8_patch_file" 0 1 2 3 5 15
+trap 'rm -f $clang_patch_file $autopep8_patch_file' 0 1 2 3 15
Review Comment:
This change to teh single quote will no longer expand $clang_patch_file and
$autopep8_patch_file. Is that an intentional change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]