Skip to content

Commit 1ce00f5

Browse files
committed
---
yaml --- r: 175742 b: refs/heads/auto c: 76c279a h: refs/heads/master v: v3
1 parent 65d4bf4 commit 1ce00f5

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: fc5bbdf70f8a9b0bfd7e377cc7df732b119bdac7
13+
refs/heads/auto: 76c279a4cfc9e54327bcc668a895ec19185139e9
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/etc/licenseck.py

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,18 @@
88
# option. This file may not be copied, modified, or distributed
99
# except according to those terms.
1010

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.
15-
//
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.
21-
"""
11+
import re
2212

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.
27-
#
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.
33-
"""
13+
license_re = re.compile(
14+
u"""(#|//) Copyright .* The Rust Project Developers. See the COPYRIGHT
15+
\\1 file at the top-level directory of this distribution and at
16+
\\1 http://rust-lang.org/COPYRIGHT.
17+
\\1
18+
\\1 Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
19+
\\1 http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
20+
\\1 <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
21+
\\1 option. This file may not be copied, modified, or distributed
22+
\\1 except according to those terms.""")
3423

3524
exceptions = [
3625
"rt/rust_android_dummy.cpp", # BSD, chromium
@@ -67,8 +56,4 @@ def check_license(name, contents):
6756

6857
# License check
6958
boilerplate = contents[:500]
70-
if (license1 not in boilerplate or license2 not in boilerplate) and \
71-
(license3 not in boilerplate or license4 not in boilerplate):
72-
return False
73-
74-
return True
59+
return bool(license_re.search(boilerplate))

0 commit comments

Comments
 (0)