HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/share/dh-python/dhpython/__pycache__/fs.cpython-35.pyc


vXA@sddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZmZmZmZddlmZddlmZmZddlmZejd	Zd
dZdd
ZGdddZ dS)N)cmp)existsisdirislinkjoinrealpathsplitsplitext)rmtree)ST_MODES_IXUSRS_IXGRPS_IXOTH)MULTIARCH_DIR_TPL)fix_shebangclean_egg_name)Interpreterdhpythonc
Cs8t|}x%|D]}||_|j|}xo|j|D]^}t|rAtjd||t||||ytj	|WqAt
k
rYqAXqAW|j|dd}xu|j|ddD]^}t|rtjd||t||||ytj	|Wqt
k
r+YqXqWqWdS)z!Move files to the right location.zmoving files from %s to %sZgdbTN)rversionsitedirZold_sitedirsrlogdebugshare_filesos
removedirsOSError)packageinterpreterZversionsoptionsrdstdirsrcdirr!#/usr/share/dh-python/dhpython/fs.py
fix_locations#s*
	
	
r#c
Csxtj|D]}t||}|jrt|d	dkr|j|}|r|dk	r|}|j||}|rt||}t|rtj	d||n)tj
d||tj|||}t||}	t|rt|	rtj||	qt
|rmt|	sEtj||	qt|t|	krtj|qt|rt||	||qt||	ddrtj|qWytj|Wntk
rYnXdS)
z<Try to move as many files from srcdir to dstdir as possible.z.soTz.destination file exist, cannot rename %s to %szrenaming %s to %sZshallowFN)rlistdirr
no_ext_renamer	parse_public_dir
check_extnamerrwarninforenamesrrrremovercmpfilerr)
r rrriZfpath1rZfpath1_orignew_nameZfpath2r!r!r"rBs@ 	

rc@seZdZejdZejdZddddZeddZ	dd	Z
d
dZedd
ZeddZ
ddZddZddZddZddZddZddZddZd d!Zd"d#Zd$d%ZdS)&Scanz.*/__pycache__(/.*)?$z.*\.py[co]$NcCs`||_|j|_||_|s7d|j|_n'|jd}td|j||_||_~||_dtdtdtdtdtd	id
ddtd
ti	|_	x|t
j|jD]h\}}}|j|r|dd=qd|_
|_|j|}|rWd|_|dkrKd}q`||_n	d|_|jr|jdr.|dk	r|j	dj|xdD]B}	|	|krtjd|	tt||	|j|	qWnF|j||_
|j
s.|j|}
|
r|j||nqxF|D]>}	t||	}|j|r5t||j|	q5q5W|j|r|j||qxzt|D]l}t||}|j|rtjd|t
j|q|j|r	|j |qt!|sWt"|rdt#|dkrtj$d|t
j|qt%|ddd}
|
dkr|jj&s|j'|}|j(|}|p|}|r|j)j*dtj|n|j)j*d
tj||j
rt!|r|
dkrt
j+|t,}|t-@sL|t.@sL|t/@r|j0sjt1||jj2r|jj3ryt4j5|}Wn8t6k
r}ztjd||WYdd}~Xn X|j)j*dtj||
dkr|j7|dk	rd|j)d
<qW|syt
j8|Wqt9k
rAYqXqWtjd||j	dS)Nz	debian/%s/debianzrequires.txtzegg-infoznsp.txtshebangsZpublic_versprivate_dirscompileFZext_versZext_no_versionTz	-packagestesttestsz+removing dist-packages/%s (too common name)zremoving unwanted: %sz.so.r$zremoving dangling symlink: %ssozcannot parse shebang %s: %spyzpackage %s details = %s)r7r8r%r%):rimplrprootstriprdpathrsetresultrwalkZ
should_ignorecurrent_private_dircurrent_pub_versionr(current_dir_is_publicendswithaddrrr
r-check_private_dir
is_bin_dirhandle_bin_diris_unwanted_dir
is_egg_dirhandle_egg_dirsortedis_unwanted_fileis_egg_filehandle_egg_filerrrr+r	r'
rename_ext
handle_extcurrent_result
setdefaultstatrrr
rno_shebang_rewritershebangignore_shebangsr	from_file	Exceptionhandle_public_modulerr)selfrrr>rrootdirs
file_namesrnamerHfnfpathZfextZvermodereser!r!r"__init__rs										"
				
	




"
"		
&!
	z
Scan.__init__cCs*|jr#|jdj|jiS|jS)Nr5)rBr@rT)r\r!r!r"rSs	zScan.current_resultcCs|jjj|S)N)	__class__
UNWANTED_DIRSmatch)r\r>r!r!r"rJszScan.is_unwanted_dircCs_|jjj|rdS|jr[|jr[|jjr[t|ddddkr[dSdS)NTr$r9hr%)r9rj)rgUNWANTED_FILESrirDis_dbg_packager
clean_dbg_pkgr	)r\rbr!r!r"rNs zScan.is_unwanted_filecsHjrjgSjdkr+g}nfdddD}|S)	NFcsg|]}|jqSr!)r).0r/)r\r!r"
<listcomp>s	z.Scan.private_dirs_to_check.<locals>.<listcomp>
usr/lib/%susr/lib/games/%susr/share/%susr/share/games/%s)rprqrrrs)r>)r\r@r!)r\r"private_dirs_to_checks	
	
zScan.private_dirs_to_checkcCs|jjdS)Nz-dbg)rrE)r\r!r!r"rlszScan.is_dbg_packagecCs>x7|jD],}|jtd|j|r
d|Sq
WdS)z0Return private dir's root if it's a private dir.r3r2N)rt
startswithrr)r\r>r/r!r!r"rGszScan.check_private_dirc	Cst|jdd\}}|jrt|r|}t}x5t|rs|j|t|tj|}q?Wt|rdt	|dkrx+|D]#}t
jd|tj|qWt
jd||tj
||tj|r|S|jj||j}|rpt||}t|rIt
jd||n#t
jd||tj
|||S|S)zAdd multiarch triplet, etc. Return new name.

        This method is invoked for all .so files in public or private directories.
        r2r$z.so.zremoving symlink: %szrenaming %s to %sz.destination file exist, cannot rename %s to %sr%)rsplitrDrr?rFrrreadlinkrrrr+r-renamerrirr)rCr*)	r\rbpathfnameZdstfpathZlinksZlpathZnew_fnZ	new_fpathr!r!r"rQ!s2	
"
	
zScan.rename_extcCsdS)z0Handle .so file, return its version if detected.Nr!)r\rbr!r!r"rRGszScan.handle_extcCsdS)Nr!)r\rbr!r!r"r[JszScan.handle_public_modulecCsH|jdjdd}t|dkr1dS|jd	rDdSdS)
z#Check if dir is one from PATH ones.r2F/sbin/bin
/usr/gamesTN)r|r}r~)r=rlenrE)r\r>Zspathr!r!r"rHMs
zScan.is_bin_dircCs|jjs|jjrdSx|D]}t||}t||jjr#ytj|}Wn8tk
r}zt	j
d||WYdd}~Xq#X|jdj|q#WdS)Nzcannot parse shebang %s: %sr4)
rrVrXrrrWrrYrZrrr@rF)r\r>r_rarbrdrer!r!r"rIWs
&zScan.handle_bin_dircCs
|jdS)z+Check if given directory contains egg-info.z	.egg-info)rE)r\dnamer!r!r"rKdszScan.is_egg_dircCsU|jdd\}}|jr;|jjr;t|dSt|}||krtt||rtj	d||t|dStj	d||t
j|t|||}t||}|rQd|kr|jdj
t|dd|kr"|jdj
t|dd|krQt
jt|d|jddS)	Nr2r$z%removing %s (%s is already available)zrenaming %s to %szrequires.txtznamespace_packages.txtznsp.txtzSOURCES.txt)rvrlrrmr
rrrrr+rrxr@rFr-)r\r>r_ryr
clean_namer!r!r"rLhs,

zScan.handle_egg_dircCs
|jdS)z&Check if given file contains egg-info.z	.egg-info)rE)r\rbr!r!r"rOszScan.is_egg_filecCs|jdd\}}t|}||krtt||rhtjd||tj|n,tjd||tj|t|||j	dj
t||dS)Nr2r$z%removing %s (%s is already available)zrenaming %s to %szegg-info)rvrrrrr+rr-rxr@rF)r\rbr]r`rr!r!r"rPs	
zScan.handle_egg_filecCs|jr|jjr|jd}x_tj|ddD]H\}}}d|kr8|r8ytj|Wq8tk
rYq8Xq8WdS)Nz/usr/libtopdownFz
-packages/)rlrrmr<rrArrZ)r\r<r]r^r_r!r!r"cleanups
%
zScan.cleanup)__name__
__module____qualname__rer6rhrkrfpropertyrSrJrNrtrlrGrQrRr[rHrIrKrLrOrPrr!r!r!r"r1ns&&


r1)!ZloggingrrZfilecmprr.os.pathrrrrrrr	Zshutilr
rUrrr
rrrZdhpython.toolsrrZdhpython.interpreterrZ	getLoggerrr#rr1r!r!r!r"<module>s4",