-í
ç¶<c       sð     d  Z  
  d k Z  d k Z  d k Z  d d d g Z  h  Z  d d Z  d d d	 „ Z B d
 „  Z G d „  Z	 U d f  d „  ƒ  YZ
 d d d „ Z ,d „  Z 5d „  Z >d „  Z Je d j o Ke ƒ  n d S(   s¯   Utilities for comparing files and directories.

Classes:
    dircmp

Functions:
    cmp(f1, f2, shallow=1, use_statcache=0) -> int
    cmpfiles(a, b, common) -> ([], [], [])

Ns   cmps   dircmps   cmpfilesi   i   i   i    c 	   sR   - . | o / t i } n 1 t i } 2 t | |  ƒ ƒ } 3 t | | ƒ ƒ } 4 | d t i
 j p | d t i
 j o 5 d Sn 6 | o
 | | j o 7 d Sn 8 | d | d j o 9 d Sn ; t i |  | f ƒ } < | o | | f | d  j o = | d Sn > t |  | ƒ } ? | | | f t |  | f <@ | Sd S(   sŠ  Compare two files.

    Arguments:

    f1 -- First file name

    f2 -- Second file name

    shallow -- Just check stat signature (do not read the files).
               defaults to 1.

    use_statcache -- Do not stat() each file directly: go through
                     the statcache module for more efficiency.

    Return value:

    integer -- 1 if the files are the same, 0 otherwise.

    This function uses a cache for past comparisons and the results,
    with a cache invalidation mechanism relying on stale signatures.
    Of course, if 'use_statcache' is true, this mechanism is defeated,
    and the cache will never grow stale.

    i    i   i   N(   s   use_statcaches	   statcaches   stats   stat_functions   oss   _sigs   f1s   s1s   f2s   s2s   S_IFREGs   shallows   _caches   gets   results   _do_cmps   outcome(	   s   f1s   f2s   shallows   use_statcaches   s2s   s1s   stat_functions   results   outcome(    (    s   /usr/lib/python2.2/filecmp.pys   cmp s$   
+!c    s5   B C t  i |  t  i ƒ |  t  i |  t  i f Sd  S(   N(   s   stats   S_IFMTs   sts   ST_MODEs   ST_SIZEs   ST_MTIME(   s   st(    (    s   /usr/lib/python2.2/filecmp.pys   _sigB s   c    sž   G H t  } I t |  d ƒ } J t | d ƒ } K xd K d oY L | i | ƒ } M | i | ƒ } N | | j o O d Sn P | o Q d Sn q6 Wd  S(   Ns   rbi   i    (
   s   BUFSIZEs   bufsizes   opens   f1s   fp1s   f2s   fp2s   reads   b1s   b2(   s   f1s   f2s   fp1s   b1s   b2s   fp2s   bufsize(    (    s   /usr/lib/python2.2/filecmp.pys   _do_cmpG s   	 
c      sï   U t  Z d  Z u w e e d „ Z ƒ d „  Z ‹ d f Z Œ d d d f Z  d d d	 f Z Ž d
 d d f Z	  d d f Z
 ‘ d „  Z   d „  Z ´ d „  Z × d „  Z Û d „  Z å d „  Z ê d „  Z d „  Z 	d „  Z RS(   sQ  A class that manages the comparison of 2 directories.

    dircmp(a,b,ignore=None,hide=None)
      A and B are directories.
      IGNORE is a list of names to ignore,
        defaults to ['RCS', 'CVS', 'tags'].
      HIDE is a list of names to hide,
        defaults to [os.curdir, os.pardir].

    High level usage:
      x = dircmp(dir1, dir2)
      x.report() -> prints a report on the differences between dir1 and dir2
       or
      x.report_partial_closure() -> prints report on differences between dir1
            and dir2, and reports on common immediate subdirectories.
      x.report_full_closure() -> like report_partial_closure,
            but fully recursive.

    Attributes:
     left_list, right_list: The files in dir1 and dir2,
        filtered by hide and ignore.
     common: a list of names in both dir1 and dir2.
     left_only, right_only: names only in dir1, dir2.
     common_dirs: subdirectories in both dir1 and dir2.
     common_files: files in both dir1 and dir2.
     common_funny: names in both dir1 and dir2 where the type differs between
        dir1 and dir2, or the name is not stat-able.
     same_files: list of identical files.
     diff_files: list of filenames which differ.
     funny_files: list of files which could not be compared.
     subdirs: a dictionary of dircmp objects, keyed by names in common_dirs.
     c    sŒ   w x | |  _ y | |  _ z | t j o { t i t i	 g |  _ n } | |  _ ~ | t j o  d d d g |  _
 n  | |  _
 d  S(   Ns   RCSs   CVSs   tags(   s   as   selfs   lefts   bs   rights   hides   Nones   oss   curdirs   pardirs   ignore(   s   selfs   as   bs   ignores   hide(    (    s   /usr/lib/python2.2/filecmp.pys   __init__w s   c    sƒ   ƒ „ t  t i |  i ƒ … |  i |  i ƒ |  _ † t  t i |  i ƒ ‡ |  i |  i ƒ |  _	 ˆ |  i i
 ƒ  ‰ |  i	 i
 ƒ  d  S(   N(   s   _filters   oss   listdirs   selfs   lefts   hides   ignores	   left_lists   rights
   right_lists   sort(   s   self(    (    s   /usr/lib/python2.2/filecmp.pys   phase0ƒ s   s   subdirss
   same_filess
   diff_filess   funny_filess   common_dirss   common_filess   common_funnys   commons	   left_onlys
   right_onlys	   left_lists
   right_listc    s×   ‘ ’ | |  i j o “ |  i ƒ  n ” | |  i j o • |  i ƒ  ny – | |  i j o — |  i ƒ  nU ˜ | |  i j o ™ |  i	 ƒ  n1 š | |  i
 j o › |  i ƒ  n  t | ‚ ž t |  | ƒ Sd  S(   N(   s   attrs   selfs   _dircmp__p4_attrss   phase4s   _dircmp__p3_attrss   phase3s   _dircmp__p2_attrss   phase2s   _dircmp__p1_attrss   phase1s   _dircmp__p0_attrss   phase0s   AttributeErrors   getattr(   s   selfs   attr(    (    s   /usr/lib/python2.2/filecmp.pys   __getattr__‘ s   c    s    ¡ g  g  f \ } } ¢ h  } £ h  } ¤ x! |  i D¤ ] } ¥ d | | <q7 W¦ xK |  i D¦ ]= } § | i	 | d ƒ o ¨ d | | <n ª | i
 | ƒ q^ W« xA |  i D« ]3 } ¬ | i	 | d ƒ o ­ n ¯ | i
 | ƒ q¯ W° | i ƒ  |  _ ± | |  _ ² | |  _ d  S(   Ni   i    (   s   a_onlys   b_onlys   commons   bs   selfs
   right_lists   fnms	   left_lists   xs   gets   appends   keyss	   left_onlys
   right_only(   s   selfs   b_onlys   bs   commons   xs   a_onlys   fnm(    (    s   /usr/lib/python2.2/filecmp.pys   phase1  s&   		 	 	 	c 
   så  ´ µ g  |  _ ¶ g  |  _ · g  |  _ ¹ x´|  i D¹ ]¦} º t i i |  i	 | ƒ } » t i i |  i | ƒ } ½ d } ¾ y ¿ t i | ƒ } Wn$ À t i j
 o }	 Â d } n XÃ y Ä t i | ƒ } Wn$ Å t i j
 o }	 Ç d } n XÉ | oÄ Ê t i | t i ƒ } Ë t i | t i ƒ } Ì | | j o Í |  i i | ƒ nh Î t i | ƒ o Ï |  i i | ƒ n> Ð t i | ƒ o Ñ |  i i | ƒ n Ó |  i i | ƒ n Õ |  i i | ƒ q4 Wd  S(   Ni   i    (   s   selfs   common_dirss   common_filess   common_funnys   commons   xs   oss   paths   joins   lefts   a_paths   rights   b_paths   oks	   statcaches   stats   a_stats   errors   whys   b_stats   S_IFMTs   ST_MODEs   a_types   b_types   appends   S_ISDIRs   S_ISREG(
   s   selfs   b_paths   oks   b_types   b_stats   a_types   a_stats   a_paths   xs   why(    (    s   /usr/lib/python2.2/filecmp.pys   phase2´ s6    		
c    s@   × Ø t  |  i |  i |  i ƒ } Ù | \ |  _ |  _ |  _ d  S(   N(	   s   cmpfiless   selfs   lefts   rights   common_filess   xxs
   same_filess
   diff_filess   funny_files(   s   selfs   xx(    (    s   /usr/lib/python2.2/filecmp.pys   phase3× s   c    sˆ   Û ß h  |  _ à xo |  i Dà ]a } á t i i |  i | ƒ } â t i i |  i	 | ƒ } ã t | | |  i |  i ƒ |  i | <q Wd  S(   N(   s   selfs   subdirss   common_dirss   xs   oss   paths   joins   lefts   a_xs   rights   b_xs   dircmps   ignores   hide(   s   selfs   b_xs   xs   a_x(    (    s   /usr/lib/python2.2/filecmp.pys   phase4Û s    	c    sH   å æ |  i ƒ  ç x. |  i i ƒ  Dç ] } è |  i | i ƒ  q# Wd  S(   N(   s   selfs   phase4s   subdirss   keyss   xs   phase4_closure(   s   selfs   x(    (    s   /usr/lib/python2.2/filecmp.pys   phase4_closureå s    	c    sƒ  ê ì d G|  i G|  i GHí |  i o. î |  i i ƒ  ï d G|  i Gd G|  i GHn ð |  i o. ñ |  i i ƒ  ò d G|  i Gd G|  i GHn ó |  i o# ô |  i i ƒ  õ d G|  i GHn ö |  i o# ÷ |  i i ƒ  ø d G|  i GHn ù |  i o# ú |  i i ƒ  û d G|  i GHn ü |  i	 o# ý |  i	 i ƒ  þ d G|  i	 GHn ÿ |  i
 o#  |  i
 i ƒ  d G|  i
 GHn d  S(	   Ns   diffs   Only ins   :s   Identical files :s   Differing files :s   Trouble with common files :s   Common subdirectories :s   Common funny cases :(   s   selfs   lefts   rights	   left_onlys   sorts
   right_onlys
   same_filess
   diff_filess   funny_filess   common_dirss   common_funny(   s   self(    (    s   /usr/lib/python2.2/filecmp.pys   reportê s,   c    sL   |  i ƒ  x2 |  i i ƒ  D] } H|  i | i ƒ  q# Wd  S(   N(   s   selfs   reports   subdirss   keyss   x(   s   selfs   x(    (    s   /usr/lib/python2.2/filecmp.pys   report_partial_closures
    	c    sL   	
|  i ƒ  x2 |  i i ƒ  D] } H|  i | i ƒ  q# Wd  S(   N(   s   selfs   reports   subdirss   keyss   xs   report_full_closure(   s   selfs   x(    (    s   /usr/lib/python2.2/filecmp.pys   report_full_closure	s
    	(   s   __name__s
   __module__s   __doc__s   Nones   __init__s   phase0s   _dircmp__p4_attrss   _dircmp__p3_attrss   _dircmp__p2_attrss   _dircmp__p1_attrss   _dircmp__p0_attrss   __getattr__s   phase1s   phase2s   phase3s   phase4s   phase4_closures   reports   report_partial_closures   report_full_closure(    (    (    s   /usr/lib/python2.2/filecmp.pys   dircmpU s"    #
c 	   s   g  g  g  f } xd | D]Y }  t i i |  | ƒ } !t i i | | ƒ } "| t
 | | | | ƒ i | ƒ q" W#| Sd S(   s¥  Compare common files in two directories.

    a, b -- directory names
    common -- list of file names found in both directories
    shallow -- if true, do comparison based solely on stat() information
    use_statcache -- if true, use statcache.stat() instead of os.stat()

    Returns a tuple of three lists:
      files that compare equal
      files that are different
      filenames that aren't regular files.

    N(   s   ress   commons   xs   oss   paths   joins   as   axs   bs   bxs   _cmps   shallows   use_statcaches   append(	   s   as   bs   commons   shallows   use_statcaches   ress   xs   axs   bx(    (    s   /usr/lib/python2.2/filecmp.pys   cmpfiless   
 	'c    sN   ,-y! .t  t |  | | | ƒ ƒ SWn  /t i j
 o 0d Sn Xd  S(   Ni   (   s   abss   cmps   as   bs   shs   sts   oss   error(   s   as   bs   shs   st(    (    s   /usr/lib/python2.2/filecmp.pys   _cmp,s   !c    sR   56g  } 7x5 |  D7]* } 8| | j o 8| i | ƒ n q W9| Sd  S(   N(   s   results   lists   items   skips   append(   s   lists   skips   results   item(    (    s   /usr/lib/python2.2/filecmp.pys   _filter5s   	
 	 c     s¸   >?d  k  }  @d  k } A| i |  i d d ƒ \ } } Bt | ƒ d j o C| i d ‚ n Dt | d | d ƒ } Ed d f | j o F| i	 ƒ  n H| i
 ƒ  d  S(   Ni   s   ri   s   need exactly two argsi    s   -rs    (   s   syss   getopts   argvs   optionss   argss   lens   errors   dircmps   dds   report_full_closures   report(   s   syss   getopts   dds   argss   options(    (    s   /usr/lib/python2.2/filecmp.pys   demo>s   "s   __main__(   s   __doc__s   oss   stats	   statcaches   __all__s   _caches   BUFSIZEs   cmps   _sigs   _do_cmps   dircmps   cmpfiless   _cmps   _filters   demos   __name__(   s   demos   stats   dircmps   __all__s	   statcaches   _sigs   _cmps   _filters   _caches   cmpfiless   BUFSIZEs   oss   _do_cmps   cmp(    (    s   /usr/lib/python2.2/filecmp.pys   ?
 s    	-»		