From 0ab1bb4867a95dc620752e413f62d972b81f7bce Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Tue, 30 Oct 2007 10:45:54 +0000
Subject: [PATCH] It seems that sometimes required versions are specified
 without parentheses... Which is the right format? For now, support both.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17291 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Tool/TemplateTool.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/Tool/TemplateTool.py b/product/ERP5/Tool/TemplateTool.py
index b4011dcbd3..3f8e6c1d4d 100644
--- a/product/ERP5/Tool/TemplateTool.py
+++ b/product/ERP5/Tool/TemplateTool.py
@@ -688,8 +688,10 @@ class TemplateTool (BaseTool):
                 dependency = dependency_couple_list[0]
                 version_restriction = None
                 if len(dependency_couple_list) > 1:
-                  # remove parenthesis to get something like ">= O.2"
-                  version_restriction = dependency_couple_list[1][1:-1]
+                  version_restriction = dependency_couple_list[1]
+                  if version_restriction.startswith('('):
+                    # Something like "(>= 1.0rc6)".
+                    version_restriction = version_restriction[1:-1]
                 require_update = False
                 installed_bt = self.portal_templates.getInstalledBusinessTemplate(dependency)
                 if version_restriction is not None:
-- 
2.30.9