3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

Update version

This commit is contained in:
Pragmatic Software 2020-09-12 16:28:44 -07:00
parent 7c6359481a
commit 8947d0ca98
5 changed files with 8 additions and 27 deletions

View File

@ -713,24 +713,9 @@ sub split_args {
my $rest = '';
if ($preserve_quotes) {
# get from second half of args, which contains quotes
# and don't insert space before separators
my $sep = '';
my $last_quoted = 0;
foreach my $arg (@$args[@$args / 2 + $i .. @$args - 1]) {
if ($arg =~ m/^[,;)+!.?-]/ and $last_quoted) {
$sep = '';
} else {
$sep = ' ';
}
$rest .= $sep unless not length $rest;
$rest .= ' ' unless not length $rest;
$rest .= $arg;
if ($arg =~ /["']$/) {
$last_quoted = 1;
} else {
$last_quoted = 0;
}
}
} else {
$rest = join ' ', @$args[$i .. $max - 1];

View File

@ -9,6 +9,7 @@ use feature 'unicode_strings';
use Scalar::Util qw/openhandle/;
use File::Basename;
use File::Copy;
sub new {
my ($proto, %conf) = @_;
@ -51,16 +52,8 @@ sub rotate_log {
my ($self) = @_;
my $time = localtime $self->{start};
$time =~ s/\s+/_/g;
$self->log("Rotating log to $self->{logfile}-$time\n");
# logfile has to be closed first for maximum compatibility with `rename`
close LOGFILE;
rename $self->{logfile}, $self->{logfile} . '-' . $time;
# reopen renamed logfile to resume any needed logging
open LOGFILE, ">>$self->{logfile}-$time" or Carp::carp "Couldn't re-open logfile $self->{logfile}-$time: $!\n";
LOGFILE->autoflush(1) if openhandle * LOGFILE;
move($self->{logfile}, $self->{logfile} . '-' . $time);
}
1;

View File

@ -1818,6 +1818,7 @@ sub commit_message_history {
my $self = shift;
return if not $self->{dbh};
return if $self->{pbot}->{child}; # don't commit() as child of fork()
if ($self->{new_entries} > 0) {
# $self->{pbot}->{logger}->log("Commiting $self->{new_entries} messages to SQLite\n");

View File

@ -180,6 +180,8 @@ sub execute_process {
# child
close $reader;
$self->{pbot}->{child} = 1;
# don't quit the IRC client when the child dies
no warnings;
*PBot::IRC::Connection::DESTROY = sub { return; };

View File

@ -19,8 +19,8 @@ use LWP::UserAgent;
# These are set automatically by the misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 3911,
BUILD_DATE => "2020-09-03",
BUILD_REVISION => 3913,
BUILD_DATE => "2020-09-12",
};
sub initialize {