Don Newton | 379ae25 | 2019-04-01 12:17:06 -0400 | [diff] [blame^] | 1 | #!/usr/bin/env perl |
| 2 | use v5.10; |
| 3 | use strict; |
| 4 | use warnings; |
| 5 | use utf8; |
| 6 | use open qw/:std :utf8/; |
| 7 | use File::Find qw/find/; |
| 8 | |
| 9 | my @license_files; |
| 10 | |
| 11 | find( |
| 12 | sub { |
| 13 | return unless lc($_) eq 'license'; |
| 14 | push @license_files, [ $File::Find::dir, $File::Find::name ]; |
| 15 | }, |
| 16 | 'vendor' |
| 17 | ); |
| 18 | |
| 19 | print forked_licenses(); |
| 20 | |
| 21 | for my $entry (sort { $a->[0] cmp $b->[0] } @license_files) { |
| 22 | ( my $package_name = $entry->[0] ) =~ s{vendor/}{}; |
| 23 | my $license_text = do { local ( @ARGV, $/ ) = $entry->[1]; <> }; |
| 24 | $license_text =~ s/ +$//mg; |
| 25 | say "" x 70; |
| 26 | say "-" x 70; |
| 27 | say "License notice for $package_name"; |
| 28 | say "-" x 70; |
| 29 | say ""; |
| 30 | print $license_text; |
| 31 | } |
| 32 | |
| 33 | # These licenses are the originals for forked code; they must |
| 34 | # be included along with license from the vendor directory |
| 35 | sub forked_licenses { |
| 36 | return <<'HERE'; |
| 37 | --------------------------------------------------------------------- |
| 38 | License notice for gopkg.in/mgo.v2/bson |
| 39 | --------------------------------------------------------------------- |
| 40 | |
| 41 | BSON library for Go |
| 42 | |
| 43 | Copyright (c) 2010-2013 - Gustavo Niemeyer <gustavo@niemeyer.net> |
| 44 | |
| 45 | All rights reserved. |
| 46 | |
| 47 | Redistribution and use in source and binary forms, with or without |
| 48 | modification, are permitted provided that the following conditions are met: |
| 49 | |
| 50 | 1. Redistributions of source code must retain the above copyright notice, this |
| 51 | list of conditions and the following disclaimer. |
| 52 | 2. Redistributions in binary form must reproduce the above copyright notice, |
| 53 | this list of conditions and the following disclaimer in the documentation |
| 54 | and/or other materials provided with the distribution. |
| 55 | |
| 56 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 57 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 58 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 59 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 60 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 61 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 62 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 63 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 64 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 65 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 66 | |
| 67 | --------------------------------------------------------------------- |
| 68 | License notice for JSON and CSV code from github.com/golang/go |
| 69 | --------------------------------------------------------------------- |
| 70 | |
| 71 | Copyright (c) 2009 The Go Authors. All rights reserved. |
| 72 | |
| 73 | Redistribution and use in source and binary forms, with or without |
| 74 | modification, are permitted provided that the following conditions are |
| 75 | met: |
| 76 | |
| 77 | * Redistributions of source code must retain the above copyright |
| 78 | notice, this list of conditions and the following disclaimer. |
| 79 | * Redistributions in binary form must reproduce the above |
| 80 | copyright notice, this list of conditions and the following disclaimer |
| 81 | in the documentation and/or other materials provided with the |
| 82 | distribution. |
| 83 | * Neither the name of Google Inc. nor the names of its |
| 84 | contributors may be used to endorse or promote products derived from |
| 85 | this software without specific prior written permission. |
| 86 | |
| 87 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 88 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 89 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 90 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 91 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 92 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 93 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 94 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 95 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 96 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 97 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 98 | HERE |
| 99 | } |