�
��^i� � �� � d dl Z d dlZd dlmZ d dlmZ d dlmZ ddlm Z ej
� d� � rd dl mZ nd e
fd
�Z G d� de � � Zd
ed ee fd�ZdgZdS )� N)�ConfigParser)�Path)�Optional� )�PlatformDirsABC�linux)�getuid�returnc � � t d� � �)Nzshould only be used on Linux)�RuntimeError� � ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/platformdirs/unix.pyr r
s � ��9�:�:�:r c �f � e Zd ZdZedefd�� � Zedefd�� � Zdedefd�Zedefd�� � Z edefd�� � Z
edefd �� � Zedefd
�� � Zedefd�� � Z
edefd�� � Zedefd
�� � Zedefd�� � Zedefd�� � Zdedefd�ZdS )�UnixaD
On Unix/Linux, we follow the
`XDG Basedir Spec `_. The spec allows
overriding directories with environment variables. The examples show are the default values, alongside the name of
the environment variable that overrides them. Makes use of the
`appname `,
`version `,
`multipath `,
`opinion `.
r
c �� � t j � dd� � }|� � � st j � d� � }| � |� � S )z�
:return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or
``$XDG_DATA_HOME/$appname/$version``
�
XDG_DATA_HOME� z~/.local/share��os�environ�get�strip�path�
expanduser�_append_app_name_and_version��selfr s r �
user_data_dirzUnix.user_data_dir sS � � �z�~�~�o�r�2�2���z�z�|�|� 8��7�%�%�&6�7�7�D��0�0��6�6�6r c � � t j � dd� � }|� � � sdt j � d�}| � |� � S )aY
:return: data directories shared by users (if `multipath ` is
enabled and ``XDG_DATA_DIR`` is set and a multi path the response is also a multi path separated by the OS
path separator), e.g. ``/usr/local/share/$appname/$version`` or ``/usr/share/$appname/$version``
�
XDG_DATA_DIRSr z/usr/local/sharez
/usr/share)r r r r �pathsep�_with_multi_pathr s r �
site_data_dirzUnix.site_data_dir( sO � � �z�~�~�o�r�2�2���z�z�|�|� =�<�b�j�<�<�<�D��$�$�T�*�*�*r r c � � � |� t j � � }� j s
|dd� }� fd�|D � � }t j � |� � S )Nr r c �t �� g | ]4}�� t j � |� � � � ��5S r
)r r r r )�.0�pr s �r �
z)Unix._with_multi_path..9 s8 �� �a�a�a�RS�T�6�6�r�w�7I�7I�!�7L�7L�M�M�a�a�ar )�splitr r" � multipath�join)r r � path_lists ` r r# zUnix._with_multi_path5 s[ �� ��J�J�r�z�*�*� ��~� '�!�!�A�#��I�a�a�a�a�W`�a�a�a� ��z���y�)�)�)r c �� � t j � dd� � }|� � � st j � d� � }| � |� � S )z�
:return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or
``$XDG_CONFIG_HOME/$appname/$version``
�XDG_CONFIG_HOMEr z ~/.configr r s r �user_config_dirzUnix.user_config_dir<