[packages/satis] parse rpm-like tags: 1.2-3

glen glen at pld-linux.org
Tue Apr 28 08:23:34 CEST 2015


commit a923f5293e7aba6e3fa3d0ff3db1f6d2d64a427d
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Apr 28 09:23:13 2015 +0300

    parse rpm-like tags: 1.2-3

 satis.spec          |  5 ++++-
 versionparser.patch | 16 ++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/satis.spec b/satis.spec
index 6c19af4..21da5f5 100644
--- a/satis.spec
+++ b/satis.spec
@@ -1,5 +1,5 @@
 %define		subver	alpha1
-%define		rel		0.1
+%define		rel		0.2
 %define		php_min_version 5.3.4
 %include	/usr/lib/rpm/macros.php
 Summary:	Package Repository Generator
@@ -10,6 +10,7 @@ License:	MIT
 Group:		Development/Languages/PHP
 Source0:	https://github.com/composer/satis/archive/%{version}-%{subver}/%{name}-%{version}%{subver}.tar.gz
 # Source0-md5:	708ebffa7b7053ed19f65c470d8c1966
+Patch0:		versionparser.patch
 URL:		https://github.com/composer/satis
 BuildRequires:	composer
 BuildRequires:	rpm-php-pearprov >= 4.4.2-11
@@ -48,6 +49,8 @@ mv %{name}-*/* .
 COMPOSER_HOME=${PWD:-$(pwd)} \
 composer install --prefer-dist --no-dev -v
 
+%patch0 -p0
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
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/satis.git/commitdiff/a923f5293e7aba6e3fa3d0ff3db1f6d2d64a427d



More information about the pld-cvs-commit mailing list