summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-12-10 06:59:53 -0500
committerEric S. Raymond <esr@thyrsus.com>2010-12-10 06:59:53 -0500
commit935879b3002c31d18933f4cad15f93bae5a948ea (patch)
treed65df247c4cc51cd8f087a56f7c42ccae94e98dc
parent96fe434470f6d967f30d6cb1c7a6431d9f51066c (diff)
downloaddeheader-935879b3002c31d18933f4cad15f93bae5a948ea.tar.gz
deheader-935879b3002c31d18933f4cad15f93bae5a948ea.tar.bz2
deheader-935879b3002c31d18933f4cad15f93bae5a948ea.tar.xz
deheader-935879b3002c31d18933f4cad15f93bae5a948ea.zip
Don're register requires more than once.
-rwxr-xr-xdeheader7
-rw-r--r--test/regress.chk12
2 files changed, 4 insertions, 15 deletions
diff --git a/deheader b/deheader
index 4ec85a9..d8d9986 100755
--- a/deheader
+++ b/deheader
@@ -131,9 +131,10 @@ class InclusionMap:
print "deheader: ignoring %s (conditional inclusion)" % name
for (r, h) in requirements:
if r.search(line):
- if verbosity >= PROGRESS_DEBUG:
- print "deheader: %s has requires %s from %s" % (sourcefile, h, r.pattern)
- requires.append(h)
+ if h not in requires:
+ if verbosity >= PROGRESS_DEBUG:
+ print "deheader: %s has requires %s from %s" % (sourcefile, h, r.pattern)
+ requires.append(h)
self.depends_on[sourcefile] = includes
self.requires[sourcefile] = re.compile("|".join(requires))
# Duplicate-header detection
diff --git a/test/regress.chk b/test/regress.chk
index 5b70f47..ef6a689 100644
--- a/test/regress.chk
+++ b/test/regress.chk
@@ -5,30 +5,18 @@ deheader: test/duplicate.c has more than one inclusion of <stdio.h>
deheader: test/umask.c includes <sys/stat.h>
deheader: test/umask.c includes <sys/types.h>
deheader: test/umask.c has requires <sys/stat.h>|<sys/types.h> from umask\s*\(
-deheader: test/umask.c has requires <sys/stat.h>|<sys/types.h> from umask\s*\(
deheader: test/a64l.c has requires <stdlib.h> from a64l\s*\(
-deheader: test/a64l.c has requires <stdlib.h> from l64a\s*\(
deheader: test/a64l.c includes <stdlib.h>
-deheader: test/a64l.c has requires <stdlib.h> from a64l\s*\(
-deheader: test/a64l.c has requires <stdlib.h> from l64a\s*\(
deheader: test/abs.c includes <stdlib.h>
deheader: test/access.c has requires <unistd.h> from access\s*\(
-deheader: test/access.c has requires <unistd.h> from access\s*\(
deheader: test/access.c includes <unistd.h>
-deheader: test/access.c has requires <unistd.h> from access\s*\(
-deheader: test/acos.c has requires <math.h> from acos\s*\(
deheader: test/acos.c has requires <math.h> from acos\s*\(
deheader: test/acos.c includes <math.h>
-deheader: test/acos.c has requires <math.h> from acos\s*\(
deheader: test/abort.c includes <stdlib.h>
deheader: test/acosh.c has requires <math.h> from acosh\s*\(
-deheader: test/acosh.c has requires <math.h> from acosh\s*\(
deheader: test/acosh.c includes <math.h>
-deheader: test/acosh.c has requires <math.h> from acosh\s*\(
-deheader: test/advance.c has requires <regexp.h> from advance\s*\(
deheader: test/advance.c has requires <regexp.h> from advance\s*\(
deheader: test/advance.c includes <regexp.h>
-deheader: test/advance.c has requires <regexp.h> from advance\s*\(
deheader: in test/advance.c, retaining required '#include <regexp.h>\n'
deheader: test/string.c without <string.h> succeeded.
deheader: remove <string.h> from test/string.c