404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.220.85.96: ~ $
3

�f89�@s�ddlmZddlmZddlZddlZddlZddlZddlmZm	Z	ddl
mZddlZddl
Zdd�ZGdd	�d	ejj�ZejjGd
d�dejj��ZdS)�)�absolute_import)�unicode_literalsN)�_�logger)�OptionParsercCs(tjjtj��}tjjtjj|||��S)N)�dnfZi18nZucd�os�getcwd�path�realpath�join)Zintermediate�target�cwd�r�/usr/lib/python3.6/reposync.py�_pkgdir#srcs(eZdZ�fdd�Z�fdd�Z�ZS)�RPMPayloadLocationcs$tt|�j||�tjj|�|_dS)N)�superr�__init__rr
�dirname�package_dir)�self�pkg�progressZpkg_location)�	__class__rrr)szRPMPayloadLocation.__init__cs*tt|�j�}tjj|j�|j|d<|S)N�dest)rr�_target_paramsr�util�
ensure_dirr)r�tp)rrrr-s
z!RPMPayloadLocation._target_params)�__name__�
__module__�__qualname__rr�
__classcell__rr)rrr(srcs�eZdZdZed�Z�fdd�Zedd��Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z�ZS) �RepoSyncCommand�reposyncz&download all packages from remote repocstt|�j|�dS)N)rr$r)r�cli)rrrr9szRepoSyncCommand.__init__c	Cs|jdddgtjdtd�d�|jddd	td
�d�|jddd	td
�d�|jdddd	td�d�|jdddd	td�d�|jdtd�d�|jdddd	td�d�|jddd	td�d�|jdddtd�d �|jd!dd	td"�d�|jd#dd	td$�d�|jd%d&dd	td'�d�dS)(Nz-az--arch�archesz[arch]z$download only packages for this ARCH)r�default�action�metavar�helpz--deleteF�
store_truez5delete local packages no longer present in repository)r(r)r+z--download-metadatazdownload all the metadata.z-gz
--gpgcheckzBRemove packages that fail GPG signature checking after downloadingz-mz--downloadcompsz&also download and uncompress comps.xmlz--metadata-pathzXwhere to store downloaded repository metadata. Defaults to the value of --download-path.)r+z-nz
--newest-onlyz&download only newest packages per-repoz--norepopathz,Don't add the reponame to the download path.z-pz--download-pathz./z&where to store downloaded repositories)r(r+z
--remote-timezCtry to set local timestamps of local files by the one on the serverz--sourcezdownload only source packagesz-uz--urlsz:Just list urls of what would be downloaded, don't download)�add_argumentrZ_SplitCallbackr)�parserrrr�
set_argparser<s2





zRepoSyncCommand.set_argparsercCs�|jj}d|_d|_|jj}|jjr||j�j	�xJ|jjD]>}y||}Wn$t
k
rntjjd|��YnX|j
�q:W|jjr�|j�tt|j���dkr�|jjr�tjjtd���x |j�D]}|jj�d|_q�WdS)NTzUnknown repo: '%s'.�z1Can't use --norepopath with multiple repositoriesF)r&�demandsZavailable_reposZsack_activation�base�repos�opts�repo�all�disable�KeyErrorrZCliError�enable�sourceZenable_source_repos�len�list�iter_enabled�
norepopathr�_repoZexpireZdeltarpm)rr1r3Zrepoidr5rrr�	configure\s(

zRepoSyncCommand.configurecs�d|jj_d}�x�|jjj�D�]�}|jjr8|jjd�|jj	r�|jj
r�xP|jj�D]6\}}|j|�}|rtt
|�qTtd�|}tj|�qTWn
|j	|�|jj�r|jj
�rt|jj����fdd�dD�}|�rxB|D]}|j|�}|r�t
|�Pq�Wtd�}tj|�n
|j|�|j|�}	|jj
�r8|j|	�n�|j|	�|jj�r�xt|	D]l}
|j|
�}tj|fd	d
�|
�|
_|jj|
�\}}
|dk�rRtjtd�jtjj |�|
��tj!|�d
}�qRW|jj"r|j#||	�qW|�s�t$j%j&td���dS)NTz%Failed to get mirror for metadata: %scsg|]}|�kr�|�qSrr)�.0�md_type)�mdlrr�
<listcomp>�sz'RepoSyncCommand.run.<locals>.<listcomp>�group�group_gz�group_gz_zckz(Failed to get mirror for the group file.cSs|S)Nr)�s�
local_pathrrr�<lambda>�sz%RepoSyncCommand.run.<locals>.<lambda>rzRemoving {}: {}FzGPG signature check failed.)rErFrG)'r2ZconfZ	keepcacher3r=r4Zremote_timer?ZsetPreserveRemoteTime�download_metadataZurlsZgetMetadataLocations�remote_location�printrr�warningZ
downloadcomps�dict�getcomps�get_pkglist�
print_urls�download_packagesZgpgcheck�pkg_download_path�types�
MethodTypeZlocalPkgZpackage_signature_check�formatrr
�basename�unlink�delete�delete_old_local_packagesr�
exceptions�Error)rZgpgcheck_okr5rBZmd_location�url�msgZgroup_locationsZgroup_location�pkglistrrI�result�errorr)rCr�runws^


















zRepoSyncCommand.runcCs$t|jjp|jj|jjs|jnd�S)N�)rr4ZdestdirZ
download_pathr>�id)rr5rrr�repo_target�szRepoSyncCommand.repo_targetcCs&|jjrt|jj|j�S|j|�SdS)N)r4Z
metadata_pathrrerf)rr5rrr�metadata_target�szRepoSyncCommand.metadata_targetcCsT|j|j�}tjjtjj||j��}|jtjj|d��sPtj	j
td�j||���|S)Nrdz6Download target '{}' is outside of download path '{}'.)
rfr5rr
rr�location�
startswithrr\r]rrW)rrrfrTrrrrT�s
z!RepoSyncCommand.pkg_download_pathc	
s�t�fdd�|D��}x�tj�j|��D]�\}}}x||D]t}tjj||�}|jd�r8tjj|�r8||kr8ytj|�t	j
td�|�Wq8tk
r�t	j
td�|�Yq8Xq8Wq(WdS)Nc3s|]}�j|�VqdS)N)rT)rAr)rrr�	<genexpr>�sz<RepoSyncCommand.delete_old_local_packages.<locals>.<genexpr>z.rpmz[DELETED] %szfailed to delete file %s)�setr�walkrfr
r�endswith�isfilerYr�infor�OSErrorrb)	rr5r`Zdownloaded_files�dirpathZdirnames�	filenames�filenamer
r)rrr[�s

z)RepoSyncCommand.delete_old_local_packagescCsZ|jj�}|rV|j|�}tjj|�tjj|d�}tj	j
j||d�tj
td�|j�dS)Nz	comps.xml)rz!comps.xml for repository %s saved)r?Z
getCompsFnrgrrrrr
rZyumZmiscZ
decompressrrorre)rr5Zcomps_fnZ	dest_pathrrrrrP�s

zRepoSyncCommand.getcompscCs|j|�}|jj|�dS)NT)rgr?ZdownloadMetadata)rr5rfrrrrK�s
z!RepoSyncCommand.download_metadatacCs�tjjs|j�S|j�|jjj�}t�}i}i}xp|D]h}|j�}|j	|�|j
|j�i�j
|j�g�j
|�x.|D]&}|j
|i�j
|j�g�j
|j��qvWq8W|j|j|d�d�j�}	t�}
x�|j�D]�\}}t�}
|
jt|j�dd�d�t�}x0|j�D]$}x|D]}|j	|j���qW�qWx:|j|d�j�D]&}dj|�}|
jt|||���q>Wx0|
D](}x ||D]}|
j	|j���q|W�qnWq�W|	j|j|
d��}	|	S)a\
        return union of these queries:
        - the latest NEVRAs from non-modular packages
        - all packages from stream version with the latest package NEVRA
          (this should not be needed but the latest package NEVRAs might be
          part of an older module version)
        - all packages from the latest stream version
        )Znevra_strict)Zpkg__neqT)�reverserz3{0.name}-{0.epoch}:{0.version}-{0.release}.{0.arch})rr2ZWITH_MODULESZlatestZapplyZ_moduleContainerZgetModulePackagesrkZgetArtifacts�update�
setdefaultZ
getNameStreamZ
getVersionNum�append�filter�items�add�sorted�keys�valuesrW�max�union)r�queryZmodule_packagesZ
all_artifactsZmodule_dictZartifact_versionZmodule_packageZ	artifactsZartifactZlatest_queryZlatest_stream_artifactsZ
namestreamZversion_dictZversionsZstream_artifacts�modules�moduleZ
latest_pkgZnevra�versionrrr�_get_latest�sB	





zRepoSyncCommand._get_latestcCsd|jjjtjd�j�j|jd�}|jj	r2|j
|�}|jjrH|jdd�n|jjr`|j|jjd�|S)N)�flags)Zreponame�src)Zarch)
r2�sackr��hawkey�IGNORE_MODULAR_EXCLUDESZ	availableZfiltermrer4Znewest_onlyr�r:r')rr5r�rrrrQs

zRepoSyncCommand.get_pkglistcsj�j}|jj��dkr tjj��tjj|jj	t
jd�j��d�}��fdd�|D�}|j
||�dd�dS)N)r�rcsg|]}t|��j|���qSr)rrT)rAr)rrrrrD0sz5RepoSyncCommand.download_packages.<locals>.<listcomp>F)r2�outputrr�callbackZNullDownloadProgress�drpmZ	DeltaInfor�r�r�r�Z	installedZ_download_remote_payloads)rr`r2r�Zpayloadsr)rrrrS)s
z!RepoSyncCommand.download_packagescCs@x:|D]2}|j�}|r t|�qtd�|j}tj|�qWdS)Nz$Failed to get mirror for package: %s)rLrMr�namerrN)rr`rr^r_rrrrR4s

zRepoSyncCommand.print_urls)r%)r r!r"�aliasesrZsummaryr�staticmethodr/r@rcrfrgrTr[rPrKr�rQrSrRr#rr)rrr$4s  :
	9r$)Z
__future__rrr�rZshutilrUZdnfpluginscorerrZdnf.cli.option_parserrrZdnf.clirr5Z
RPMPayloadrZpluginZregister_commandr&ZCommandr$rrrr�<module>s

Filemanager

Name Type Size Permission Actions
builddep.cpython-36.opt-1.pyc File 7.27 KB 0644
builddep.cpython-36.pyc File 7.27 KB 0644
changelog.cpython-36.opt-1.pyc File 4.08 KB 0644
changelog.cpython-36.pyc File 4.08 KB 0644
config_manager.cpython-36.opt-1.pyc File 7.09 KB 0644
config_manager.cpython-36.pyc File 7.09 KB 0644
copr.cpython-36.opt-1.pyc File 20.2 KB 0644
copr.cpython-36.pyc File 20.2 KB 0644
debug.cpython-36.opt-1.pyc File 10.56 KB 0644
debug.cpython-36.pyc File 10.56 KB 0644
debuginfo-install.cpython-36.opt-1.pyc File 5.93 KB 0644
debuginfo-install.cpython-36.pyc File 5.93 KB 0644
download.cpython-36.opt-1.pyc File 9.29 KB 0644
download.cpython-36.pyc File 9.29 KB 0644
generate_completion_cache.cpython-36.opt-1.pyc File 3 KB 0644
generate_completion_cache.cpython-36.pyc File 3 KB 0644
groups_manager.cpython-36.opt-1.pyc File 8.45 KB 0644
groups_manager.cpython-36.pyc File 8.45 KB 0644
needs_restarting.cpython-36.opt-1.pyc File 9.88 KB 0644
needs_restarting.cpython-36.pyc File 9.88 KB 0644
repoclosure.cpython-36.opt-1.pyc File 4.31 KB 0644
repoclosure.cpython-36.pyc File 4.31 KB 0644
repodiff.cpython-36.opt-1.pyc File 7.55 KB 0644
repodiff.cpython-36.pyc File 7.55 KB 0644
repograph.cpython-36.opt-1.pyc File 2.72 KB 0644
repograph.cpython-36.pyc File 2.72 KB 0644
repomanage.cpython-36.opt-1.pyc File 6.37 KB 0644
repomanage.cpython-36.pyc File 6.37 KB 0644
reposync.cpython-36.opt-1.pyc File 10.19 KB 0644
reposync.cpython-36.pyc File 10.19 KB 0644
spacewalk.cpython-36.opt-1.pyc File 9.79 KB 0644
spacewalk.cpython-36.pyc File 9.79 KB 0644
system_upgrade.cpython-36.opt-1.pyc File 22.48 KB 0644
system_upgrade.cpython-36.pyc File 22.48 KB 0644
universal_hooks.cpython-36.opt-1.pyc File 5.86 KB 0644
universal_hooks.cpython-36.pyc File 5.86 KB 0644