mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
meson: also indent scripts with 8 spaces
This commit is contained in:
parent
dd6ab3df74
commit
b884196cc1
@ -21,4 +21,7 @@
|
|||||||
(eval . (c-set-offset 'arglist-close 0))))
|
(eval . (c-set-offset 'arglist-close 0))))
|
||||||
(nxml-mode . ((nxml-child-indent . 2)
|
(nxml-mode . ((nxml-child-indent . 2)
|
||||||
(fill-column . 119)))
|
(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))))
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
BEGIN{ print "static const char* const af_names[] = { "}
|
BEGIN{
|
||||||
!/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ {
|
print "static const char* const af_names[] = { "
|
||||||
printf " [%s] = \"%s\",\n", $1, $1
|
}
|
||||||
|
!/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ {
|
||||||
|
printf " [%s] = \"%s\",\n", $1, $1
|
||||||
|
}
|
||||||
|
END{
|
||||||
|
print "};"
|
||||||
}
|
}
|
||||||
END{print "};"}
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
BEGIN{ print "static const char* const arphrd_names[] = { "}
|
BEGIN{
|
||||||
!/CISCO/ {
|
print "static const char* const arphrd_names[] = { "
|
||||||
printf " [ARPHRD_%s] = \"%s\",\n", $1, $1
|
}
|
||||||
|
!/CISCO/ {
|
||||||
|
printf " [ARPHRD_%s] = \"%s\",\n", $1, $1
|
||||||
|
}
|
||||||
|
END{
|
||||||
|
print "};"
|
||||||
}
|
}
|
||||||
END{print "};"}
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
BEGIN{ print "static const char* const capability_names[] = { "}
|
BEGIN{
|
||||||
{
|
print "static const char* const capability_names[] = { "
|
||||||
printf " [%s] = \"%s\",\n", $1, tolower($1)
|
}
|
||||||
|
{
|
||||||
|
printf " [%s] = \"%s\",\n", $1, tolower($1)
|
||||||
|
}
|
||||||
|
END{
|
||||||
|
print "};"
|
||||||
}
|
}
|
||||||
END{print "};"}
|
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
BEGIN{ print "static const char* const errno_names[] = { " }
|
BEGIN{
|
||||||
|
print "static const char* const errno_names[] = { "
|
||||||
|
}
|
||||||
!/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ {
|
!/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ {
|
||||||
printf " [%s] = \"%s\",\n", $1, $1 }
|
printf " [%s] = \"%s\",\n", $1, $1
|
||||||
END{ print "};" }
|
}
|
||||||
|
END{
|
||||||
|
print "};"
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
$1 -E -dM -include sys/socket.h - </dev/null | \
|
$1 -E -dM -include sys/socket.h - </dev/null | \
|
||||||
grep -Ev 'AF_UNSPEC|AF_MAX' | \
|
grep -Ev 'AF_UNSPEC|AF_MAX' | \
|
||||||
awk '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $2; }'
|
awk '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $2; }'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
$1 -dM -include net/if_arp.h - </dev/null | \
|
$1 -dM -include net/if_arp.h - </dev/null | \
|
||||||
awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
|
awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
|
||||||
sed -e 's/ARPHRD_//'
|
sed -e 's/ARPHRD_//'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
$1 -dM -include linux/capability.h -include "$2" -include "$3" - </dev/null | \
|
$1 -dM -include linux/capability.h -include "$2" -include "$3" - </dev/null | \
|
||||||
awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
|
awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
|
||||||
grep -v CAP_LAST_CAP
|
grep -v CAP_LAST_CAP
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
$1 -dM -include errno.h - </dev/null | \
|
$1 -dM -include errno.h - </dev/null | \
|
||||||
awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
|
awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
if nm -D -u "$1" | grep ' U '; then
|
if nm -D -u "$1" | grep ' U '; then
|
||||||
echo "Undefined symbols detected!"
|
echo "Undefined symbols detected!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
BEGIN{
|
BEGIN{
|
||||||
keywords=0 ; FS="," ;
|
keywords=0 ; FS="," ;
|
||||||
print "extern const char load_fragment_gperf_nulstr[];" ;
|
print "extern const char load_fragment_gperf_nulstr[];" ;
|
||||||
print "const char load_fragment_gperf_nulstr[] ="
|
print "const char load_fragment_gperf_nulstr[] ="
|
||||||
}
|
}
|
||||||
keyword==1 {
|
keyword==1 {
|
||||||
print "\"" $$1 "\\0\""
|
print "\"" $$1 "\\0\""
|
||||||
}
|
}
|
||||||
/%%/ {
|
/%%/ {
|
||||||
keyword=1
|
keyword=1
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
print ";"
|
||||||
}
|
}
|
||||||
END { print ";" }
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
BEGIN{ print "const char *audit_type_to_string(int type) {\n\tswitch(type) {" }
|
BEGIN{
|
||||||
|
print "const char *audit_type_to_string(int type) {\n\tswitch(type) {"
|
||||||
|
}
|
||||||
{
|
{
|
||||||
printf " case AUDIT_%s: return \"%s\";\n", $1, $1
|
printf " case AUDIT_%s: return \"%s\";\n", $1, $1
|
||||||
}
|
}
|
||||||
END{ print " default: return NULL;\n\t}\n}\n" }
|
END{
|
||||||
|
print " default: return NULL;\n\t}\n}\n"
|
||||||
|
}
|
||||||
|
@ -5,10 +5,10 @@ shift
|
|||||||
|
|
||||||
includes=""
|
includes=""
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
includes="$includes -include $i"
|
includes="$includes -include $i"
|
||||||
done
|
done
|
||||||
|
|
||||||
$cpp -dM $includes - </dev/null | \
|
$cpp -dM $includes - </dev/null | \
|
||||||
grep -vE 'AUDIT_.*(FIRST|LAST)_' | \
|
grep -vE 'AUDIT_.*(FIRST|LAST)_' | \
|
||||||
sed -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | \
|
sed -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | \
|
||||||
sort -k2
|
sort -k2
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" }
|
BEGIN{
|
||||||
{
|
print "const char *dns_type_to_string(int type) {\n\tswitch(type) {"
|
||||||
printf " case DNS_TYPE_%s: return ", $1;
|
}
|
||||||
sub(/_/, "-");
|
{
|
||||||
printf "\"%s\";\n", $1
|
printf " case DNS_TYPE_%s: return ", $1;
|
||||||
|
sub(/_/, "-");
|
||||||
|
printf "\"%s\";\n", $1
|
||||||
|
}
|
||||||
|
END{
|
||||||
|
print " default: return NULL;\n\t}\n}\n"
|
||||||
}
|
}
|
||||||
END{ print " default: return NULL;\n\t}\n}\n" }
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
BEGIN {
|
BEGIN {
|
||||||
print "/* GENERATED FILE */";
|
print "/* GENERATED FILE */";
|
||||||
print "#define ORDERED"
|
print "#define ORDERED"
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
if (!match($0, "^#include"))
|
if (!match($0, "^#include"))
|
||||||
gsub(/hashmap/, "ordered_hashmap");
|
gsub(/hashmap/, "ordered_hashmap");
|
||||||
gsub(/HASHMAP/, "ORDERED_HASHMAP");
|
gsub(/HASHMAP/, "ORDERED_HASHMAP");
|
||||||
gsub(/Hashmap/, "OrderedHashmap");
|
gsub(/Hashmap/, "OrderedHashmap");
|
||||||
print
|
print
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
$1 -dM -include linux/input.h - </dev/null | \
|
$1 -dM -include linux/input.h - </dev/null | \
|
||||||
awk '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($2 != "KEY_MAX") { print $2 } }'
|
awk '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($2 != "KEY_MAX") { print $2 } }'
|
||||||
|
@ -5,7 +5,7 @@ systemd_efi="$2"
|
|||||||
boot_stub="$3"
|
boot_stub="$3"
|
||||||
splash_bmp="$4"
|
splash_bmp="$4"
|
||||||
if [ -z "$out" -o -z "$systemd_efi" -o -z "$boot_stub" -o -z "$splash_bmp" ]; then
|
if [ -z "$out" -o -z "$systemd_efi" -o -z "$boot_stub" -o -z "$splash_bmp" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create GPT table with EFI System Partition
|
# create GPT table with EFI System Partition
|
||||||
@ -27,12 +27,12 @@ cp "$systemd_efi" mnt/EFI/BOOT/BOOTX64.efi
|
|||||||
mkdir mnt/EFI/Linux
|
mkdir mnt/EFI/Linux
|
||||||
echo -n "foo=yes bar=no root=/dev/fakeroot debug rd.break=initqueue" >mnt/cmdline.txt
|
echo -n "foo=yes bar=no root=/dev/fakeroot debug rd.break=initqueue" >mnt/cmdline.txt
|
||||||
objcopy \
|
objcopy \
|
||||||
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
|
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
|
||||||
--add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \
|
--add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \
|
||||||
--add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \
|
--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 .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 \
|
--add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \
|
||||||
"$boot_stub" mnt/EFI/Linux/linux-test.efi
|
"$boot_stub" mnt/EFI/Linux/linux-test.efi
|
||||||
|
|
||||||
# install entries
|
# install entries
|
||||||
mkdir -p mnt/loader/entries
|
mkdir -p mnt/loader/entries
|
||||||
|
@ -2,19 +2,19 @@
|
|||||||
|
|
||||||
# output width
|
# output width
|
||||||
if "$1" --help | grep -v 'default:' | grep -E -q '.{80}.'; then
|
if "$1" --help | grep -v 'default:' | grep -E -q '.{80}.'; then
|
||||||
echo "$(basename "$1") --help output is too wide:"
|
echo "$(basename "$1") --help output is too wide:"
|
||||||
"$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}'
|
"$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# no --help output to stdout
|
# no --help output to stdout
|
||||||
if "$1" --help 2>&1 1>/dev/null | grep .; then
|
if "$1" --help 2>&1 1>/dev/null | grep .; then
|
||||||
echo "$(basename "$1") --help prints to stderr"
|
echo "$(basename "$1") --help prints to stderr"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# error output to stderr
|
# error output to stderr
|
||||||
if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then
|
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"
|
echo "$(basename "$1") with an unknown parameter does not print to stderr"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
git shortlog -s `git describe --abbrev=0`.. | \
|
git shortlog -s `git describe --abbrev=0`.. | \
|
||||||
cut -c8- | \
|
cut -c8- | \
|
||||||
sed 's/ / /g' | \
|
sed 's/ / /g' | \
|
||||||
awk '{ print $$0 "," }' | \
|
awk '{ print $$0 "," }' | \
|
||||||
sort -u
|
sort -u
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
mkdir -vp "$(dirname "${DESTDIR:-}$2")"
|
mkdir -vp "$(dirname "${DESTDIR:-}$2")"
|
||||||
if [ "$(dirname $1)" = . ]; then
|
if [ "$(dirname $1)" = . ]; then
|
||||||
ln -vfs -T "$1" "${DESTDIR:-}$2"
|
ln -vfs -T "$1" "${DESTDIR:-}$2"
|
||||||
else
|
else
|
||||||
ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
|
ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
|
||||||
fi
|
fi
|
||||||
|
@ -5,23 +5,23 @@ target="$2"
|
|||||||
unit="$3"
|
unit="$3"
|
||||||
|
|
||||||
case "$target" in
|
case "$target" in
|
||||||
*/?*) # a path, but not just a slash at the end
|
*/?*) # a path, but not just a slash at the end
|
||||||
dir="${DESTDIR:-}${target}"
|
dir="${DESTDIR:-}${target}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
dir="${DESTDIR:-}${unitdir}/${target}"
|
dir="${DESTDIR:-}${unitdir}/${target}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
unitpath="${DESTDIR:-}${unitdir}/${unit}"
|
unitpath="${DESTDIR:-}${unitdir}/${unit}"
|
||||||
|
|
||||||
case "$target" in
|
case "$target" in
|
||||||
*/)
|
*/)
|
||||||
mkdir -p -m 0755 "$dir"
|
mkdir -p -m 0755 "$dir"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
mkdir -p -m 0755 "$(basename "$dir")"
|
mkdir -p -m 0755 "$(basename "$dir")"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
ln -vfs --relative "$unitpath" "$dir"
|
ln -vfs --relative "$unitpath" "$dir"
|
||||||
|
Loading…
Reference in New Issue
Block a user