X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLeiExternal.pm;fp=lib%2FPublicInbox%2FLeiExtinbox.pm;h=0378551a9d97cc3706df8f9f7dc3fb77e9053ab7;hb=0d649fc15eab07976344a6ae32a946b2b1c32f4f;hp=c2de773535f2eb2169dfd39db722a9ff0ce5b554;hpb=73b40ff62a7ab305443a9fb81b16d2b10b15bf60;p=public-inbox.git
diff --git a/lib/PublicInbox/LeiExtinbox.pm b/lib/PublicInbox/LeiExternal.pm
similarity index 75%
rename from lib/PublicInbox/LeiExtinbox.pm
rename to lib/PublicInbox/LeiExternal.pm
index c2de7735..0378551a 100644
--- a/lib/PublicInbox/LeiExtinbox.pm
+++ b/lib/PublicInbox/LeiExternal.pm
@@ -1,22 +1,22 @@
# Copyright (C) 2020 all contributors
# License: AGPL-3.0+
-# *-extinbox commands of lei
-package PublicInbox::LeiExtinbox;
+# *-external commands of lei
+package PublicInbox::LeiExternal;
use strict;
use v5.10.1;
use parent qw(Exporter);
-our @EXPORT = qw(lei_ls_extinbox lei_add_extinbox lei_forget_extinbox);
+our @EXPORT = qw(lei_ls_external lei_add_external lei_forget_external);
-sub lei_ls_extinbox {
+sub lei_ls_external {
my ($self, @argv) = @_;
my $stor = $self->_lei_store(0);
my $cfg = $self->_lei_cfg(0);
my $out = $self->{1};
my ($OFS, $ORS) = $self->{opt}->{z} ? ("\0", "\0\0") : (" ", "\n");
my (%boost, @loc);
- for my $sec (grep(/\Aextinbox\./, @{$cfg->{-section_order}})) {
- my $loc = substr($sec, length('extinbox.'));
+ for my $sec (grep(/\Aexternal\./, @{$cfg->{-section_order}})) {
+ my $loc = substr($sec, length('external.'));
$boost{$loc} = $cfg->{"$sec.boost"};
push @loc, $loc;
}
@@ -28,14 +28,14 @@ sub lei_ls_extinbox {
}
}
-sub lei_add_extinbox {
+sub lei_add_external {
my ($self, $url_or_dir) = @_;
my $cfg = $self->_lei_cfg(1);
if ($url_or_dir !~ m!\Ahttps?://!) {
$url_or_dir = File::Spec->canonpath($url_or_dir);
}
my $new_boost = $self->{opt}->{boost} // 0;
- my $key = "extinbox.$url_or_dir.boost";
+ my $key = "external.$url_or_dir.boost";
my $cur_boost = $cfg->{$key};
return if defined($cur_boost) && $cur_boost == $new_boost; # idempotent
$self->lei_config($key, $new_boost);
@@ -44,7 +44,7 @@ sub lei_add_extinbox {
$stor->done;
}
-sub lei_forget_extinbox {
+sub lei_forget_external {
# TODO
}