GDB (xrefs)
Loading...
Searching...
No Matches
Functions | Variables
copyright Namespace Reference

Functions

 get_update_list ()
 
 update_files (update_list)
 
 may_have_copyright_notice (filename)
 
argparse.ArgumentParser get_parser ()
 
Optional[int] main (List[str] argv)
 

Variables

tuple EXCLUDE_LIST
 Some constants, placed at the end because they take up a lot of room.
 
tuple EXCLUDE_ALL_LIST
 
tuple BY_HAND
 
tuple MULTIPLE_COPYRIGHT_HEADERS
 

Detailed Description

copyright.py

This script updates the list of years in the copyright notices in
most files maintained by the GDB project.

Usage: cd src/gdb && ./copyright.py

Always review the output of this script before committing it!
A useful command to review the output is:
    % filterdiff -x \*.c -x \*.cc -x \*.h -x \*.exp updates.diff
This removes the bulk of the changes which are most likely to be correct.

Function Documentation

◆ get_parser()

argparse.ArgumentParser copyright.get_parser ( )
Get a command line parser.

Definition at line 160 of file copyright.py.

Referenced by main().

◆ get_update_list()

copyright.get_update_list ( )
Return the list of files to update.

Assumes that the current working directory when called is the root
of the GDB source tree (NOT the gdb/ subdirectory!).  The names of
the files are relative to that root directory.

Definition at line 43 of file copyright.py.

Referenced by main().

◆ main()

Optional[int] copyright.main ( List[str] argv)
The main subprogram.

Definition at line 168 of file copyright.py.

References get_parser(), get_update_list(), and update_files().

◆ may_have_copyright_notice()

copyright.may_have_copyright_notice ( filename)
Check that the given file does not seem to have a copyright notice.

The filename is relative to the root directory.
This function assumes that the current working directory is that root
directory.

The algorithm is fairly crude, meaning that it might return
some false positives.  I do not think it will return any false
negatives...  We might improve this function to handle more
complex cases later...

Definition at line 130 of file copyright.py.

Referenced by update_files().

◆ update_files()

copyright.update_files ( update_list)
Update the copyright header of the files in the given list.

We use gnulib's update-copyright script for that.

Definition at line 85 of file copyright.py.

References may_have_copyright_notice().

Referenced by main().

Variable Documentation

◆ BY_HAND

tuple copyright.BY_HAND
Initial value:
1= (
2 # Nothing at the moment :-).

Definition at line 248 of file copyright.py.

◆ EXCLUDE_ALL_LIST

tuple copyright.EXCLUDE_ALL_LIST
Initial value:
1= (
2 "COPYING",
3 "COPYING.LIB",
4 "CVS",
5 "configure",
6 "copying.c",
7 "fdl.texi",
8 "gpl.texi",
9 "aclocal.m4",
10)

Definition at line 236 of file copyright.py.

◆ EXCLUDE_LIST

tuple copyright.EXCLUDE_LIST
Initial value:
1= (
2 "gdb/nat/glibc_thread_db.h",
3 "gdb/CONTRIBUTE",
4 "gdbsupport/Makefile.in",
5 "gnulib/doc/gendocs_template",
6 "gnulib/doc/gendocs_template_min",
7 "gnulib/import",
8 "gnulib/config.in",
9 "gnulib/Makefile.in",
10)

Some constants, placed at the end because they take up a lot of room.

The actual value of these constants is not significant to the understanding of the script.

Definition at line 217 of file copyright.py.

◆ MULTIPLE_COPYRIGHT_HEADERS

tuple copyright.MULTIPLE_COPYRIGHT_HEADERS
Initial value:
1= (
2 "gdb/doc/gdb.texinfo",
3 "gdb/doc/refcard.tex",
4 "gdb/syscalls/update-netbsd.sh",
5)

Definition at line 255 of file copyright.py.