Browse Source

Allow custom version to be passed on to makewheel when building with --wheel

rdb 9 years ago
parent
commit
fa851ae5ac
1 changed files with 8 additions and 4 deletions
  1. 8 4
      makepanda/makepanda.py

+ 8 - 4
makepanda/makepanda.py

@@ -52,6 +52,7 @@ RUNTIME=0
 DISTRIBUTOR=""
 DISTRIBUTOR=""
 VERSION=None
 VERSION=None
 DEBVERSION=None
 DEBVERSION=None
+WHLVERSION=None
 RPMRELEASE="1"
 RPMRELEASE="1"
 GIT_COMMIT=None
 GIT_COMMIT=None
 P3DSUFFIX=None
 P3DSUFFIX=None
@@ -163,7 +164,7 @@ def usage(problem):
 def parseopts(args):
 def parseopts(args):
     global INSTALLER,WHEEL,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
     global INSTALLER,WHEEL,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
     global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
     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
     global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
     longopts = [
     longopts = [
         "help","distributor=","verbose","runtime","osxtarget=",
         "help","distributor=","verbose","runtime","osxtarget=",
@@ -206,8 +207,11 @@ def parseopts(args):
             elif (option=="--arch"): target_arch = value.strip()
             elif (option=="--arch"): target_arch = value.strip()
             elif (option=="--nocolor"): DisableColors()
             elif (option=="--nocolor"): DisableColors()
             elif (option=="--version"):
             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=="--lzma"): COMPRESSOR="lzma"
             elif (option=="--override"): AddOverride(value.strip())
             elif (option=="--override"): AddOverride(value.strip())
             elif (option=="--static"): SetLinkAllStatic(True)
             elif (option=="--static"): SetLinkAllStatic(True)
@@ -7257,7 +7261,7 @@ try:
     if WHEEL:
     if WHEEL:
         ProgressOutput(100.0, "Building wheel")
         ProgressOutput(100.0, "Building wheel")
         from makewheel import makewheel
         from makewheel import makewheel
-        makewheel(VERSION, GetOutputDir())
+        makewheel(WHLVERSION, GetOutputDir())
 finally:
 finally:
     SaveDependencyCache()
     SaveDependencyCache()