diff options
Diffstat (limited to 'libc/tools/generate-NOTICE.py')
-rwxr-xr-x | libc/tools/generate-NOTICE.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libc/tools/generate-NOTICE.py b/libc/tools/generate-NOTICE.py index 5115317..8cd75a3 100755 --- a/libc/tools/generate-NOTICE.py +++ b/libc/tools/generate-NOTICE.py @@ -25,7 +25,7 @@ def IsUninteresting(path): return False def IsAutoGenerated(content): - if "generated by gensyscalls.py" in content or "generated by genserv.py" in content: + if "Generated by gensyscalls.py" in content or "generated by genserv.py" in content: return True if "This header was automatically generated from a Linux kernel header" in content: return True @@ -55,10 +55,13 @@ def ExtractCopyrightAt(lines, i): break if "\tcitrus Id: " in lines[i]: break - if "\t$OpenBSD: " in lines[i] or " $FreeBSD: " in lines[i] or "\t$NetBSD: " in lines[i]: + if "\t$Citrus: " in lines[i] or "\t$OpenBSD: " in lines[i] or " $FreeBSD: " in lines[i] or "\t$NetBSD: " in lines[i]: break if "$FreeBSD$" in lines[i] or "$Citrus$" in lines[i]: break + # OpenBSD likes to say where stuff originally came from: + if "Original version ID:" in lines[i]: + break i += 1 end = i @@ -74,7 +77,7 @@ def ExtractCopyrightAt(lines, i): for line in lines[start:end]: line = line.replace("\t", " ") line = line.replace("/* ", "") - line = line.replace(" * ", "") + line = re.sub("^ \* ", "", line) line = line.replace("** ", "") line = line.replace("# ", "") if line.startswith("++Copyright++"): @@ -141,7 +144,7 @@ for arg in args: i = 0 while i < len(lines): - if "Copyright" in lines[i]: + if "Copyright" in lines[i] and not "@(#) Copyright" in lines[i]: i = ExtractCopyrightAt(lines, i) i += 1 |