]> git.pld-linux.org Git - packages/satis.git/commitdiff
parse rpm-like tags: 1.2-3
authorElan Ruusamäe <glen@delfi.ee>
Tue, 28 Apr 2015 06:23:13 +0000 (09:23 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 28 Apr 2015 06:23:13 +0000 (09:23 +0300)
satis.spec
versionparser.patch [new file with mode: 0644]

index 6c19af47aac0707e2466ee36bd1c3575967e88f8..21da5f59ec7319d7b25b9216608d2b32f0a83271 100644 (file)
@@ -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 (file)
index 0000000..4eab141
--- /dev/null
@@ -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]
This page took 0.082929 seconds and 4 git commands to generate.