@@ -95,15 +95,21 @@ def get_version_from_string(self, version):
9595
9696 @param version: The version you want
9797 @type version: str
98- @return: A tuple containing ('PS_VERSION', 'BRANCH_VERSION', (PHP_VERSIONS), 'CONTAINER_TYPE')
99- or ('PS_VERSION', 'BRANCH_VERSION', 'PHP_VERSION', 'CONTAINER_TYPE')
98+ @return: A tuple containing ('PS_VERSION', 'BRANCH_VERSION', (PHP_VERSIONS), 'CONTAINER_TYPE', 'FLAVOR_VERSION' )
99+ or ('PS_VERSION', 'BRANCH_VERSION', 'PHP_VERSION', 'CONTAINER_TYPE', 'FLAVOR_VERSION' )
100100 @rtype: tuple
101101 '''
102102 matches = self .parse_version_from_string (version )
103103 if not matches :
104104 return None
105105
106106 ps_version = matches .group ('version' )
107+
108+ flavor_versions = None
109+ if matches .group ('flavor' ):
110+ flavor_versions = matches .group ('flavor' )
111+ ps_version = ps_version + '-' + flavor_versions
112+
107113 if matches .group ('php' ):
108114 php_versions = (matches .group ('php' ),)
109115 else :
@@ -140,7 +146,8 @@ def get_version_from_string(self, version):
140146 'ps_version' : ps_version ,
141147 'branch_version' : branch_version ,
142148 'php_versions' : php_versions ,
143- 'container_version' : container_version
149+ 'container_version' : container_version ,
150+ 'flavor_versions' : flavor_versions
144151 }
145152
146153 def get_last_patch_from_version (self , version ):
@@ -201,7 +208,7 @@ def parse_version_from_string(self, version):
201208 @return: Return None if no position in the string matches the pattern otherwise a Match object.
202209 @rtpe: None|Match
203210 '''
204- regex = r"^(?P<version>(?:[0-9]+\.){0,3}(?:[0-9]+|nightly|x)(?:-(?:alpha|beta|rc)(?:\.\d+)?(?:\+\d+)?)?)(?:-(?P<php>\d+\.\d+))?(?:-(?P<container>fpm|apache))?$"
211+ regex = r"^(?P<version>(?:[0-9]+\.){0,3}(?:[0-9]+|nightly|x)(?:-(?:alpha|beta|rc)(?:\.\d+)?(?:\+\d+)?)?)(?:-(?P<flavor>classic))?(?:-(?P< php>\d+\.\d+))?(?:-(?P<container>fpm|apache))?$"
205212 return re .search (regex , version )
206213
207214 def get_aliases (self ):
0 commit comments