ó
 ;7Rc           @   sP   d  Z  d d l m Z d d l m Z d d l m Z d e f d     YZ d S(   sD   Handle checkin and checkout of archives from the pristine-tar branchi˙˙˙˙(   t   compressor_opts(   t   PristineTar(   t   DebianPkgPolicyt   DebianPristineTarc           B   s#   e  Z d  Z d d  Z d   Z RS(   s2   The pristine-tar branch in a Debian git repositoryc         C   sF   | s d } n t  | d } d | | | f } t t |   j |  S(   s  
        Do we have a pristine-tar commit for package I{package} at version
        {version} with compression type I{comp_type}?

        @param package: the package to look for
        @type package: C{str}
        @param version: the upstream version to look for
        @type version: C{str}
        @param comp_type: the compression type
        @type comp_type: C{str}
        s   \w\+i   s   %s_%s\.orig\.tar\.%s(   R    t   superR   t
   has_commit(   t   selft   packaget   versiont	   comp_typet   extt   name_regexp(    (    s7   /usr/lib/python2.7/dist-packages/gbp/deb/pristinetar.pyR      s
    	c         C   s2   t  j | | | |  } t t |   j |  d S(   s  
        Checkout the orig tarball for package I{package} of I{version} and
        compression type I{comp_type} to I{output_dir}

        @param package: the package to generate the orig tarball for
        @type package: C{str}
        @param version: the version to check generate the orig tarball for
        @type version: C{str}
        @param comp_type: the compression type of the tarball
        @type comp_type: C{str}
        @param output_dir: the directory to put the tarball into
        @type output_dir: C{str}
        N(   R   t   build_tarball_nameR   R   t   checkout(   R   R   R   R	   t
   output_dirt   name(    (    s7   /usr/lib/python2.7/dist-packages/gbp/deb/pristinetar.pyR   .   s
    		N(   t   __name__t
   __module__t   __doc__t   NoneR   R   (    (    (    s7   /usr/lib/python2.7/dist-packages/gbp/deb/pristinetar.pyR      s   N(   R   t   gbp.pkgR    t   gbp.pkg.pristinetarR   t   gbp.debR   R   (    (    (    s7   /usr/lib/python2.7/dist-packages/gbp/deb/pristinetar.pyt   <module>   s   