AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/UpdateManager/Core/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/UpdateManager/Core/__pycache__/MyCache.cpython-310.pyc
o

z��c�G�@sZddlmZmZddlZe�dde�ddlZddlZddlZddl	Z	zddl
mZddlm
Z
ddlmZWneyNddlmZm
Z
ddlmZYnwzdd	lmZWneyfdd	lmZYnwddlZddlZddlZddlZdd
lmZzddlmZWney�dZYnwdZd
Z e dZ!Gdd�de"�Z#Gdd�dej$j%�Z%dS)�)�absolute_import�print_functionN�ignorezapt API not stable yet)�	HTTPError)�urlopen)�urlsplit)rr)�
BadStatusLine)�gettext)�	Launchpadz/var/lib/synaptic/preferencesz.https://changelogs.ubuntu.com/changelogs/pool/z%s/%s/%s/%s_%s/%sc@seZdZdZdS)�HttpsChangelogsUnsupportedErrorz� https changelogs with credentials are unsupported because of the
        lack of certitifcation validation in urllib2 which allows MITM
        attacks to steal the credentials
    N)�__name__�
__module__�__qualname__�__doc__�rr�</usr/lib/python3/dist-packages/UpdateManager/Core/MyCache.pyr9src@s�eZdZdZd,dd�Zdd�Zdd�Zd	d
�Zedd��Z	ed
d��Z
dd�Zedd��Zdd�Z
dd�Zdd�Zdd�Z		d-dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZdS).�MyCache�UbuntuNcstj�|||�||_t|j�dksJ�|��rJ�|��i|_i|_	|j
jdkr.|��|j
jdkr:|j
j
dks<J�d|_tj�d�}|rzt�dd�dd�|D��d�|_tjdd	gd
d����t�dd��fdd�|D��d�|_dSd|_d|_dS)
NrzAPT::VersionedKernelPackages�(�|cSsg|]}d|�qS)�^r��.0�prrr�
<listcomp>_sz$MyCache.__init__.<locals>.<listcomp>�)�unamez-rT)�universal_newlinescs.g|]}|�d�sd|d�n�|�qS)z.*r)�
startswithr��running_kernel_versionrrrcs���)�apt�Cache�__init__�rootdir�len�req_reinstall_pkgs�_dpkgJournalDirty�
_initDepCache�all_changes�all_news�	_depcache�broken_count�saveDistUpgrade�	del_count�	launchpad�apt_pkg�config�
value_list�re�compile�join�versioned_kernel_pkgs_regexp�
subprocess�check_output�rstrip�running_kernel_pkgs_regexp)�self�progressr$�apt_versioned_kernel_pkgsrrrr#EsH
��
����

���
zMyCache.__init__cCs>tj�tj�d��d}t�|�D]}t�d|�rdSqdS)z`
        test if the dpkg journal is dirty
        (similar to debSystem::CheckUpdates)
        zDir::State::statusz/updatesz[0-9]+TF)	�os�path�dirnamer0r1�	find_file�listdirr3�match)r;�d�frrrr'js
���zMyCache._dpkgJournalDirtycCs0|j��tj�t�r|j�t�|j��dS�N)r+�read_pinfiler>r?�exists�SYNAPTIC_PINFILE�init�r;rrrr(vs
zMyCache._initDepCachecCs|��dSrF)r(rKrrr�clearsz
MyCache.clearcCs,t�|j�}t��}|�||j|j�|jS)z< get the size of the packages that are required to download )r0�PackageManagerr+�Acquire�get_archives�_list�_records�fetch_needed)r;�pm�fetcherrrr�required_download�szMyCache.required_downloadcC�|jjSrF)r+�
inst_countrKrrr�
install_count��zMyCache.install_countcCrVrF)r+�
keep_countrKrrrrZ�szMyCache.keep_countcCrVrF)r+r.rKrrrr.�rYzMyCache.del_countcCsR|D]$}|sqd}|D]}|j|jjkst�|j|j|j�s d}q|r&dSqdS)z<Return True if any of the dependencies in deps match target.TF)�name�package�	shortnamer0�	check_dep�version�relation)r;�target�deps�dep_orrC�base_deprrr�_check_dependencies�s ����zMyCache._check_dependenciescCsl|j}|sdS|D]*}|j}|dur3|�||�d��r3|�||�d��r3t�d|jj|jf�dSq	dS)NF�	Conflicts�Replacesz*%s Conflicts/Replaces %s; allowing removalT)�	installed�	candidatere�get_dependencies�logging�infor\r])r;�pkgra�cpkgrirrr�find_removal_justification�s*
�
��
���z"MyCache.find_removal_justificationcCs�|j�d�|jj}|dkr+dd�|D�}|t|�ksJ�|D]}|�|�r*|d8}q|dkrB|��|jjdkr?|jjdksAJ�n|jjdksJJ�|j��|S)z@ this functions mimics a upgrade but will never remove anything TrcSsg|]}|jr|�qSr)�
marked_delete)rrmrrrr�sz+MyCache.saveDistUpgrade.<locals>.<listcomp>�)r+�upgrader.r%rorLr,)r;�wouldDelete�deleted_pkgsrmrrrr-�s"
�
�
zMyCache.saveDistUpgradecCs,|�d�}t|�dkrd�|dd��}|S)z strip of the epoch �:rq�N)�splitr%r5)r;�verstr�
vers_no_epochrrr�_strip_epoch�s
zMyCache._strip_epochFcCs�||}|jj}d}|jj�|j�j}|jj}	|�|	�}
|�	d�}t
|�dkr+|d}|d}|�d�r:d|d}|r?|}
n
t|||||
|f}
t
|
�}|jdkrY|jrYtd��t|
�}d	}d
t�|�}	|���dd
�}|d	krv	|St�||�}|r�t|jdd�}|r�d|vr�|�	dd�d}|�d�}|r�d|vr�|�	dd�d}|r�|r�t�||�dkr�	|Sn
|r�t�||�dkr�	|S||}qg)z* helper that fetches the file in question �main�/rqr�lib��httpszKhttps locations with username/password are notsupported to fetch changelogsrvz^%s \((.*)\)(.*)$TzUTF-8�replacer_Nru)ri�source_name�_pcacher+�get_candidate_ver�_pkg�section�source_versionrzrwr%r�CHANGELOGS_URIr�scheme�usernamerrr3�escape�readline�decoderC�getattrrh�groupr0�version_compare)r;r[�fname�strict_versioning�changelogs_urirm�srcpkg�src_sectionr��srcver_epoch�srcver�
split_section�prefix�uri�res�	changelog�alllines�regexp�linerCrh�changelogverrrr�_get_changelog_or_news�sx



���
����������zMyCache._get_changelog_or_newsc	Cs�ts	t�d�dS||j}|jD]!}t|�jdkrqt�d|�}|dur2|�	d�|�	d�}}nqt�
d�dS|jdurHtjdd	d
d�|_|jj
jd||fd
�}|dur_t�
d�dS|j|jd|jd�}|srt�
d�dS|d��S)zbReturn the changelog URI from the Launchpad API

        Return None in case of an error.
        z9Launchpadlib not available, cannot retrieve PPA changelogNzppa.launchpad.netzhttp.*/(.*)/(.*)/ubuntu/.*rq�z)Unable to find a valid PPA candidate URL.zupdate-manager�
production�devel)r_z
~%s/ubuntu/%s)�	referencez6Unable to retrieve the archive from the Launchpad API.T)r��exact_matchr_z;No published sources were retrieved from the Launchpad API.r)r
rk�warningri�urisr�hostnamer3�searchr��errorr/�login_anonymously�archives�getByReference�getPublishedSourcesr�r��changelogUrl)	r;r[�cdtr�rC�user�ppa�archive�spphsrrr�_extract_ppa_changelog_uri)sB


�

�
�
�
z"MyCache._extract_ppa_changelog_uricCs�||}|jj}|durdS|jj�d�}|sdS|�d�d��}d|vr1|�d�d�d�}n|jj}|�d�d}|d||fS)N�Sourcerrrqrr|z/%s_%s.changelog)	rir��record�getrw�stripr9r��
rpartition)r;r[rm�deb_uri�srcrecr�r��base_urirrr�+_guess_third_party_changelogs_uri_by_sourceWsz3MyCache._guess_third_party_changelogs_uri_by_sourcecCs,||}|jj}|rd|�dd�dSdS)z` guess changelogs uri based on ArchiveURI by replacing .deb
            with .changelog
        z%s.changelog�.rqrN)rir��rsplit)r;r[rmr�rrr�+_guess_third_party_changelogs_uri_by_binaryhs
z3MyCache._guess_third_party_changelogs_uri_by_binarycCs8|�|�|�|�z|��WdStyYdSwrF)�get_news�
get_changelog�release�	Exception)r;r[�lockrrr�get_news_and_changelogts

�zMyCache.get_news_and_changelogcCs>z	|�|dd�}Wn
tyYdSw|r||j|<dSdS)z7 get the NEWS.Debian file from the changelogs location zNEWS.DebianTN)r�r�r*)r;r[�newsrrrr�|s��zMyCache.get_newsc
Cs�d}|D]}|j�d�r#z|�|�}Wnty"t�d�Yqwq|�|�}|�|�}d}|||fD]<}|rqz|�|dd|�}	|j	||	7<Wq5t
tfy[td�}Yq5t
ttjfypt�d�td�}Yq5wq5|j	||7<dS)	NzLP-PPA-z'Unable to connect to the Launchpad API.rvr�FzAThis update does not come from a source that supports changelogs.zerror on changelog fetching�OFailed to download the list of changes. 
Please check your Internet connection.)�originrr�r�rk�	exceptionr�r�r�r)rr�_�IOErrorr�socketr�)
r;r[�origins�changelogs_uri_ppar��changelogs_uri_binary�changelogs_uri_source�
error_messager�r�rrr�(_fetch_changelog_for_third_party_package�sJ
��	�����
���z0MyCache._fetch_changelog_for_third_party_packagec
Cs ||jj}td�|t||jdd�||jjf|j|<|jdd�|D�vr/|�||�dS||jj	}||jj
�dd�}z|�|d�}t
|�d	krTtd
�||f}Wn/tyftd�||f}Yntttjfy�}ztd|�td
�}WYd}~nd}~ww|j||7<dS)z4 get the changelog file from the changelog location zFChanges for %s versions:
Installed version: %s
Available version: %s

r_NcSsg|]}|j�qSr)r�)r�orrrr�sz)MyCache.get_changelog.<locals>.<listcomp>ruz%3Ar�rz�The changelog does not contain any relevant changes.

Please use http://launchpad.net/ubuntu/+source/%s/%s/+changelog
until the changes become available or try again later.z�The list of changes is not available yet.

Please use http://launchpad.net/ubuntu/+source/%s/%s/+changelog
until the changes become available or try again later.zcaught exception: r�)rir�r�r�rhr_r)�CHANGELOG_ORIGINr�r�r�r�r�r%rr�rr�r��print)r;r[r�r�r�r��errrr��s8
�
����
��zMyCache.get_changelogrF)FN)rr
rr�r#r'r(rL�propertyrUrXrZr.reror-rzr�r�r�r�r�r�r�r�rrrrrAs6
%	



�W.	&r)&�
__future__rr�warnings�filterwarnings�
FutureWarningr!r0rkr>�urllib.errorr�urllib.requestr�urllib.parser�ImportError�urllib2�urlparse�http.clientr�httplibr�r7r3�DistUpgrade.DistUpgradeCache�DistUpgrader	r��launchpadlib.launchpadr
rI�CHANGELOGS_POOLr�r�r�DistUpgradeCacherrrrr�<module>sF���

Anon7 - 2022
AnonSec Team