From ef867550ac6609e5ffb025a2b6e489d58b9938d4 Mon Sep 17 00:00:00 2001 From: Bob Yang Date: Thu, 7 Dec 2023 06:32:23 +0000 Subject: [PATCH] Revert "generate_notice.py: don't check for strings we don't use any more." This reverts commit adb8af2668b6393bcb687aebe0f38b4c40a9d296. Reason for revert: DroidMonitor: Potential culprit for Bug 315240955 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. BUG: 315240955 BUG: 315240463 Change-Id: I9f7297c6ca48728a91f7f4640ac19f901effb3cc --- libc/tools/generate_notice.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libc/tools/generate_notice.py b/libc/tools/generate_notice.py index 69d2d00e3..505708a76 100755 --- a/libc/tools/generate_notice.py +++ b/libc/tools/generate_notice.py @@ -45,6 +45,14 @@ def is_interesting(path_str: str) -> bool: return True +def is_auto_generated(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 + return False + + def is_copyright_end(line: str, first_line_was_hash: bool) -> bool: endings = [ " $FreeBSD: ", @@ -145,6 +153,10 @@ def do_file(path: str) -> None: warn_verbose("ignoring short file %s" % path) return + if is_auto_generated(content): + warn_verbose("ignoring auto-generated file %s" % path) + return + if not "Copyright" in content: if "public domain" in content.lower(): warn_verbose("ignoring public domain file %s" % path)