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

It seem like in bug #729452 it was missed to add support for versions
that have a '-dev' or '-patch' suffix. I came across this while trying
to use dh_phpcomposer to generate substvars for
symfony/proxy-manager-bridge (v2.3.16), which has the following in its
composer.json:

 "require": {
    "php": ">=5.3.3",
    "symfony/dependency-injection": "~2.3",
    "ocramius/proxy-manager": ">=0.3.1,<0.4-dev"
},

According to composer's documentation [1] '-patch' can be followed by an
optional number, while '-dev' can not.

The patch attached adds the missing support.

[1] https://getcomposer.org/doc/04-schema.md#version

From 109c2068e2c240cc711a5f919d7c0a56f1259e0c Mon Sep 17 00:00:00 2001
From: Daniel Beyer <d...@deb.ymc.ch>
Date: Tue, 8 Jul 2014 07:20:39 +0200
Subject: [PATCH] Allow phpcomposer to handle dev and patch releases

According to composer's documentation [1] '-patch' can be followed by an
optional number, while '-dev' can not.

[1] https://getcomposer.org/doc/04-schema.md#version
---
 lib/scripts/phppkginfo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/scripts/phppkginfo b/lib/scripts/phppkginfo
index 1f97965..23df1fa 100755
--- a/lib/scripts/phppkginfo
+++ b/lib/scripts/phppkginfo
@@ -365,7 +365,7 @@ function composerDebianVersion($pkg, $version, $link) {
 			'(>|>=|<|<=|!=|~)?'. # Operator
 			'\s*'. # Optional spaces
 			'v?(([\d*]+)(\.[\d*]+)?(\.[\d*]+)?(\.[\d*]+)?)'. # version
-			'-?((?i)alpha\d*|a\d*|beta\d*|b\d*|rc\d*(?-i))?'. # wip
+			'-?((?i)alpha\d*|a\d*|beta\d*|b\d*|dev|patch\d*|rc\d*(?-i))?'. # wip
 			'(@(stable|RC|beta|alpha|dev))?'. # stability
 			'(\s+as +([^,\s]+))?$/', # "as ..."
 			$version, $match)
-- 
1.9.1

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to