blob: a7a033addd432e558f8044f46f8a0e7dbef0ebf7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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"
}
|