In my last post I showed a fairly complex command line that parses the output of licensecheck into something more usable for the new debian/copyright format. The problem was that it didn't quite work properly and it was too complex to modify. So, I took a different approach and modified the licensecheck program directly. Yea, open source!

Here is my simple but working patch for the licensecheck program. Enjoy.


--- licensecheck 2008-06-29 08:53:10.000000000 -0400
+++ licensecheck 2008-07-21 12:44:03.000000000 -0400
@@ -288,12 +288,11 @@
$content =~ tr/ //s;

$license = parselicense($content);
- print "$file: ";
+ print $license . "\t";
print "*No copyright* " unless $copyright;
- print $license . "\n";
- print " [Copyright: " . $copyright . "]\n"
+ print "[Copyright: " . $copyright . "]\t"
if $copyright and $opt_copyright;
- print "\n" if $opt_copyright;
+ print "$file\n";
}

sub parse_copyright($) {


Now I can easily sort all the files by copyright and by owner. This will hopefully make it easier to build and maintain my copyright file for my redmine package.