³ò
OÉcIc        	   @   s    d  Z  d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d d	 „ Z d S(
   s@   Provides functions and *ITR classes, for writing increment filesiÿÿÿÿNc         C   sá   t  i d | i d ƒ |  o |  i ƒ  p | i ƒ  o | i ƒ  o | i ƒ  n | i ƒ  p t | ƒ } n` | i ƒ  o t | | ƒ } n@ |  i ƒ  o# | i ƒ  o t	 |  | | ƒ } n t
 | | ƒ } t i | ƒ | S(   s  Main file incrementing function, returns inc file created

	new is the file on the active partition,
	mirror is the mirrored file from the last backup,
	incpref is the prefix of the increment file.

	This function basically moves the information about the mirror
	file to incpref.

	s   Incrementing mirror file i   (   t   logt   Logt   patht   isdirt   lstatt   mkdirt   makemissingt   makedirt   isregt   makedifft   makesnapshott
   statisticst   process_increment(   t   newt   mirrort   incpreft   incrp(    (    s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pyt	   Increment   s    /  c         C   s   t  |  d ƒ } | i ƒ  | S(   s$   Signify that mirror file was missingt   missing(   t   get_inct   touch(   R   R   (    (    s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pyR   0   s    
c         C   s   t  i o t  i i |  i ƒ S(   s7   Return true if mirror's increments should be compressed(   t   Globalst   compressiont   no_compression_regexpt   matchR   (   R   (    (    s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pyt   iscompressed6   s    
c         C   sÔ   t  |  ƒ } | o  |  i ƒ  o t | d ƒ } n t | d ƒ } |  i ƒ  on t i d ƒ } t i | t i |  | | f ƒ d j o3 | i	 ƒ  | i
 ƒ  o | i ƒ  n | i ƒ  qÐ n t i |  | | ƒ | S(   s4   Copy mirror to incfile, since new is quite differents   snapshot.gzt   snapshott   SpecialFileErrori    (   R   R   R   t	   isspecialt   robustt   get_error_handlert   check_common_errort   rpatht   copy_with_attribst   setdataR   t   deleteR   (   R   R   t   compresst
   snapshotrpt   eh(    (    s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pyR
   ;   s    
 c         C   s  t  | ƒ } | o t | d ƒ } n t | d ƒ } d \ } } t i d j o` |  i ƒ  p! |  i ƒ  } |  i d | Bƒ n | i ƒ  p! | i ƒ  } | i d | Bƒ q± n t i	 |  | | | ƒ | o |  i | ƒ n | o | i | ƒ n t
 i | | ƒ | S(   s*   Make incfile which is a diff new -> mirrors   diff.gzt   diffi    i   N(   NN(   R   R   t   NoneR   t   process_uidt   readablet   getpermst   chmodt   Rdifft   write_deltaR    t   copy_attribs_inc(   R   R   R   R$   R'   t   old_new_permst   old_mirror_perms(    (    s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pyR	   L   s&       c         C   s-   t  | d ƒ } | i ƒ  t i |  | ƒ | S(   s4   Make file indicating directory mirrordir has changedt   dir(   R   R   R    R/   (   t	   mirrordirR   t   dirsign(    (    s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pyR   e   s    
c      	      s¿   ˆ  d j o t i ‰  n ‡  ‡ f d †  } |  i o: |  i |  i |  i |  i d  | |  i d ƒ f ƒ } n4 |  i ƒ  \ } } |  i |  i | | | ƒ f ƒ } | i ƒ  p
 t	 | ‚ | S(   s¸   Return increment like rp but with time and typestr suffixes

	To avoid any quoting, the returned rpath has empty index, and the
	whole filename is in the base (which is not quoted).

	c            s   d  |  t  i ˆ  ƒ ˆ f S(   s   %s.%s.%s(   t   Timet   timetostring(   t   s(   t   timet   typestr(    s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pyt   <lambda>t   s    iÿÿÿÿN(
   R(   R5   t   prevtimet   indext	   __class__t   connt   baset   dirsplitR   t   AssertionError(   t   rpR9   R8   t   addtostrR   t   dirnamet   basename(    (   R8   R9   s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pyR   l   s     
!(   t   __doc__R   R5   R    R-   R    R   R   R   R   R   R
   R	   R   R(   R   (    (    (    s;   /var/lib/python-support/python2.5/rdiff_backup/increment.pys   <module>   s   T						