+
    oÆFj-3  ã                   óˆ   € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t^ RI
Ht R tR tR
R ltR R ltRR R	 lltR# )zFunctions to manage sandboxes.N)Úimplc                ó€  € / pV P                  RR4       RV P                  RR4       2P                  4        F9  pVP                  4       '       g   K   VP                  4       R,          w  r4YAT&   K;  	  \        VP                  4       4      #   \         d%    \
        P                  P                  RT4        K„  i ; i)z�Determine necessary packages for given report.

Return list of (pkgname, version) pairs. version might be None for unknown
package versions.
ÚPackageÚ Ú
ÚDependenciesºNé   Nú%invalid Package/Dependencies line: %s)
ÚgetÚ
splitlinesÚstripÚsplitÚ
ValueErrorÚapportÚloggingÚwarningÚlistÚitems)ÚreportÚpkgsÚlineÚpkgÚversions   &    Ú5/usr/lib/python3/dist-packages/apport/sandboxutils.pyÚneeded_packagesr      s°   € ð €Dð �:‰:�i Ó$Ð
% R¨¯
©
°>À2Ó(FÐ'GÐHß�jƒlòˆð �z‰z�|Š|Ùð	ØŸ:™:›<¨Õ+‰LˆCð
 ˆS‹	ñô �—
‘
“ÓÐøô ô 	Ü�N‰N×"Ñ"Ð#JÈDÔQâð	ús   ÁBÂ+B=Â<B=c                óR  € / pV P                  RR4       RV P                  RR4       2P                  4        F9  pVP                  4       '       g   K   VP                  4       R,          w  r4YAT&   K;  	  V#   \         d%    \
        P                  P                  RT4        Km  i ; i)z1Return package -> version dictionary from report.r   r   r   r   r   r
   )r   r   r   r   r   r   r   r   )r   Úpkg_versr   r   r   s   &    r   Úreport_package_versionsr   2   s    € à€Hà�:‰:�i Ó$Ð
% R¨¯
©
°>À2Ó(FÐ'GÐHß�jƒlòˆð �z‰z�|Š|Ùð	ØŸ:™:›<¨Õ+‰LˆCð
  �‹ñð €Oøô ô 	Ü�N‰N×"Ñ"Ð#JÈDÔQâð	ús   ÁA7Á7+B&Â%B&c           
     ó
  € \        4       p\        4       pRV 9   d±   V R,          P                  4        F”  pVP                  4       '       g   K  VP                  4       p\	        V4      R9   g   K=  RV^,          9   g   KM  RV^,          9   g   K]  \
        P                  P                  V^,          4      pVP                  V4       K–  	  M4\        P                  P                  V R,          4      P                  4       p\
        P                  P                  V4      '       g   \
        P                  ! V4       V F�  p\        P                   ! VRVV R,          V P#                  R4      R7      p	V	'       dB   V'       d'   \        P$                  P'                  R	V R
V	 R24       VP                  V	4       K}  \        P$                  P)                  RV4       KŸ  	  V U
u. uF  qªVP#                  V
4      3NK  	  up
# u up
i )aÆ  Determine necessary runtime packages for given report.

This determines libraries dynamically loaded at runtime in two cases:
1. The executable has already run: /proc/pid/maps is used, from the report
2. The executable has not already run: shared_libraries() is used

The libraries are resolved to the packages that installed them.

Return list of (pkgname, None) pairs.

When pkgmap_cache_dir is specified, it is used as a cache for
get_file_package().
ÚProcMapsÚxz.soÚExecutablePathTÚDistroReleaseÚArchitecture©ÚreleaseÚarchzdynamically loaded z needs package z
, queueingz/%s is needed, but cannot be mapped to a package>   é   é   )Úsetr   r   r   ÚlenÚosÚpathÚrealpathÚaddr   Ú	fileutilsÚshared_librariesÚvaluesÚexistsÚmakedirsÚ	packagingÚget_file_packager   r   Úlogr   )r   Úpkgmap_cache_dirÚpkg_versionsÚverboser   Úlibsr   ÚcolsÚlibr   Úps   &&&&       r   Úneeded_runtime_packagesr?   E   sˆ  € ô  ‹5€DÜ‹5€DØ�VÔØ˜:Õ&×1Ñ1Ö3ˆDØ—:‘:—<’<ÙØ—:‘:“<ˆDÜ�4‹y˜FÖ" s¨d°1­g¦~¸%À4ÈÅ7Ö:JÜ—g‘g×&Ñ& t¨A¥wÓ/�Ø—‘˜–ò 4ô ×Ñ×0Ñ0°Ð8HÕ1IÓJ×QÑQÓSˆÜ�7‰7�>‰>Ð*×+Ò+Ü
�ŠÐ$Ô%ó ˆÜ×(Ò(ØØØØ˜?Õ+Ø—‘˜NÓ+ô
ˆ÷ ßÜ—‘×"Ñ"Ø)¨$¨¨¸s¸eÀ:ÐNôð �H‰H�SŽMä�N‰N×"Ñ"ØAÀ4öñ ñ& /3Ó3©d¨�× Ñ  Ó#Ó$©dÑ3Ð3ùÒ3s   Ç"H c                ón   € V ^8„  d   QhR\         \        \        R\        ,          3,          ,          RR/# )r	   r   NÚreturn)r   ÚtupleÚstr)Úformats   "r   Ú__annotate__rE   |   s,   € ÷ ñ ¤¤e¬C°¼µ¨OÕ&<Õ!=ð À$ñ ó    c                óz   € \        V 4       F+  w  pw  r#VR8X  g   K  V P                  V4       RV3.V R&    R# 	  R# )z2Move base-files to the front or add it if missing.z
base-files:Né    NN)Ú	enumerateÚpop)r   Úir   r   s   &   r   Ú_move_base_files_firstrL   |   s>   € ä& tž_Ñˆ‰>ˆCØ�,ÖØ�H‰H�QŒKØ% wÐ/Ð0ˆD�‰HÚó	 -rF   c                ó&  € V ^8„  d   QhR\         P                  P                  R\        R,          R\        R,          R\        R,          R\        \        ,          R,          R\
        R\
        R	\
        R
\        \        \        \        3,          /	# )r	   r   Ú
config_dirNÚ	cache_dirÚsandbox_dirÚextra_packagesr:   Úlog_timestampsÚdynamic_originsrA   )r   r   ÚReportrC   r   ÚboolrB   )rD   s   "r   rE   rE   †   s—   € ÷ Z0ñ Z0Ü�M‰M× Ñ ðZ0ä�d•
ðZ0ô �T�zðZ0ô �t•ð	Z0ô
 œ•I Õ$ðZ0ô ðZ0ô ðZ0ô ðZ0ô Œ3””Sˆ=ÕñZ0rF   c                óþ  € V'       d^   \         P                  P                  V4      p\         P                  P                  V4      '       g   \         P                  ! V4       RpM>\
        P                  ! RR7      p\        P                  ! \        P                  V4       RpV'       d!   \         P                  P                  V4      pM<\
        P                  ! RR7      p\        P                  ! \        P                  V4       \         P                  P                  W R,          4      p	. p
RV 9  g/   RV P                  R	R
4      V P                  RR
4      ,           9   d   \        V 4      p
VR8X  d   RpRpV'       d‚   V P                  R	R
4       RV P                  RR
4       2p\        P                  ! R4      p\!        VP#                  V4      4      pV'       d#   \$        P&                  P)                  RV 24       \+        V
4        \,        P.                  ! VVV R,          V
VVVV P                  R4      VR7	      pV'       dR    X\,        P.                  ! TTV R,          V Uu. uF  pVR3NK	  	  upVVVV P                  R4      VRRR7      ,          p\7        V 4      p\9        W	VV4      p
R# FÚ  pVV 9   g   K  \,        P:                  ! V V,          RV	V R,          V P                  R4      R7      pVR8X  d   V R,          R8X  d   RV R&   RpV'       dK   \$        P&                  P)                  RV RV 2V4       V
P=                  VVP                  V4      34       K²  \$        P&                  P3                  RVV V,          4       KÜ  	  V
'       d>    X\,        P.                  ! VVV R,          V
VVVV P                  R4      VR7	      ,          pR	V 9   Ed#   R# EF  pVV 9   g   K  \         P                  P?                  W0V,          ,           4      '       d   KA  V V,          PA                  R4      '       d‡   \         P                  P?                  W0V,          R,          ,           4      '       d   V V,          R,          V V&   K­  \$        P&                  P3                  R VW0V,          ,           V R	,          4       Kå  \$        P&                  P3                  R VW0V,          ,           V R	,          4       EK  	  X'       d   WàR!&   \$        P&                  PC                  R"4       W2V3#   \0         d5   p\$        P&                  P3                  R\5        T4      4        Rp?EL)Rp?ii ; iu upi   \0         d5   p\$        P&                  P3                  R\5        T4      4        Rp?ELRp?ii ; i  \0         d5   p\$        P&                  P3                  R\5        T4      4        Rp?ELRp?ii ; i)$a¨  Build a sandbox with the packages that belong to a particular report.

This downloads and unpacks all packages from the report's Package and
Dependencies fields, plus all packages that ship the files from ProcMaps
(often, runtime plugins do not appear in Dependencies), plus optionally
some extra ones, for the distro release and architecture of the report.

For unpackaged executables, there are no Dependencies. Packages for shared
libraries are unpacked.

report is an apport.report.Report object to build a sandbox for. Presence
of the Package field determines whether to determine dependencies through
packaging (via the optional report['Dependencies'] field), or through ldd
via needed_runtime_packages() -> shared_libraries().  Usually
report['Architecture'] and report['Uname'] are present.

config_dir points to a directory with by-release configuration files for
the packaging system, or "system"; this is passed to
apport.packaging.install_packages(), see that method for details.

cache_dir points to a directory where the downloaded packages and debug
symbols are kept, which is useful if you create sandboxes very often. If
not given, the downloaded packages get deleted at program exit.

sandbox_dir points to a directory with a permanently unpacked sandbox with
the already unpacked packages. This speeds up operations even further if
you need to create sandboxes for different reports very often; but the
sandboxes can become very big over time, and you must ensure that an
already existing sandbox matches the DistroRelease: and Architecture: of
report. If not given, a temporary directory will be created which gets
deleted at program exit.

extra_packages can specify a list of additional packages to install which
are not derived from the report and will be installed along with their
dependencies.

If verbose is True (False by default), this will write some additional
logging to stdout.

If log_timestamps is True, these log messages will be prefixed with the
current time.

If dynamic_origins is True (False by default), the sandbox will be built
with packages from foreign origins that appear in the report's
Packages:/Dependencies:.

Return a tuple (sandbox_dir, cache_dir, outdated_msg).
TÚapport_sandbox_)ÚprefixFÚapport_cache_r#   r    z[originr   r   r   ÚsystemNr   z+\[origin: ([a-zA-Z0-9][a-zA-Z0-9\+\.\-]+)\]z	Origins: r$   )ÚarchitectureÚoriginsz%s)r[   r\   Úinstall_dbgÚinstall_depsr"   r%   Ú	systemctlÚSourcePackageÚsystemdz/bin/systemctlzInstalling extra package z to get z%Cannot find package which ships %s %sz/usr:é   NNz2%s %s does not exist (report specified package %s)ÚRetraceOutdatedPackageszbuilt sandbox)ÚInterpreterPathr"   )"r,   r-   ÚabspathÚisdirr4   ÚtempfileÚmkdtempÚatexitÚregisterÚshutilÚrmtreeÚjoinr   r   ÚreÚcompiler*   Úfindallr   r   r7   rL   r5   Úinstall_packagesÚSystemErrorÚfatalrC   r   r?   r6   Úappendr3   Ú
startswithÚmemdbg)r   rN   rO   rP   rQ   r:   rR   rS   Úpermanent_rootdirr8   r   r\   Úpkg_listÚmatchÚoutdated_msgÚerrorr>   r9   r-   r   s   &&&&&&&&            r   Úmake_sandboxr|   †   s×  € ÷z Ü—g‘g—o‘o kÓ2ˆÜ�w‰w�}‰}˜[×)Ò)Ü�KŠK˜Ô$Ø Ñä×&Ò&Ð.?Ô@ˆÜ�ŠœŸ™ {Ô3Ø!Ð÷ Ü—G‘G—O‘O IÓ.‰	ä×$Ò$¨OÔ<ˆ	Ü�ŠœŸ™ yÔ1ä—w‘w—|‘| I°oÕ/FÓGÐà€Dð
 ˜Ô 9Ø�
‰
�9˜bÓ! F§J¡J¨~¸rÓ$BÕBô$ô ˜vÓ&ˆà�XÔØˆ
à€GßØ—j‘j ¨BÓ/Ð0°°6·:±:¸nÈbÓ3QÐ2RÐSˆÜ—
’
ÐIÓJˆÜ�e—m‘m HÓ-Ó.ˆßÜ�N‰N×Ñ ¨7¨)Ð4Ô5ô ˜4Ô ð/Ü ×1Ò1ØØØ�?Õ#ØØØØØŸ™ NÓ3Øô

ˆ÷ ð	3ØœI×6Ò6ØØØ�Õ'Ù$2Ó3¡N˜q�!�T“¡NÑ3ØØØ!Ø#ŸZ™Z¨Ó7ØØ!Ø!ôõ ˆLô  +¨6Ó2€LÜ" 6¸\È7ÓS€Dó 6ˆØ�6Ž>Ü×,Ò,Ø�t•ØØ Ø˜Õ/Ø—Z‘Z Ó/ôˆCð �kÔ!Ø˜/Õ*¨iÔ7Ø/?�FÐ+Ñ,Ø#�CßÜ—‘×"Ñ"Ø/°¨u°H¸T¸FÐCÀ^ôð —‘˜S ,×"2Ñ"2°3Ó"7Ð8Ö9ä—‘×$Ñ$Ø;¸TÀ6È$Å<öñ/ 6÷8 ð	3ØœI×6Ò6ØØØ�Õ'ØØØØ!Ø#ŸZ™Z¨Ó7Øô
õ 
ˆLð$ �FÕÜ9ˆDØ�vŽ~¤b§g¡g§n¡n°[È$Å<Õ5O×&PÔ&PØ˜$•<×*Ñ*¨6×2Ò2Ü—w‘w—~‘~ k¸4µLÀÕ4DÕ&D×EÒEØ'-¨d¥|°BÕ'7˜˜t›äŸ™×,Ñ,ØPØ Ø'°­,Õ6Ø" 9Õ-ö	ô —N‘N×(Ñ(ØLØØ#¨T¥lÕ2Ø˜yÕ)÷	ñ :÷( Ø,8Ð(Ñ)ä
‡N�N×Ñ˜/Ô*à <Ð/Ð/øôK ô /Ü�‰×Ñ˜T¤3 u£:×.Ò.ûð/üò 4øô ô 	3Ü�N‰N× Ñ  ¤s¨5£z×2Ò2ûð	3ûôb ô 	3Ü�N‰N× Ñ  ¤s¨5£z×2Ò2ûð	3úsZ   È5T4 ÉU; É-U6É:$U; Î<V= Ô4U3Ô?)U.Õ.U3Õ6U; Õ;V:Ö)V5Ö5V:Ö=W<×)W7×7W<)F)NNNFFF)Ú__doc__ri   r,   rn   rk   rg   Úapport.fileutilsr   Úapport.loggingÚapport.reportÚapport.packaging_implr   r5   r   r   r?   rL   r|   © rF   r   Ú<module>rƒ      sF   ðÙ $ó Û 	Û 	Û Û ã Û Û Ý 3òò2ô&44õn÷Z0ñ Z0rF   