1 # Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
11 license1 = """// Copyright """
12 license2 = """ The Rust Project Developers. See the COPYRIGHT
13 // file at the top-level directory of this distribution and at
14 // http://rust-lang.org/COPYRIGHT.
16 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
17 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
18 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
19 // option. This file may not be copied, modified, or distributed
20 // except according to those terms.
23 license3 = """# Copyright """
24 license4 = """ The Rust Project Developers. See the COPYRIGHT
25 # file at the top-level directory of this distribution and at
26 # http://rust-lang.org/COPYRIGHT.
28 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
29 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
30 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
31 # option. This file may not be copied, modified, or distributed
32 # except according to those terms.
36 "rt/rust_android_dummy.cpp", # BSD, chromium
37 "rt/rust_android_dummy.h", # BSD, chromium
38 "rt/isaac/randport.cpp", # public domain
39 "rt/isaac/rand.h", # public domain
40 "rt/isaac/standard.h", # public domain
41 "libstd/comm/mpsc_queue.rs", # BSD
42 "libstd/comm/spsc_queue.rs", # BSD
43 "test/bench/shootout-binarytrees.rs", # BSD
44 "test/bench/shootout-chameneos-redux.rs", # BSD
45 "test/bench/shootout-fannkuch-redux.rs", # BSD
46 "test/bench/shootout-fasta.rs", # BSD
47 "test/bench/shootout-fasta-redux.rs", # BSD
48 "test/bench/shootout-k-nucleotide.rs", # BSD
49 "test/bench/shootout-mandelbrot.rs", # BSD
50 "test/bench/shootout-meteor.rs", # BSD
51 "test/bench/shootout-nbody.rs", # BSD
52 "test/bench/shootout-regex-dna.rs", # BSD
53 "test/bench/shootout-reverse-complement.rs", # BSD
54 "test/bench/shootout-spectralnorm.rs", # BSD
55 "test/bench/shootout-threadring.rs", # BSD
58 def check_license(name, contents):
60 for exception in exceptions:
61 if name.endswith(exception):
65 firstlineish = contents[:100]
66 if firstlineish.find("ignore-license") != -1:
70 boilerplate = contents[:500]
71 if (boilerplate.find(license1) == -1 or boilerplate.find(license2) == -1) and \
72 (boilerplate.find(license3) == -1 or boilerplate.find(license4) == -1):