~ubuntu-branches/debian/sid/libconfig-model-dpkg-perl/sid

« back to all changes in this revision

Viewing changes to lib/Config/Model/Dpkg/Copyright.pm

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Dominique Dumont
  • Date: 2015-06-15 12:45:10 UTC
  • Revision ID: package-import@ubuntu.com-20150615124510-512k91a59u2iijrx
Tags: 2.066
[ gregor herrmann ]
* Add Build-Conflicts-Indep fields to Dpkg::Control::Source model.
* Dpkg::Control::Source model: warn on duplicates in Build-
  Conflicts{,-Indep}.
* Update descriptions and summaries for Dpkg::Control::Source model.

[ Dominique Dumont ]
* updated © years in model doc
* Dpkg::Copyright doc:
  + added explanation on merge mechanism in pod doc
  + added scary example to modify copyright content with cme

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    my %new_split_files;
64
64
    my @data;
65
65
    my %data_keys;
66
 
    foreach my $path ( keys $files->%* ) {
 
66
    foreach my $path ( sort keys $files->%* ) {
67
67
        my ($c, $l) = $copyrights_by_id->[ $files->{$path} ]->@*;
68
68
 
69
69
        my $new_data = dclone (delete $old_split_files{$path} || {} );
225
225
 
226
226
__END__
227
227
 
 
228
=encoding utf8
228
229
 
229
230
=head1 NAME
230
231
 
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
299
300
 
 
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)/
 
305
 
 
306
=head1 Under the hood
 
307
 
 
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):
 
311
 
 
312
=over
 
313
 
 
314
=item *
 
315
 
 
316
The old and new information are compared in the form of file lists:
 
317
 
 
318
=over
 
319
 
 
320
=item *
 
321
 
 
322
New file entries are kept as is in the new list.
 
323
 
 
324
=item *
 
325
 
 
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.
 
329
 
 
330
=item *
 
331
 
 
332
Old files entries not found in the new list are deleted.
 
333
 
 
334
=back
 
335
 
 
336
=item *
 
337
 
 
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>)
 
339
 
 
340
=item *
 
341
 
 
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>)
 
343
 
 
344
=item *
 
345
 
 
346
Directories (path ending with C</*>) from old list then checked:
 
347
 
 
348
=over
 
349
 
 
350
=item *
 
351
 
 
352
Directory is found in the new list: the old information is clobbered by new information.
 
353
 
 
354
=item *
 
355
 
 
356
Directory not found in new list but exists: the old information is copied in the new list.
 
357
 
 
358
=item *
 
359
 
 
360
Directory is not found: the old information is discarded
 
361
 
 
362
=back
 
363
 
 
364
=item *
 
365
 
 
366
Files entries are sorted and the new C<debian/copyright> is generated.
 
367
 
 
368
=back
 
369
 
300
370
 
301
371
=head1 AUTHOR
302
372