diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-04 14:10:42 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-12 08:30:31 +0200 |
commit | cc5549ca12616376a4e4ef04fd4e2fb53d6d098c (patch) | |
tree | 68e2b0d1da95d280e8d3c277298db65c62a18ec4 /tools | |
parent | 408c9a07e55572f272e38fc84174cf610a9c9ccb (diff) | |
download | systemd-cc5549ca12616376a4e4ef04fd4e2fb53d6d098c.tar.gz |
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/add-git-hook.sh | 2 | ||||
-rwxr-xr-x | tools/check-directives.sh | 13 | ||||
-rwxr-xr-x | tools/choose-default-locale.sh | 7 | ||||
-rwxr-xr-x | tools/coverity.sh | 254 | ||||
-rwxr-xr-x | tools/find-build-dir.sh | 24 | ||||
-rwxr-xr-x | tools/find-double-newline.sh | 69 | ||||
-rwxr-xr-x | tools/find-tabs.sh | 69 | ||||
-rwxr-xr-x | tools/meson-apply-m4.sh | 12 | ||||
-rwxr-xr-x | tools/meson-check-api-docs.sh | 41 | ||||
-rwxr-xr-x | tools/meson-check-help.sh | 14 | ||||
-rwxr-xr-x | tools/meson-git-contrib.sh | 10 | ||||
-rwxr-xr-x | tools/meson-hwdb-update.sh | 24 | ||||
-rwxr-xr-x | tools/meson-make-symlink.sh | 4 | ||||
-rwxr-xr-x | tools/meson-vcs-tag.sh | 4 | ||||
-rwxr-xr-x | tools/oss-fuzz.sh | 4 |
15 files changed, 273 insertions, 278 deletions
diff --git a/tools/add-git-hook.sh b/tools/add-git-hook.sh index c1db99b18a..5b1bf17219 100755 --- a/tools/add-git-hook.sh +++ b/tools/add-git-hook.sh @@ -4,7 +4,7 @@ set -eu cd "$MESON_SOURCE_ROOT" if [ ! -f .git/hooks/pre-commit.sample -o -f .git/hooks/pre-commit ]; then - exit 2 # not needed + exit 2 # not needed fi cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit diff --git a/tools/check-directives.sh b/tools/check-directives.sh index 99f8f9d451..e8c6e60040 100755 --- a/tools/check-directives.sh +++ b/tools/check-directives.sh @@ -1,5 +1,4 @@ #!/bin/bash - set -e function generate_directives() { @@ -12,18 +11,18 @@ function generate_directives() { ret=0 if [[ $(generate_directives src/network/networkd-network-gperf.gperf | wc -l) -ne $(wc -l <test/fuzz/fuzz-network-parser/directives.network) ]]; then - echo "Looks like test/fuzz/fuzz-network-parser/directives.network hasn't been updated" - ret=1 + echo "Looks like test/fuzz/fuzz-network-parser/directives.network hasn't been updated" + ret=1 fi if [[ $(generate_directives src/network/netdev/netdev-gperf.gperf | wc -l) -ne $(wc -l <test/fuzz/fuzz-netdev-parser/directives.netdev) ]]; then - echo "Looks like test/fuzz/fuzz-netdev-parser/directives.netdev hasn't been updated" - ret=1 + echo "Looks like test/fuzz/fuzz-netdev-parser/directives.netdev hasn't been updated" + ret=1 fi if [[ $(generate_directives src/udev/net/link-config-gperf.gperf | wc -l) -ne $(wc -l <test/fuzz/fuzz-link-parser/directives.link) ]]; then - echo "Looks like test/fuzz/fuzz-link-parser/directives.link hasn't been updated" - ret=1 + echo "Looks like test/fuzz/fuzz-link-parser/directives.link hasn't been updated" + ret=1 fi exit $ret diff --git a/tools/choose-default-locale.sh b/tools/choose-default-locale.sh index 3b3003835c..da9768ad7c 100755 --- a/tools/choose-default-locale.sh +++ b/tools/choose-default-locale.sh @@ -1,12 +1,11 @@ #!/bin/sh - set -e # Fedora uses C.utf8 but Debian uses C.UTF-8 if locale -a | grep -xq -E 'C\.(utf8|UTF-8)'; then - echo 'C.UTF-8' + echo 'C.UTF-8' elif locale -a | grep -xqF 'en_US.utf8'; then - echo 'en_US.UTF-8' + echo 'en_US.UTF-8' else - echo 'C' + echo 'C' fi diff --git a/tools/coverity.sh b/tools/coverity.sh index af4c920cd2..5842eeb81f 100755 --- a/tools/coverity.sh +++ b/tools/coverity.sh @@ -1,4 +1,4 @@ -#!/bin/env bash +#!/bin/bash # The official unmodified version of the script can be found at # https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh @@ -24,32 +24,32 @@ echo -e "\033[33;1mNote: COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN are # Do not run on pull requests if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then - echo -e "\033[33;1mINFO: Skipping Coverity Analysis: branch is a pull request.\033[0m" - exit 0 + echo -e "\033[33;1mINFO: Skipping Coverity Analysis: branch is a pull request.\033[0m" + exit 0 fi # Verify this branch should run if [[ "${TRAVIS_BRANCH^^}" =~ "${COVERITY_SCAN_BRANCH_PATTERN^^}" ]]; then - echo -e "\033[33;1mCoverity Scan configured to run on branch ${TRAVIS_BRANCH}\033[0m" + echo -e "\033[33;1mCoverity Scan configured to run on branch ${TRAVIS_BRANCH}\033[0m" else - echo -e "\033[33;1mCoverity Scan NOT configured to run on branch ${TRAVIS_BRANCH}\033[0m" - exit 1 + echo -e "\033[33;1mCoverity Scan NOT configured to run on branch ${TRAVIS_BRANCH}\033[0m" + exit 1 fi # Verify upload is permitted AUTH_RES=`curl -s --form project="$COVERITY_SCAN_PROJECT_NAME" --form token="$COVERITY_SCAN_TOKEN" $SCAN_URL/api/upload_permitted` if [ "$AUTH_RES" = "Access denied" ]; then - echo -e "\033[33;1mCoverity Scan API access denied. Check COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN.\033[0m" - exit 1 -else - AUTH=`echo $AUTH_RES | python -c "import sys, json; print(json.load(sys.stdin)['upload_permitted'])"` - if [ "$AUTH" = "True" ]; then - echo -e "\033[33;1mCoverity Scan analysis authorized per quota.\033[0m" - else - WHEN=`echo $AUTH_RES | python -c "import sys, json; print(json.load(sys.stdin)['next_upload_permitted_at'])"` - echo -e "\033[33;1mCoverity Scan analysis NOT authorized until $WHEN.\033[0m" + echo -e "\033[33;1mCoverity Scan API access denied. Check COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN.\033[0m" exit 1 - fi +else + AUTH=`echo $AUTH_RES | python -c "import sys, json; print(json.load(sys.stdin)['upload_permitted'])"` + if [ "$AUTH" = "True" ]; then + echo -e "\033[33;1mCoverity Scan analysis authorized per quota.\033[0m" + else + WHEN=`echo $AUTH_RES | python -c "import sys, json; print(json.load(sys.stdin)['next_upload_permitted_at'])"` + echo -e "\033[33;1mCoverity Scan analysis NOT authorized until $WHEN.\033[0m" + exit 1 + fi fi TOOL_DIR=`find $TOOL_BASE -type d -name 'cov-analysis*'` @@ -62,8 +62,8 @@ export CCACHE_DISABLE=1 # -------------------- _help() { - # displays help and exits - cat <<-EOF + # displays help and exits + cat <<-EOF USAGE: $0 [CMD] [OPTIONS] CMD @@ -87,98 +87,98 @@ _help() -t, --tar ARCHIVE Use custom .tgz archive instead of intermediate directory or pre-archived .tgz (by default 'analysis-result.tgz' EOF - return; + return; } _pack() { - RESULTS_ARCHIVE=${RESULTS_ARCHIVE:-'analysis-results.tgz'} + RESULTS_ARCHIVE=${RESULTS_ARCHIVE:-'analysis-results.tgz'} - echo -e "\033[33;1mTarring Coverity Scan Analysis results...\033[0m" - tar czf $RESULTS_ARCHIVE $RESULTS_DIR - SHA=`git rev-parse --short HEAD` + echo -e "\033[33;1mTarring Coverity Scan Analysis results...\033[0m" + tar czf $RESULTS_ARCHIVE $RESULTS_DIR + SHA=`git rev-parse --short HEAD` - PACKED=true + PACKED=true } _build() { - echo -e "\033[33;1mRunning Coverity Scan Analysis Tool...\033[0m" - local _cov_build_options="" - #local _cov_build_options="--return-emit-failures 8 --parse-error-threshold 85" - eval "${COVERITY_SCAN_BUILD_COMMAND_PREPEND}" - COVERITY_UNSUPPORTED=1 cov-build --dir $RESULTS_DIR $_cov_build_options sh -c "$COVERITY_SCAN_BUILD_COMMAND" - cov-import-scm --dir $RESULTS_DIR --scm git --log $RESULTS_DIR/scm_log.txt - - if [ $? != 0 ]; then - echo -e "\033[33;1mCoverity Scan Build failed: $TEXT.\033[0m" - return 1 - fi - - [ -z $TAR ] || [ $TAR = false ] && return 0 - - if [ "$TAR" = true ]; then - _pack - fi + echo -e "\033[33;1mRunning Coverity Scan Analysis Tool...\033[0m" + local _cov_build_options="" + #local _cov_build_options="--return-emit-failures 8 --parse-error-threshold 85" + eval "${COVERITY_SCAN_BUILD_COMMAND_PREPEND}" + COVERITY_UNSUPPORTED=1 cov-build --dir $RESULTS_DIR $_cov_build_options sh -c "$COVERITY_SCAN_BUILD_COMMAND" + cov-import-scm --dir $RESULTS_DIR --scm git --log $RESULTS_DIR/scm_log.txt + + if [ $? != 0 ]; then + echo -e "\033[33;1mCoverity Scan Build failed: $TEXT.\033[0m" + return 1 + fi + + [ -z $TAR ] || [ $TAR = false ] && return 0 + + if [ "$TAR" = true ]; then + _pack + fi } _upload() { - # pack results - [ -z $PACKED ] || [ $PACKED = false ] && _pack - - # Upload results - echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m" - response=$(curl \ - --silent --write-out "\n%{http_code}\n" \ - --form project=$COVERITY_SCAN_PROJECT_NAME \ - --form token=$COVERITY_SCAN_TOKEN \ - --form email=$COVERITY_SCAN_NOTIFICATION_EMAIL \ - --form file=@$RESULTS_ARCHIVE \ - --form version=$SHA \ - --form description="Travis CI build" \ - $UPLOAD_URL) - printf "\033[33;1mThe response is\033[0m\n%s\n" "$response" - status_code=$(echo "$response" | sed -n '$p') - # Coverity Scan used to respond with 201 on successfully receieving analysis results. - # Now for some reason it sends 200 and may change back in the foreseeable future. - # See https://github.com/pmem/pmdk/commit/7b103fd2dd54b2e5974f71fb65c81ab3713c12c5 - if [ "$status_code" != "200" ]; then - TEXT=$(echo "$response" | sed '$d') - echo -e "\033[33;1mCoverity Scan upload failed: $TEXT.\033[0m" - exit 1 - fi - - echo -e "\n\033[33;1mCoverity Scan Analysis completed succesfully.\033[0m" - exit 0 + # pack results + [ -z $PACKED ] || [ $PACKED = false ] && _pack + + # Upload results + echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m" + response=$(curl \ + --silent --write-out "\n%{http_code}\n" \ + --form project=$COVERITY_SCAN_PROJECT_NAME \ + --form token=$COVERITY_SCAN_TOKEN \ + --form email=$COVERITY_SCAN_NOTIFICATION_EMAIL \ + --form file=@$RESULTS_ARCHIVE \ + --form version=$SHA \ + --form description="Travis CI build" \ + $UPLOAD_URL) + printf "\033[33;1mThe response is\033[0m\n%s\n" "$response" + status_code=$(echo "$response" | sed -n '$p') + # Coverity Scan used to respond with 201 on successfully receieving analysis results. + # Now for some reason it sends 200 and may change back in the foreseeable future. + # See https://github.com/pmem/pmdk/commit/7b103fd2dd54b2e5974f71fb65c81ab3713c12c5 + if [ "$status_code" != "200" ]; then + TEXT=$(echo "$response" | sed '$d') + echo -e "\033[33;1mCoverity Scan upload failed: $TEXT.\033[0m" + exit 1 + fi + + echo -e "\n\033[33;1mCoverity Scan Analysis completed succesfully.\033[0m" + exit 0 } # PARSE COMMAND LINE OPTIONS # -------------------------- case $1 in - -h|--help) - _help - exit 0 - ;; - build) - CMD='build' - TEMP=`getopt -o ho:t --long help,out-dir:,tar -n '$0' -- "$@"` - _ec=$? - [[ $_ec -gt 0 ]] && _help && exit $_ec - shift - ;; - upload) - CMD='upload' - TEMP=`getopt -o hd:t: --long help,result-dir:tar: -n '$0' -- "$@"` - _ec=$? - [[ $_ec -gt 0 ]] && _help && exit $_ec - shift - ;; - *) - _help && exit 1 ;; + -h|--help) + _help + exit 0 + ;; + build) + CMD='build' + TEMP=`getopt -o ho:t --long help,out-dir:,tar -n '$0' -- "$@"` + _ec=$? + [[ $_ec -gt 0 ]] && _help && exit $_ec + shift + ;; + upload) + CMD='upload' + TEMP=`getopt -o hd:t: --long help,result-dir:tar: -n '$0' -- "$@"` + _ec=$? + [[ $_ec -gt 0 ]] && _help && exit $_ec + shift + ;; + *) + _help && exit 1 ;; esac RESULTS_DIR='cov-int' @@ -188,46 +188,46 @@ if [ $? != 0 ] ; then exit 1 ; fi # extract options and their arguments into variables. if [[ $CMD == 'build' ]]; then - TAR=false - while true ; do - case $1 in - -h|--help) - _help - exit 0 - ;; - -o|--out-dir) - RESULTS_DIR="$2" - shift 2 - ;; - -t|--tar) - TAR=true - shift - ;; - --) _build; shift ; break ;; - *) echo "Internal error" ; _help && exit 6 ;; - esac - done + TAR=false + while true ; do + case $1 in + -h|--help) + _help + exit 0 + ;; + -o|--out-dir) + RESULTS_DIR="$2" + shift 2 + ;; + -t|--tar) + TAR=true + shift + ;; + --) _build; shift ; break ;; + *) echo "Internal error" ; _help && exit 6 ;; + esac + done elif [[ $CMD == 'upload' ]]; then - while true ; do - case $1 in - -h|--help) - _help - exit 0 - ;; - -d|--result-dir) - CHANGE_DEFAULT_DIR=true - RESULTS_DIR="$2" - shift 2 - ;; - -t|--tar) - RESULTS_ARCHIVE="$2" - [ -z $CHANGE_DEFAULT_DIR ] || [ $CHANGE_DEFAULT_DIR = false ] && PACKED=true - shift 2 - ;; - --) _upload; shift ; break ;; - *) echo "Internal error" ; _help && exit 6 ;; - esac - done + while true ; do + case $1 in + -h|--help) + _help + exit 0 + ;; + -d|--result-dir) + CHANGE_DEFAULT_DIR=true + RESULTS_DIR="$2" + shift 2 + ;; + -t|--tar) + RESULTS_ARCHIVE="$2" + [ -z $CHANGE_DEFAULT_DIR ] || [ $CHANGE_DEFAULT_DIR = false ] && PACKED=true + shift 2 + ;; + --) _upload; shift ; break ;; + *) echo "Internal error" ; _help && exit 6 ;; + esac + done fi diff --git a/tools/find-build-dir.sh b/tools/find-build-dir.sh index 06b6297ea5..fb8a1c17a3 100755 --- a/tools/find-build-dir.sh +++ b/tools/find-build-dir.sh @@ -5,28 +5,28 @@ set -e # we look for subdirectories of the parent directory that look like ninja build dirs. if [ -n "$BUILD_DIR" ]; then - echo "$(realpath "$BUILD_DIR")" - exit 0 + echo "$(realpath "$BUILD_DIR")" + exit 0 fi root="$(dirname "$(realpath "$0")")" found= for i in "$root"/../*/build.ninja; do - c="$(dirname $i)" - [ -d "$c" ] || continue - [ "$(basename "$c")" != mkosi.builddir ] || continue + c="$(dirname $i)" + [ -d "$c" ] || continue + [ "$(basename "$c")" != mkosi.builddir ] || continue - if [ -n "$found" ]; then - echo 'Found multiple candidates, specify build directory with $BUILD_DIR' >&2 - exit 2 - fi - found="$c" + if [ -n "$found" ]; then + echo 'Found multiple candidates, specify build directory with $BUILD_DIR' >&2 + exit 2 + fi + found="$c" done if [ -z "$found" ]; then - echo 'Specify build directory with $BUILD_DIR' >&2 - exit 1 + echo 'Specify build directory with $BUILD_DIR' >&2 + exit 1 fi echo "$(realpath $found)" diff --git a/tools/find-double-newline.sh b/tools/find-double-newline.sh index 6a6790b4b2..51204eb7c9 100755 --- a/tools/find-double-newline.sh +++ b/tools/find-double-newline.sh @@ -4,39 +4,38 @@ TOP=`git rev-parse --show-toplevel` case "$1" in - - recdiff) - if [ "$2" = "" ] ; then - DIR="$TOP" - else - DIR="$2" - fi - - find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 diff \{\} \; - ;; - - recpatch) - if [ "$2" = "" ] ; then - DIR="$TOP" - else - DIR="$2" - fi - - find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 patch \{\} \; - ;; - - diff) - T=`mktemp` - sed '/^$/N;/^\n$/D' < "$2" > "$T" - diff -u "$2" "$T" - rm -f "$T" - ;; - - patch) - sed -i '/^$/N;/^\n$/D' "$2" - ;; - - *) - echo "Expected recdiff|recpatch|diff|patch as verb." >&2 - ;; + recdiff) + if [ "$2" = "" ] ; then + DIR="$TOP" + else + DIR="$2" + fi + + find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 diff \{\} \; + ;; + + recpatch) + if [ "$2" = "" ] ; then + DIR="$TOP" + else + DIR="$2" + fi + + find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 patch \{\} \; + ;; + + diff) + T=`mktemp` + sed '/^$/N;/^\n$/D' < "$2" > "$T" + diff -u "$2" "$T" + rm -f "$T" + ;; + + patch) + sed -i '/^$/N;/^\n$/D' "$2" + ;; + + *) + echo "Expected recdiff|recpatch|diff|patch as verb." >&2 + ;; esac diff --git a/tools/find-tabs.sh b/tools/find-tabs.sh index e32eac8f32..95249f9c9c 100755 --- a/tools/find-tabs.sh +++ b/tools/find-tabs.sh @@ -4,39 +4,38 @@ TOP=`git rev-parse --show-toplevel` case "$1" in - - recdiff) - if [ "$2" = "" ] ; then - DIR="$TOP" - else - DIR="$2" - fi - - find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 diff \{\} \; - ;; - - recpatch) - if [ "$2" = "" ] ; then - DIR="$TOP" - else - DIR="$2" - fi - - find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 patch \{\} \; - ;; - - diff) - T=`mktemp` - sed 's/\t/ /g' < "$2" > "$T" - diff -u "$2" "$T" - rm -f "$T" - ;; - - patch) - sed -i 's/\t/ /g' "$2" - ;; - - *) - echo "Expected recdiff|recpatch|diff|patch as verb." >&2 - ;; + recdiff) + if [ "$2" = "" ] ; then + DIR="$TOP" + else + DIR="$2" + fi + + find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 diff \{\} \; + ;; + + recpatch) + if [ "$2" = "" ] ; then + DIR="$TOP" + else + DIR="$2" + fi + + find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 patch \{\} \; + ;; + + diff) + T=`mktemp` + sed 's/\t/ /g' < "$2" > "$T" + diff -u "$2" "$T" + rm -f "$T" + ;; + + patch) + sed -i 's/\t/ /g' "$2" + ;; + + *) + echo "Expected recdiff|recpatch|diff|patch as verb." >&2 + ;; esac diff --git a/tools/meson-apply-m4.sh b/tools/meson-apply-m4.sh index 6abe177ac5..5fad8cd94f 100755 --- a/tools/meson-apply-m4.sh +++ b/tools/meson-apply-m4.sh @@ -5,18 +5,18 @@ CONFIG=$1 TARGET=$2 if [ $# -ne 2 ]; then - echo 'Invalid number of arguments.' - exit 1 + echo 'Invalid number of arguments.' + exit 1 fi if [ ! -f $CONFIG ]; then - echo "$CONFIG not found." - exit 2 + echo "$CONFIG not found." + exit 2 fi if [ ! -f $TARGET ]; then - echo "$TARGET not found." - exit 3 + echo "$TARGET not found." + exit 3 fi DEFINES=$(awk '$1 == "#define" && $3 == "1" { printf "-D%s ", $2 }' $CONFIG) diff --git a/tools/meson-check-api-docs.sh b/tools/meson-check-api-docs.sh index a654368f9e..bd320562ad 100755 --- a/tools/meson-check-api-docs.sh +++ b/tools/meson-check-api-docs.sh @@ -1,5 +1,4 @@ #!/bin/sh - set -eu sd_good=0 @@ -8,27 +7,27 @@ udev_good=0 udev_total=0 for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | sort -u` ; do - if test -f ${MESON_BUILD_ROOT}/man/$symbol.3 ; then - echo "✓ Symbol $symbol() is documented." - good=1 - else - printf " \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m\n" - good=0 - fi + if test -f ${MESON_BUILD_ROOT}/man/$symbol.3 ; then + echo "✓ Symbol $symbol() is documented." + good=1 + else + printf " \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m\n" + good=0 + fi - case $symbol in - sd_*) - ((sd_good+=good)) - ((sd_total+=1)) - ;; - udev_*) - ((udev_good+=good)) - ((udev_total+=1)) - ;; - *) - echo 'unknown symbol prefix' - exit 1 - esac + case $symbol in + sd_*) + ((sd_good+=good)) + ((sd_total+=1)) + ;; + udev_*) + ((udev_good+=good)) + ((udev_total+=1)) + ;; + *) + echo 'unknown symbol prefix' + exit 1 + esac done echo "libsystemd: $sd_good/$sd_total libudev: $udev_good/$udev_total" diff --git a/tools/meson-check-help.sh b/tools/meson-check-help.sh index 69157105f2..a0e304ca9c 100755 --- a/tools/meson-check-help.sh +++ b/tools/meson-check-help.sh @@ -5,19 +5,19 @@ export SYSTEMD_LOG_LEVEL=info # output width if "$1" --help | grep -v 'default:' | grep -E -q '.{80}.'; then - echo "$(basename "$1") --help output is too wide:" - "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}' - exit 1 + echo "$(basename "$1") --help output is too wide:" + "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}' + exit 1 fi # no --help output to stdout if "$1" --help 2>&1 1>/dev/null | grep .; then - echo "$(basename "$1") --help prints to stderr" - exit 2 + echo "$(basename "$1") --help prints to stderr" + exit 2 fi # error output to stderr if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then - echo "$(basename "$1") with an unknown parameter does not print to stderr" - exit 3 + echo "$(basename "$1") with an unknown parameter does not print to stderr" + exit 3 fi diff --git a/tools/meson-git-contrib.sh b/tools/meson-git-contrib.sh index 514daa0949..b40e97ba62 100755 --- a/tools/meson-git-contrib.sh +++ b/tools/meson-git-contrib.sh @@ -2,8 +2,8 @@ set -eu git shortlog -s `git describe --abbrev=0`.. | \ - cut -c8- | \ - sed 's/ / /g' | \ - awk '{ print $$0 "," }' | \ - sed -e 's/ / /g' | \ - sort -u + cut -c8- | \ + sed 's/ / /g' | \ + awk '{ print $$0 "," }' | \ + sed -e 's/ / /g' | \ + sort -u diff --git a/tools/meson-hwdb-update.sh b/tools/meson-hwdb-update.sh index 8bdc58ac7f..39efd75192 100755 --- a/tools/meson-hwdb-update.sh +++ b/tools/meson-hwdb-update.sh @@ -5,23 +5,23 @@ cd "$1" unset permissive if [ "${2:-}" = "-p" ]; then - permissive=1 - shift + permissive=1 + shift else - permissive=0 + permissive=0 fi if [ "${2:-}" != "-n" ]; then ( - [ -z "$permissive" ] || set +e - set -x + [ -z "$permissive" ] || set +e + set -x - curl -L -o usb.ids 'http://www.linux-usb.org/usb.ids' - curl -L -o pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids' - curl -L -o ma-large.txt 'http://standards-oui.ieee.org/oui/oui.txt' - curl -L -o ma-medium.txt 'http://standards-oui.ieee.org/oui28/mam.txt' - curl -L -o ma-small.txt 'http://standards-oui.ieee.org/oui36/oui36.txt' - curl -L -o pnp_id_registry.html 'https://uefi.org/uefi-pnp-export' - curl -L -o acpi_id_registry.html 'https://uefi.org/uefi-acpi-export' + curl -L -o usb.ids 'http://www.linux-usb.org/usb.ids' + curl -L -o pci.ids 'http://pci-ids.ucw.cz/v2.2/pci.ids' + curl -L -o ma-large.txt 'http://standards-oui.ieee.org/oui/oui.txt' + curl -L -o ma-medium.txt 'http://standards-oui.ieee.org/oui28/mam.txt' + curl -L -o ma-small.txt 'http://standards-oui.ieee.org/oui36/oui36.txt' + curl -L -o pnp_id_registry.html 'https://uefi.org/uefi-pnp-export' + curl -L -o acpi_id_registry.html 'https://uefi.org/uefi-acpi-export' ) fi set -x diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh index 501cd43d47..da0d13a341 100755 --- a/tools/meson-make-symlink.sh +++ b/tools/meson-make-symlink.sh @@ -6,7 +6,7 @@ set -eu mkdir -vp "$(dirname "${DESTDIR:-}$2")" if [ "$(dirname $1)" = . ]; then - ln -vfs -T "$1" "${DESTDIR:-}$2" + ln -vfs -T "$1" "${DESTDIR:-}$2" else - ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2" + ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2" fi diff --git a/tools/meson-vcs-tag.sh b/tools/meson-vcs-tag.sh index c8033d00a1..a8605b6bc9 100755 --- a/tools/meson-vcs-tag.sh +++ b/tools/meson-vcs-tag.sh @@ -8,8 +8,8 @@ tag="$2" fallback="$3" if [ -n "$tag" ]; then - echo "$tag" - exit 0 + echo "$tag" + exit 0 fi # Apparently git describe has a bug where it always considers the work-tree diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh index 9a116be114..610bb9c235 100755 --- a/tools/oss-fuzz.sh +++ b/tools/oss-fuzz.sh @@ -29,7 +29,7 @@ mkdir -p $build fuzzflag="oss-fuzz=true" if [ -z "$FUZZING_ENGINE" ]; then - fuzzflag="llvm-fuzz=true" + fuzzflag="llvm-fuzz=true" fi meson $build -D$fuzzflag -Db_lundef=false @@ -38,7 +38,7 @@ ninja -C $build fuzzers # The seed corpus is a separate flat archive for each fuzzer, # with a fixed name ${fuzzer}_seed_corpus.zip. for d in "$(dirname "$0")/../test/fuzz/fuzz-"*; do - zip -jqr $OUT/$(basename "$d")_seed_corpus.zip "$d" + zip -jqr $OUT/$(basename "$d")_seed_corpus.zip "$d" done # get fuzz-dns-packet corpus |