From 09511e9a197f0cf429590871cbc4def6658b35cf Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 5 Oct 2020 09:21:03 +0200 Subject: update to 2.19.0 --- php-bartlett-php-compatinfo-db-2.16-rpm.patch | 104 -------------------------- php-bartlett-php-compatinfo-db-2.19-rpm.patch | 95 +++++++++++++++++++++++ php-bartlett-php-compatinfo-db.spec | 10 ++- 3 files changed, 101 insertions(+), 108 deletions(-) delete mode 100644 php-bartlett-php-compatinfo-db-2.16-rpm.patch create mode 100644 php-bartlett-php-compatinfo-db-2.19-rpm.patch diff --git a/php-bartlett-php-compatinfo-db-2.16-rpm.patch b/php-bartlett-php-compatinfo-db-2.16-rpm.patch deleted file mode 100644 index f9a67e1..0000000 --- a/php-bartlett-php-compatinfo-db-2.16-rpm.patch +++ /dev/null @@ -1,104 +0,0 @@ -diff -up ./bin/compatinfo-db.rpm ./bin/compatinfo-db ---- ./bin/compatinfo-db.rpm 2020-07-11 10:24:45.000000000 +0200 -+++ ./bin/compatinfo-db 2020-07-13 11:22:01.041329662 +0200 -@@ -7,10 +7,7 @@ declare(strict_types=1); - gc_disable(); // performance boost - - $possibleAutoloadPaths = [ -- // local dev repository -- __DIR__ . '/../vendor/autoload.php', -- // dependency -- __DIR__ . '/../../../../vendor/autoload.php', -+ '/usr/share/php/Bartlett/CompatInfoDb/autoload.php', - ]; - - $isAutoloadFound = false; -diff -up ./src/DatabaseFactory.php.rpm ./src/DatabaseFactory.php ---- ./src/DatabaseFactory.php.rpm 2020-07-11 10:24:45.000000000 +0200 -+++ ./src/DatabaseFactory.php 2020-07-13 11:22:01.041329662 +0200 -@@ -35,14 +35,13 @@ class DatabaseFactory - - private static function getSqliteDsn() : array - { -- if (PATH_SEPARATOR == ';') { -- // windows -- $userHome = getenv('USERPROFILE'); -+ if (($db = getenv('BARTLETT_COMPATINFO_DB')) && file_exists($db)) { -+ static::$tempDir = dirname($db); -+ } else if (file_exists($db = '/usr/share/php-bartlett-php-compatinfo-db/' . static::$database)) { -+ static::$tempDir = dirname($db); - } else { -- // unix -- $userHome = getenv('HOME'); -- } -- static::$tempDir = $userHome . '/.bartlett'; -+ static::$tempDir = dirname(dirname(dirname(__DIR__))) . '/data'; -+ } - - return [ - 'driver' => 'pdo_sqlite', -@@ -58,19 +57,6 @@ class DatabaseFactory - { - $dbParams = self::getSqliteDsn(); - -- if (!file_exists(static::$tempDir)) { -- mkdir(static::$tempDir); -- } -- $source = dirname(__DIR__) . '/data/' . static::$database; -- $dest = static::$tempDir . '/' . static::$database; -- -- if (!file_exists($dest) -- || sha1_file($source) !== sha1_file($dest) -- ) { -- // install DB only if necessary (missing or modified) -- copy($source, $dest); -- } -- - return new PDO($dbParams['url']); - } --} -\ Pas de fin de ligne à la fin du fichier -+} -diff -up ./src/Presentation/Console/Application.php.rpm ./src/Presentation/Console/Application.php ---- ./src/Presentation/Console/Application.php.rpm 2020-07-13 11:22:01.041329662 +0200 -+++ ./src/Presentation/Console/Application.php 2020-07-13 11:32:58.975441852 +0200 -@@ -13,8 +13,6 @@ use Bartlett\CompatInfoDb\Presentation\C - use Bartlett\CompatInfoDb\Presentation\Console\Command\ReleaseCommand; - use Bartlett\CompatInfoDb\Presentation\Console\Command\ShowCommand; - --use PackageVersions\Versions; -- - use Psr\Container\ContainerInterface; - - use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; -@@ -30,7 +28,7 @@ use PDO; - class Application extends \Symfony\Component\Console\Application - { - public const NAME = 'Database handler for CompatInfo'; -- public const VERSION = '2.x-dev'; -+ public const VERSION = '@VERSION@'; - - /** @var string */ - private $baseDir; -@@ -40,20 +38,7 @@ class Application extends \Symfony\Compo - - public function __construct(ContainerInterface $container, string $version = 'UNKNOWN') - { -- if ('UNKNOWN' === $version) { -- // composer or git outside world strategy -- $version = self::VERSION; -- } elseif (substr_count($version, '.') === 2) { -- // release is in X.Y.Z format -- } else { -- // composer or git strategy -- $version = Versions::getVersion('bartlett/php-compatinfo-db'); -- list($ver, ) = explode('@', $version); -- -- if (strpos($ver, 'dev') === false) { -- $version = $ver; -- } -- } -+ $version = self::VERSION; - parent::__construct(self::NAME, $version); - - $this->container = $container; diff --git a/php-bartlett-php-compatinfo-db-2.19-rpm.patch b/php-bartlett-php-compatinfo-db-2.19-rpm.patch new file mode 100644 index 0000000..1d1d2f5 --- /dev/null +++ b/php-bartlett-php-compatinfo-db-2.19-rpm.patch @@ -0,0 +1,95 @@ +diff -up ./bin/compatinfo-db.rpm ./bin/compatinfo-db +--- ./bin/compatinfo-db.rpm 2020-07-11 10:24:45.000000000 +0200 ++++ ./bin/compatinfo-db 2020-07-13 11:22:01.041329662 +0200 +@@ -7,10 +7,7 @@ declare(strict_types=1); + gc_disable(); // performance boost + + $possibleAutoloadPaths = [ +- // local dev repository +- __DIR__ . '/../vendor/autoload.php', +- // dependency +- __DIR__ . '/../../../../vendor/autoload.php', ++ '/usr/share/php/Bartlett/CompatInfoDb/autoload.php', + ]; + + $isAutoloadFound = false; +diff -up ./src/DatabaseFactory.php.rpm ./src/DatabaseFactory.php +--- ./src/DatabaseFactory.php.rpm 2020-07-11 10:24:45.000000000 +0200 ++++ ./src/DatabaseFactory.php 2020-07-13 11:22:01.041329662 +0200 +@@ -35,14 +35,13 @@ class DatabaseFactory + + private static function getSqliteDsn() : array + { +- if (PATH_SEPARATOR == ';') { +- // windows +- $userHome = getenv('USERPROFILE'); ++ if (($db = getenv('BARTLETT_COMPATINFO_DB')) && file_exists($db)) { ++ static::$tempDir = dirname($db); ++ } else if (file_exists($db = '/usr/share/php-bartlett-php-compatinfo-db/' . static::$database)) { ++ static::$tempDir = dirname($db); + } else { +- // unix +- $userHome = getenv('HOME'); +- } +- static::$tempDir = $userHome . '/.bartlett'; ++ static::$tempDir = dirname(dirname(dirname(__DIR__))) . '/data'; ++ } + + return [ + 'driver' => 'pdo_sqlite', +@@ -58,19 +57,6 @@ class DatabaseFactory + { + $dbParams = self::getSqliteDsn(); + +- if (!file_exists(static::$tempDir)) { +- mkdir(static::$tempDir); +- } +- $source = dirname(__DIR__) . '/data/' . static::$database; +- $dest = static::$tempDir . '/' . static::$database; +- +- if (!file_exists($dest) +- || sha1_file($source) !== sha1_file($dest) +- ) { +- // install DB only if necessary (missing or modified) +- copy($source, $dest); +- } +- + return new PDO($dbParams['url']); + } +-} +\ Pas de fin de ligne à la fin du fichier ++} +diff -up ./src/Presentation/Console/Application.php.rpm ./src/Presentation/Console/Application.php +--- ./src/Presentation/Console/Application.php.rpm 2020-07-13 11:22:01.041329662 +0200 ++++ ./src/Presentation/Console/Application.php 2020-07-13 11:32:58.975441852 +0200 +@@ -13,8 +13,6 @@ use Bartlett\CompatInfoDb\Presentation\C + use Bartlett\CompatInfoDb\Presentation\Console\Command\ReleaseCommand; + use Bartlett\CompatInfoDb\Presentation\Console\Command\ShowCommand; + +-use PackageVersions\Versions; +- + use Psr\Container\ContainerInterface; + + use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; +@@ -40,20 +38,7 @@ class Application extends \Symfony\Compo + + public function __construct(ContainerInterface $container, string $version = 'UNKNOWN') + { +- if ('UNKNOWN' === $version) { +- // composer or git outside world strategy +- $version = self::VERSION; +- } elseif (substr_count($version, '.') === 2) { +- // release is in X.Y.Z format +- } else { +- // composer or git strategy +- $version = Versions::getVersion('bartlett/php-compatinfo-db'); +- list($ver, ) = explode('@', $version); +- +- if (strpos($ver, 'dev') === false) { +- $version = $ver; +- } +- } ++ $version = self::VERSION; + parent::__construct(self::NAME, $version); + + $this->container = $container; diff --git a/php-bartlett-php-compatinfo-db.spec b/php-bartlett-php-compatinfo-db.spec index 94fa9d4..de8629f 100644 --- a/php-bartlett-php-compatinfo-db.spec +++ b/php-bartlett-php-compatinfo-db.spec @@ -7,12 +7,12 @@ # Please, preserve the changelog entries # # See https://github.com/llaville/php-compatinfo-db/releases -%global gh_commit da956e8c1d845a6710310e9a619ca549ba39ed83 +%global gh_commit 4bc78f3103014c65f598162055838a1abee939fe %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20151031 %global gh_owner llaville %global gh_project php-compatinfo-db -%global upstream_version 2.18.0 +%global upstream_version 2.19.0 #global upstream_prever RC1 # Namespace %global ns_vendor Bartlett @@ -41,7 +41,7 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # Fix autoloader path # Fix sqlite database path # Fix version and avoir composer/package-versions-deprecated (relying on composer.lock) -Patch0: %{name}-2.16-rpm.patch +Patch0: %{name}-2.19-rpm.patch # CURL_SSLVERSION constants have been backported Patch1: %{name}-curltls.patch @@ -165,7 +165,6 @@ require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; EOF # Use package version -sed -e 's/@VERSION@/%{upstream_version}%{?upstream_prever}/' -i src/Presentation/Console/Application.php grep "%{version}" src/Presentation/Console/Application.php # Cleanup patched files @@ -272,6 +271,9 @@ exit $ret %changelog +* Mon Oct 5 2020 Remi Collet - 2.19.0-1 +- update to 2.19.0 + * Mon Sep 14 2020 Remi Collet - 2.18.0-1 - update to 2.18.0 -- cgit