]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/check-directives.sh
logind: when we cannot attach a passed fd to a device, close it
[thirdparty/systemd.git] / tools / check-directives.sh
CommitLineData
a2ab58da
EV
1#!/bin/bash
2
3set -e
4
5function generate_directives() {
6 perl -aF'/[\s,]+/' -ne '
7 if (my ($s, $d) = ($F[0] =~ /^([^\s\.]+)\.([^\s\.]+)$/)) { $d{$s}{"$d="} = 1; }
8 END { while (my ($key, $value) = each %d) {
9 printf "[%s]\n%s\n", $key, join("\n", keys(%$value))
10 }}' "$1"
11}
12
051f39c2 13ret=0
a2ab58da
EV
14if [[ $(generate_directives src/network/networkd-network-gperf.gperf | wc -l) -ne $(wc -l <test/fuzz/fuzz-network-parser/directives.network) ]]; then
15 echo "Looks like test/fuzz/fuzz-network-parser/directives.network hasn't been updated"
051f39c2 16 ret=1
a2ab58da
EV
17fi
18
19if [[ $(generate_directives src/network/netdev/netdev-gperf.gperf | wc -l) -ne $(wc -l <test/fuzz/fuzz-netdev-parser/directives.netdev) ]]; then
20 echo "Looks like test/fuzz/fuzz-netdev-parser/directives.netdev hasn't been updated"
051f39c2 21 ret=1
a2ab58da 22fi
810d43a8
YW
23
24if [[ $(generate_directives src/udev/net/link-config-gperf.gperf | wc -l) -ne $(wc -l <test/fuzz/fuzz-link-parser/directives.link) ]]; then
25 echo "Looks like test/fuzz/fuzz-link-parser/directives.link hasn't been updated"
051f39c2 26 ret=1
810d43a8 27fi
051f39c2
YW
28
29exit $ret