
                         b   d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	  ej                  d      Zej                  d	d
dd       ej                  dd
dddgd       ej                  dd
dd       dZd Zedk(  r" e	j                          5   e        ddd       yy# 1 sw Y   yxY w)zuThis package imports images from a 'docker save' tarball.

Unlike 'docker save' the format this uses is proprietary.
    N)docker_image)save)logging_setup)patchedz7Import images from a tarball into our faaaaaast format.)descriptionz	--tarballstorezPThe tarball containing the docker image to rewrite into our fast on-disk format.T)actionhelprequiredz--formattartar.gzz!The form in which to save layers.)r	   defaultchoicesr
   z--directoryz Where to save the image's files.    c                     t        j                  t               t        j                         } t        j                  |        t
        j                  }| j                  dk(  rt
        j                  }t        j                  d| j                         t        j                  | j                        5 } ||| j                  t               d d d        y # 1 sw Y   y xY w)N)argsr   z"Reading v2.2 image from tarball %r)threads)r   DefineCommandLineArgsparser
parse_argsInitr   uncompressedformatfastlogginginfotarball
v2_2_imageFromTarball	directory_THREADS)r   methodv2_2_imgs      9lib/third_party/containerregistry/tools/fast_importer_.pymainr%   3   s    %%f-				$$&	[[HYYF	,,3T\\Bdll+x
8T^^X6 ,++s   2CC__main__)__doc__argparser   containerregistry.client.v2_2r   r   r   containerregistry.toolsr   r   ArgumentParserr   add_argumentr!   r%   __name__Httplib2     r$   <module>r1      s   
   D . 1 +	 	 	 I
K   *     H	,  .   '(K   7 zwF  s   B%%B.