Package: pkg-php-tools
Version: 1.9
Severity: normal
Tags: patch

The upcoming php-sabredav 1.9 version requires in composer.json:

        "sabre/http" : "~2.0.0-alpha5",

But the build fails since phppkginfo is not able to handle such version:

[pear_error: message="Unable to parse version (~2.0.0-alpha5)" code=0 
mode=return level=notice prefix="" info=""]

Please find attached a naive patch that fixes the issue. I didn’t
committed it directly since I’m not sure if it’s proper enough, and
because I’m not yet comfortable with Composer (anyway, alioth is down).

Thanks for taking care of pkg-php-tools, it really makes our lives
easier.

Regards

David

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 
'oldstable'), (100, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11-1-amd64 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pkg-php-tools depends on:
ii  debhelper  9.20131110
ii  php-pear   5.5.5+dfsg-1
ii  php5-cli   5.5.5+dfsg-1
ii  php5-json  1.3.2-2

pkg-php-tools recommends no packages.

Versions of packages pkg-php-tools suggests:
ii  dh-make  0.63

-- no debconf information
From b7d5c552e88690c7047f0b5843bed69503ddb5cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Pr=C3=A9vot?= <taf...@debian.org>
Date: Tue, 12 Nov 2013 23:24:43 -0400
Subject: [PATCH] Composer: handle alpha and other WIP releases

---
 lib/scripts/phppkginfo | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/scripts/phppkginfo b/lib/scripts/phppkginfo
index 3dcbe67..b28129e 100755
--- a/lib/scripts/phppkginfo
+++ b/lib/scripts/phppkginfo
@@ -370,15 +370,17 @@ function composerDebianVersion($pkg, $version, $link) {
 			'(>|>=|<|<=|!=|~)?'. # Operator
 			'\s*'. # Optional spaces
 			'v?(([\d*]+)(\.[\d*]+)?(\.[\d*]+)?(\.[\d*]+)?)'. # version
+			'-?(alpha\d*|a\d*|beta\d*|b\d*|rc\d*)?'. # wip
 			'(@(stable|RC|beta|alpha|dev))?'. # stability
 			'(\s+as +([^,\s]+))?$/', # "as ..."
 			$version, $match)
 	) {
 		$operator = isset($match[1]) ? $match[1] : NULL;
 		$short_version = isset($match[2]) ? $match[2] : NULL;
+		$short_version .= isset($match[7]) ? '~'.$match[7] : NULL;
 		$short_version_array = explode('.', $short_version);
-		$stability = isset($match[7]) ? $match[7] : NULL;
-		$as = isset($match[9]) ? $match[9] : NULL;
+		$stability = isset($match[8]) ? $match[8] : NULL;
+		$as = isset($match[10]) ? $match[10] : NULL;
 		switch($operator) {
 			case '':
 				if ($short_version == '*') {
-- 
1.8.4.3

Attachment: signature.asc
Description: Digital signature

Reply via email to