-#!/bin/sh -ex
+#!/bin/sh
+set -ex
# This file is part of systemd.
#
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
$1 -E -dM -include sys/socket.h - </dev/null | \
grep -Ev 'AF_UNSPEC|AF_MAX' | \
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
$1 -dM -include net/if_arp.h - </dev/null | \
awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
$1 -dM -include linux/capability.h -include "$2" -include "$3" - </dev/null | \
awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
$1 -dM -include errno.h - </dev/null | \
awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
$1 -dM -include netinet/in.h - </dev/null | \
awk '/^#define[ \t]+IPPROTO_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
if nm -D -u "$1" | grep ' U '; then
echo "Undefined symbols detected!"
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
cpp="$1"
shift
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
awk ' BEGIN {
print "%{\n\
#if __GNUC__ >= 7\n\
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
$1 -dM -include linux/input.h - </dev/null | awk '
/\<(KEY_(MAX|MIN_INTERESTING))|(BTN_(MISC|MOUSE|JOYSTICK|GAMEPAD|DIGI|WHEEL|TRIGGER_HAPPY))\>/ { next }
self.addCleanup(os.remove, script)
with os.fdopen(fd, 'w+') as f:
f.write('''\
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
mkdir -p /run/systemd/network
mkdir -p /run/systemd/netif
mount -t tmpfs none /run/systemd/network
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
cd "$MESON_SOURCE_ROOT"
-#!/bin/sh -e
+#!/bin/sh
+set -e
# Try to guess the build directory:
# we look for subdirectories of the parent directory that look like ninja build dirs.
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
"$@" '-' -o/dev/null </dev/null
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
export SYSTEMD_LOG_LEVEL=info
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
git shortlog -s `git describe --abbrev=0`.. | \
cut -c8- | \
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
cd "$1"
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
# this is needed mostly because $DESTDIR is provided as a variable,
# and we need to create the target directory...
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
unitdir="$1"
target="$2"