@@ -300,15 +300,13 @@ if releaseBuild and (debugBuild or not optBuild):
300300mongoclientVersion = "1.0.0-rc0-pre"
301301# We don't keep the -pre in the user testable version identifiers, because
302302# nobody should be conditioning on the pre-release status.
303- mongoclientVersionComponents = mongoclientVersion .split ('-' )
304- if len (mongoclientVersionComponents ) not in (1 ,2 ):
305- print ("Error: client version most be of the form w.x.y or w.x.y-string" )
306- Exit (1 )
307- mongoclientVersionComponents = mongoclientVersionComponents [0 ].split ('.' )
308- if len (mongoclientVersionComponents ) != 3 :
309- print ("Error: client version most be of the form w.x.y or w.x.y-string" )
303+ mongoclientVersionComponents = re .split (r'\.|-rc' , mongoclientVersion .partition ('-pre' )[0 ])
304+ if len (mongoclientVersionComponents ) not in (3 ,4 ):
305+ print ("Error: client version most be of the form w.x.y[-rcz][-string]" )
310306 Exit (1 )
311307
308+ mongoclientVersionRC = mongoclientVersionComponents [3 :][0 ]
309+
312310env = Environment ( BUILD_DIR = buildDir ,
313311 VARIANT_DIR = variantDir ,
314312 EXTRAPATH = get_option ("extrapath" ),
@@ -323,6 +321,7 @@ env = Environment( BUILD_DIR=buildDir,
323321 MONGOCLIENT_VERSION_MAJOR = mongoclientVersionComponents [0 ],
324322 MONGOCLIENT_VERSION_MINOR = mongoclientVersionComponents [1 ],
325323 MONGOCLIENT_VERSION_PATCH = mongoclientVersionComponents [2 ],
324+ MONGOCLIENT_VERSION_RC = mongoclientVersionRC ,
326325 INSTALL_DIR = get_option ("prefix" ),
327326 )
328327
0 commit comments