a  ze @s@dZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl mZmZmZmZmZmZddlmZdd lmZdd lmZd d lmZeeZdd dee eee ee eeefdddZ!d ee eeeee eeedddZ"edddZ#edddZ$edddZ%eeeefdddZ&dS)!z7Locations where we look for configs, install stuff, etcN)Command) SCHEME_KEYS)installget_python_lib)DictListOptionalTupleUnioncast)Scheme)WINDOWS)running_under_virtualenv)get_major_minor_versionF)ignore_config_files) dist_nameuserhomerootisolatedprefixrreturnc Csddlm}d|i}|r"dg|d<||} |srz | Wn6typ| } tdddd | DYn0d } | jd d d } | d usJt t | } |r|rJd|d||r|rJd|d||p| j | _ |s|rd| _ |p| j | _ |p| j | _ |p| j| _| i} tD]}t| d|| |<q$d| d vrd| t| j| jdtr|rx|}n|r| j}n| j }tj|dddt|| d<|d urtjtj| dd}tj||dd | d<| S)z+ Return a distutils install scheme r) Distributionnamez --no-user-cfg script_argsz6Ignore distutils configs in %s due to encoding errors.z, css|]}tj|VqdS)N)ospathbasename).0pr"d/opt/bitninja-python-dojo/embedded/lib/python3.9/site-packages/pip/_internal/locations/_distutils.py 4z#distutils_scheme..NrT)createzuser=z prefix=zhome=install_ install_lib)purelibplatlibincludesitepythonheadersr)distutils.distrparse_config_filesUnicodeDecodeErrorfind_config_filesloggerwarningjoinget_command_objr distutils_install_commandrrrrfinalize_optionsrgetattrget_option_dictupdatedictr)rinstall_userbaserrr splitdriveabspath)rrrrrrrr dist_argsdpathsobjischemekey path_no_driver"r"r#distutils_schemesb           rI)rrrrrrrcCs8t||||||}t|d|d|d|d|ddS)a; Get the "scheme" corresponding to the input parameters. The distutils documentation provides the context for the available schemes: https://docs.python.org/3/install/index.html#alternate-installation :param dist_name: the name of the package to retrieve the scheme for, used in the headers scheme path :param user: indicates to use the "user" scheme :param home: indicates to use the "home" scheme and provides the base directory for the same :param root: root under which other directories are re-based :param isolated: equivalent to --no-user-cfg, i.e. do not consider ~/.pydistutils.cfg (posix) or ~/pydistutils.cfg (non-posix) for scheme paths :param prefix: indicates to use the "prefix" scheme and provides the base directory for the same r+r*r/scriptsdata)r+r*r/rJrK)rIr )rrrrrrrFr"r"r# get_schemeisrL)rcCsrtjtj}tr>tj|d}tj|s:tj|d}|Stjdddkrd|dddkrddStj|dS)NScriptsbindarwinz/System/Library/z/usr/local/bin) rrnormpathsysrrr6existsplatform)rbin_pyr"r"r#get_bin_prefixs "rWcCs tddS)NF plat_specificrr"r"r"r# get_purelibsrZcCs tddS)NTrXrr"r"r"r# get_platlibsr[)rrcCstd|dtd|dfS)NF)rYrTr)rr"r"r#get_prefixed_libss  r\)FNNFN)FNNFN)'__doc__loggingrrS distutils.cmdrDistutilsCommanddistutils.command.installrrr8distutils.sysconfigrtypingrrr r r r pip._internal.models.schemer pip._internal.utils.compatrpip._internal.utils.virtualenvrbaser getLogger__name__r4strboolrIrLrWrZr[r\r"r"r"r#s`           S #