""" Vhex kernel uninstall script """ import os import sys from scripts.core.cmake import cmake_uninstall __all__ = [ 'uninstall_entry' ] __HELP__ = """ usage: vxdev uninstall [OPTIONS] ... uninstall script for the Vhex kernel Options: -h, --help display this message -v, --verbose display more information during the building process """ #--- # Public #--- def uninstall_entry(argv): """ uninstall entry """ if '-h' in argv or '--help' in argv: print(__HELP__) sys.exit(0) enable_verbose = False for arg in argv: if arg in ['-v', '--verbose']: enable_verbose = True continue print(f"unrecognized argument '{arg}'", file=sys.stderr) sys.exit(84) try: _ = os.environ['VXSDK_PREFIX_BUILD'] __ = os.environ['VXSDK_PREFIX_INSTALL'] except KeyError: print( "unable to generate the configuration file, you should use the " "vxSDK", file=sys.stderr ) sys.exit(84) return cmake_uninstall(os.environ['VXSDK_PREFIX_BUILD'], enable_verbose)