From a2ab58da1a6f0b6c51537d92c40208c2e00b97e9 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Wed, 28 Nov 2018 04:50:04 +0100 Subject: [PATCH] travis: make sure that *.perf and directives.* files are in sync New features are constantly added to networkd. Apparently, not everybody knows that the "directives" files should be updated too to make the fuzzers aware of them. --- tools/check-directives.sh | 21 +++++++++++++++++++++ travis-ci/managers/fedora.sh | 1 + 2 files changed, 22 insertions(+) create mode 100755 tools/check-directives.sh diff --git a/tools/check-directives.sh b/tools/check-directives.sh new file mode 100755 index 0000000..e2fd388 --- /dev/null +++ b/tools/check-directives.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +function generate_directives() { + perl -aF'/[\s,]+/' -ne ' + if (my ($s, $d) = ($F[0] =~ /^([^\s\.]+)\.([^\s\.]+)$/)) { $d{$s}{"$d="} = 1; } + END { while (my ($key, $value) = each %d) { + printf "[%s]\n%s\n", $key, join("\n", keys(%$value)) + }}' "$1" +} + +if [[ $(generate_directives src/network/networkd-network-gperf.gperf | wc -l) -ne $(wc -l