HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/unpackaged.cpython-39.opt-1.pyc
a

\��h�
�@sBddlmZddlZddlZddlmZmZGdd�dee�ZdS)�)�PathN)�Plugin�RedHatPluginc@seZdZdZdZdd�ZdS)�
UnpackagedzDCollects a list of files that are not handled by the package manager�
unpackagedc	s�dd�}d�fdd�	}�fdd�}�jdd�s2dS��d	���}|��g}t�fd
d��j��jj���D����D]}|||�7}qr�fdd
�|D�}||�}|�d�|��Wd�n1s�0YdS)NcSstjd�d�S)z3Return a list of directories in $PATH.
            �PATH�:)�os�environ�split�rr�A/usr/lib/python3.9/site-packages/sos/report/plugins/unpackaged.py�get_env_path_listsz-Unpackaged.collect.<locals>.get_env_path_listc
s�g}tj|dd�D]�\}}}|rD|D]��fdd�|D�|dd�<q$|D]h}��||�}z"t�t�|�j�rxt|���}Wnt	y�YqHYn0|�
��||�tj�|�g�qH|D]&}��||�}|�
|tj�|�g�q�q|S)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)�topdowncsg|]}|�vr|�qSrr)�.0�d��excrr
�
<listcomp>(�z@Unpackaged.collect.<locals>.all_files_system.<locals>.<listcomp>N)
r	�walk�	path_join�stat�S_ISLNK�lstat�st_moder�resolve�	Exception�append�path�realpath)rZexcludeZ	file_list�root�dirs�files�name��selfrr
�all_files_systems&
�z,Unpackaged.collect.<locals>.all_files_systemcshg}|D]Z}��|�}|�}d}��|�rT|dkrTt�|�}|d|��7}|d7}q |�|d�q|S)z4Format the unpackaged list as a string.
            r�
z -> ��
)rZpath_islinkr	�readlinkr)r#Zexpanded�file�outZlinksr%rr
�
format_output9s


z)Unpackaged.collect.<locals>.format_outputT)�cmdrc3s0|](�t�fdd��D��rtj���VqdS)c3s|]}��|�VqdS)N)�
startswith)r�p��xrr
�	<genexpr>Vrz/Unpackaged.collect.<locals>.<genexpr>.<genexpr>N)�anyr	rr )r)�pathsr2r
r4Ss�z%Unpackaged.collect.<locals>.<genexpr>csg|]\}}|�vr|�qSrr)rr3Zrp)�all_frpmrr
r[rz&Unpackaged.collect.<locals>.<listcomp>�)N)	Ztest_predicateZcollection_file�setZpolicyZmangle_package_pathZpackage_managerZ	all_files�write�join)	r&rr'r.ZufileZall_fsystemrZnot_packagedZnot_packaged_expandedr)r7r6r&r
�collects$
��zUnpackaged.collectN)�__name__�
__module__�__qualname__Z
short_descZplugin_namer<rrrr
rsr)�pathlibrr	rZsos.report.pluginsrrrrrrr
�<module>	s