xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/gdbcopyright.py (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
1*6881a400Schristos# Copyright constant for Python code to use.
2*6881a400Schristos#
3*6881a400Schristos# Copyright (C) 2022-2023 Free Software Foundation, Inc.
4*6881a400Schristos#
5*6881a400Schristos# This file is part of GDB.
6*6881a400Schristos#
7*6881a400Schristos# This program is free software; you can redistribute it and/or modify
8*6881a400Schristos# it under the terms of the GNU General Public License as published by
9*6881a400Schristos# the Free Software Foundation; either version 3 of the License, or
10*6881a400Schristos# (at your option) any later version.
11*6881a400Schristos#
12*6881a400Schristos# This program is distributed in the hope that it will be useful,
13*6881a400Schristos# but WITHOUT ANY WARRANTY; without even the implied warranty of
14*6881a400Schristos# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*6881a400Schristos# GNU General Public License for more details.
16*6881a400Schristos#
17*6881a400Schristos# You should have received a copy of the GNU General Public License
18*6881a400Schristos# along with this program.  If not, see <http://www.gnu.org/licenses/>.
19*6881a400Schristos
20*6881a400Schristos
21*6881a400Schristosdef copyright(tool, description):
22*6881a400Schristos    # Search the tool source itself for the correct copyright years.
23*6881a400Schristos    with open(tool, "r") as f:
24*6881a400Schristos        for line in f:
25*6881a400Schristos            if line.startswith("# Copyright (C) "):
26*6881a400Schristos                dateline = line[1:].strip()
27*6881a400Schristos                break
28*6881a400Schristos    return f"""/* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
29*6881a400Schristos/* vi:set ro: */
30*6881a400Schristos
31*6881a400Schristos/* {description}
32*6881a400Schristos
33*6881a400Schristos   {dateline}
34*6881a400Schristos
35*6881a400Schristos   This file is part of GDB.
36*6881a400Schristos
37*6881a400Schristos   This program is free software; you can redistribute it and/or modify
38*6881a400Schristos   it under the terms of the GNU General Public License as published by
39*6881a400Schristos   the Free Software Foundation; either version 3 of the License, or
40*6881a400Schristos   (at your option) any later version.
41*6881a400Schristos
42*6881a400Schristos   This program is distributed in the hope that it will be useful,
43*6881a400Schristos   but WITHOUT ANY WARRANTY; without even the implied warranty of
44*6881a400Schristos   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
45*6881a400Schristos   GNU General Public License for more details.
46*6881a400Schristos
47*6881a400Schristos   You should have received a copy of the GNU General Public License
48*6881a400Schristos   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
49*6881a400Schristos
50*6881a400Schristos/* To regenerate this file, run:
51*6881a400Schristos   ./{tool}
52*6881a400Schristos*/
53*6881a400Schristos"""
54