ó
È”Mc           @   s•   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z m Z m	 Z	 d  d l
 Td  d l m Z d  d l Z d e f d	 „  ƒ  YZ d
 „  Z d S(   iÿÿÿÿ(   t   ArchSiteLoader(   t   getFileDigest(   t   PackageChannel(   t	   SUCCEEDEDt   FAILEDt   NEVER(   t   *(   t   urlparseNt   ArchSiteChannelc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         G   s€   t  t |  ƒ j | Œ  | |  _ | sY t | ƒ } | j j d ƒ j d ƒ } | d } n  | |  _ | d |  _	 | d |  _
 d  S(   Nt   /iýÿÿÿs
   .db.tar.gzs   .files.tar.gz(   t   superR   t   __init__t   _baseurlR   t   patht   rstript   splitt	   _treenamet   _dbfilet   _flfile(   t   selft   baseurlt   treenamet   argst   compst   paths(    (    s<   /usr/lib/python2.7/dist-packages/smart/channels/arch_site.pyR   !   s    		c         C   s   t  j |  j |  j ƒ g S(   N(   t	   posixpatht   joinR   R   (   R   (    (    s<   /usr/lib/python2.7/dist-packages/smart/channels/arch_site.pyt   getCacheCompareURLs,   s    c         C   s   d S(   Ni   (    (   R   (    (    s<   /usr/lib/python2.7/dist-packages/smart/channels/arch_site.pyt   getFetchSteps/   s    c         C   s¤  | j  ƒ  t j |  j |  j ƒ } | j | d t ƒ} t j |  j |  j ƒ } | j | d t ƒ} | j d | ƒ | j	 ƒ  t
 k r@| j ƒ  } t | ƒ } | |  j k r± t S| j	 ƒ  t
 k rÒ | j ƒ  }	 n/ t j t d ƒ | j ƒ  | j ƒ  f ƒ d  }	 |  j ƒ  t | |	 |  j ƒ }
 |
 j |  ƒ |  j j |
 ƒ nW | j ƒ  t k r“t d ƒ |  d | j ƒ  | j ƒ  f g } t d j | ƒ ‚ n t S| |  _ t S(   Nt   uncompt   progresssZ   Failed to download. You must fetch channel information to acquire needed filelists.
%s: %ss&   Failed acquiring information for '%s':u   %s: %ss   
(   t   resetR   R   R   R   t   enqueuet   TrueR   t   runt	   getStatusR   t   getTargetPathR   t   _digestt   ifacet   warningt   _t   getURLt   getFailedReasont   Nonet   removeLoadersR    t
   setChannelt   _loaderst   appendt
   getCachingR   t   Errort   False(   R   t   fetcherR   t   urlt   itemt   flurlt   flitemt	   localpatht   digestt	   filespatht   loadert   lines(    (    s<   /usr/lib/python2.7/dist-packages/smart/channels/arch_site.pyt   fetch2   s8    
	
	(   t   __name__t
   __module__R   R   R   R=   (    (    (    s<   /usr/lib/python2.7/dist-packages/smart/channels/arch_site.pyR      s   			c      
   C   s;   t  | d | d | d |  | d | d | d | d ƒ S(   NR   R   t   typet   namet   manualt	   removablet   priority(   R   (   t   aliast   data(    (    s<   /usr/lib/python2.7/dist-packages/smart/channels/arch_site.pyt   createX   s    
(   t   smart.backends.arch.loaderR    t   smart.util.filetoolsR   t   smart.channelR   t   smart.constR   R   R   t   smartR   R   R   RG   (    (    (    s<   /usr/lib/python2.7/dist-packages/smart/channels/arch_site.pyt   <module>   s   
9