]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiExternal.pm
lei up: support --exclude=, --no-(external|remote|local)
[public-inbox.git] / lib / PublicInbox / LeiExternal.pm
index 851715d7099c4445f29fab429de5b3552075575e..30bb1a4579c74d8245d1eec7b66b9687bd526e71 100644 (file)
@@ -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