Print this page
6924 make libc copyright file contents deterministic
   1 #! /usr/perl5/bin/perl
   2 #
   3 # This file and its contents are supplied under the terms of the
   4 # Common Development and Distribution License ("CDDL"), version 1.0.
   5 # You may only use this file in accordance with the terms version
   6 # 1.0 of the CDDL.
   7 #
   8 # A full copy of the text of the CDDL should have accompanied this
   9 # source.  A copy is of the CDDL is also available via the Internet
  10 # at http://www.illumos.org/license/CDDL.
  11 #
  12 
  13 #
  14 # Copyright 2010 Nexenta Systems, Inc.  All rights reserved.

  15 #
  16 
  17 #
  18 # This extracts all the BSD copyrights (excluding the CDDL licenses)
  19 # for use in a THIRDPARTYLICENSE file.  It tries hard to avoid duplicates.
  20 #
  21 
  22 use strict;
  23 use warnings;
  24 use File::Find;
  25 
  26 my %LICENSE = ();
  27 
  28 sub dofile
  29 {
  30         my $file = shift;
  31         my $comment = 0;
  32         my @license = ();
  33         my @block = ();;
  34         my $copyr = 0;


  88 
  89 my @FILES;
  90 
  91 sub wanted {
  92         my $path = $File::Find::name;
  93 
  94         if (!-f $path) {
  95                 if ($path =~ /\.[chs]$/) {
  96                         push(@FILES, $path);
  97                 }
  98         }
  99         
 100 }
 101 foreach $a (@ARGV) {
 102         if (-d $a) {
 103                 find(\&wanted, $a);
 104         } elsif (-f $a) {
 105                 push(@FILES, $a);
 106         }
 107 }



 108 
 109 foreach $a (@FILES) {
 110         dofile($a);
 111 }
 112 
 113 foreach my $lic (keys %LICENSE) {
 114         my @files = @{$LICENSE{$lic}};
 115         print "\nThe following files from the C library:\n";
 116         foreach my $f (@files) {
 117                 print("    $f\n");
 118         }
 119         print "are provided under the following terms:\n\n";
 120         print "$lic\n";
 121 }
   1 #! /usr/perl5/bin/perl
   2 #
   3 # This file and its contents are supplied under the terms of the
   4 # Common Development and Distribution License ("CDDL"), version 1.0.
   5 # You may only use this file in accordance with the terms version
   6 # 1.0 of the CDDL.
   7 #
   8 # A full copy of the text of the CDDL should have accompanied this
   9 # source.  A copy is of the CDDL is also available via the Internet
  10 # at http://www.illumos.org/license/CDDL.
  11 #
  12 
  13 #
  14 # Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  15 # Copyright 2016 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  16 #
  17 
  18 #
  19 # This extracts all the BSD copyrights (excluding the CDDL licenses)
  20 # for use in a THIRDPARTYLICENSE file.  It tries hard to avoid duplicates.
  21 #
  22 
  23 use strict;
  24 use warnings;
  25 use File::Find;
  26 
  27 my %LICENSE = ();
  28 
  29 sub dofile
  30 {
  31         my $file = shift;
  32         my $comment = 0;
  33         my @license = ();
  34         my @block = ();;
  35         my $copyr = 0;


  89 
  90 my @FILES;
  91 
  92 sub wanted {
  93         my $path = $File::Find::name;
  94 
  95         if (!-f $path) {
  96                 if ($path =~ /\.[chs]$/) {
  97                         push(@FILES, $path);
  98                 }
  99         }
 100         
 101 }
 102 foreach $a (@ARGV) {
 103         if (-d $a) {
 104                 find(\&wanted, $a);
 105         } elsif (-f $a) {
 106                 push(@FILES, $a);
 107         }
 108 }
 109 
 110 # sort files to get a stable ordering to aid wsdiff(1onbld)
 111 @FILES = sort @FILES;
 112 
 113 foreach $a (@FILES) {
 114         dofile($a);
 115 }
 116 
 117 foreach my $lic (keys %LICENSE) {
 118         my @files = @{$LICENSE{$lic}};
 119         print "\nThe following files from the C library:\n";
 120         foreach my $f (@files) {
 121                 print("    $f\n");
 122         }
 123         print "are provided under the following terms:\n\n";
 124         print "$lic\n";
 125 }