Skip to content

Commit c277257

Browse files
committed
CXX-280 allow for rc versions
1 parent e3576be commit c277257

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

SConstruct

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,13 @@ if releaseBuild and (debugBuild or not optBuild):
300300
mongoclientVersion = "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+
312310
env = 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

Comments
 (0)