%PDF- %PDF-
Direktori : /lib/python3/dist-packages/sos/report/plugins/__pycache__/ |
Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/unpackaged.cpython-312.pyc |
� i��d� � �H � d dl mZmZ d dlZd dlZd dlmZ G d� dee� Zy)� )�Plugin�RedHatPluginN)�Pathc � � e Zd ZdZdZd� Zy)� UnpackagedzDCollects a list of files that are not handled by the package manager� unpackagedc � � �� d� }d � fd� }� fd�}� j d�� sy � j d� 5 } |� �g }t �fd�� j j � j j j � � D � � }�D ] }| ||� z }� |D �� cg c] \ }} | |vs�|�� } }} || � }|j dj |� � d d d � y c c} }w # 1 sw Y y xY w) Nc �F � t j d j d� S )z3Return a list of directories in $PATH. �PATH�:)�os�environ�split� � �?/usr/lib/python3/dist-packages/sos/report/plugins/unpackaged.py�get_env_path_listz-Unpackaged.collect.<locals>.get_env_path_list s � � �:�:�f�%�+�+�C�0�0r c � �� g }t j | d�� D �] \ }}}|r|D ] }|D �cg c] }||vs�|�� c}|dd � |D ]� }� j ||� } t j t j | � j � rt | � j � } |j � j ||� t j j | � g� �� |D ]D }� j ||� }|j |t j j |� g� �F �� |S c c}w # t $ r Y ��w xY w)z�Return a list of all files present on the system, excluding any directories listed in `exclude`. :param path: the starting path :param exclude: list of paths to exclude T)�topdownN) r �walk� path_join�stat�S_ISLNK�lstat�st_moder �resolve� Exception�append�path�realpath) r �exclude� file_list�root�dirs�files�e�d�name�selfs �r �all_files_systemz,Unpackaged.collect.<locals>.all_files_system sD �� � �I�%'�W�W�T�4�%@� E�!��d�E��$� B��.2�"A��a�q�j�1�"A��Q��B�!� �D��>�>�$��5�D�!��<�<������(>�(>�?�#'��:�#5�#5�#7�D� �$�$�����d�3�R�W�W�5E�5E�d�5K�L�� � !� E�D��>�>�$��5�D��$�$�d�B�G�G�,<�,<�T�,B�%C�D�E� E�$ ��� #B�� %� !� �!�s � D7�D7�AD<�< E �E c � �� g }| D ]{ }�j |� }|� }d}�j |� r>|dk r9t j |� }|d|� �z }|dz }�j |� r|dk r�9|j |dz � �} |S )z4Format the unpackaged list as a string. r � z -> � � )r �path_islinkr �readlinkr )r% �expanded�f�fp�out�linksr) s �r � format_outputz)Unpackaged.collect.<locals>.format_output: s� �� � �H�� ,���^�^�A�&������� �&�&�r�*�u�r�z����R��B��T�"��;�&�C��Q�J�E� �&�&�r�*�u�r�z� ����d� �+� ,� �Or T)�cmdr c 3 � �K � | ]K }t �D �cg c] }|j |� �� c}� r!t j j |� �� �M y c c}w �w�N)�any� startswithr r r )�.0�x�p�pathss �r � <genexpr>z%Unpackaged.collect.<locals>.<genexpr>T sH �� �� � �()��5�9�a�!�,�,�q�/�9�:� ��� � ��#��� :�s �A�A �0A� r9 ) �test_predicate�collection_file�set�policy�mangle_package_path�package_manager� all_files�write�join) r) r r* r6 �ufile�all_fsystem�all_frpmr'