From fa851ae5acb2b0ce06a2ae425f896ce7acb983c4 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 4 Jan 2017 22:42:05 +0100 Subject: [PATCH] Allow custom version to be passed on to makewheel when building with --wheel --- makepanda/makepanda.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 95dc6d791b..c96d188bcb 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -52,6 +52,7 @@ RUNTIME=0 DISTRIBUTOR="" VERSION=None DEBVERSION=None +WHLVERSION=None RPMRELEASE="1" GIT_COMMIT=None P3DSUFFIX=None @@ -163,7 +164,7 @@ def usage(problem): def parseopts(args): global INSTALLER,WHEEL,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL - global DEBVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION + global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER longopts = [ "help","distributor=","verbose","runtime","osxtarget=", @@ -206,8 +207,11 @@ def parseopts(args): elif (option=="--arch"): target_arch = value.strip() elif (option=="--nocolor"): DisableColors() elif (option=="--version"): - VERSION=value - if (len(VERSION.split(".")) != 3): raise Exception + match = re.match(r'^\d+\.\d+\.\d+', value) + if not match: + usage("version requires three digits") + WHLVERSION = value + VERSION = match.group() elif (option=="--lzma"): COMPRESSOR="lzma" elif (option=="--override"): AddOverride(value.strip()) elif (option=="--static"): SetLinkAllStatic(True) @@ -7257,7 +7261,7 @@ try: if WHEEL: ProgressOutput(100.0, "Building wheel") from makewheel import makewheel - makewheel(VERSION, GetOutputDir()) + makewheel(WHLVERSION, GetOutputDir()) finally: SaveDependencyCache()