diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2014-09-15 20:50:43 -0400 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-16 17:32:33 +0200 |
commit | 11c044aa48e4dc14c86cdf37591115a2590e48f8 (patch) | |
tree | cdc898f04fc41f6fd8791b123f4db717a5093bda | |
parent | 45e2345a7f3e85c3e3c22944dda5fdb83c65ecc6 (diff) | |
download | mpv-11c044aa48e4dc14c86cdf37591115a2590e48f8.tar.bz2 mpv-11c044aa48e4dc14c86cdf37591115a2590e48f8.tar.xz |
TOOLS: shellcheck: quote variable expansions
-rw-r--r-- | TOOLS/gen-x11-icon.sh | 4 | ||||
-rwxr-xr-x | TOOLS/idet.sh | 30 | ||||
-rwxr-xr-x | version.sh | 12 |
3 files changed, 23 insertions, 23 deletions
diff --git a/TOOLS/gen-x11-icon.sh b/TOOLS/gen-x11-icon.sh index 0faf2c1f5e..550e9c354d 100644 --- a/TOOLS/gen-x11-icon.sh +++ b/TOOLS/gen-x11-icon.sh @@ -5,8 +5,8 @@ conv() { echo - identify -format "icon: %w %h" $1 - convert $1 -depth 8 rgba:- + identify -format "icon: %w %h" "$1" + convert "$1" -depth 8 rgba:- } (echo "# File generated by gen-x11-icon.sh" ; diff --git a/TOOLS/idet.sh b/TOOLS/idet.sh index 898ae0cd9c..50b5bbcf83 100755 --- a/TOOLS/idet.sh +++ b/TOOLS/idet.sh @@ -1,14 +1,14 @@ #!/bin/sh -: ${MPV:=mpv} -: ${ILDETECT_MPV:=$MPV} -: ${ILDETECT_MPV:=$MPV} -: ${ILDETECT_MPVFLAGS:=--start=35% --length=35} -: ${ILDETECT_DRY_RUN:=} -: ${ILDETECT_QUIET:=} -: ${ILDETECT_RUN_INTERLACED_ONLY:=} -: ${ILDETECT_FORCE_RUN:=} -: ${MAKE:=make} +: "${MPV:=mpv}" +: "${ILDETECT_MPV:=$MPV}" +: "${ILDETECT_MPV:=$MPV}" +: "${ILDETECT_MPVFLAGS:=--start=35% --length=35}" +: "${ILDETECT_DRY_RUN:=}" +: "${ILDETECT_QUIET:=}" +: "${ILDETECT_RUN_INTERLACED_ONLY:=}" +: "${ILDETECT_FORCE_RUN:=}" +: "${MAKE:=make}" # exit status: # 0 progressive @@ -47,22 +47,22 @@ judge() interlaced=$((bff + tff)) determined=$((interlaced + progressive)) - if [ $undetermined -gt $determined ] || [ $determined -lt 250 ]; then + if [ "$undetermined" -gt "$determined" ] || [ "$determined" -lt 250 ]; then echo >&2 "ERROR: Less than 50% or 250 frames are determined." [ -n "$ILDETECT_FORCE_RUN" ] || exit 8 echo >&2 "Assuming interlacing." - if [ $tff -gt $((bff * 10)) ]; then + if [ "$tff" -gt $((bff * 10)) ]; then verdict=interlaced-tff - elif [ $bff -gt $((tff * 10)) ]; then + elif [ "$bff" -gt $((tff * 10)) ]; then verdict=interlaced-bff else verdict=interlaced fi - elif [ $((interlaced * 20)) -gt $progressive ]; then + elif [ $((interlaced * 20)) -gt "$progressive" ]; then # At least 5% of the frames are interlaced! - if [ $tff -gt $((bff * 10)) ]; then + if [ "$tff" -gt $((bff * 10)) ]; then verdict=interlaced-tff - elif [ $bff -gt $((tff * 10)) ]; then + elif [ "$bff" -gt $((tff * 10)) ]; then verdict=interlaced-bff else echo >&2 "ERROR: Content is interlaced, but can't determine field order." diff --git a/version.sh b/version.sh index 37802c6571..3eac7ef050 100755 --- a/version.sh +++ b/version.sh @@ -21,18 +21,18 @@ done # Extract revision number from file used by daily tarball snapshots # or from "git describe" output git_revision=$(cat snapshot_version 2> /dev/null) -test $git_revision || test ! -e .git || git_revision=$(git rev-parse --short HEAD) -test $git_revision && git_revision=git-$git_revision +test "$git_revision" || test ! -e .git || git_revision="$(git rev-parse --short HEAD)" +test "$git_revision" && git_revision="git-$git_revision" version="$git_revision" # releases extract the version number from the VERSION file -releaseversion=$(cat VERSION 2> /dev/null) -if test $releaseversion ; then - test $version && version="-$version" +releaseversion="$(cat VERSION 2> /dev/null)" +if test "$releaseversion" ; then + test "$version" && version="-$version" version="$releaseversion$version" fi -test $version || version=UNKNOWN +test "$version" || version=UNKNOWN VERSION="${version}${extra}" |