summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/generate-change-log2
-rwxr-xr-xtools/update-thanks56
2 files changed, 58 insertions, 0 deletions
diff --git a/tools/generate-change-log b/tools/generate-change-log
index 3a6b38e7..ad19ce96 100755
--- a/tools/generate-change-log
+++ b/tools/generate-change-log
@@ -19,6 +19,7 @@ use Text::Wrap;
19 19
20# The lines will have a length of no more than $columns - 1. 20# The lines will have a length of no more than $columns - 1.
21$Text::Wrap::columns = 81; 21$Text::Wrap::columns = 81;
22$Text::Wrap::huge = 'overflow';
22 23
23if (system('git rev-parse --git-dir >/dev/null 2>&1') != 0) { 24if (system('git rev-parse --git-dir >/dev/null 2>&1') != 0) {
24 print "Not a Git repository, so I won't update the ChangeLog.\n"; 25 print "Not a Git repository, so I won't update the ChangeLog.\n";
@@ -51,6 +52,7 @@ while ($git_log =~ /$regex/gm) {
51 $prev_date = $commit{date}; 52 $prev_date = $commit{date};
52 $prev_name = $commit{name}; 53 $prev_name = $commit{name};
53 $prev_email = $commit{email}; 54 $prev_email = $commit{email};
55 $commit{message} =~ s/\s*Signed\-off\-by.*$//sgmx;
54 56
55 my @files = split(/\n/, $commit{files}); 57 my @files = split(/\n/, $commit{files});
56 my @message = map { s/^ {4}//; $_ } split(/\n/, $commit{message}); 58 my @message = map { s/^ {4}//; $_ } split(/\n/, $commit{message});
diff --git a/tools/update-thanks b/tools/update-thanks
new file mode 100755
index 00000000..27932f94
--- /dev/null
+++ b/tools/update-thanks
@@ -0,0 +1,56 @@
1#!/bin/sh
2
3# Copyright (c) 2014 Monitoring Plugins Development Team
4#
5# Originally written by Holger Weiss <holger@zedat.fu-berlin.de>.
6#
7# This file is free software; the Monitoring Plugins Development Team gives
8# unlimited permission to copy and/or distribute it, with or without
9# modifications, as long as this notice is preserved.
10#
11# This program is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY, to the extent permitted by law; without even the implied
13# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
15set -e
16set -u
17
18tempfile=$(mktemp '/tmp/.plugins.XXXXXX')
19trap 'rm -f $tempfile' EXIT INT TERM
20
21if [ ! -e THANKS.in ]
22then
23 echo >&2 'Please change into the "monitoring-plugins" repository.'
24 exit 2
25fi
26
27case $# in
28 1) since=$1; git cat-file -e "$since";;
29 0) since=$(git tag -l 'v*' | tail -n 1);;
30 *) echo >&2 "Usage: $0 [<since>]"; exit 2;;
31esac
32
33git log --pretty='%an' "$since.." | sort -u | while read first last rest
34do
35 if [ -n "$first" -a -n "$last" -a -z "$rest" ]
36 then
37 if ! grep -q "^$first $last$" AUTHORS THANKS.in
38 then
39 echo "$first $last" >> THANKS.in
40 fi
41 else
42 echo "$first $last $rest" | sed 's/ *$//' >> "$tempfile"
43 fi
44done
45
46if ! git diff --quiet THANKS.in
47then
48 echo 'Please check/commit the changes in the THANKS.in file.'
49fi
50
51if [ -s "$tempfile" ]
52then
53 echo 'The following authors were NOT added to the THANKS.in file:'
54 echo
55 cat "$tempfile"
56fi