Added saving of updatelog

This commit is contained in:
2019-08-24 15:29:39 +02:00
parent c0010b0970
commit 9bf8c2bc5e
2 changed files with 19 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env perl
package pcurse;
use strict;
no warnings 'all';
use DateTime;
use IO::Socket::SSL;
use Getopt::Long;
use Archive::Extract;
@ -348,4 +348,16 @@ sub init_pool {
return $p;
}
sub updatelog {
my $now = DateTime->now->iso8601();
my $addon_name = shift;
my $addon_oldv = shift;
my $addon_newv = shift;
my $filename = $ENV{'HOME'}.'/.pcurse/update.log';
open my $fh, '>>', $filename, or return { retval => 0, message => 'Could not open '.$filename.' for appending' };
print $fh $now.': '.$addon_name.': '.$addon_oldv.' => '.$addon_newv."\n";
close $fh;
return { retval => 1 }
}
1;