X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLeiExternal.pm;h=30bb1a4579c74d8245d1eec7b66b9687bd526e71;hb=bb0eab1051318528011252866b592735981084a5;hp=851715d7099c4445f29fab429de5b3552075575e;hpb=01a049cadb1080698a447479de806755e9bc9342;p=public-inbox.git diff --git a/lib/PublicInbox/LeiExternal.pm b/lib/PublicInbox/LeiExternal.pm index 851715d7..30bb1a45 100644 --- a/lib/PublicInbox/LeiExternal.pm +++ b/lib/PublicInbox/LeiExternal.pm @@ -105,7 +105,16 @@ sub get_externals { } else { die("`$loc' is ambiguous:\n", map { "\t$_\n" } @m, "\n"); } - (); +} + +sub canonicalize_excludes { + my ($lei, $excludes) = @_; + my %x; + for my $loc (@$excludes) { + my @l = get_externals($lei, $loc, 1); + $x{$_} = 1 for @l; + } + \%x; } # returns an anonymous sub which returns an array of potential results