o
    jZh                     @   s$   d Z dd Zedkree dS dS )z>
(c) 2006-2013, Armin Rigo, Holger Krekel, Maciej Fijalkowski
c              	      s  dd l dd l	dd lddlm   \g fdd 	fddg  d} d D ]X\}\}}}  } d	|td
 d  f |d urx|rjt||krjtd|t	|d}|
| |  z|r|| |||f W n	 ty   Y nw ~q= d   }|dkr|\}	}
}j|
}z| W n	 ty   Y nw |	dkrˈj|}n
|	dksJ |	|}||   }|dks d d S )N    )md5c                    s@   |   sJ z|  W d S  ty   | d Y d S w )NT)
startswithunlinkOSErrorrmtree)path)destdirosshutil K/var/www/html/lang_env/lib/python3.10/site-packages/execnet/rsync_remote.pyremove   s   zserve_rsync.<locals>.removec                    s  z | }W n ty   d }Y nw   }t|tr{|r+|js+|  d }|s2|  |	d}|rA
| |dB  i }|D ]}j| |}|||g  d||< qEdrw| D ]}||vrvj| |}	|	 qed S d S |d urt|tsJ d }
|rɈ|jr|\}}}||jkrn.||jkrt| d}|  }
|  n|r||jkrÈ
| |dB  d S d S |   d||
ff | |f d S d S )Nr   i  Tdeleterbsend)lstatr   receive
isinstancelistS_ISDIRst_moder   makedirspopchmodr   joingetlistdirtupleS_ISREGst_sizest_mtimeopenreaddigestcloser   append)r   ZrelcomponentsstmsgmodeZ
entrynames	entrynameZdestpathZ	othernameZ	otherpathZchecksumZmsg_modeZ	msg_mtimeZmsg_sizef)channelr   modifiedfilesoptionsr	   receive_directory_structurer   statr   r   r.      s`   










z0serve_rsync.<locals>.receive_directory_structureF)Z	list_doneNZack   zfile modified during rsync: wb)linksN*   Zlinkbaselink)doneN)r	   r/   r
   hashlibr   r   r   lenr   r!   writer$   r   utimer   r   symlink)r+   ZSTRICT_CHECKr   r(   timesizedatar*   r'   _typerelpathZ	linkpointsrcr   )
r+   r   r   r,   r-   r	   r.   r   r
   r/   r   serve_rsync   s\   
3




rA   Z__channelexec__N)__doc__rA   __name__r+   r   r   r   r   <module>   s
    n