.github/workflows/compliance/ls-deps.pl: extract all 3rd-party deps

... from `go list -deps` input.
This commit is contained in:
Alexander A. Klimov 2021-09-29 12:55:13 +02:00 committed by Eric Lippmann
parent 94abcef7bf
commit 12a6d525e1

24
.github/workflows/compliance/ls-deps.pl vendored Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/perl
use warnings;
use strict;
use autodie qw(:all);
my @mods = <>;
chomp @mods;
s~^vendor/~~ for @mods;
@mods = grep m~^[^./]+\.~, @mods;
@mods = grep !m~^golang\.org/x(?:/|$)~, @mods;
@mods = grep !m~^github\.com/icinga/icingadb(?:/|$)~, @mods;
@mods = sort @mods;
my $lastMod = undef;
for (@mods) {
# prefixed with last mod (e.g. "go.uber.org/zap/buffer" after "go.uber.org/zap"), so redundant
next if defined($lastMod) && /$lastMod/;
$lastMod = '^' . quotemeta("$_/");
print "$_\n"
}