From b674104c1f59613ef23d6d41c9dd3ecbd0be347b Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 9 Dec 2018 15:53:40 +0100 Subject: [PATCH] makepanda: don't error for harmless use of removed options Let's show a warning when an option has been removed but its presence would not have affected the build in an important way. For options like --use-awesomium we should still show an error since it invokes behavior we no longer support, but it should be harmless to specify --no-awesomium. --- makepanda/makepanda.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index ff6787f987..4ee16763a3 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -171,14 +171,22 @@ def parseopts(args): global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER + + # Options for which to display a deprecation warning. + removedopts = [ + "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts", + ] + + # All recognized options. longopts = [ "help","distributor=","verbose","runtime","osxtarget=","tests", "optimize=","everything","nothing","installer","wheel","rtdist","nocolor", "version=","lzma","no-python","threads=","outputdir=","override=", "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=", "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl", - "universal", "target=", "arch=", "git-commit=", "no-directscripts", - "use-touchinput", "no-touchinput"] + "universal", "target=", "arch=", "git-commit=", + ] + removedopts + anything = 0 optimize = "" target = None @@ -190,6 +198,7 @@ def parseopts(args): longopts.append("no-" + pkg.lower()) longopts.append(pkg.lower() + "-incdir=") longopts.append(pkg.lower() + "-libdir=") + try: opts, extras = getopt.getopt(args, "", longopts) for option, value in opts: @@ -230,7 +239,6 @@ def parseopts(args): # Backward compatibility, OPENGL was renamed to GL elif (option=="--use-opengl"): PkgEnable("GL") elif (option=="--no-opengl"): PkgDisable("GL") - elif (option=="--no-directscripts"): pass elif (option=="--directx-sdk"): STRDXSDKVERSION = value.strip().lower() if STRDXSDKVERSION == '': @@ -242,6 +250,8 @@ def parseopts(args): MSVC_VERSION = value.strip().lower() elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True elif (option=="--clean"): clean_build = True + elif (option[2:] in removedopts): + Warn("Ignoring removed option %s" % (option)) else: for pkg in PkgListGet(): if option == "--use-" + pkg.lower():