repo.or.cz
/
libvirt
/
ericb.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
backup: Wire up qemu full pull backup commands over QMP
[libvirt/ericb.git]
/
build-aux
/
prohibit-duplicate-header.pl
blob
4a2ea656650373a842c14562d5fb70a751c5691d
1
#!/usr/bin/env perl
2
3
use
strict
;
4
5
my
$file
=
" "
;
6
my
$ret
=
0
;
7
my
%includes
= ( );
8
my
$lineno
=
0
;
9
10
while
(<>) {
11
if
(
not
$file
eq
$ARGV
) {
12
%includes
= ( );
13
$file
=
$ARGV
;
14
$lineno
=
0
;
15
}
16
$lineno
++;
17
if
(
/^# *include *[<"]([^>"]*\.h)[">]/
) {
18
$includes
{
$1
}++;
19
if
(
$includes
{
$1
} ==
2
) {
20
$ret
=
1
;
21
print
STDERR
"
$ARGV
:
$lineno
:
$_
"
;
22
print
STDERR
"Do not include a header more than once per file
\n
"
;
23
}
24
}
25
}
26
exit
$ret
;