[pkg-nagios-changes] [Git][nagios-team/pkg-icingaweb2][master] 2 commits: Add upstream patches to support PHP 8.0

Bas Couwenberg gitlab at salsa.debian.org
Mon Dec 14 09:48:36 GMT 2020



Bas Couwenberg pushed to branch master at Debian Nagios Maintainer Group / pkg-icingaweb2


Commits:
72877f70 by Ondřej Surý at 2020-12-14T10:14:44+01:00
Add upstream patches to support PHP 8.0

- - - - -
d2decfe2 by Ondřej Surý at 2020-12-14T10:14:44+01:00
Update changelog for 2.8.2-2~1.gbpe5dd68 release

- - - - -


7 changed files:

- debian/changelog
- + debian/patches/0001-setup-ensure-not-to-pass-an-empty-array-to-max.patch
- + debian/patches/0002-downtimestarthistoryQuery-joinBaseTables-don-t-call-.patch
- + debian/patches/0003-ApplicationBootstrap-setupErrorHandling-migrate-erro.patch
- + debian/patches/0004-DashboardConfig-listConfigFilesForUser-silence-error.patch
- + debian/patches/0005-Version-getGitHead-silence-errors-from-file_get_cont.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,10 +1,16 @@
-icingaweb2 (2.8.2-2) UNRELEASED; urgency=medium
+icingaweb2 (2.8.2-2~1.gbpe5dd68) UNRELEASED; urgency=medium
 
+  ** SNAPSHOT build @e5dd68a9108f2856206176b8c6a7d01b93e84751 **
+
+  [ Bas Couwenberg ]
   * Team upload.
   * Bump watch file version to 4.
   * Bump Standards-Version to 4.5.1, no changes.
 
- -- Bas Couwenberg <sebastic at debian.org>  Fri, 06 Nov 2020 20:04:15 +0100
+  [ Ondřej Surý ]
+  * Add upstream patches to support PHP 8.0
+
+ -- Ondřej Surý <ondrej at debian.org>  Mon, 14 Dec 2020 10:08:04 +0100
 
 icingaweb2 (2.8.2-1) unstable; urgency=high
 


=====================================
debian/patches/0001-setup-ensure-not-to-pass-an-empty-array-to-max.patch
=====================================
@@ -0,0 +1,28 @@
+From: "Alexander A. Klimov" <alexander.klimov at icinga.com>
+Date: Wed, 2 Dec 2020 19:22:19 +0100
+Subject: /setup/: ensure not to pass an empty array to max()
+
+... as PHP 8 doesn't tolerate such.
+
+refs #4287
+---
+ modules/setup/application/views/scripts/index/index.phtml | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/setup/application/views/scripts/index/index.phtml b/modules/setup/application/views/scripts/index/index.phtml
+index b5fb407..f697458 100644
+--- a/modules/setup/application/views/scripts/index/index.phtml
++++ b/modules/setup/application/views/scripts/index/index.phtml
+@@ -9,10 +9,10 @@ $currentPos = array_search($wizard->getCurrentPage(), $pages, true);
+ list($configPagesLeft, $configPagesRight) = array_chunk($configPages, count($configPages) / 2, true);
+ 
+ $visitedPages = array_keys($wizard->getPageData());
+-$maxProgress = @max(array_keys(array_filter(
++$maxProgress = @max(array_merge([0], array_keys(array_filter(
+     $pages,
+     function ($page) use ($visitedPages) { return in_array($page->getName(), $visitedPages); }
+-)));
++))));
+ 
+ ?>
+ <div id="setup-content-wrapper" data-base-target="layout">


=====================================
debian/patches/0002-downtimestarthistoryQuery-joinBaseTables-don-t-call-.patch
=====================================
@@ -0,0 +1,39 @@
+From: "Alexander A. Klimov" <alexander.klimov at icinga.com>
+Date: Thu, 3 Dec 2020 19:42:19 +0100
+Subject: *downtimestarthistoryQuery#joinBaseTables(): don't call
+ func_get_arg() with an invalid index
+
+... as PHP 8 doesn't tolerate that.
+
+refs #4287
+---
+ .../Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php      | 2 +-
+ .../Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php
+index 831df6c..4b23428 100644
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php
+@@ -96,7 +96,7 @@ class HostdowntimestarthistoryQuery extends IdoQuery
+             array()
+         );
+ 
+-        if (@func_get_arg(0) === false) {
++        if (func_num_args() === 0 || @func_get_arg(0) === false) {
+             $this->select->where(
+                 "hdh.actual_start_time > '1970-01-02 00:00:00'"
+             );
+diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php
+index 6ed081e..fd4dfba 100644
+--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php
++++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php
+@@ -97,7 +97,7 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
+             array()
+         );
+ 
+-        if (@func_get_arg(0) === false) {
++        if (func_num_args() === 0 || @func_get_arg(0) === false) {
+             $this->select->where(
+                 "sdh.actual_start_time > '1970-01-02 00:00:00'"
+             );


=====================================
debian/patches/0003-ApplicationBootstrap-setupErrorHandling-migrate-erro.patch
=====================================
@@ -0,0 +1,26 @@
+From: "Alexander A. Klimov" <alexander.klimov at icinga.com>
+Date: Fri, 4 Dec 2020 12:15:13 +0100
+Subject: ApplicationBootstrap#setupErrorHandling(): migrate error handler to
+ PHP 8
+
+... as recommended here:
+https://www.php.net/manual/de/migration80.incompatible.php
+
+refs #4287
+---
+ library/Icinga/Application/ApplicationBootstrap.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php
+index f3d8c08..0e774fd 100644
+--- a/library/Icinga/Application/ApplicationBootstrap.php
++++ b/library/Icinga/Application/ApplicationBootstrap.php
+@@ -546,7 +546,7 @@ abstract class ApplicationBootstrap
+         ini_set('display_startup_errors', 1);
+         ini_set('display_errors', 1);
+         set_error_handler(function ($errno, $errstr, $errfile, $errline) {
+-            if (error_reporting() === 0) {
++            if (!(error_reporting() & $errno)) {
+                 // Error was suppressed with the @-operator
+                 return false; // Continue with the normal error handler
+             }


=====================================
debian/patches/0004-DashboardConfig-listConfigFilesForUser-silence-error.patch
=====================================
@@ -0,0 +1,48 @@
+From: "Alexander A. Klimov" <alexander.klimov at icinga.com>
+Date: Thu, 3 Dec 2020 19:31:53 +0100
+Subject: DashboardConfig::listConfigFilesForUser(): silence errors from
+ opendir()
+
+... which appeared with PHP 8.
+
+refs #4287
+---
+ library/Icinga/Legacy/DashboardConfig.php | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/library/Icinga/Legacy/DashboardConfig.php b/library/Icinga/Legacy/DashboardConfig.php
+index 3fb5c2f..cb9734b 100644
+--- a/library/Icinga/Legacy/DashboardConfig.php
++++ b/library/Icinga/Legacy/DashboardConfig.php
+@@ -3,6 +3,7 @@
+ 
+ namespace Icinga\Legacy;
+ 
++use Exception;
+ use Icinga\Application\Config;
+ use Icinga\User;
+ use Icinga\Web\Navigation\DashboardPane;
+@@ -60,7 +61,14 @@ class DashboardConfig extends Config
+     {
+         $files = array();
+         $dashboards = static::resolvePath('dashboards');
+-        if ($handle = @opendir($dashboards)) {
++
++        try {
++            $handle = @opendir($dashboards);
++        } catch (Exception $_) {
++            return [];
++        }
++
++        if ($handle) {
+             while (false !== ($entry = readdir($handle))) {
+                 if ($entry[0] === '.' || ! is_dir($dashboards . '/' . $entry)) {
+                     continue;
+@@ -71,6 +79,7 @@ class DashboardConfig extends Config
+             }
+             closedir($handle);
+         }
++
+         return $files;
+     }
+ 


=====================================
debian/patches/0005-Version-getGitHead-silence-errors-from-file_get_cont.patch
=====================================
@@ -0,0 +1,37 @@
+From: "Alexander A. Klimov" <alexander.klimov at icinga.com>
+Date: Fri, 4 Dec 2020 11:21:23 +0100
+Subject: Version::getGitHead(): silence errors from file_get_contents()
+
+... which appeared with PHP 8.
+
+refs #4287
+---
+ library/Icinga/Application/Version.php | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/library/Icinga/Application/Version.php b/library/Icinga/Application/Version.php
+index a863cd4..8410205 100644
+--- a/library/Icinga/Application/Version.php
++++ b/library/Icinga/Application/Version.php
+@@ -3,6 +3,8 @@
+ 
+ namespace Icinga\Application;
+ 
++use Exception;
++
+ /**
+  * Retrieve the version of Icinga Web 2
+  */
+@@ -47,7 +49,11 @@ class Version
+             $repo .= '/.git';
+         }
+ 
+-        $head = @file_get_contents($repo . '/HEAD');
++        try {
++            $head = @file_get_contents($repo . '/HEAD');
++        } catch (Exception $_) {
++            return false;
++        }
+ 
+         if ($head !== false) {
+             if (preg_match('/^ref: (.+)/', $head, $matches)) {


=====================================
debian/patches/series
=====================================
@@ -0,0 +1,5 @@
+0001-setup-ensure-not-to-pass-an-empty-array-to-max.patch
+0002-downtimestarthistoryQuery-joinBaseTables-don-t-call-.patch
+0003-ApplicationBootstrap-setupErrorHandling-migrate-erro.patch
+0004-DashboardConfig-listConfigFilesForUser-silence-error.patch
+0005-Version-getGitHead-silence-errors-from-file_get_cont.patch



View it on GitLab: https://salsa.debian.org/nagios-team/pkg-icingaweb2/-/compare/40bf8d3d93be518011b4afdf1da3d360aa927952...d2decfe27785fbc7ac49da60316c8519b661982b

-- 
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-icingaweb2/-/compare/40bf8d3d93be518011b4afdf1da3d360aa927952...d2decfe27785fbc7ac49da60316c8519b661982b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20201214/4584e4a9/attachment-0001.html>


More information about the pkg-nagios-changes mailing list