[pkg-php-pear] Bug#729452: [PATCH] Composer: handle alpha and other WIP releases

David Prévot taffit at debian.org
Tue Nov 26 19:36:05 UTC 2013


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

diff --git a/lib/scripts/phppkginfo b/lib/scripts/phppkginfo
index 8171f51..e257e1c 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 .= !empty($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.4



More information about the pkg-php-pear mailing list