Fix shellcheck warnings

This commit is contained in:
a1346054 2021-08-21 13:03:42 +00:00 committed by Tatsuhiro Tsujikawa
parent bbef0f0492
commit aea080969c
5 changed files with 20 additions and 20 deletions

View File

@ -32,7 +32,7 @@
# files in the program, then also delete it here.
# cd to the directory where this script exists.
cd $(dirname $0)
cd "$(dirname $0)"
. ./script-helper
get_version
@ -43,8 +43,8 @@ if [ -z "$VERSION" ]; then
fi
DIST_DIR=aria2-$VERSION-aarch64-linux-android-build1
mkdir $DIST_DIR
mkdir "$DIST_DIR"
cp AUTHORS COPYING ChangeLog LICENSE.OpenSSL NEWS README.html README.android \
android-out/aria2c $DIST_DIR
zip -9 -r $DIST_DIR.zip $DIST_DIR
rm -rf $DIST_DIR
android-out/aria2c "$DIST_DIR"
zip -9 -r "$DIST_DIR.zip" "$DIST_DIR"
rm -rf "$DIST_DIR"

View File

@ -6,27 +6,27 @@ BUILDDIR=/tmp/aria2buildtest
if [ ! -d "$BUILDDIR" ]; then
mkdir "$BUILDDIR" \
|| { echo "Failed to create directory $BUILDDIR" && exit -1; }
|| { echo "Failed to create directory $BUILDDIR" && exit 1; }
fi
echo -n "Starting build test "
echo `date`
echo "$(date)"
# build CONFIGURE_OPTS BIN_SUFFIX DESC
build()
{
echo -n "new build() started at "
echo `date`
echo "$(date)"
echo "*** configure opts=$1"
BIN_NAME="aria2c_$2"
if [ -f "$BUILDDIR/$BIN_NAME" ]; then
echo "$BIN_NAME exists, skipping"
return
fi
./configure $1 2>&1 | tee "$BUILDDIR/configure_$2.log"\
./configure $1 2>&1 | tee "$BUILDDIR/configure_$2.log" \
&& cp config.log "$BUILDDIR/config.log_$2" \
&& LANG=C make clean \
&& LANG=C make -j2 check 2>&1 |tee "$BUILDDIR/aria2c_$2.log" \
&& LANG=C make -j2 check 2>&1 | tee "$BUILDDIR/aria2c_$2.log" \
&& cp src/aria2c "$BUILDDIR/aria2c_$2"
if [ -f "test/aria2c.log" ]; then
@ -36,8 +36,8 @@ build()
clear()
{
for file in `ls $BUILDDIR`; do
rm -f "$BUILDDIR/$file";
for file in $(ls "$BUILDDIR"); do
rm -f "$BUILDDIR/$file"
done
}

View File

@ -33,7 +33,7 @@ echo -n "en@quot en@boldquot" > "$PO_DIR"/LINGUAS
for file in "$WORK_DIR"/*.po; do
# First remove useless '\r' in messages
sed -i -e 's/\\r//' "$file"
bn=`basename "$file"`
bn=$(basename "$file")
bn=${bn#aria2-}
dst="$PO_DIR"/"$bn"
# copy file to po directory

View File

@ -36,7 +36,7 @@ test -z "$BUILD_VER" && BUILD_VER=1
test -z "$LABEL" && LABEL=$HOST
# cd to the directory where this script exists.
cd $(dirname $0)
cd "$(dirname "$0")"
. ./script-helper
get_version
@ -48,8 +48,8 @@ fi
DIST_DIR=aria2-${VERSION}-${LABEL}-build${BUILD_VER}
mkdir $DIST_DIR
mkdir "$DIST_DIR"
cp AUTHORS COPYING ChangeLog LICENSE.OpenSSL NEWS README.html README.mingw \
mingw-out/aria2c.exe $DIST_DIR
zip -9 -r $DIST_DIR.zip $DIST_DIR
rm -rf $DIST_DIR
mingw-out/aria2c.exe "$DIST_DIR"
zip -9 -r "$DIST_DIR.zip" "$DIST_DIR"
rm -rf "$DIST_DIR"

View File

@ -29,7 +29,7 @@
# version. If you delete this exception statement from all source
# files in the program, then also delete it here.
get_version () {
VERSION=`grep AC_INIT configure.ac | sed '/AC_INIT/ s/AC_INIT(\[aria2\],\[\([^]]\+\)\],.*/\1/'`
get_version() {
VERSION=$(grep AC_INIT configure.ac | sed '/AC_INIT/ s/AC_INIT(\[aria2\],\[\([^]]\+\)\],.*/\1/')
echo "Version: $VERSION"
}