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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 } | 421 } |
422 | 422 |
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 associated documentation files \
(the Software\), to deal in the Software/) { | 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 } | 433 } |
434 | 434 |
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/) { | 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/) { |
436 $license = "ISC $license"; | 436 $license = "ISC $license"; |
437 } | 437 } |
438 | 438 |
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/) { | 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/) { |
440 if ($licensetext =~ /All advertising materials mentioning features or us
e of this software must display the following/) { | 440 if ($licensetext =~ /All advertising materials mentioning features or us
e of this software must display the following/) { |
441 $license = "BSD (4 clause) $license"; | 441 $license = "BSD (4 clause) $license"; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 } | 481 } |
482 | 482 |
483 if ($licensetext =~ /under the terms of the CeCILL /) { | 483 if ($licensetext =~ /under the terms of the CeCILL /) { |
484 $license = "CeCILL $license"; | 484 $license = "CeCILL $license"; |
485 } | 485 } |
486 | 486 |
487 if ($licensetext =~ /under the terms of the CeCILL-([^ ]+) /) { | 487 if ($licensetext =~ /under the terms of the CeCILL-([^ ]+) /) { |
488 $license = "CeCILL-$1 $license"; | 488 $license = "CeCILL-$1 $license"; |
489 } | 489 } |
490 | 490 |
491 if ($licensetext =~ /under the SGI Free Software License B/) { | 491 if ($licensetext =~ /under the SGI Free Software (B License|License B)/) { |
492 $license = "SGI Free Software License B $license"; | 492 $license = "SGI Free Software License B $license"; |
493 } | 493 } |
494 | 494 |
495 if ($licensetext =~ /in the public domain/i) { | 495 if ($licensetext =~ /in the public domain/i) { |
496 $license = "Public domain"; | 496 $license = "Public domain"; |
497 } | 497 } |
498 | 498 |
499 if ($licensetext =~ /terms of the Common Development and Distribution Licens
e(, Version ([^(]+))? \(the License\)/) { | 499 if ($licensetext =~ /terms of the Common Development and Distribution Licens
e(, Version ([^(]+))? \(the License\)/) { |
500 $license = "CDDL " . ($1 ? "(v$2) " : '') . $license; | 500 $license = "CDDL " . ($1 ? "(v$2) " : '') . $license; |
501 } | 501 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 return $license; | 536 return $license; |
537 } | 537 } |
538 | 538 |
539 sub fatal($) { | 539 sub fatal($) { |
540 my ($pack,$file,$line); | 540 my ($pack,$file,$line); |
541 ($pack,$file,$line) = caller(); | 541 ($pack,$file,$line) = caller(); |
542 (my $msg = "$progname: fatal error at line $line:\n@_\n") =~ tr/\0//d; | 542 (my $msg = "$progname: fatal error at line $line:\n@_\n") =~ tr/\0//d; |
543 $msg =~ s/\n\n$/\n/; | 543 $msg =~ s/\n\n$/\n/; |
544 die $msg; | 544 die $msg; |
545 } | 545 } |
OLD | NEW |