Bug 1809653 - Shellcheck fixes for smime data-generation scripts. r=kaie
Changes as suggested by "shellcheck" linter. Differential Revision: https://phabricator.services.mozilla.com/D167221 --HG-- extra : amend_source : 405ad1ae053d37e671766ed5e6831c682c1118b1
This commit is contained in:
Родитель
e6f5363895
Коммит
9fdc5a9016
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# This script creates updated data for automated S/MIME tests.
|
||||
# It will do a local build of NSS, execute parts of the NSS test suite,
|
||||
# and copy data created by it to the local source tree.
|
||||
|
@ -30,19 +32,22 @@ cp -v nssbuild/tests_results/security/localhost.1/sharedb/smime/tb/*.eml .
|
|||
cp -v nssbuild/tests_results/security/localhost.1/sharedb/smime/tb/*.p12 .
|
||||
cp -v nssbuild/tests_results/security/localhost.1/sharedb/smime/tb/*.pem .
|
||||
|
||||
EXPIRATION_INFO_FILE="`pwd`/expiration.txt"
|
||||
ALICE_DIR="`pwd`/nssbuild/tests_results/security/localhost.1/sharedb/alicedir"
|
||||
CWD=$(pwd)
|
||||
|
||||
export DIST="`pwd`/nssbuild/dist/"
|
||||
EXPIRATION_INFO_FILE="$CWD/expiration.txt"
|
||||
ALICE_DIR="$CWD/nssbuild/tests_results/security/localhost.1/sharedb/alicedir"
|
||||
|
||||
export DIST="$CWD/nssbuild/dist/"
|
||||
|
||||
pushd nssbuild/nss/tests/common
|
||||
export OBJDIR=`make objdir_name`
|
||||
OBJDIR=$(make objdir_name)
|
||||
export OBJDIR
|
||||
popd
|
||||
|
||||
# PATH logic copied from nss/tests/common/init.sh
|
||||
if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" != "CYGWIN_NT" -a "$OS_NAME" != "MINGW32_NT" ]; then
|
||||
if [ "${OS_ARCH}" = "WINNT" ] && [ "$OS_NAME" != "CYGWIN_NT" ] && [ "$OS_NAME" != "MINGW32_NT" ]; then
|
||||
PATH=.\;${DIST}/${OBJDIR}/bin\;${DIST}/${OBJDIR}/lib\;$PATH
|
||||
PATH=`perl ../path_uniq -d ';' "$PATH"`
|
||||
PATH=$(perl ../path_uniq -d ';' "$PATH")
|
||||
elif [ "${OS_ARCH}" = "Android" ]; then
|
||||
# android doesn't have perl, skip the uniq step
|
||||
PATH=.:${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:$PATH
|
||||
|
@ -50,7 +55,7 @@ else
|
|||
PATH=.:${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:/bin:/usr/bin:$PATH
|
||||
# added /bin and /usr/bin in the beginning so a local perl will
|
||||
# be used
|
||||
PATH=`perl nssbuild/nss/tests/path_uniq -d ':' "$PATH"`
|
||||
PATH=$(perl nssbuild/nss/tests/path_uniq -d ':' "$PATH")
|
||||
fi
|
||||
|
||||
export PATH
|
||||
|
@ -59,8 +64,8 @@ export SHLIB_PATH=${DIST}/${OBJDIR}/lib:$SHLIB_PATH
|
|||
export LIBPATH=${DIST}/${OBJDIR}/lib:$LIBPATH
|
||||
export DYLD_LIBRARY_PATH=${DIST}/${OBJDIR}/lib:$DYLD_LIBRARY_PATH
|
||||
|
||||
certutil -d ${ALICE_DIR} -L -n Alice |grep -i "Not After" | \
|
||||
sed 's/^.*: //' > ${EXPIRATION_INFO_FILE}
|
||||
certutil -d "${ALICE_DIR}" -L -n Alice |grep -i "Not After" | \
|
||||
sed 's/^.*: //' > "${EXPIRATION_INFO_FILE}"
|
||||
|
||||
# exporting DYLD_LIBRARY_PATH to a subprocess doesn't work on recent OSX
|
||||
export NSS_LIB_PATH=${DIST}/${OBJDIR}/lib
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# This script creates additional S/MIME test files.
|
||||
# It's called automatically by generate.sh.
|
||||
# However, it can also be called directly, if the test data from NSS
|
||||
|
@ -26,12 +28,12 @@ then
|
|||
exit
|
||||
fi
|
||||
|
||||
MILLDIR="`pwd`/../../../../mail/test/browser/smime/data"
|
||||
MILLDIR="$(pwd)/../../../../mail/test/browser/smime/data"
|
||||
|
||||
# When executing mozmill in the CI environment, the files from this
|
||||
# directory aren't available. Copy all files that mozmill requires to
|
||||
# the mozmill directory.
|
||||
cp -rv Bob.p12 TestCA.pem $MILLDIR
|
||||
cp -rv Bob.p12 TestCA.pem "$MILLDIR"
|
||||
|
||||
TMPDIR="./tmp-local"
|
||||
mkdir $TMPDIR
|
||||
|
@ -69,15 +71,17 @@ echo "$INPUT" | cmsutil -d $TMPDIR -E -r bob@example.com | btoa > $TMPDIR/bait.b
|
|||
|
||||
MSG=$TMPDIR/msg.eml
|
||||
|
||||
echo -n "$MSGHEADER" > $MSG
|
||||
echo "--$BOUNDARY" >> $MSG
|
||||
echo -n "$ENVHEADER" >> $MSG
|
||||
cat $TMPDIR/bait.b64 >> $MSG
|
||||
echo "--$BOUNDARY" >> $MSG
|
||||
echo -n "$ENVHEADER" >> $MSG
|
||||
cat $TMPDIR/prey.b64 >> $MSG
|
||||
echo "--$BOUNDARY" >> $MSG
|
||||
{
|
||||
echo -n "$MSGHEADER"
|
||||
echo "--$BOUNDARY"
|
||||
echo -n "$ENVHEADER"
|
||||
cat $TMPDIR/bait.b64
|
||||
echo "--$BOUNDARY"
|
||||
echo -n "$ENVHEADER"
|
||||
cat $TMPDIR/prey.b64
|
||||
echo "--$BOUNDARY"
|
||||
} > $MSG
|
||||
|
||||
mv $MSG $MILLDIR/multipart-alternative.eml
|
||||
mv $MSG "$MILLDIR/multipart-alternative.eml"
|
||||
|
||||
rm -rf $TMPDIR
|
||||
|
|
|
@ -3,9 +3,6 @@ shellcheck:
|
|||
description: Shell script linter
|
||||
include:
|
||||
- comm/
|
||||
exclude:
|
||||
- comm/mailnews/test/data/smime/generate.sh
|
||||
- comm/mailnews/test/data/smime/local-gen.sh
|
||||
# 1090: https://github.com/koalaman/shellcheck/wiki/SC1090
|
||||
# 'Can't follow a non-constant source'
|
||||
extensions: ['sh']
|
||||
|
|
Загрузка…
Ссылка в новой задаче