mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-17 13:40:13 +00:00
avoid warning about uninitialize values
And log a message to syslog when we update the package list.
This commit is contained in:
parent
c06e9cc8cf
commit
446f92178d
@ -119,6 +119,8 @@ my $pve_pkgstatus_fn = "/var/lib/pve-manager/pkgupdates";
|
|||||||
|
|
||||||
my $update_pve_pkgstatus = sub {
|
my $update_pve_pkgstatus = sub {
|
||||||
|
|
||||||
|
syslog('info', "update new package list: $pve_pkgstatus_fn");
|
||||||
|
|
||||||
my $pkglist = [];
|
my $pkglist = [];
|
||||||
|
|
||||||
my $cache = &$get_apt_cache();
|
my $cache = &$get_apt_cache();
|
||||||
@ -173,7 +175,7 @@ __PACKAGE__->register_method({
|
|||||||
my $st2 = File::stat::stat("/var/cache/apt/pkgcache.bin");
|
my $st2 = File::stat::stat("/var/cache/apt/pkgcache.bin");
|
||||||
my $st3 = File::stat::stat("/var/lib/dpkg/status");
|
my $st3 = File::stat::stat("/var/lib/dpkg/status");
|
||||||
|
|
||||||
if ($st2->mtime <= $st1->mtime && $st3->mtime <= $st1->mtime) {
|
if ($st2 && $st3 && $st2->mtime <= $st1->mtime && $st3->mtime <= $st1->mtime) {
|
||||||
my $data;
|
my $data;
|
||||||
eval {
|
eval {
|
||||||
my $jsonstr = PVE::Tools::file_get_contents($pve_pkgstatus_fn, 5*1024*1024);
|
my $jsonstr = PVE::Tools::file_get_contents($pve_pkgstatus_fn, 5*1024*1024);
|
||||||
|
Loading…
Reference in New Issue
Block a user