forked from openresty/openresty-devel-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngx-releng
executable file
·61 lines (54 loc) · 1.71 KB
/
ngx-releng
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
wiki_file=`perl -e 'print glob "doc/*.wiki"'`
if [ -n "$wiki_file" -a -f "$wiki_file" ]; then
wiki2markdown.pl $wiki_file > README.markdown || exit 1
wiki2pod.pl $wiki_file > /tmp/a.pod || exit 1
pod2text /tmp/a.pod > README || exit 1
fi
ack '(?<=This document describes ).*-nginx-module v\d+(\.\d\S*)' README
echo =======================================
ack '(?<=\#define)\s*DDEBUG\s*[1-9]' src && exit 1
ack '.{81}' src/ngx_*.[ch]
ack '//' src/ngx_*.[ch]
ack '^master_on' t && exit 1
ack '\b(?:ONLY|LAST)\b' t
ack -l '\r\n' t
ack '\(\);' src/ngx_*.h
ack '^static .*?\(\);' src/ngx_*.[ch]
perl -e 'use strict; use warnings;
my $seen = 0;
my $saved;
my $indent;
for my $fname (@ARGV) {
open my $in, $fname or die $!;
while (<$in>) {
next if /^\s*$/ || m{^\s*/\*};
if (/ngx_p[cn]*alloc\b|\b[mc]alloc\b/) {
my $pattern = $&;
if (!/return\b.*?$pattern/ && !/"[^"]*$pattern/ && !/^\s+\*/) {
if (/^\s+/) {
$indent = $&;
} else {
$indent = "";
}
$seen = 1;
$saved = $_;
next;
}
}
if ($seen) {
if (/^\s+/) {
if (length($&) > length($indent)) {
next;
}
}
if (!/\bif\b.*? == NULL/) {
warn "not check NULL: $fname: line $.: $saved$_";
}
}
$seen = 0;
}
close $in;
}' src/ngx_*.[ch]
ack '_log_error\(NGX_[^L]' src/ngx_*.[ch]
echo done.