From b884196cc1565eaf1b97141fbfa0667ee348e463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 24 Apr 2017 19:40:02 -0400 Subject: [PATCH] meson: also indent scripts with 8 spaces --- .dir-locals.el | 5 ++++- src/basic/af-to-name.awk | 12 ++++++++---- src/basic/arphrd-to-name.awk | 12 ++++++++---- src/basic/cap-to-name.awk | 12 ++++++++---- src/basic/errno-to-name.awk | 11 ++++++++--- src/basic/generate-af-list.sh | 4 ++-- src/basic/generate-arphrd-list.sh | 4 ++-- src/basic/generate-cap-list.sh | 4 ++-- src/basic/generate-errno-list.sh | 2 +- src/boot/efi/no-undefined-symbols.sh | 4 ++-- src/core/load-fragment-gperf-nulstr.awk | 14 ++++++++------ src/journal/audit_type-to-name.awk | 8 ++++++-- src/journal/generate-audit_type-list.sh | 8 ++++---- src/resolve/dns_type-to-name.awk | 16 ++++++++++------ src/test/test-hashmap-ordered.awk | 14 +++++++------- src/udev/generate-keyboard-keys-list.sh | 2 +- test/test-efi-create-disk.sh | 14 +++++++------- tools/meson-check-help.sh | 14 +++++++------- tools/meson-git-contrib.sh | 8 ++++---- tools/meson-make-symlink.sh | 4 ++-- units/meson-add-wants.sh | 24 ++++++++++++------------ 21 files changed, 113 insertions(+), 83 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 9dfdbe3fe2..5ef7e11634 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -21,4 +21,7 @@ (eval . (c-set-offset 'arglist-close 0)))) (nxml-mode . ((nxml-child-indent . 2) (fill-column . 119))) - (meson-mode . ((meson-indent-basic . 8)))) + (meson-mode . ((meson-indent-basic . 8))) + (sh-mode . ((sh-basic-offset . 8) + (sh-indentation . 8))) + (awk-mode . ((c-basic-offset . 8)))) diff --git a/src/basic/af-to-name.awk b/src/basic/af-to-name.awk index e20830487f..18d0a89728 100644 --- a/src/basic/af-to-name.awk +++ b/src/basic/af-to-name.awk @@ -1,5 +1,9 @@ -BEGIN{ print "static const char* const af_names[] = { "} -!/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { - printf " [%s] = \"%s\",\n", $1, $1 +BEGIN{ + print "static const char* const af_names[] = { " +} +!/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { + printf " [%s] = \"%s\",\n", $1, $1 +} +END{ + print "};" } -END{print "};"} diff --git a/src/basic/arphrd-to-name.awk b/src/basic/arphrd-to-name.awk index 57e4680f17..5a35673e2c 100644 --- a/src/basic/arphrd-to-name.awk +++ b/src/basic/arphrd-to-name.awk @@ -1,5 +1,9 @@ -BEGIN{ print "static const char* const arphrd_names[] = { "} -!/CISCO/ { - printf " [ARPHRD_%s] = \"%s\",\n", $1, $1 +BEGIN{ + print "static const char* const arphrd_names[] = { " +} +!/CISCO/ { + printf " [ARPHRD_%s] = \"%s\",\n", $1, $1 +} +END{ + print "};" } -END{print "};"} diff --git a/src/basic/cap-to-name.awk b/src/basic/cap-to-name.awk index d252291851..402a782024 100644 --- a/src/basic/cap-to-name.awk +++ b/src/basic/cap-to-name.awk @@ -1,5 +1,9 @@ -BEGIN{ print "static const char* const capability_names[] = { "} -{ - printf " [%s] = \"%s\",\n", $1, tolower($1) +BEGIN{ + print "static const char* const capability_names[] = { " +} +{ + printf " [%s] = \"%s\",\n", $1, tolower($1) +} +END{ + print "};" } -END{print "};"} diff --git a/src/basic/errno-to-name.awk b/src/basic/errno-to-name.awk index c48c8f93ab..0878abacbd 100644 --- a/src/basic/errno-to-name.awk +++ b/src/basic/errno-to-name.awk @@ -1,4 +1,9 @@ -BEGIN{ print "static const char* const errno_names[] = { " } +BEGIN{ + print "static const char* const errno_names[] = { " +} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { - printf " [%s] = \"%s\",\n", $1, $1 } -END{ print "};" } + printf " [%s] = \"%s\",\n", $1, $1 +} +END{ + print "};" +} diff --git a/src/basic/generate-af-list.sh b/src/basic/generate-af-list.sh index 733cf59dd0..8d9cdd1836 100755 --- a/src/basic/generate-af-list.sh +++ b/src/basic/generate-af-list.sh @@ -1,5 +1,5 @@ #!/bin/sh -eu $1 -E -dM -include sys/socket.h - mnt/cmdline.txt objcopy \ - --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \ - --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \ - --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \ - --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \ - --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \ - "$boot_stub" mnt/EFI/Linux/linux-test.efi + --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \ + --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \ + --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \ + --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \ + --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \ + "$boot_stub" mnt/EFI/Linux/linux-test.efi # install entries mkdir -p mnt/loader/entries diff --git a/tools/meson-check-help.sh b/tools/meson-check-help.sh index 7102866a5c..47a5099a04 100755 --- a/tools/meson-check-help.sh +++ b/tools/meson-check-help.sh @@ -2,19 +2,19 @@ # 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 ac031638e0..1c614ef511 100755 --- a/tools/meson-git-contrib.sh +++ b/tools/meson-git-contrib.sh @@ -1,7 +1,7 @@ #!/bin/sh -eu git shortlog -s `git describe --abbrev=0`.. | \ - cut -c8- | \ - sed 's/ / /g' | \ - awk '{ print $$0 "," }' | \ - sort -u + cut -c8- | \ + sed 's/ / /g' | \ + awk '{ print $$0 "," }' | \ + sort -u diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh index 360ff92ebb..47a5e70ae5 100755 --- a/tools/meson-make-symlink.sh +++ b/tools/meson-make-symlink.sh @@ -5,7 +5,7 @@ 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/units/meson-add-wants.sh b/units/meson-add-wants.sh index e2f5a355bc..dfd287e172 100755 --- a/units/meson-add-wants.sh +++ b/units/meson-add-wants.sh @@ -5,23 +5,23 @@ target="$2" unit="$3" case "$target" in - */?*) # a path, but not just a slash at the end - dir="${DESTDIR:-}${target}" - ;; - *) - dir="${DESTDIR:-}${unitdir}/${target}" - ;; + */?*) # a path, but not just a slash at the end + dir="${DESTDIR:-}${target}" + ;; + *) + dir="${DESTDIR:-}${unitdir}/${target}" + ;; esac unitpath="${DESTDIR:-}${unitdir}/${unit}" case "$target" in - */) - mkdir -p -m 0755 "$dir" - ;; - *) - mkdir -p -m 0755 "$(basename "$dir")" - ;; + */) + mkdir -p -m 0755 "$dir" + ;; + *) + mkdir -p -m 0755 "$(basename "$dir")" + ;; esac ln -vfs --relative "$unitpath" "$dir"