diff options
-rw-r--r-- | modules-available/minilinux/inc/minilinux.inc.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules-available/minilinux/inc/minilinux.inc.php b/modules-available/minilinux/inc/minilinux.inc.php index cbc797f2..512f678e 100644 --- a/modules-available/minilinux/inc/minilinux.inc.php +++ b/modules-available/minilinux/inc/minilinux.inc.php @@ -87,6 +87,15 @@ class MiniLinux private static function addBranches($sourceid, $systems) { + // Make a before-snapshot, so we can generate events for new versions for each branch + $newestPerBranch = []; + $versions = Database::queryAll("SELECT branchid, versionid, dateline + FROM minilinux_version + ORDER BY branchid ASC, dateline ASC"); + foreach ($versions as $ver) { + $newestPerBranch[$ver['branchid']] = $ver; + } + // foreach ($systems as $system) { if (!self::isValidIdPart($system['id'])) continue; @@ -118,6 +127,18 @@ class MiniLinux ]); } } + // Now, compare again + $versions = Database::queryAll("SELECT branchid, versionid, title, description, dateline + FROM minilinux_version + ORDER BY branchid ASC, dateline ASC"); + foreach ($versions as $ver) { + if (!isset($newestPerBranch[$ver['branchid']])) + continue; + if ($newestPerBranch[$ver['branchid']]['dateline'] < $ver['dateline']) { + // New version found :-) + EventLog::applyFilterRules('#netboot-new-version', $ver); + } + } } private static function addVersions($branchid, $versions) |