Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
Config::Model::Dpkg::Copyright - Fill the File sections of debian/copyright file
# this modules is used by cme when invoked with this command
$ cme update dpkg-copyright
This commands helps with the tedious task of maintening "debian/copyright" file. When you package a new release of a software, you can run "cme update dpkg-copyright" to update the content of the copyright file.
This command scans current package directory to extract copyright and license information and store them in the Files sections of debian/copyright file.
In debian package directory:
* run 'cme update dpkg-copyright' or 'cme update dpkg' * check the result with your favorite VCS diff tool. (you do use
a VCS for your package files, do you ?)
Note: this command is experimental.
Results can be tweaked either by:
o Changing the list of files to scan or ignore. (By default, licensecheck will decide which file to scan or not.)
o Specifying information for individual files
o Tweaking the copyright entries created by grouping and coaslescing information.
The first 2 ways are described in "Selecting or ignoring files to scan" in Dpkg::Copyright::Scanner and "Filling the blanks" in Dpkg::Copyright::Scanner.
The last way is described below:
Tweak copyright entries
Since the extraction of copyright information from source file is based on comments, the result is sometimes lackluster. Your may specify instruction to alter or set specific copyright entries in "debian/fix.scanned.copyright" file (or "debian/
If the extracted copyright contains:
Copyright: 2014-2015, Adam Kennedy
License: Artistic or GPL-1+
You may add this line in "debian/fix.copyright" file:
! Files:'*' Copyright=~s/\s*".*//
This way, the copyright information will be updated from the file content but the extra ""foobar" will always be removed during updates.
Comments are accepted in Perl and C++ style from the beginning of the line. Lines breaks are ignored.
Here's another more complex example:
// added a global license, MIT license text is filled by Config::Model
! copyright License:MIT
# don't forget '!' to go back to tree root
! copyright Files:"pan/general/map-vector.h" Copyright="2001,Andrei Alexandrescu"
# delete license text since short_name points to global MIT license
# use a loop there vvvvvv to clean up that vvvvvvvvvvvvvvvvvvvvvvv in all copyrights
! copyright Files:~/.*/ Copyright=~s/all\s*rights\s*reserved//i
# defeat spammer by replacing all '@' in emails of 3rdparty files
# the operation :~/^3party/ loops over all Files entries that match ^3rdparty
# and modify the copyright entry with a Perl substitution
! Files:~/^3rdparty/ Copyright=~s/@/(at)/
Under the hood
This section explains how cme merges the information from the existing "debian/copyright" file (the "old" information) with the information extracted by licensecheck (the "new" information):
o The old and new information are compared in the form of file lists:
o New file entries are kept as is in the new list.
o When a file entry is found in both old and new lists, the new X and license short names are checked. If they are unknown, the information from the old list is copied in the new list.
o Old files entries not found in the new list are deleted.
o File entries are coalesced in the new list to reduce redundancies (this mechanism is explained in this blog
o License entries are created, either attached to Files specification or as global licenses. License text is added for known license (actually known by Software::License)
o Directories (path ending with "/*") from old list then checked:
o Directory is found in the new list: the old information is clobbered by new information.
o Directory not found in new list but exists: the old information is copied in the new list.
o Directory is not found: the old information is discarded
o Files entries are sorted and the new "debian/copyright" is generated.
update ( %args )
Updates data using the output "scan_files ( %args )" in Dpkg::Copyright::Scanner.
Parameters in %args:
set to 1 to suppress progress messages. Should be used only in tests.
Otherwise, %args is passed to "scan_files"