+
    ng                         R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ^ RI
t
^ RIt^ RIHt ^ RIt ! R R]4      t ! R R	4      t ! R
 R]4      tR R lt]R8X  d
   ]! 4        R# R# )z;Classes for working with locally available Debian packages.N)Iterable)BytesIO)cast)gettextc                       ] tR t^#tRtRtR# )NoDebArchiveExceptionz9Exception which is raised if a file is no Debian archive. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       -/usr/lib/python3/dist-packages/apt/debfile.pyr   r   #   s    Cr   r   c                     a  ] tR t^'t o Rt]! ^4      w  tttt	^ t
RBV 3R lR lltV 3R lR ltV 3R lR ltV 3R	 lR
 lt]V 3R lR l4       t]V 3R lR l4       tRCV 3R lR lltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR lt]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR  l4       tV 3R! lR" ltV 3R# lR$ ltV 3R% lR& ltRDV 3R' lR( lltRCV 3R) lR* lltV 3R+ lR, lt V 3R- lR. lt!]V 3R/ lR0 l4       t"]V 3R1 lR2 l4       t#]$V 3R3 lR4 l4       t%]$V 3R5 lR6 l4       t&REV 3R7 lR8 llt'V 3R9 lR: lt(V 3R; lR< lt)V 3R= lR> lt*RFV 3R? lR@ llt+RAt,V t-R# )G
DebPackagezA Debian Package (.deb file).Nc                Z   < V ^8  d   QhRS[ R,          RS[P                  R,          RR/#    filenameNcachereturnstraptCache)format__classdict__s   "r   __annotate__DebPackage.__annotate__0   s2        d
 25))d2B 	 r   c                   Vf   \         P                  ! 4       pW n        \        \        P
                  R 4      V n        RV n        R V n        / V n	        . V n
        RV n        RV n        R V n        V'       d   V P                  V4       R # R # )N F)r   r   _cacher   apt_instDebFile_debfilepkgnamer   	_sections
_need_pkgs_check_was_run_failure_string
_multiarchopenselfr   r   s   &&&r   __init__DebPackage.__init__0   st     =IIKEX--t4$(CE%'#!&*IIh r   c                $   < V ^8  d   QhRS[ RR/# )r   r   r   Nr   )r   r   s   "r   r   r    A   s     $ $S $T $r   c                   V P                  ^RV,          4       . V n        \        4       V n        RV n        Wn        \        P                  ! V P
                  4      V n        V P                  P                  P                  R4      p\        P                  ! V4      V n        V P                  R,          V n        RV n        R# )zopen given debfilez	open '%s'r"   controlPackageFN)_dbgr)   set_installed_conflictsr+   r   r$   r%   r&   r5   extractdataapt_pkg
TagSectionr(   r'   r*   )r/   r   r5   s   && r   r-   DebPackage.openA   s    		![8+,.1e!!  ((7--''33I> ++G4~~i0#r   c                &   < V ^8  d   QhRS[ RS[ /# r   keyr   r3   )r   r   s   "r   r   r    N   s     # #s #s #r   c                (    V P                   V,          # Nr(   r/   r@   s   &&r   __getitem__DebPackage.__getitem__N   s    ~~c""r   c                &   < V ^8  d   QhRS[ RS[/# r?   r   bool)r   r   s   "r   r   r    Q   s     % % % %r   c                    WP                   9   # rB   rC   rD   s   &&r   __contains__DebPackage.__contains__Q   s    nn$$r   c                0   < V ^8  d   QhRS[ S[,          /# r   r   listr   )r   r   s   "r   r   r    U   s      $s) r   c                   a . o V P                   P                  P                  V3R l4       S#   \         d!    \	        R4      T P
                  ,          .u # i ; i)z$return the list of files in the deb.c                 :   < SP                  V P                  4      # rB   appendname)itemdatafiless   &&r   <lambda>%DebPackage.filelist.<locals>.<lambda>Y   s    U\\$))5Lr   z(List of files for '%s' could not be read)r&   rW   goSystemError_r   )r/   rX   s   &@r   filelistDebPackage.filelistT   s[     	SMM!!"LM   	S@ADMMQRR	Ss   )0 (AAc                0   < V ^8  d   QhRS[ S[,          /# rN   rO   )r   r   s   "r   r   r    _   s     	 	$s) 	r   c                   a . o V P                   P                  P                  V3R l4       \        S4      #   \         d!    \	        R4      T P
                  ,          .u # i ; i)z*return the list of files in control.tar.gzc                 :   < SP                  V P                  4      # rB   rS   )rV   rW   r5   s   &&r   rY   -DebPackage.control_filelist.<locals>.<lambda>c   s    tyy8Qr   z0List of control files for '%s' could not be read)r&   r5   r[   r\   r]   r   sorted)r/   r5   s   &@r   control_filelistDebPackage.control_filelist^   sa     	MM!!$$%QR
 g	  	DEU 	s   )9 (A$#A$c                ,   < V ^8  d   QhRS[ RS[RS[ /# )r   r'   in_conflict_checkingr   rH   )r   r   s   "r   r   r    k   s%     $! $!$!26$!	$!r   c                   R V9   d   V# V P                   '       g   V# V P                  P                  V4      '       d   V# WP                  9   dp   V P                  V,          P                  eQ   \	        \
        P                  P                  V P                  V,          P                  4      P                  R8X  d   V# V R V P                    2pW0P                  9  d   V# V P                  V,          pVP                  f   V# VP                  P                  pVP                  VP                  ,          '       d   V# V'       d&   VP                  VP                  ,          '       g   V# V# ):all)r,   r#   is_virtual_package	candidater   r   packageVersionarchitecture_cand
multi_archMULTI_ARCH_FOREIGNMULTI_ARCH_SAME)r/   r'   rh   multiarch_pkgnamemultiarch_pkgcands   &&&   r   _maybe_append_multiarch_suffix)DebPackage._maybe_append_multiarch_suffixk   s'    '>NN[[++G44N{{"G$..:S[[(($++g*>*H*HIVV N&iq(9:KK/$$$56""*$$&&,, ??T4444N  4;O;O)O)ON  r   c                P   < V ^8  d   QhRS[ S[S[S[S[3,          ,          RS[/# r   or_groupr   rP   tupler   rI   )r   r   s   "r   r   r       s+     / /tE#sC-4H/I /d /r   c           
        V P                  ^RV,          4       V EFi  pV^ ,          pV^,          pV^,          pV P                  V4      pW0P                  9  du   V P                  P                  V4      '       dR   V P                  ^RV,          4       V P                  P	                  V4       F  pVP
                  '       g   K    R# 	  K  V P                  V,          P                  pVe+   \        P                  ! VP                  WT4      '       d    R# V'       d   EK
  V P                  P	                  VRR7       F>  pVP
                  '       g   K  V P                  ^RVP                  : RV: R24         R# 	  EKl  	  R# )	zReturn True if at least one dependency of the or-group is satisfied.

This method gets an 'or_group' and analyzes if at least one dependency
of this group is already satisfied.
z_checkOrGroup(): %s z+_is_or_group_satisfied(): %s is virtual depT)include_nonvirtualzfound installed 'z' that provides ''F)r7   rx   r#   rl   get_providing_packagesis_installed	installedr;   	check_depversionrU   )	r/   r|   depdepnameveroperpkginstppkgs	   &&       r   _is_or_group_satisfied!DebPackage._is_or_group_satisfied   sJ    			!+x89C!fGa&Cq6D 99'BG kk);;11'::IIH7R  ${{AA'J+++#'  K ;;w'11DG$5$5dllD$N$N 4 KK>> ? D (((		#yy'3
  $; N r   c                P   < V ^8  d   QhRS[ S[S[S[S[3,          ,          RS[/# r{   r}   )r   r   s   "r   r   r       s+     * *$uS#s]/C*D * *r   c                   V EF7  pVw  r4pV P                  V4      pW0P                  9  dd   V P                  P                  V4      '       g   KM  V P                  P                  V4      p\	        V4      ^8w  d   Kz  V^ ,          P
                  pV P                  V,          pV P                  P                  P                  VP                  4      pV'       g   K  \        P                  ! VP                  WT4      '       g   EK  V P                  ^RV,          4       V P                  P                  V4        R# 	  Rp	V Fh  pW^ ,          ,          p	X'       d'   X'       d   V	RV^,           RV^,           R2,          p	W!\	        V4      ^,
          ,          8w  g   K_  V	R,          p	Kj  	  V ;P                  \!        R4      V	,          ,          un        R	# )
zTry to satisfy the or_group.zNeed to get: %sTr"   z ( )|z"Dependency is not satisfiable: %s
F)rx   r#   rl   r   lenrU   	_depcacheget_candidate_ver_pkgr;   r   ver_strr7   r)   rT   r+   r]   )
r/   r|   r   r   r   r   	providersr   rw   or_strs
   &&        r   _satisfy_or_groupDebPackage._satisfy_or_group   s{   C!$G$ 99'BG kk){{55g>> KK>>wG	 y>Q&#A,++ ++g&C;;((::388DD$$T\\4== IIa*W45OO""7+; @ C!fFtBs1vhaAxq11s8}q011#  	"G H6 QQr   c                2   < V ^8  d   QhRS[ RS[ RS[ RS[/# )r   r'   r   r   r   rH   )r   r   s   "r   r   r       s)      # C s t r   c           
     l   V P                  ^RV: RV: RV: R24       V P                  V,          pVP                  '       d(   VP                  f   Q hVP                  P                  pM;VP
                  '       d(   VP                  f   Q hVP                  P                  pMR# \        P                  ! WSV4      '       dq   V P                  WV4      '       gY   V ;P                  \        R4      VP                  ,          ,          un
        V P                  ^RVP                  ,          4       R# R# )	z@Return True if a pkg conflicts with a real installed/marked pkg.z"_check_single_pkg_conflict() pkg='z' ver='z' oper='r   Fz)Conflicts with the installed package '%s'z!conflicts with installed pkg '%s'T)r7   r#   r   r   r   marked_installrm   r;   r   replaces_real_pkgr+   r]   rU   )r/   r'   r   r   r   pkgvers   &&&&  r   _check_single_pkg_conflict%DebPackage._check_single_pkg_conflict   s     			T#	

 kk'"==,,,]]**F==,,,]]**F
 V3//8N8N39
 9
   @ACHHL  IIa<sxxGHr   c                P   < V ^8  d   QhRS[ S[S[S[S[3,          ,          RS[/# r{   r}   )r   r   s   "r   r   r      s,     / /$uS#s]7K2L /QU /r   c                   V P                  ^RV,          4       V EFY  pV^ ,          pV^,          pV^,          pV P                  VRR7      pW0P                  9  d   V P                  P                  V4      '       d   V P                  P	                  V4       F  pV P                  ^RVP
                  ,          4       V P                  VP
                  8X  d   V P                  ^R4       KU  V P                  VP
                  WE4      '       g   Ky  V P                  P                  VP
                  4       K  	  EK#  V P                  W4V4      '       g   EK>  V P                  P                  V4       EK\  	  \        V P                  4      # )z5Check the or-group for conflicts with installed pkgs.z _check_conflicts_or_group(): %s T)rh   zconflicts virtual check: %szconflict on self, ignoring)r7   rx   r#   rl   r   rU   r'   r   r9   addrI   )r/   r|   r   r   r   r   r   s   &&     r   _check_conflicts_or_group$DebPackage._check_conflicts_or_group  s<   		!78DEC!fGa&Cq6D 99d : G
 kk) ;;11'::#{{AA'J		!%BSXX%MN<<3883 IIa)EF$::388SOO 5599#((C  K ..wTBB))--g65 6 D--..r   c                Z   < V ^8  d   QhRS[ S[ S[S[S[S[3,          ,          ,          /# rN   rP   r~   r   )r   r   s   "r   r   r    /  s)      4U3S=%9 :; r   c                ~    Rp \         P                  ! V P                  V,          R4      #   \         d    . u # i ; i)z/List of packages conflicting with this package.	ConflictsFr;   parse_dependsr(   KeyErrorrD   s   & r   	conflictsDebPackage.conflicts.  s>     	(()<eDD 	I	   ', <<c                Z   < V ^8  d   QhRS[ S[ S[S[S[S[3,          ,          ,          /# rN   r   )r   r   s   "r   r   r    8  s)     	 	d5c3#789 	r   c                    . pR F;  p VP                  \        P                  ! V P                  V,          R4      4       K=  	  V#   \         d     KO  i ; i)z2List of packages on which this package depends on.F)DependszPre-Depends)extendr;   r   r(   r   )r/   dependsr@   s   &  r   r   DebPackage.depends7  sU     +Cw44T^^C5H%PQ ,
   s   7AAAc                Z   < V ^8  d   QhRS[ S[ S[S[S[S[3,          ,          ,          /# rN   r   )r   r   s   "r   r   r    D  )      $tE#sC-$89: r   c                ~    Rp \         P                  ! V P                  V,          R4      #   \         d    . u # i ; i)z<List of virtual packages which are provided by this package.ProvidesFr   rD   s   & r   providesDebPackage.providesC  >     	(()<eDD 	I	r   c                Z   < V ^8  d   QhRS[ S[ S[S[S[S[3,          ,          ,          /# rN   r   )r   r   s   "r   r   r    M  r   r   c                ~    Rp \         P                  ! V P                  V,          R4      #   \         d    . u # i ; i)z4List of packages which are replaced by this package.ReplacesFr   rD   s   & r   replacesDebPackage.replacesL  r   r   c                2   < V ^8  d   QhRS[ RS[ RS[ RS[/# )r   r'   r   r   r   rH   )r   r   s   "r   r   r    U  s)       C c d r   c           	        V P                  ^RV RV RV 24       V P                  V,          pRpVP                  '       d(   VP                  f   Q hVP                  P                  pM;VP
                  '       d(   VP                  f   Q hVP                  P                  pMRpV P                   FU  pV FL  w  rspWq8X  g   K  Ve    \        P                  ! WRV4      '       g   K1  V P                  ^RV,          4         R# 	  KW  	  R# )zReturn True if a given non-virtual package is replaced.

Return True if the deb packages replaces a real (not virtual)
packages named (pkgname, oper, ver).
zreplaces_real_pkg() r   Nz?we have a replaces in our package for the conflict against '%s'TF)
r7   r#   r   r   r   r   rm   r   r;   r   )r/   r'   r   r   r   r   r|   rU   s   &&&&    r   r   DebPackage.replaces_real_pkgU  s     			!+G9AdV1SEBCkk'"!==,,,]]**F==,,,]]**FFH#+4?Ng&7&7c&J&JII03:<
   $, & r   c                    < V ^8  d   QhRS[ /# rN   rI   )r   r   s   "r   r   r    s  s       r   c                f    RpV P                    F  pV P                  V4      '       g   K  RpK   	  V# )zCheck if there are conflicts with existing or selected packages.

Check if the package conflicts with a existing or to be installed
package. Return True if the pkg is OK.
TF)r   r   )r/   resr|   s   &  r   check_conflictsDebPackage.check_conflictss  s6     H--h77 	 '
 
r   c                    < V ^8  d   QhRS[ /# rN   r   )r   r   s   "r   r   r      s     ^ ^ ^r   c                t	   \        \        V P                  4      4      p\        \	        V^2,          4      ^4      pV P
                  R,          pV P
                  R,          pV P                   Uu. uF  qU^ ,          ^ ,          NK  	  pp\        V P                  4       EF  w  rxWr,          ^ 8X  d=   V P                  P                  P                  \        V4      V,          R,          4       VP                  '       g   Kc  VP                  f   Q hVP                  P                  p	VP                  P                   EF
  p
V
P                   F  pVP                   V P"                  8X  g   K   \$        P&                  ! W;P(                  VP*                  4      '       d   KS  V P-                  ^RVP                   ,          4       V ;P.                  \1        R4      RVP                   RVP                   RVP(                  R	VP*                  /,          ,          un        V P                  P                  P3                  4           R
# 	  EK  	  RV	P4                  9   g   EK  V	P4                  R,           EF  pV EF  pVP6                  P                   V P"                  8X  d   VP6                  P8                  V8X  d   \$        P&                  ! W=P:                  VP<                  4      '       d   V P-                  ^RVP                   ,          4       V ;P.                  \1        R4      RVP                   RVP6                  P                   RVP:                  RVP<                  /,          ,          un        V P                  P                  P3                  4           R
# VP6                  P                   V9   g   EKB  V P"                  VP                   8w  g   EK`  V P-                  ^RV,          4       V ;P.                  \1        R4      RRP?                  V4      RV P@                  RVP6                  P                   RVP                   /,          ,          un        V P                  P                  P3                  4           R
# 	  EK  	  EK  	  V P                  P                  P3                  4        R# u upi )z
check if installing the package would break exsisting
package on the system, e.g. system has:
smc depends on smc-data (= 1.4)
and user tries to installs smc-data 1.6
ro   Architectureg      Y@zwould break (depends) %sz]Breaks existing package '%(pkgname)s' dependency %(depname)s (%(deprelation)s %(depversion)s)r'   r   deprelation
depversionFr   zwould break (conflicts) %szZBreaks existing package '%(pkgname)s' conflict: %(targetpkg)s (%(comptype)s %(targetver)s)	targetpkgcomptype	targetverz{Breaks existing package '%(pkgname)s' that conflict: '%(targetpkg)s'. But the '%(debfile)s' provides it via: '%(provides)s'r   ,debfileT)!floatr   r#   maxintr(   r   	enumerateop_progressupdater   r   r   current_verdependenciesor_dependenciesrU   r'   r;   r   relationr   r7   r+   r]   donedepends_list
target_pkgrp   	comp_type
target_verjoinr   )r/   sizestepsdebverdebarchxr   ir   r   dep_orr   conflicts_ver_listc_ors   &             r   check_breaks_existing_packages)DebPackage.check_breaks_existing_packages  s    S%&Cr	NA&	*..0%)]]3]aDGG]3,FAyA~''..uQx$/FG###==,,, ((&&C--44!11Cxx4<</&00s{{SS IIa)Cchh)NO
 !00A!C5
 !*388 )388 -s|| ,ckk	!		5 	0 !KK3388:#(' 2 5. c...*-*:*:;*G*G& 2 OO00DLL@ $ < < G&00 &    !%		!-ICHH-T U !% 4 4%C9"
 %.sxx$/1E1E$.$/	%"		9" 	!" 4 !% 7 7 < < >', OO00H< $ 8 IIa)E)PQ 00A!15 !+CHHX,> )4== +T__-A-A )388	!
5 
0 !KK3388:#(Y !3 +HC -^ 	$$&c 4s   /R5c                &   < V ^8  d   QhRS[ RS[/# )r   use_installedr   )rI   r   )r   r   s   "r   r   r      s     !! !! !! !!r   c                   V P                  ^R4       V P                  R,          pV P                  R,          pRP                  W#.4      pV P                  R,          pV P                  ^RV,          4       W P                  9   d   V P                  V,          pV'       d&   VP                  e   VP                  P
                  pM9V'       g&   VP                  e   VP                  P
                  pMV P                  # Vei   \        P                  ! Wd4      pV P                  ^RV,          4       V^ 8X  d   V P                  # V^ 8  d   V P                  # V^ 8  d   V P                  # V P                  # )zCompare the package to the version available in the cache.

Checks if the package is already installed or availabe in the cache
and if so in what version, returns one of (VERSION_NONE,
VERSION_OUTDATED, VERSION_SAME, VERSION_NEWER).
compare_to_version_in_cacher6   r   rj   ro   z
debver: %sz"CompareVersion(debver,instver): %s)r7   r(   r   r#   r   r   rm   VERSION_NONEr;   version_compareVERSION_SAMEVERSION_NEWERVERSION_OUTDATED)r/   r   r'   rp   r   r   cachevercmps   &&      r   r   &DebPackage.compare_to_version_in_cache  s,    			!23..+~~n5 ((G23	*		!\F*+kk!++g&C!:==00"s}}'@==00(((#--h?		!ACGH!8,,,1W---1W000   r   c                &   < V ^8  d   QhRS[ RS[ /# r   allow_downgrader   r   )r   r   s   "r   r   r      s     C CT Cd Cr   c                z   V P                  ^R4       RV n        RV P                  9  d%   V P                  ^R4       \        R4      V n        R# V P                  R,          pVR8w  d   V\
        P                  P                  R4      8w  d   V\
        P                  ! 4       9   dA   W n	        V P                   R	V P                   2V n
        V P                  ^R
V,          4       M+V P                  ^R4       \        R4      V,          V n        R# V'       g_   V P                  4       V P                  8X  d@   V P                  V P                  ,          P                  '       d   \        R4      V n        R# RV n        V P                  4       '       g   R# V P!                  4       '       g   R# V P#                  V P$                  4      '       g   R# V P                  4       '       g   R# V P                  P&                  P(                  ^ 8  d-   \        R4      V n        V P                  P+                  4        R# R# )z$Check if the package is installable.checkTr   zERROR: no architecture fieldz$No Architecture field in the packageFrk   zAPT::Architecturerj   zFound multiarch arch: '%s'zERROR: Wrong architecture dude!zVWrong architecture '%s' -- Run dpkg --add-architecture to add it and update afterwardsz$A later version is already installedr"   z1Failed to satisfy all dependencies (broken cache))r7   r*   r(   r]   r+   r;   configfindget_architecturesr,   r'   r   r   r#   r   r   r   _satisfy_dependsr   r   broken_countclear)r/   r  archs   && r   r  DebPackage.check  s   		!W" /IIa78#$%K#LD ~~n-5=TW^^%8%89L%MMw0022"&"&,,q0AB		!9D@A		!>?7
  $   002d6K6KK{{4<<(222'()O'P$  " ##%% 2244 $$T\\22 ##%%;;  --1#$F$D  KKr   c                &   < V ^8  d   QhRS[ RS[/# )r   
dependsstrr   rH   )r   r   s   "r   r   r    I  s     O Oc Od Or   c                N    V P                  \        P                  ! VR4      4      # )z-Satisfy the dependencies in the given string.F)r  r;   r   )r/   r  s   &&r   satisfy_depends_strDebPackage.satisfy_depends_strI  s     $$W%:%::u%MNNr   c                `   < V ^8  d   QhRS[ S[ S[S[S[S[3,          ,          ,          RS[/# )r   r   r   r}   )r   r   s   "r   r   r    M  s0      T%S#2F-G(H T r   c                    \         P                  ! V P                  P                  4      pV V F6  pV P                  V4      '       d   K  V P                  V4      '       d   K5   R# 	  V P                   F'  p V P                  V,          P                  RR7       K)  	  R#   \         d     Li ; i  \         d7    \        R4      T,          T n        T P                  P                  4          R# i ; i)zSatisfy the dependencies.F)	from_userzCannot install '%s'T)r;   ActionGroupr#   r   AttributeErrorr   r   r)   mark_installr\   r]   r+   r
  )r/   r   _actiongroupr|   r   s   &&   r   r  DebPackage._satisfy_dependsM  s    	"..t{{/D/DEL  H..x88--h77   
 ??CC ---> #   		  '()>'?#'E$!!#s#   ,B# :#B4#B10B14<C54C5c                0   < V ^8  d   QhRS[ S[,          /# rN   rO   )r   r   s   "r   r   r    e  s      d3i r   c                    V P                  ^RV P                  ,          4       V P                  '       g   \        R4      hV P                  # )zReturn missing dependencies.zInstalling: %s-property only available after check() was run)r7   r)   r*   r  r/   s   &r   missing_depsDebPackage.missing_depsd  s>     			!%78""" !PQQr   c                j   < V ^8  d   QhRS[ S[S[,          S[S[,          S[S[,          3,          /# rN   )r~   rP   r   )r   r   s   "r   r   r    m  s,     2 2%S	49d3i(G"H 2r   c                   . p. p. pV P                   '       g   \        R4      hV P                   F  pVP                  '       g   VP                  '       d   VP
                  f   Q hVP                  VP                  4       RpVP
                  P                   F  pWVP                  ,          pK  	  V'       g   VP                  VP                  4       VP                  '       g   K  VP                  VP                  4       K  	  WV3# )zpGet the changes required to satisfy the dependencies.

Returns: a tuple with (install, remove, unauthenticated)
r  F)r*   r  r#   r   marked_upgraderm   rT   rU   originstrustedmarked_delete)r/   installremoveunauthenticatedr   authenticatedorigins   &      r   required_changesDebPackage.required_changesl  s     """ !PQQ;;C!!!S%7%7%7}}000sxx( !&!mm33F!^^3M 4$#**3884   chh'  11r   c                &   < V ^8  d   QhRS[ RS[ /# r   in_datar   r3   )r   r   s   "r   r   r      s        r   c                    R p\        V 4       F5  w  r#V^P,          ^ 8X  d
   VR,          pVR\        V4      ,          ,          pK7  	  V# )r"   
z%2.2x )r   ord)r/  hexr   cs   &   r   to_hexDebPackage.to_hex  sF    g&DA2v{t8c!f$$C ' 
r   c                F   < V ^8  d   QhRS[ S[S[,          ,          RS[ /# r.  )r   r   r   )r   r   s   "r   r   r      s$      3#. 3 r   c                   R p\        V \        4      '       d?   V  F6  p\        V4      ^
8  g   \        V4      ^8  d   VR,          pK.  W,          pK8  	  V# V  F.  pV^
8  g   V^8  d   VR,          pK  V\        V4      ,          pK0  	  V# )r"   r   )
isinstancer   r2  chr)r/  sr4  bs   &   r   	to_strishDebPackage.to_strish  s    gs##q6B;#a&3,HAFA	   r6QWHAQKA	 
 r   c          
      L   < V ^8  d   QhRS[ P                  RS[RS[RS[RS[/# )r   partrU   auto_decompressauto_hexr   )r$   TarFiler   rI   )r   r   s   "r   r   r      sC        	
  
r   c                   VP                  R 4      '       d
   VR,          pVP                  V4      pVP                  R4      '       d[   V'       dS   \        V4      p\        P
                  ! VR7      p\        R4      P                  R4      pWWP                  4       ,          p VP                  R4      #   \         d(    \        R4      pYP                  T4      ,          pTu # i ; i)z./:r   NNz.gz)fileobjzAutomatically decompressed:

zutf-8z,Automatically converted to printable ascii:
)
startswithr:   endswithr   gzipGzipFiler]   encodereaddecode	Exceptionr=  )	r/   r@  rU   rA  rB  rW   iogznew_datas	   &&&&&    r   _get_contentDebPackage._get_content  s     ??4  8D%==OBr*B67>>wGDGGID	;;w'' 	HIHt,,HO	s   $B5 5/C'&C'c                &   < V ^8  d   QhRS[ RS[ /# r   rU   r   r3   )r   r   s   "r   r   r      s      C C r   c                t     V P                  V P                  P                  V4      #   \         d     R# i ; iz4return the content of a specific control.tar.gz filer"   )rQ  r&   r5   LookupErrorr/   rU   s   &&r   control_contentDebPackage.control_content  s6    	$$T]]%:%:DAA 		   %( 77c                &   < V ^8  d   QhRS[ RS[ /# rT  r3   )r   r   s   "r   r   r      s        r   c                t     V P                  V P                  P                  V4      #   \         d     R# i ; irV  )rQ  r&   rW   rW  rX  s   &&r   data_contentDebPackage.data_content  s6    	$$T]]%7%7>> 		r[  c                *   < V ^8  d   QhRS[ RS[RR/# )r   levelmsgr   N)r   r   )r   r   s   "r   r   r      s"     ( (# (C (D (r   c                `    WP                   8:  d   \        V\        P                  R7       R# R# )z%Write debugging output to sys.stderr.)fileN)debugprintsysstderr)r/   ra  rb  s   &&&r   r7   DebPackage._dbg  s    JJ#CJJ' r   c                p   < V ^8  d   QhRS[ P                  P                  P                  R,          RS[/# )r   install_progressNr   )r   progressbaseInstallProgressr   )r   r   s   "r   r   r      s2       # 1 1 A AD H	r   c                   V P                   f   \        P                  ! R4      hVf3   \        P                  ! \        P
                  RRRV P                   4      #  VP                  4        VP                  V P                   4      p VP                  4        V#   \         d    TP                  4         LKi ; i  \         d    TP                  4         T# i ; i)zInstall the package.zNo filename specifieddpkgz-i)r   r;   ErrorosspawnlpP_WAITstart_updater  startUpdaterunfinish_updatefinishUpdate)r/   rk  r   s   && r   r&  DebPackage.install  s     == -- 788#::biit}}MM/ --/ #&&t}}5C0 ..0 J " / ,,./
 " 0 --/J0s$   B B; B87B8;CC)
r#   r*   r&   r+   r9   r,   r)   r(   r   r'   NNF)T)TTrB   ).r	   r
   r   r   r   ranger   r   r   r   re  r0   r-   rE   rK   propertyr^   re   rx   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r+  staticmethodr5  r=  rQ  rY  r^  r7   r&  r   __classdictcell__r   s   @r   r   r   '   s    ' EJ!HA\#\=E   "$ $# #% %   	 	$! $!L/ /b* *X @/ /@   	 	     < ^ ^@!! !!FC CJO O .   2 22    $ 0  ( (
  r   r   c                      a  ] tR tRt o RtRV 3R lR llt]V 3R lR l4       t]V 3R lR	 l4       t]V 3R
 lR l4       t	V 3R lR lt
RV 3R lR lltRtV tR# )DscSrcPackagei  z#A locally available source package.Nc                Z   < V ^8  d   QhRS[ R,          RS[P                  R,          RR/# r   r   )r   r   s   "r   r   DscSrcPackage.__annotate__  s2     % %d
%25))d2B%	%r   c                    \         P                  V R V4       Wn        . V n        . V n        \        4       V n        RV n        . V n        / V n	        V P                  e   V P                  V P                  4       R # R # )Nr"   )r   r0   r   _depends
_conflictsr8   r9   r'   binariesr(   r-   r.   s   &&&r   r0   DscSrcPackage.__init__  sg     	D$.$,:<<>.1e!#%)+==$IIdmm$ %r   c                Z   < V ^8  d   QhRS[ S[ S[S[S[S[3,          ,          ,          /# rN   r   )r   r   s   "r   r   r    s)      d5c3#789 r   c                    V P                   # z&Return the dependencies of the package)r  r  s   &r   r   DscSrcPackage.depends  s     }}r   c                Z   < V ^8  d   QhRS[ S[ S[S[S[S[3,          ,          ,          /# rN   r   )r   r   s   "r   r   r    s)      4U3S=%9 :; r   c                    V P                   # r  )r  r  s   &r   r   DscSrcPackage.conflicts  s     r   c                0   < V ^8  d   QhRS[ S[,          /# rN   rO   )r   r   s   "r   r   r    s     5 5$s) 5r   c                R    V P                   R,          P                  4       R,          # )z6Return the list of files associated with this dsc fileFiles:r   N   )r(   splitr  s   &r   r^   DscSrcPackage.filelist  s!     ~~g&,,.t44r   c                $   < V ^8  d   QhRS[ RR/# )r   rd  r   Nr3   )r   r   s   "r   r   r    s      $  $  $  $r   c                   RR.pRR.p\         P                  ! V4      p\        P                  ! V4      p\         P                  ! V4      p V EF  pV F@  pW9  d   K  V P
                  P                  \         P                  ! Wx,          4      4       KB  	  V F@  pW9  d   K  V P                  P                  \         P                  ! Wx,          4      4       KB  	  RV9   d   VR,          V n	        RV9   d;   VR,          P                  R4       U	u. uF  qP                  4       NK  	  up	V n        VP                  4        F   pW9   g   K  Wx,          V P                  V&   K"  	  EK  	  ?VP                  4        \!        R4      V P                  R	P#                  V P                  4      3,          p
WP                  R
&   RV n        R# u up	i   ?TP                  4        i ; i)zOpen the package.zBuild-DependszBuild-Depends-IndepzBuild-ConflictszBuild-Conflicts-IndepSourceBinaryr   zBInstall Build-Dependencies for source package '%s' that builds %s
r   DescriptionFN)r;   open_maybe_clear_signed_filerr  fdopenTagFiler  r   parse_src_dependsr  r'   r  stripr  keysr(   closer]   r   r*   )r/   rd  depends_tagsconflicts_tagsfdfobjtagfilesectagr<  r;  s   &&         r   r-   DscSrcPackage.open  s   ')>?+-DE11$7yy}//$'	'C~ MM(()B)B38)LM ( *C~ OO**7+D+DSX+NO * s?#&x=DLs?8;H8K8KC8P$Q8P1WWY8P$QDM88:Cz.1hs+ & " JJLT
\\388DMM234 )*}%# %R
 JJLs%   CG G,G G G G$c                &   < V ^8  d   QhRS[ RS[ /# r  r   )r   r   s   "r   r   r  %  s     3 3T 3d 3r   c                \   V P                  4       '       gv   V P                   Fe  pV P                  V,          P                  P                  '       d   \        \        R4      4      hV P                  V,          P                  4        Kg  	  RV n        V P                  V P                  4      # )zyCheck if the package is installable.

The second parameter is ignored and only exists for compatibility
with parent type.z%An essential package would be removedT)r   r9   r#   r   	essentialrM  r]   mark_deleter*   r  r   )r/   r  r'   s   && r   r  DscSrcPackage.check%  s    
 ##%%44;;w',,666#A&M$NOOG$002 5
 # $$T\\22r   )r*   r  r  r9   r(   r  r   r'   r{  r|  )r	   r
   r   r   r   r0   r~  r   r   r^   r-   r  r   r  r  s   @r   r  r    sh     -% %     5 5
 $  $D3 3 3r   r  c                    V ^8  d   QhRR/# )r   r   Nr   )r   s   "r   r   r   6  s     #@ #@t #@r   c                 B   ^ RI Hp  ^ RIHp V ! 4       pRp\	        V RVP                  V4       24       VP                  V4      p\	        RV,          4       V F  p\	        RVP                  ,          4       K!  	  \        \        P                  ^,          V4      p\	        RVP                  ,          4       VP                  4       '       g!   \	        R4       \	        VP                  4       \	        R	VP                  ,          4       \	        VP                  4       \	        VP                   4       \	        R
4       VP#                  V! 4       4      p\	        V4       \%        VR7      pRp	\	        VP'                  \(        P*                  ! V	R4      4      4       R# )zTest function)r   )rn  zwww-browserz
 virtual: zProviders for %s :z %szDeb: %szcan't be satifiedzmissing deps: %szInstalling ...)r   z:libc6 (>= 2.3.2), libaio (>= 0.3.96) | libaio1 (>= 0.3.96)FN)	apt.cacher   apt.progress.basern  rf  rl   r   rU   r   rg  argvr'   r  r+   r  r+  r^   r&  r  r  r;   r   )
r   rn  r   vpr   r   dretr;  dss
             r   _testr  6  s3   1GE	B	RD
533B78
9:,,R0I	

#$echh  	388A;&A	)aii
 7799!"a 	
q~~
-.	!

	!**	

))O%
&C	#J 	E"A	EB	!

W222u=
>?r   __main__)r   rH  rr  rg  collections.abcr   rN  r   typingr   r$   r;   r   r]   r   IOErrorr   r   r  r  r	   r   r   r   <module>r     sn   & B  	 
 $       
DG Dx
 x
vQ3J Q3h#@L z	G r   