old_license_pattern=re.compile(r"""/\*\s*(Copyright \(C\) \d{4} .*?\n\s*)+\n\s*This program is free software: you can redistribute it and/or modify\n\s*it under the terms of the GNU General Public License as published by\n\s*the Free Software Foundation, either version 3 of the License, or\n\s*\(at your option\) any later version\.\n\n\s*This program is distributed in the hope that it will be useful,\n\s*but WITHOUT ANY WARRANTY; without even the implied warranty of\n\s*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\. See the\n\s*GNU General Public License for more details\.\n\n\s*You should have received a copy of the GNU General Public License\n\s*along with this program\. If not, see <https://www\.gnu\.org/licenses/>\.\n\s*\*/""",re.MULTILINE)
new_license="""/* Copyright (C) CZ.NIC, z.s.p.o. and contributors
*SPDX-License-Identifier:GPL-2.0-or-later
*Formoreinformation,see<https://www.knot-dns.cz/>
*/"""
forroot,_,filesinos.walk(directory):
forfileinfiles:
iffile.endswith(('.c','.h','.rl','.h.in')):# Process C and header files