Skip to content

Commit 6421d8b

Browse files
authored
misc: make update_licenses.sh faster (#2553)
build(update_licenses.sh): make update_licenses.sh faster. Signed-off-by: Jan-Otto Kröpke <[email protected]>
1 parent 714d8c4 commit 6421d8b

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

THIRD-PARTY-LICENSES.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Module | License URL | License
22
---|---|---
3-
43
cloud.google.com/go/compute/metadata|https://github.com/googleapis/google-cloud-go/blob/compute/metadata/v0.3.0/compute/metadata/LICENSE|Apache-2.0
54
cloud.google.com/go/iam|https://github.com/googleapis/google-cloud-go/blob/iam/v1.1.6/iam/LICENSE|Apache-2.0
65
cloud.google.com/go/internal|https://github.com/googleapis/google-cloud-go/blob/v0.112.1/LICENSE|Apache-2.0
@@ -294,7 +293,7 @@ github.com/opencontainers/go-digest|https://github.com/opencontainers/go-digest/
294293
github.com/opencontainers/image-spec/specs-go|https://github.com/opencontainers/image-spec/blob/v1.1.0/LICENSE|Apache-2.0
295294
github.com/opencontainers/image-spec|https://github.com/opencontainers/image-spec/blob/v1.1.0/LICENSE|Apache-2.0
296295
github.com/opencontainers/runtime-spec/specs-go|https://github.com/opencontainers/runtime-spec/blob/v1.2.0/LICENSE|Apache-2.0
297-
github.com/opencontainers/selinux|https://github.com/opencontainers/selinux/blob/v1.11.0/LICENSE|Apache-2.0
296+
github.com/opencontainers/selinux/go-selinux|https://github.com/opencontainers/selinux/blob/v1.11.0/LICENSE|Apache-2.0
298297
github.com/opentracing/opentracing-go|https://github.com/opentracing/opentracing-go/blob/v1.2.0/LICENSE|Apache-2.0
299298
github.com/package-url/packageurl-go|https://github.com/package-url/packageurl-go/blob/v0.1.3/LICENSE|MIT
300299
github.com/pborman/uuid|https://github.com/pborman/uuid/blob/v1.2.1/LICENSE|BSD-3-Clause
@@ -398,7 +397,6 @@ golang.org/x/oauth2|https://cs.opensource.google/go/x/oauth2/+/v0.21.0:LICENSE|B
398397
golang.org/x/sync/errgroup|https://cs.opensource.google/go/x/sync/+/v0.7.0:LICENSE|BSD-3-Clause
399398
golang.org/x/sync/semaphore|https://cs.opensource.google/go/x/sync/+/v0.7.0:LICENSE|BSD-3-Clause
400399
golang.org/x/sync|https://cs.opensource.google/go/x/sync/+/v0.7.0:LICENSE|BSD-3-Clause
401-
golang.org/x/sys/cpu|https://cs.opensource.google/go/x/sys/+/v0.22.0:LICENSE|BSD-3-Clause
402400
golang.org/x/sys/unix|https://cs.opensource.google/go/x/sys/+/v0.22.0:LICENSE|BSD-3-Clause
403401
golang.org/x/sys|https://cs.opensource.google/go/x/sys/+/v0.22.0:LICENSE|BSD-3-Clause
404402
golang.org/x/term|https://cs.opensource.google/go/x/term/+/v0.22.0:LICENSE|BSD-3-Clause
@@ -437,6 +435,7 @@ k8s.io/component-base|https://github.com/kubernetes/component-base/blob/v0.30.1/
437435
k8s.io/klog/v2|https://github.com/kubernetes/klog/blob/v2.120.1/LICENSE|Apache-2.0
438436
k8s.io/kubectl|https://github.com/kubernetes/kubectl/blob/v0.30.1/LICENSE|Apache-2.0
439437
modernc.org/gc/v3|https://gitlab.com/cznic/gc/blob/573471604cb6/v3/LICENSE|BSD-3-Clause
438+
modernc.org/libc/honnef.co/go/netdb|https://gitlab.com/cznic/libc/blob/v1.52.1/honnef.co/go/netdb/LICENSE|MIT
440439
modernc.org/libc|https://gitlab.com/cznic/libc/blob/v1.52.1/LICENSE-GO|BSD-3-Clause
441440
modernc.org/mathutil|Unknown|Unknown
442441
modernc.org/memory|https://gitlab.com/cznic/memory/blob/v1.8.0/LICENSE-GO|BSD-3-Clause

scripts/update_licenses.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,4 @@ export GOFLAGS="-tags=debug,imagetrust,lint,metrics,mgmt,profile,scrub,search,sy
66
echo "Module | License URL | License" > THIRD-PARTY-LICENSES.md
77
echo "---|---|---" >> THIRD-PARTY-LICENSES.md;
88

9-
for i in $(go list -m all | awk '{print $1}'); do
10-
l=$(go-licenses csv $i 2>/dev/null)
11-
if [ $? -ne 0 ]; then continue; fi
12-
echo $l | tr \, \| | tr ' ' '\n'
13-
done | LC_ALL=C sort -u >> THIRD-PARTY-LICENSES.md
9+
go list -m all | awk '{print $1}' | xargs -P20 -n1 nice -n 15 go-licenses csv 2>/dev/null | awk -F, '{print $1"|"$2"|"$3}' | LC_ALL=C sort -u >> THIRD-PARTY-LICENSES.md

0 commit comments

Comments
 (0)