OLD | NEW |
1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
2 # This script was originally based on the script of the same name from | 2 # This script was originally based on the script of the same name from |
3 # the KDE SDK (by dfaure@kde.org) | 3 # the KDE SDK (by dfaure@kde.org) |
4 # | 4 # |
5 # This version is | 5 # This version is |
6 # Copyright (C) 2007, 2008 Adam D. Barratt | 6 # Copyright (C) 2007, 2008 Adam D. Barratt |
7 # | 7 # |
8 # This program is free software; you can redistribute it and/or modify | 8 # This program is free software; you can redistribute it and/or modify |
9 # it under the terms of the GNU General Public License as published by | 9 # it under the terms of the GNU General Public License as published by |
10 # the Free Software Foundation; either version 2 of the License, or | 10 # the Free Software Foundation; either version 2 of the License, or |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 General Public License, version 2 or later. | 118 General Public License, version 2 or later. |
119 | 119 |
120 =head1 AUTHOR | 120 =head1 AUTHOR |
121 | 121 |
122 Adam D. Barratt <adam@adam-barratt.org.uk> | 122 Adam D. Barratt <adam@adam-barratt.org.uk> |
123 | 123 |
124 =cut | 124 =cut |
125 | 125 |
126 use strict; | 126 use strict; |
127 use warnings; | 127 use warnings; |
128 use Getopt::Long; | 128 use Getopt::Long qw(:config gnu_getopt); |
129 use File::Basename; | 129 use File::Basename; |
130 | 130 |
131 sub fatal($); | 131 sub fatal($); |
132 sub parse_copyright($); | 132 sub parse_copyright($); |
133 sub parselicense($); | 133 sub parselicense($); |
134 | 134 |
135 my $progname = basename($0); | 135 my $progname = basename($0); |
136 | 136 |
137 # From dpkg-source | 137 # From dpkg-source |
138 my $default_ignore_regex = ' | 138 my $default_ignore_regex = ' |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 if ($licensetext =~ /This file is part of the .*Qt GUI Toolkit. This file ma
y be distributed under the terms of the Q Public License as defined/) { | 423 if ($licensetext =~ /This file is part of the .*Qt GUI Toolkit. This file ma
y be distributed under the terms of the Q Public License as defined/) { |
424 $license = "QPL (part of Qt) $license"; | 424 $license = "QPL (part of Qt) $license"; |
425 } elsif ($licensetext =~ /may be distributed under the terms of the Q Public
License as defined/) { | 425 } elsif ($licensetext =~ /may be distributed under the terms of the Q Public
License as defined/) { |
426 $license = "QPL $license"; | 426 $license = "QPL $license"; |
427 } | 427 } |
428 | 428 |
429 if ($licensetext =~ /opensource\.org\/licenses\/mit-license\.php/) { | 429 if ($licensetext =~ /opensource\.org\/licenses\/mit-license\.php/) { |
430 $license = "MIT/X11 (BSD like) $license"; | 430 $license = "MIT/X11 (BSD like) $license"; |
431 } elsif ($licensetext =~ /Permission is hereby granted, free of charge, to a
ny person obtaining a copy of this software and(\/or)? associated documentation
files \(the (Software|Materials)\), to deal in the (Software|Materials)/) { | 431 } elsif ($licensetext =~ /Permission is hereby granted, free of charge, to a
ny person obtaining a copy of this software and(\/or)? associated documentation
files \(the (Software|Materials)\), to deal in the (Software|Materials)/) { |
432 $license = "MIT/X11 (BSD like) $license"; | 432 $license = "MIT/X11 (BSD like) $license"; |
| 433 } elsif ($licensetext =~ /Permission is hereby granted, without written agre
ement and without license or royalty fees, to use, copy, modify, and distribute
this software and its documentation for any purpose/) { |
| 434 $license = "MIT/X11 (BSD like) $license"; |
433 } | 435 } |
434 | 436 |
435 if ($licensetext =~ /Permission to use, copy, modify, and(\/or)? distribute
this software for any purpose with or without fee is hereby granted, provided.*
copyright notice.*permission notice.*all copies/) { | 437 if ($licensetext =~ /Permission to use, copy, modify, and(\/or)? distribute
this software for any purpose with or without fee is hereby granted, provided.*
copyright notice.*permission notice.*all copies/) { |
436 $license = "ISC $license"; | 438 $license = "ISC $license"; |
437 } | 439 } |
438 | 440 |
439 if ($licensetext =~ /THIS SOFTWARE IS PROVIDED .*AS IS AND ANY EXPRESS OR IM
PLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCH
ANTABILITY/) { | 441 if ($licensetext =~ /THIS SOFTWARE IS PROVIDED .*AS IS AND ANY EXPRESS OR IM
PLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCH
ANTABILITY/) { |
440 if ($licensetext =~ /All advertising materials mentioning features or us
e of this software must display the following/) { | 442 if ($licensetext =~ /All advertising materials mentioning features or us
e of this software must display the following/) { |
441 $license = "BSD (4 clause) $license"; | 443 $license = "BSD (4 clause) $license"; |
442 } elsif ($licensetext =~ /be used to endorse or promote products derived
from this software/) { | 444 } elsif ($licensetext =~ /be used to endorse or promote products derived
from this software/) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 return $license; | 538 return $license; |
537 } | 539 } |
538 | 540 |
539 sub fatal($) { | 541 sub fatal($) { |
540 my ($pack,$file,$line); | 542 my ($pack,$file,$line); |
541 ($pack,$file,$line) = caller(); | 543 ($pack,$file,$line) = caller(); |
542 (my $msg = "$progname: fatal error at line $line:\n@_\n") =~ tr/\0//d; | 544 (my $msg = "$progname: fatal error at line $line:\n@_\n") =~ tr/\0//d; |
543 $msg =~ s/\n\n$/\n/; | 545 $msg =~ s/\n\n$/\n/; |
544 die $msg; | 546 die $msg; |
545 } | 547 } |
OLD | NEW |