diff options
Diffstat (limited to '')
-rwxr-xr-x | .github/workflows/compliance/ls-deps.pl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/.github/workflows/compliance/ls-deps.pl b/.github/workflows/compliance/ls-deps.pl new file mode 100755 index 0000000..a7a033a --- /dev/null +++ b/.github/workflows/compliance/ls-deps.pl @@ -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" +} |