summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-03-06 10:14:37 +0100
committerRemi Collet <remi@php.net>2024-03-06 10:14:37 +0100
commitb22c25eaeb408f3c25e12b9ce196cf87ab836cb0 (patch)
treebe0b30f4feae50e4838de473899103685d059457
parenta25dcccdaf820a19e0c72f86c1b216a7da8213a9 (diff)
improve --check-version for RPM
-rw-r--r--phpunit8-rpm.patch42
-rw-r--r--phpunit8.spec5
2 files changed, 39 insertions, 8 deletions
diff --git a/phpunit8-rpm.patch b/phpunit8-rpm.patch
index 25cd8f0..700bc8a 100644
--- a/phpunit8-rpm.patch
+++ b/phpunit8-rpm.patch
@@ -1,6 +1,6 @@
diff -up ./phpunit.rpm ./phpunit
---- ./phpunit.rpm 2021-12-30 08:58:05.000000000 +0100
-+++ ./phpunit 2021-12-30 09:01:08.095425016 +0100
+--- ./phpunit.rpm 2024-03-06 09:33:13.000000000 +0100
++++ ./phpunit 2024-03-06 10:01:01.286282118 +0100
@@ -62,27 +62,11 @@ if (isset($GLOBALS['_composer_autoload_p
define('PHPUNIT_COMPOSER_INSTALL', $GLOBALS['_composer_autoload_path']);
@@ -48,10 +48,38 @@ diff -up ./phpunit.rpm ./phpunit
+ // PHPUnit v6 to v9
+ PHPUnit\TextUI\Command::main();
+}
+diff -up ./src/TextUI/Command.php.rpm ./src/TextUI/Command.php
+--- ./src/TextUI/Command.php.rpm 2024-03-06 10:01:47.658055200 +0100
++++ ./src/TextUI/Command.php 2024-03-06 10:07:26.195999614 +0100
+@@ -1144,7 +1144,7 @@ class Command
+ $this->printVersionString();
+
+ $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit');
+- $latestCompatibleVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit-' . explode('.', Version::series())[0]);
++ $latestCompatibleVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit-' . $major=explode('.', Version::series())[0]);
+
+ $notLatest = version_compare($latestVersion, Version::id(), '>');
+ $notLatestCompatible = version_compare($latestCompatibleVersion, Version::id(), '>');
+@@ -1161,6 +1161,7 @@ class Command
+ Version::id(),
+ $latestCompatibleVersion
+ );
++ printf('Try a system update for new phpunit%s package.' . PHP_EOL, $major);
+ }
+
+ if ($notLatest) {
+@@ -1168,6 +1169,7 @@ class Command
+ 'The latest version is PHPUnit %s.' . PHP_EOL,
+ $latestVersion
+ );
++ printf('Try to install and use the phpunit%s command.' . PHP_EOL, explode('.', $latestVersion)[0]);
+ }
+
+ exit(TestRunner::SUCCESS_EXIT);
diff -up ./src/Util/Configuration.php.rpm ./src/Util/Configuration.php
---- ./src/Util/Configuration.php.rpm 2021-12-30 08:58:05.000000000 +0100
-+++ ./src/Util/Configuration.php 2021-12-30 08:58:11.290733945 +0100
-@@ -929,7 +929,7 @@ final class Configuration
+--- ./src/Util/Configuration.php.rpm 2024-03-06 09:33:13.000000000 +0100
++++ ./src/Util/Configuration.php 2024-03-06 10:01:01.286282118 +0100
+@@ -932,7 +932,7 @@ final class Configuration
private function validateConfigurationAgainstSchema(): void
{
$original = libxml_use_internal_errors(true);
@@ -61,8 +89,8 @@ diff -up ./src/Util/Configuration.php.rpm ./src/Util/Configuration.php
if (defined('__PHPUNIT_PHAR_ROOT__')) {
$xsdFilename = __PHPUNIT_PHAR_ROOT__ . '/phpunit.xsd';
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
---- ./tests/bootstrap.php.rpm 2021-12-30 08:58:05.000000000 +0100
-+++ ./tests/bootstrap.php 2021-12-30 08:58:11.290733945 +0100
+--- ./tests/bootstrap.php.rpm 2024-03-06 09:33:13.000000000 +0100
++++ ./tests/bootstrap.php 2024-03-06 10:01:01.286282118 +0100
@@ -9,8 +9,8 @@
*/
const TEST_FILES_PATH = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR;
diff --git a/phpunit8.spec b/phpunit8.spec
index 8f0571f..f3aabcc 100644
--- a/phpunit8.spec
+++ b/phpunit8.spec
@@ -31,7 +31,7 @@
Name: %{pk_project}%{ver_major}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: The PHP Unit Testing framework version %{ver_major}
License: BSD-3-Clause
@@ -293,6 +293,9 @@ exit $ret
%changelog
+* Wed Mar 6 2024 Remi Collet <remi@remirepo.net> - 8.5.37-2
+- improve --check-version for RPM
+
* Wed Mar 6 2024 Remi Collet <remi@remirepo.net> - 8.5.37-1
- update to 8.5.37