|
apply-license − apply a license in a directory |
|
apply-license [-l] [copying-file] |
|
The apply-license script is used to apply a license to the source files in a directory. The script will extract the relevant information from a license file and apply it to any source code it can find that does not already appear to have a copyright notice. Source code is identified by suffix. Currently recognized suffixes are ".java", ".c", ".h", ".y", ".l" (lex, not lisp), ".el" (emacs lisp), ".css", ".sh", ".awk", ".5c" (Nickle), ".pl", ".rb", ".hs" and ".man"; the file "Makefile" is also currently processed. The first line of a ".sh", ".awk", ".5c", ".pl" or ".rb" file must be a "#!" line and is skipped. The first line of a ".man" file must be a ".TH" line and is skipped. Other files may be added in the future. |
|
-l |
By default, for each "short" file (less than twice the length of the license to be applied) apply-license will omit the actual license text and just put a reference to the COPYING file. The "-l" flag ensures that every file, no matter how short, contains the full license text. For the paranoid, mostly. |
|
copying-file |
|
Extract copyright information from the license file copying-file. Default is COPYING in the current directory. The copying-file must consist of at least three paragraphs, with paragraphs separated by a single blank line. The first paragraph should contain the copyright notice. The first word of the notice must be the word "Copyright" with this capitalization; this is used to detect previously-applied licenses and avoid re-application, and to detect bogus copying-files. |
|
The copyright notice would normally be of the form Copyright (c) 2007 Bart Massey ALL RIGHTS RESERVED The second paragraph should contain the name of the license, for example [This is the "MIT license"] Subsequent paragraphs should contain the license text itself. |
|
Empty files are not licensed. This may not be a bug. Each subdirectory must be run separately. This may not be a bug. Files without a suffix should be heuristically identified and licensed if possible. |
|
Bart Massey <bart@cs.pdx.edu> |