X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=debian%2Fclscan%2Fclscan;h=0e427e203f462d63f0d26b897b0b5304fe61613d;hb=35170063f45ccb74210505c198c8c0ab5c532be0;hp=15061671d09dddbe3de922125d6004b081f4738d;hpb=5e98206a1532f3cd110f123e5ad21e59d3eb0c1a;p=gnulib.git
diff --git a/debian/clscan/clscan b/debian/clscan/clscan
index 15061671d..0e427e203 100755
--- a/debian/clscan/clscan
+++ b/debian/clscan/clscan
@@ -18,50 +18,50 @@ our $NEWFILES="$CLSCANDIR/new.txt";
our $COPYRIGHTSTUB="$CLSCANDIR/copyright.in";
my $gpl_boilerplate=<<"EOL";
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see .
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
EOL
my $lgpl2_boilerplate=<<"EOL";
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU Library General Public License as published
-by the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-USA.
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+ .
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
EOL
my $lgpl3_boilerplate=<<"EOL";
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see .
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
EOL
# license overrides as specified in modules/*
@@ -112,13 +112,15 @@ our @deleted_files=();
# actions
my $scan=0;
my $merge=0;
+my $help=0;
my $writecopyright=0;
usage() unless(@ARGV);
-usage() unless GetOptions("scan|s" => \$scan,
+usage() unless GetOptions("scan|s" => \$scan,
"merge|m" => \$merge,
"write|w" => \$writecopyright,
- "help|h" => sub { usage(); });
+ "help|h" => \$help);
+usage() if $help;
load_cache();
scan() if($scan);
@@ -126,7 +128,6 @@ merge() if($merge);
write_copyright() if ($merge || $writecopyright);
-
sub scan
{
get_filenames();
@@ -172,6 +173,7 @@ sub write_copyright
}
my %refs=();
my $refnum="00";
+ print COPYRIGHT license_trailer(sort keys(%$licenses));
for my $license (sort keys(%$licenses))
{
for my $license_text (sort keys(%{$licenses->{$license}}))
@@ -188,12 +190,18 @@ sub write_copyright
$licensestr .= " [REF$refnum]";
$refs{$licensestr}=$license_text;
}
+ else
+ {
+ if(!length($license)) {
+ $licensestr="unknown";
+ }
+ }
for my $copyright (sort keys(%{$licenses->{$license}->{$license_text}}))
{
next if(!length($license) && !length($copyright) && !length($license_text));
my @filelist=sort @{$licenses->{$license}->{$license_text}->{$copyright}};
- print COPYRIGHT "Files: ", join(', ', @filelist), "\n";
- print COPYRIGHT "Copyright: $copyright\n" if length($copyright);
+ print COPYRIGHT "Files: ", join(' ', @filelist), "\n";
+ print COPYRIGHT "Copyright: ". (length($copyright) ? $copyright : "unknown" ) . "\n";
print COPYRIGHT "License: $licensestr\n" if length($licensestr);
print COPYRIGHT "\n";
}
@@ -203,10 +211,10 @@ sub write_copyright
{
print COPYRIGHT "License: $ref\n";
my @text=split(/\n/, $refs{$ref});
+ @text=map { ($_ eq "") ? "." : $_; } @text;
print COPYRIGHT map { " " . $_ . "\n" } @text;
print COPYRIGHT "\n";
}
- print COPYRIGHT license_trailer(sort keys(%$licenses));
close(COPYRIGHT);
}
@@ -250,25 +258,26 @@ sub license_trailer
}
}
}
- my $text="\n";
+ my $text=" .\n";
# if just one, use standard style
if(keys(%types_found) == 1)
{
my ($file, $name)=each(%types_found);
- $text .= "The complete text of the $name can be\n";
- $text .= "found in /usr/share/common-licenses/$file\n";
+ $text .= " The complete text of the $name can be\n";
+ $text .= " found in /usr/share/common-licenses/$file\n";
}
else
{
# more than one, use table.
- $text .= "The complete text of standard licenses referenced above\n";
- $text .= "can be found in /usr/share/common-licenses/ as follows:\n\n";
+ $text .= " The complete text of standard licenses referenced above\n";
+ $text .= " can be found in /usr/share/common-licenses/ as follows:\n .\n ";
$text .= sprintf("%-60s %s\n", "LICENSE", "FILE");
for my $type (sort keys(%types_found))
{
- $text .= sprintf("%-60s %s\n", $license_data->{$type}, $type);
+ $text .= sprintf(" %-60s %s\n", $license_data->{$type}, $type);
}
}
+ $text .= "\n\n";
return $text;
}