]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Config.pm
rename most instances of "list" to "inbox"
[public-inbox.git] / lib / PublicInbox / Config.pm
index 844f666ef6a484f759cc445ba7047359823a713f..331d25c56bd5cddfe43687d0b50f607d6e218d25 100644 (file)
@@ -45,18 +45,18 @@ sub lookup {
                my $v = $self->{"$pfx.$k"};
                $rv{$k} = $v if defined $v;
        }
-       my $listname = $pfx;
-       $listname =~ s/\Apublicinbox\.//;
-       $rv{listname} = $listname;
+       my $inbox = $pfx;
+       $inbox =~ s/\Apublicinbox\.//;
+       $rv{inbox} = $inbox;
        my $v = $rv{address};
        $rv{-primary_address} = ref($v) eq 'ARRAY' ? $v->[0] : $v;
        \%rv;
 }
 
 sub get {
-       my ($self, $listname, $key) = @_;
+       my ($self, $inbox, $key) = @_;
 
-       $self->{"publicinbox.$listname.$key"};
+       $self->{"publicinbox.$inbox.$key"};
 }
 
 sub config_dir { $ENV{PI_DIR} || expand_filename('~/.public-inbox') }
@@ -73,7 +73,7 @@ sub git_config_dump {
        my @cmd = (qw/git config/, "--file=$file", '-l');
        my $cmd = join(' ', @cmd);
        my $pid = open(my $fh, '-|', @cmd);
-       defined $pid or die "$cmd failed: $!\n";
+       defined $pid or die "$cmd failed: $!";
        my %rv;
        foreach my $line (<$fh>) {
                chomp $line;
@@ -90,8 +90,8 @@ sub git_config_dump {
                        $rv{$k} = $v;
                }
        }
-       close $fh or die "failed to close ($cmd) pipe: $!\n";
-       $? and warn "$$ $cmd exited with: ($pid) $?\n";
+       close $fh or die "failed to close ($cmd) pipe: $!";
+       $? and warn "$$ $cmd exited with: ($pid) $?";
        \%rv;
 }
 
@@ -101,7 +101,6 @@ sub try_cat {
        if (open(my $fh, '<', $path)) {
                local $/;
                $rv = <$fh>;
-               close $fh;
        }
        $rv;
 }