Skip to content

Commit bf890ba

Browse files
authored
override revision for missed subpackages (elastic#797)
* override revision for missed subpackages * resolve unknown version errors * resolve unknown license for go-ole smart quotes
1 parent bfb2093 commit bf890ba

12 files changed

+73
-156
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ check-full: check
8484
.PHONY: notice
8585
notice: python-env
8686
@echo "Generating NOTICE"
87-
@$(PYTHON_ENV)/bin/python ${ES_BEATS}/dev-tools/generate_notice.py . -e '_beats' -s "./vendor/github.com/elastic/beats" -b "Apm Server" --beats-origin ./_beats/vendor/vendor.json
87+
@$(PYTHON_ENV)/bin/python ${ES_BEATS}/dev-tools/generate_notice.py . -e '_beats' -s "./vendor/github.com/elastic/beats" -b "Apm Server" --beats-origin <($(PYTHON_ENV)/bin/python script/generate_notice_overrides.py)
8888

8989
.PHONY: force-update-docs
9090
force-update-docs: clean docs

NOTICE.txt

+17-50
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Third party libraries used by the Apm Server project:
1111

1212
--------------------------------------------------------------------
1313
Dependency: github.com/davecgh/go-spew
14-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
14+
Revision: 346938d642f2ec3594ed81d874461961cd0faa76
1515
License type (autodetected): MIT
1616
./vendor/github.com/davecgh/go-spew/LICENSE:
1717
--------------------------------------------------------------------
@@ -33,7 +33,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3333

3434
--------------------------------------------------------------------
3535
Dependency: github.com/docker/distribution
36-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
36+
Revision: 1e2f10eb65743fed02f573d31a4587de09afb20e
3737
License type (autodetected): Apache-2.0
3838
./vendor/github.com/docker/distribution/LICENSE:
3939
--------------------------------------------------------------------
@@ -42,7 +42,7 @@ Apache License 2.0
4242

4343
--------------------------------------------------------------------
4444
Dependency: github.com/docker/docker
45-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
45+
Revision: d192db0d9350222d2b8bb6eba8525b04c3be7d61
4646
License type (autodetected): Apache-2.0
4747
./vendor/github.com/docker/docker/LICENSE:
4848
--------------------------------------------------------------------
@@ -71,7 +71,7 @@ See also https://www.apache.org/dev/crypto.html and/or seek legal counsel.
7171

7272
--------------------------------------------------------------------
7373
Dependency: github.com/docker/go-connections
74-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
74+
Revision: e15c02316c12de00874640cd76311849de2aeed5
7575
License type (autodetected): Apache-2.0
7676
./vendor/github.com/docker/go-connections/LICENSE:
7777
--------------------------------------------------------------------
@@ -98,7 +98,7 @@ Apache License 2.0
9898

9999
--------------------------------------------------------------------
100100
Dependency: github.com/eapache/go-resiliency
101-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
101+
Revision: b86b1ec0dd4209a588dc1285cdd471e73525c0b3
102102
License type (autodetected): MIT
103103
./vendor/github.com/eapache/go-resiliency/LICENSE:
104104
--------------------------------------------------------------------
@@ -192,7 +192,7 @@ Apache License 2.0
192192

193193
--------------------------------------------------------------------
194194
Dependency: github.com/elastic/go-lumber
195-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
195+
Revision: 616041e345fc33c97bc0eb0fa6b388aa07bca3e1
196196
License type (autodetected): Apache-2.0
197197
./vendor/github.com/elastic/go-lumber/LICENSE:
198198
--------------------------------------------------------------------
@@ -210,7 +210,7 @@ Apache License 2.0
210210

211211
--------------------------------------------------------------------
212212
Dependency: github.com/elastic/go-ucfg
213-
Revision: 0ba28e36add27704e6b49a7ed8557989a8f4a635
213+
Revision: ec8488a52542c0c51e42e8ea204dcaff400bc644
214214
License type (autodetected): Apache-2.0
215215
./vendor/github.com/elastic/go-ucfg/LICENSE:
216216
--------------------------------------------------------------------
@@ -300,7 +300,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
300300

301301
--------------------------------------------------------------------
302302
Dependency: github.com/garyburd/redigo
303-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
303+
Revision: b8dc90050f24c1a73a52f107f3f575be67b21b7c
304304
License type (autodetected): Apache-2.0
305305
./vendor/github.com/garyburd/redigo/LICENSE:
306306
--------------------------------------------------------------------
@@ -367,7 +367,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
367367
--------------------------------------------------------------------
368368
Dependency: github.com/go-ole/go-ole
369369
Revision: de8695c8edbf8236f30d6e1376e20b198a028d42
370-
License type (autodetected): UNKNOWN
370+
License type (autodetected): MIT
371371
./vendor/github.com/go-ole/go-ole/LICENSE:
372372
--------------------------------------------------------------------
373373
The MIT License (MIT)
@@ -426,7 +426,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
426426

427427
--------------------------------------------------------------------
428428
Dependency: github.com/golang/protobuf
429-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
429+
Revision: 2bba0603135d7d7f5cb73b2125beeda19c09f4ef
430430
License type (autodetected): BSD-3-Clause
431431
./vendor/github.com/golang/protobuf/LICENSE:
432432
--------------------------------------------------------------------
@@ -496,39 +496,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
496496
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
497497
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
498498

499-
--------------------------------------------------------------------
500-
Dependency: github.com/golang/sys
501-
License type (autodetected): BSD-3-Clause
502-
./vendor/github.com/golang/sys/LICENSE:
503-
--------------------------------------------------------------------
504-
Copyright (c) 2009 The Go Authors. All rights reserved.
505-
506-
Redistribution and use in source and binary forms, with or without
507-
modification, are permitted provided that the following conditions are
508-
met:
509-
510-
* Redistributions of source code must retain the above copyright
511-
notice, this list of conditions and the following disclaimer.
512-
* Redistributions in binary form must reproduce the above
513-
copyright notice, this list of conditions and the following disclaimer
514-
in the documentation and/or other materials provided with the
515-
distribution.
516-
* Neither the name of Google Inc. nor the names of its
517-
contributors may be used to endorse or promote products derived from
518-
this software without specific prior written permission.
519-
520-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
521-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
522-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
523-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
524-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
525-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
526-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
527-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
528-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
529-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
530-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
531-
532499
--------------------------------------------------------------------
533500
Dependency: github.com/hashicorp/golang-lru
534501
Revision: 0a025b7e63adc15a622f29b0b2c4c3848243bbf6
@@ -971,7 +938,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
971938

972939
--------------------------------------------------------------------
973940
Dependency: github.com/klauspost/compress
974-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
941+
Revision: 14c9a76e3c95e47f8ccce949bba2c1101a8b85e6
975942
License type (autodetected): BSD-3-Clause
976943
./vendor/github.com/klauspost/compress/LICENSE:
977944
--------------------------------------------------------------------
@@ -1179,7 +1146,7 @@ Apache License 2.0
11791146

11801147
--------------------------------------------------------------------
11811148
Dependency: github.com/opencontainers/image-spec
1182-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
1149+
Revision: 4038d4391fe912af1031db5a1f511cf07c07cbc8
11831150
License type (autodetected): Apache-2.0
11841151
./vendor/github.com/opencontainers/image-spec/LICENSE:
11851152
--------------------------------------------------------------------
@@ -1249,7 +1216,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12491216

12501217
--------------------------------------------------------------------
12511218
Dependency: github.com/pierrec/xxHash
1252-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
1219+
Revision: 5a004441f897722c627870a981d02b29924215fa
12531220
License type (autodetected): BSD-3-Clause
12541221
./vendor/github.com/pierrec/xxHash/LICENSE:
12551222
--------------------------------------------------------------------
@@ -1982,7 +1949,7 @@ THE SOFTWARE.
19821949

19831950
--------------------------------------------------------------------
19841951
Dependency: golang.org/x/crypto
1985-
Revision: 0fcca4842a8d74bfddc2c96a073bd2a4d2a7a2e8
1952+
Revision: 5119cf507ed5294cc409c092980c7497ee5d6fd2
19861953
License type (autodetected): BSD-3-Clause
19871954
./vendor/golang.org/x/crypto/LICENSE:
19881955
--------------------------------------------------------------------
@@ -2016,7 +1983,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20161983

20171984
--------------------------------------------------------------------
20181985
Dependency: golang.org/x/net
2019-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
1986+
Revision: 44b7c21cbf19450f38b337eb6b6fe4f6496fb5b3
20201987
License type (autodetected): BSD-3-Clause
20211988
./vendor/golang.org/x/net/LICENSE:
20221989
--------------------------------------------------------------------
@@ -2050,7 +2017,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20502017

20512018
--------------------------------------------------------------------
20522019
Dependency: golang.org/x/sys
2053-
Revision: fbc61e82107563d211ab23747902e0ad9b29d656
2020+
Revision: 37707fdb30a5b38865cfb95e5aab41707daec7fd
20542021
License type (autodetected): BSD-3-Clause
20552022
./vendor/golang.org/x/sys/LICENSE:
20562023
--------------------------------------------------------------------
@@ -2118,7 +2085,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21182085

21192086
--------------------------------------------------------------------
21202087
Dependency: golang.org/x/time
2121-
Revision: 8be79e1e0910c292df4e79c241bb7e8f7e725959
2088+
Revision: 26559e0f760e39c24d730d3224364aef164ee23f
21222089
License type (autodetected): BSD-3-Clause
21232090
./vendor/golang.org/x/time/LICENSE:
21242091
--------------------------------------------------------------------

_beats/dev-tools/generate_notice.py

+2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ def create_notice(filename, beat, copyright, vendor_dirs, csvfile, overrides=Non
215215
def detect_license_summary(content):
216216
# replace all white spaces with a single space
217217
content = re.sub(r"\s+", ' ', content)
218+
# replace smart quotes with less intelligent ones
219+
content = content.replace(b'\xe2\x80\x9c', '"').replace(b'\xe2\x80\x9d', '"')
218220
if any(sentence in content[0:1000] for sentence in APACHE2_LICENSE_TITLES):
219221
return "Apache-2.0"
220222
if any(sentence in content[0:1000] for sentence in MIT_LICENSES):

script/generate_notice_overrides.py

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env python
2+
"""
3+
Generate data used to put the correct revision information in NOTICE.TXT.
4+
"""
5+
import argparse
6+
import json
7+
import logging
8+
import sys
9+
10+
11+
def gather(vendor):
12+
overrides = {}
13+
for package in vendor['package']:
14+
path = package['path']
15+
sub_path = []
16+
for p in path.split('/'):
17+
sub_path.append(p)
18+
sub_path_str = '/'.join(sub_path)
19+
if sub_path_str in overrides and overrides[sub_path_str]['revision'] != package['revision'] and len(sub_path) > 1:
20+
logging.debug("warning: %s changed by: %s was: %s is: %s", sub_path_str,
21+
path, overrides[sub_path_str]['revision'], package['revision'])
22+
overrides[sub_path_str] = package
23+
return overrides
24+
25+
26+
def main():
27+
parser = argparse.ArgumentParser()
28+
parser.add_argument('-i', '--vendor_input', type=argparse.FileType('r'), default='_beats/vendor/vendor.json')
29+
parser.add_argument('-o', '--overrides', type=argparse.FileType('w'), default=sys.stdout)
30+
parser.add_argument('-D', '--debug', action='store_true')
31+
args = parser.parse_args()
32+
33+
level = logging.DEBUG if args.debug else logging.ERROR
34+
logging.basicConfig(level=level)
35+
36+
vendor = json.load(args.vendor_input)
37+
overrides = gather(vendor)
38+
for path_override, package in sorted(overrides.items()):
39+
vendor['package'].append({
40+
"path": path_override,
41+
"revision": package["revision"]
42+
})
43+
json.dump(vendor, args.overrides)
44+
45+
46+
if __name__ == '__main__':
47+
main()

vendor/github.com/golang/sys/AUTHORS

-3
This file was deleted.

vendor/github.com/golang/sys/CONTRIBUTING.md

-31
This file was deleted.

vendor/github.com/golang/sys/CONTRIBUTORS

-3
This file was deleted.

vendor/github.com/golang/sys/LICENSE

-27
This file was deleted.

vendor/github.com/golang/sys/PATENTS

-22
This file was deleted.

vendor/github.com/golang/sys/README.md

-18
This file was deleted.

vendor/github.com/golang/sys/codereview.cfg

-1
This file was deleted.

vendor/vendor.json

+6
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,12 @@
14111411
"revision": "0a025b7e63adc15a622f29b0b2c4c3848243bbf6",
14121412
"revisionTime": "2016-08-13T22:13:03Z"
14131413
},
1414+
{
1415+
"checksumSHA1": "40vJyUB4ezQSn/NSadsKEOrudMc=",
1416+
"path": "github.com/inconshreveable/mousetrap",
1417+
"revision": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75",
1418+
"revisionTime": "2014-10-17T20:07:13Z"
1419+
},
14141420
{
14151421
"checksumSHA1": "l9wW52CYGbmO/NGwYZ/Op2QTmaA=",
14161422
"origin": "github.com/elastic/beats/vendor/github.com/joeshaw/multierror",

0 commit comments

Comments
 (0)