U
viX @ sz d dl Z d dlZd dlZd dlZd dlZd dlmZmZ d dlm Z d dl
mZmZ ddg dfddZ
dd Zd
d ZdS ) N)
check_callcheck_output)TarFile)METADATA_FNZONEFILENAMEgzc s t tj d}tjt}zt
| 8}|D ]}|| q4 fdd|D } t|| W 5 Q R X t
tj|t
d}
tj||
ddd W 5 Q R X tj|t}t
|d| 0}t|D ]}tj||}
||
| qW 5 Q R X W 5 t X d S )
zRebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*
filename is the timezone tarball from ``ftp.iana.org/tz``.
Zzoneinfoc s g | ]}t j |qS )ospathjoin).0nZtmpdirr J/opt/alt/python38/lib/python3.8/site-packages/dateutil/zoneinfo/rebuild.py
s zrebuild..w T)indent sort_keyszw:%sN)tempfilemkdtempr r
r dirname__file__shutilrmtreer openextract_run_zicr jsondumpr listdiradd)filenametagformatZ
zonegroupsmetadatazonedirZ moduledirtfname filepathsftargetentryZ entrypathr r r rebuild s" r- c
C sr zt ddg}W n, tk
r< } zt| W 5 d}~X Y nX d|krPddg}ng }tdg| d| g | dS )a Calls the ``zic`` compiler in a compatible way to get a "fat" binary.
Recent versions of ``zic`` default to ``-b slim``, while older versions
don't even have the ``-b`` option (but default to "fat" binaries). The
current version of dateutil does not support Version 2+ TZif files, which
causes problems when used in conjunction with "slim" binaries, so this
function is used to ensure that we always get a "fat" binary.
Zzicz--helpNs -b z-bfatz-d)r OSError_print_on_nosuchfiler )r&