Package: pkg-php-tools
Version: 1.11
Severity: normal
Tags: patch
Control: affects -1 aws-sdk-for-php

Hi,

The upcoming aws-sdk-for-php version, that relies on composer, requires:

        "guzzle/guzzle": ">=3.7.0,<=3.9.9"

The current dh_phpcomposer chokes on it:

        [pear_error: message="Unable to parse version (>=3.7.0,<=3.9.9)" code=0 
mode=return level=notice prefix="" info=""]

and produces an awful version string:

        php-guzzle (ERROR:parsing ? >=3.7.0,<=3.9.9)

The attached patch fixes the issue. I’m not sure if I should commit
such non well tested (and potentially ugly) patch directly, please tell
me if you would feel comfortable with that (on the other hand, since I’m
using the #738690 and #738284 proposed patches for a while without
drawback, I just pushed the fixes).

Regards

David
From c8b0f5400c65ea61ed59370fd48df605cedee45a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Pr=C3=A9vot?= <taf...@debian.org>
Date: Sun, 27 Apr 2014 13:21:46 -0400
Subject: [PATCH] Composer: Handle multiple versions

---
 lib/scripts/phppkginfo | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/lib/scripts/phppkginfo b/lib/scripts/phppkginfo
index 59cad76..5d8fd8b 100755
--- a/lib/scripts/phppkginfo
+++ b/lib/scripts/phppkginfo
@@ -451,9 +451,20 @@ function composerDebianVersion($pkg, $version, $link) {
 function composerDebianDependencies($link, $infos) {
 	$ret = '';
 	foreach ($infos as $pkg => $version) {
-		$dep = composerDebianVersion($pkg, $version, $link);
-		if ($dep !== NULL) {
-			$ret.= $dep.', ';
+		if ((!preg_match ('/\s+as +[^,\s]+$/', $version)) and (strpos ($version, ','))) {
+			$versions = explode(',', $version);
+			foreach ($versions as $version) {
+				$dep = composerDebianVersion($pkg, $version, $link);
+				if ($dep !== NULL) {
+					$ret.= $dep.', ';
+				}
+			}
+		}
+		else {
+			$dep = composerDebianVersion($pkg, $version, $link);
+			if ($dep !== NULL) {
+				$ret.= $dep.', ';
+			}
 		}
 	}
 	return substr($ret, 0, -2);
-- 
2.0.0.rc0

Attachment: signature.asc
Description: Digital signature

Reply via email to