-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+
+# git-credential wrapper with built-in .netrc fallback
package PublicInbox::GitCredential;
-use strict;
+use v5.12;
use PublicInbox::Spawn qw(popen_rd);
sub run ($$;$) {
my $out = '';
for my $k (qw(url protocol host username password)) {
- defined(my $v = $self->{$k}) or next;
+ my $v = $self->{$k} // next;
die "`$k' contains `\\n' or `\\0'\n" if $v =~ /[\n\0]/;
$out .= "$k=$v\n";
}
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# wrap Net::NNTP client with SOCKS support
package PublicInbox::NetNNTPSocks;
-use strict;
-use v5.10.1;
+use v5.12;
use Net::NNTP;
our %OPT;
our @ISA = qw(IO::Socket::Socks);
# common reader code for IMAP and NNTP (and maybe JMAP)
package PublicInbox::NetReader;
-use strict;
-use v5.10.1;
+use v5.12;
use parent qw(Exporter PublicInbox::IPC);
use PublicInbox::Eml;
use PublicInbox::Config;
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# common writer code for IMAP (and later, JMAP)
package PublicInbox::NetWriter;
-use strict;
-use v5.10.1;
+use v5.12;
use parent qw(PublicInbox::NetReader);
use PublicInbox::Smsg;
use PublicInbox::MsgTime qw(msg_timestamp);
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# cf. RFC 5092, which the `URI' package doesn't support
#
#
# RFC 2192 also describes ";TYPE=<list_type>"
package PublicInbox::URIimap;
-use strict;
-use v5.10.1;
+use v5.12;
use URI::Split qw(uri_split uri_join); # part of URI
use URI::Escape qw(uri_unescape uri_escape);
use overload '""' => \&as_string;
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# deal with the lack of URI::nntps in upstream URI.
# cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983419
# Fixed in URI 5.08, we can drop this by 2035 when LTS distros all have it
package PublicInbox::URInntps;
-use strict;
+use v5.12;
use parent qw(URI::snews);
use URI;