]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei forget-external: don't show redundant "not found"
authorEric Wong <e@80x24.org>
Sat, 23 Jan 2021 10:27:54 +0000 (10:27 +0000)
committerEric Wong <e@80x24.org>
Sat, 23 Jan 2021 23:45:33 +0000 (23:45 +0000)
Pathname/URL canonicalization may not change the result at
all, so there's no point in trying (and failing) the same
form twice if pre and post-canonicalization are identical.

lib/PublicInbox/LeiExternal.pm

index 5b5f08d178d0f04d68455b0ad0964c0849c2cccb..e7693e09a7de67a427742590707926352e54aed0 100644 (file)
@@ -69,9 +69,11 @@ sub lei_forget_external {
        my ($self, @locations) = @_;
        my $cfg = $self->_lei_cfg(1);
        my $quiet = $self->{opt}->{quiet};
+       my %seen;
        for my $loc (@locations) {
                my (@unset, @not_found);
                for my $l ($loc, _canonicalize($loc)) {
+                       next if $seen{$l}++;
                        my $key = "external.$l.boost";
                        delete($cfg->{$key});
                        $self->_config('--unset', $key);