[packages/php-composer-semver] add versionparser patch from pld satis package
glen
glen at pld-linux.org
Wed Jan 6 20:26:55 CET 2016
commit 0b295137450b68e50e11dfd5b284538e8996448a
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Wed Jan 6 21:25:50 2016 +0200
add versionparser patch from pld satis package
https://github.com/composer/satis/issues/162
php-composer-semver.spec | 4 +++-
versionparser.patch | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/php-composer-semver.spec b/php-composer-semver.spec
index d6acdc7..5b73e37 100644
--- a/php-composer-semver.spec
+++ b/php-composer-semver.spec
@@ -2,11 +2,12 @@
Summary: Semver library that offers utilities, version constraint parsing and validation
Name: php-composer-%{pkgname}
Version: 1.2.0
-Release: 1
+Release: 2
License: MIT
Group: Development/Libraries
Source0: https://github.com/composer/semver/archive/%{version}/%{pkgname}-%{version}.tar.gz
# Source0-md5: 15db3e70b343cf509a3a2f0a0688a52c
+Patch0: versionparser.patch
URL: https://github.com/composer/semver
Requires: php(core) >= 5.3.2
Requires: php(pcre)
@@ -23,6 +24,7 @@ made available as a stand-alone library.
%prep
%setup -q -n %{pkgname}-%{version}
+%patch0 -p7 -d src
%install
rm -rf $RPM_BUILD_ROOT
diff --git a/versionparser.patch b/versionparser.patch
new file mode 100644
index 0000000..4eab141
--- /dev/null
+++ b/versionparser.patch
@@ -0,0 +1,16 @@
+parse rpm-like tags: 1.2-3
+
+--- vendor/composer/composer/src/Composer/Package/Version/VersionParser.php~ 2015-04-28 09:19:17.000000000 +0300
++++ vendor/composer/composer/src/Composer/Package/Version/VersionParser.php 2015-04-28 09:19:19.020725756 +0300
+@@ -117,6 +117,11 @@
+ return 'dev-'.substr($version, 4);
+ }
+
++ // XXX: convert 1.2-3 to 1.2-p3
++ if (preg_match('/^(\d+[\d.]+)-(\d+)$/', $version, $m)) {
++ $version = "{$m[1]}-p{$m[2]}";
++ }
++
+ // match classical versioning
+ if (preg_match('{^v?(\d{1,3})(\.\d+)?(\.\d+)?(\.\d+)?'.self::$modifierRegex.'$}i', $version, $matches)) {
+ $version = $matches[1]
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-composer-semver.git/commitdiff/0b295137450b68e50e11dfd5b284538e8996448a
More information about the pld-cvs-commit
mailing list