
                         V   S r SSKrSSKrSSKJr  SSKJr  SSKJr  SSKJ	r	  \R                  " SS9r\R                  S	S
SSS9  \R                  SS
SSS/SS9  \R                  SS
SSS9  SrS r\S:X  a"  \	R                   " 5          \" 5         SSS5        gg! , (       d  f       g= f)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                     [         R                  " [        5        [        R                  5       n [         R                  " U S9  [
        R                  nU R                  S:X  a  [
        R                  n[        R                  " SU R                  5        [        R                  " U R                  5       nU" X R                  [        S9  S S S 5        g ! , (       d  f       g = f)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
8^^X6 ,++s   4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F  s   B
B(