COPYRIGHT-UPDATE(1)
π COPYRIGHT-UPDATE β the copyright-update manual page π
okay bestie, sit down, hydrate, because we're about to make your source files legally adorable. This is copyright-update, a little Perl icon that goes through your files and freshens up the copyright year (and license boilerplate) so you never have to think about it again. No cap. π¦
πΈ NAME πΈ
copyright-update β Update Copyright information in files β¨
π USAGE π
copyright-update [options] FILE [FILE ...]
copyright-update [options] --recursive PATH [PATH ...]
π DESCRIPTION π
So basically: it updates the copyright info in a bunch of files (and yeah, it can do it recursively) while matching on content criteria. What actually gets touched? The copyright year, the GPL address information, etc. iconic behavior honestly.
Now, the line has to be just so, bestie. It must contain the word "Copyright," a space, three characters '(C)' (or a U+00A9 UTF copyright sign), a space, and then the range of years. A varying amount of spaces and tabs are permitted, but β and this is the part people mess up β there must be no spaces around the dash character in YEAR-YEAR. Look:
A whitespace, or multiple, required
| | No space between years
| | |
Copyright (C) YYYY-YYYY
Copyright: (C) YYYY-YYYY
|
A colon is optional
By default, certain files and paths are always ignored, like version control directories, backup files, object files, and binary files according to Perl's "-T" file test. Wanna see the excluded path list with your own eyes? Run the program with the option --help-exclude. π«Ά
β REQUIRED ARGUMENTS β
Either FILE or PATH with "--recursive" option. That's the whole vibe. No files, no party. π
β¨ OPTIONS β¨
π₯ Run options π₯
-a,--autoβ In automatic mode, the author's name is read from the environment variableNAME, and only lines matching'Copyright.*$NAME'are affected. IfNAMEis not set, the information is read fromEMAIL.
If neither NAME nor EMAIL exists in the environment, or if their values are not in a recognizable format (see section ENVIRONMENT), this option does nothing.
This option effectively tries to preset a value for the --line option.
-c,--codeβ Preset--includeto match common code files:.c,.h,.cc,.hh,.cpp,.c++,.hpp,.C,.pl,.py,.sh, and.rb. It's giving "I know what you code in" π-D,--debug LEVELβ Turn on debugging. LEVEL can be in the range of0-10.-f,--fsf-addressβ Change license paragraphs that refer to the FSF address. The FSF's current recommendation is to redirect inquiries about licenses to their URL.
Effectively replace the paragraphs:
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
With this:
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-i,--include REGEXPβ Include files matching regexp. The match is done against whole path.
If this option is not supplied, every file is automatically included. The matches can be further filtered by using option --exclude.
This option can be used multiple times. See also option --code.
-l,--line REGEXPβ Change only lines which match REGEXP. The match is case-insensitive. π-r,--recursiveβ Recursively search all directories given in command line.-R,--regexp REGEXPβ Change only files whose content matches REGEXP. The file is read in as one big string so that it's possible to match using Perl regular expressions across the whole file. An example:'(?smi)This.*multi.*line.*match'. Seeperlre(1)for more information about'smi'and other modifiers.
This option can be used as a preliminary Content criteria, to select files before --line option finds the correct Copyright lines.
-t,--test,--dry-runβ Run in test mode. Show what would happen. No files are changed. Look, don't touch. π-v,--verbose LEVELβ Print informational messages. Increase numeric LEVEL for more verbosity.-x,--exclude REGEXPβ Ignore files matching regexp. The match is done against whole path. The option can be used multiple times.
This option is applied after possible --include matches.
-y,--year YEARβ Update files using YEAR. Value must be four digits.
The default operation is to use currect year, so this option is not necessary in normal use. Use case: you plan to take a long holiday before year's end and want to update the next year's value beforehand. future-proofing queen π΄
-Y,--no-yearβ Disable updating year.
π Miscellaneus options π
-h,--helpβ Display help.--help-excludeβ Display default values used to exclude paths and files.--help-htmlβ Display help in HTML format.--help-manβ Display help in manual pageman(1)format.-V,--versionβ Display contact and version information.
π EXAMPLES π
The primary use is to update files to reflect current year; option --year is implicit:
copyright-update *
To test what would happen:
copyright-update --verbose 1 --test *
Update only C-code file:
copyright-update --verbose 1 --include '\.[ch]$' --recursive .
It is possible to restrict updating files recursively to only those files whose content match regexp. Here, the lines affected are those that match --line regular expression.
copyright-update \
--regexp '(?i)Author:.*John.*Doe' \
--line '\bFoo\b' \
--ignore '\.(bak|bup|[~#]])$' \
--verbose 1 \
--year 2013 \
--test \
--recursive \
.
π TROUBLESHOOTING π
See option --debug. She'll tell you everything, bestie. π΅οΈββοΈ
π§ ENVIRONMENT π§
EMAILβ In the form"firstname.lastname@example.com"; that is, without the angles<>. If set, the value is used in option--autoonly if environment variableNAMEis not set.
In order to find first and lastname, the localpart in email address must match case insensitive regexp '^[a-z-]+\.[a-z-]+@':
address@example.com Not used, not in form First.Last
+------ +----------
mr.first.lastname@example.com Not used, likewise
+---------------- +----------
| |
Localpart Domain part
NAMEβ In the form"Firstname Lastname". If set, the value is used in option--auto.
π©Ί DIAGNOSTICS π©Ί
See option "--debug LEVEL". Yes, that's the whole section. Slay. π
πͺ EXIT STATUS πͺ
Value 0 on normal exit and non-zero on error. Simple as. β¨
βοΈ CONFIGURATION βοΈ
None. Nothing to set up, she just works. π«Ά
π¦ DEPENDENCIES π¦
None. Uses only standard Perl modules. no extra installs, no drama π
π INCOMPATIBILITIES π
None. She plays nice with everybody.
π FILES π
None.
π SEE ALSO π
π BUGS AND LIMITATIONS π
The Copyright stanzas searched with option --fsf-address must be exactly like in the FSF recommendation in order for them to be noticed. See STANDARDS. Like, character-for-character exactly. Don't freestyle it. π
π STANDARDS π
"How to use GNU licenses for your own software" http://www.gnu.org/copyleft/gpl-howto.html
"Information for maintainers of GNU software (6.5 Copyright Notices)" http://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html
"Information for maintainers of GNU software (6.6 License Notices)" http://www.gnu.org/prep/maintain/html_node/License-Notices.html#License-Notices
π AVAILABILITY π
Homepage is at https://github.com/jaalto/project--copyright-update β go say hi πΈ
π AUTHOR π
Jari Aalto
π LICENSE AND COPYRIGHT π
Copyright (C) 2000-2025 Jari Aalto
This program is free software; you can redistribute and/or modify program under the terms of GNU General Public license either version 2 of the License, or (at your option) any later version. For more information, see see <http://www.gnu.org/licenses/>.
and that's the whole page, bestie!! π this one came to you from perl v5.40.1, dated 2025-04-04 β love her, follow her, go update your copyright headers before you forget again π¦π
π¦ where this page comes from
- nixos 26.05: copyright-update 2025.0404
- nixpkgs unstable: copyright-update 2025.0404
- ubuntu resolute: copyright-update 2025.0404-1 Β· GPL-2.0-or-later
- ubuntu stonking: copyright-update 2025.0404-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms