63
63
my %new_split_files;
66
foreach my $path ( keys $files->%* ) {
66
foreach my $path ( sort keys $files->%* ) {
67
67
my ($c, $l) = $copyrights_by_id->[ $files->{$path} ]->@*;
69
69
my $new_data = dclone (delete $old_split_files{$path} || {} );
297
298
# use a loop there vvvvvv to clean up that vvvvvvvvvvvvvvvvvvvvvvv in all copyrights
298
299
! copyright Files:~/.*/ Copyright=~s/all\s*rights\s*reserved//i
301
# defeat spammer by replacing all '@' in emails of 3rdparty files
302
# the operation :~/^3party/ loops over all Files entries that match ^3rdparty
303
# and modify the copyright entry with a Perl substitution
304
! Files:~/^3rdparty/ Copyright=~s/@/(at)/
306
=head1 Under the hood
308
This section explains how cme merges the information from the existing
309
C<debian/copyright> file (the "old" information) with the information
310
extracted by I<licensecheck> (the "new" information):
316
The old and new information are compared in the form of file lists:
322
New file entries are kept as is in the new list.
326
When a file entry is found in both old and new lists, the new © and
327
license short names are checked. If they are unknown, the information
328
from the old list is copied in the new list.
332
Old files entries not found in the new list are deleted.
338
File entries are coalesced in the new list to reduce redundancies (this mechanism is explained in this L<blog|https://ddumont.wordpress.com/2015/04/05/improving-creation-of-debian-copyright-file>)
342
License entries are created, either attached to Files specification or as global licenses. License text is added for known license (actually known by L<Software::License>)
346
Directories (path ending with C</*>) from old list then checked:
352
Directory is found in the new list: the old information is clobbered by new information.
356
Directory not found in new list but exists: the old information is copied in the new list.
360
Directory is not found: the old information is discarded
366
Files entries are sorted and the new C<debian/copyright> is generated.