HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //lib/python3.6/site-packages/tracer/packageManagers/__pycache__/dpkg.cpython-36.pyc
3

�|
`Z�@stddlmZddlmZej�dkrpddlmZddlmZddl	m
Z
ddlZddlZddl
Z
Gd	d
�d
e�ZdS)�)�absolute_import)�SystemZdebian�)�IPackageManager)�Package)�PackagesCollectionNc@sDeZdZdZdd�Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dS)�Dpkgz"
		Package manager class - DPKG
		cKs
||_dS)N)Zopts)�self�kwargs�r�/usr/lib/python3.6/dpkg.py�__init__'sz
Dpkg.__init__cCsdS)Nz/var/log/dpkg.logr)r	rrr�dpkg_log*sz
Dpkg.dpkg_logcCs�t�}t|jd�}xp|D]h}|jd�}|ddkr4qtjtj|dd|dd��}||kr|djd	�d}|jt||��qW|S)
zp
			Returns list of packages which were modified between unix_time and present
			Requires root permissions.
			�r� �Zupgraderrz%Y-%m-%d %H:%M:%S��:)	r�openr�split�timeZmktimeZstrptime�appendr)r	Z	unix_timeZnewer�log�lineZmodified�pkg_namerrr�packages_newer_than-s

zDpkg.packages_newer_thancCsrg}ttjd�}dd|g}tj|tj|d�}|j�d}x4|j�jd�dd	�D]}tj	j
|�rP|j|�qPW|S)
z)Returns list of files provided by package�wz
dpkg-queryz-L)�stdout�stderrr�
Nr���)r�os�devnull�
subprocess�Popen�PIPE�communicate�decoder�path�isfiler)r	r�filesZfnull�command�process�out�filerrr�
package_filesDs
zDpkg.package_filescCsjd}tjdd|jgtjd�}|j�d}|j�jd�}x(|D] }|jd�r<|jd�dj�}q<W||_	dS)	zFFrom database load informations about given package and set them to itNZdpkgz-s)rrrzDescription:r)
r#r$�namer%r&r'r�
startswith�strip�description)r	�packager3r,r-rrrr�load_package_infoPs

zDpkg.load_package_infocCsLdd|jg}tj|tjd�}|j�d}|j�jd�d}t|jd�d�S)z8Returns name of package which provides given applicationZdlocatez-S)rrrr)r0r#r$r%r&r'rr)r	Zappr+r,rrrr�provided_by^s
zDpkg.provided_byN)�__name__�
__module__�__qualname__�__doc__r
�propertyrrr/r5r6rrrrr sr)Z
__future__rZtracer.resources.systemrZdistributionZipackageManagerrZtracer.resources.packagerZtracer.resources.collectionsrr#rr!rrrrr�<module>s