* [PATCH 3/4] import_slrnspool: load private config key
2015-01-12 2:30 6% [PATCH 0/4] misc import_slrnspool improvements Eric Wong
@ 2015-01-12 2:30 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-01-12 2:30 UTC (permalink / raw)
To: meta
PublicInbox::Config->lookup won't return unknown keys
---
scripts/import_slrnspool | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/scripts/import_slrnspool b/scripts/import_slrnspool
index d95836d..e55c96c 100755
--- a/scripts/import_slrnspool
+++ b/scripts/import_slrnspool
@@ -31,16 +31,28 @@ if ($ENV{'FILTER'}) {
@mda = (qw(ssoma-mda -1), $cfg->{mainrepo});
}
-sub get_min {
+sub key {
my ($cfg) = @_;
- $cfg->{importslrnspoolstate} || 0;
+ "publicinbox.$cfg->{listname}.importslrnspoolstate";
+}
+
+sub get_min {
+ my $f = PublicInbox::Config->default_file;
+ my @cmd = (qw/git config/, "--file=$f", key($cfg));
+ use IPC::Run qw/run/;
+
+ my $in = '';
+ my $out = '';
+ unless (run(\@cmd, \$in, \$out)) {
+ $out = 0;
+ }
+ int($out);
}
sub set_min {
my ($cfg, $num) = @_;
my $f = PublicInbox::Config->default_file;
- my @cmd = (qw/git config/, "--file=$f",
- "publicinbox.$cfg->{listname}.importslrnspoolstate", $num);
+ my @cmd = (qw/git config/, "--file=$f", key($cfg), $num);
system(@cmd) == 0 or die join(' ', @cmd). " failed: $?\n";
}
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] misc import_slrnspool improvements
@ 2015-01-12 2:30 6% Eric Wong
2015-01-12 2:30 7% ` [PATCH 3/4] import_slrnspool: load private config key Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-01-12 2:30 UTC (permalink / raw)
To: meta
Eric Wong (4):
import_slrnspool: make filtering optional
import_slrnspool: graceful exit for interruptibility
import_slrnspool: load private config key
import_slrnspool: fork a process for each message
scripts/import_slrnspool | 79 ++++++++++++++++++++++++++++++++++--------------
1 file changed, 57 insertions(+), 22 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-01-12 2:30 6% [PATCH 0/4] misc import_slrnspool improvements Eric Wong
2015-01-12 2:30 7% ` [PATCH 3/4] import_slrnspool: load private config key Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).