HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/DistUpgrade/__pycache__/DistUpgradePatcher.cpython-310.pyc
o

>I�c��@s.ddlZddlZGdd�de�Zddd�ZdS)�Nc@seZdZdZdS)�
PatchErrorz  Error during the patch process N)�__name__�
__module__�__qualname__�__doc__�rr�@/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradePatcher.pyrsrcCs<td�\}}t|dd��}|��}Wd�n1swYd}}|}	t|dd��}|��}
Wd�n1s;wY|
D]�}|	|kr�|��}|�d�r|dd�}|�dd�\}}
|
retd	��|�d�\}}}tj	||||dd
�\}}|||<qB|d}|dd��d�\}}}t
|�}|d8}|d
kr�|d}nt
|�}|dkr�|||�=|}	|d8}qB|dkr�|}	qB|dkr�|||�=qBtd|��|	|kr�|dkr�|}	qB|d7}|�||�qBd
�|�}|r�t
��}|�|�d��|��|kr�td��t|ddd��}|�|�Wd�dS1�swYdS)z� python implementation of enough "ed" to apply ed-style
        patches. Note that this patches in memory so its *not*
        suitable for big files
    �zUTF-8)�encodingNrzs/�/�zflags for s// not supported yet)�count����,��c�a�dzunknown command: '%s'z.
z(the md5sum after patching is not correct�wT)�range�open�	readlines�strip�
startswith�rsplitr�	partition�re�subn�int�insert�join�hashlib�md5�update�encode�	hexdigest�write)�orig�edpatch�
result_md5sum�STATE_EXPECT_COMMAND�STATE_EXPECT_DATA�f�
orig_lines�start�end�state�lines�line�subs�flags�regexp�sep�repl�newr
�command�	start_str�end_str�resultr"rrr�patchsr�
�
�



�

��r=)N)r!r�	Exceptionrr=rrrr�<module>s