Agent: Packages fixes (+pacman) (#15415)

* Agent: Packages fixes
Don't try to save invalid packages, probably due to script failure on device.
Add pacman support

* Apply fixes from StyleCI

* Add version

* cast to number

* Update includes/polling/unix-agent/packages.inc.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
This commit is contained in:
Tony Murray
2023-10-08 18:37:33 -05:00
committed by GitHub
parent c87c6e8b8e
commit 14d9d66529
4 changed files with 43 additions and 2 deletions

View File

@@ -50,4 +50,9 @@ class Package extends DeviceRelatedModel implements Keyable
{
return $this->name . ' (' . $this->arch . ') version ' . $this->version . ($this->build ? "-$this->build" : '');
}
public function isValid(): bool
{
return $this->name && $this->manager && $this->arch && $this->version;
}
}