tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
L\¬Qc@sÓdZddlZddlZddlmZmZmZmZdddgZiZ    dZ
d    d
„Z d „Z d „Z ddd „ƒYZd    d„Zee d„Zd„Zd„ZedkrÏeƒndS(sžUtilities for comparing files and directories.
 
Classes:
    dircmp
 
Functions:
    cmp(f1, f2, shallow=1) -> int
    cmpfiles(a, b, common) -> ([], [], [])
 
iÿÿÿÿN(tifiltert ifilterfalsetimaptiziptcmptdircmptcmpfilesiiicCsôttj|ƒƒ}ttj|ƒƒ}|dtjksP|dtjkrTtS|rj||krjtS|d|dkr‚tStj||||fƒ}|dkrðt    ||ƒ}t
tƒdkr×tj ƒn|t||||f<n|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.
 
    Return value:
 
    True if the files are the same, False otherwise.
 
    This function uses a cache for past comparisons and the results,
    with a cache invalidation mechanism relying on stale signatures.
 
    iiidN( t_sigtoststattS_IFREGtFalsetTruet_cachetgettNonet_do_cmptlentclear(tf1tf2tshallowts1ts2toutcome((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyRs&  cCstj|jƒ|j|jfS(N(R    tS_IFMTtst_modetst_sizetst_mtime(tst((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyR;sc
Cst}t|dƒd}t|dƒL}xBtrn|j|ƒ}|j|ƒ}||kratS|s-tSq-WWdQXWdQXdS(Ntrb(tBUFSIZEtopenR treadR (RRtbufsizetfp1tfp2tb1tb2((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyR@s     cBsÈeZdZddd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d„Z d    „Z d
„Z ed e    d ed edededededededededeƒ Zd„ZRS(sQA 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.
     cCsm||_||_|dkr6tjtjg|_n    ||_|dkr`dddg|_n    ||_dS(NtRCStCVSttags(tlefttrightRRtcurdirtpardirthidetignore(tselftatbR/R.((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyt__init__os              cCsnttj|jƒ|j|jƒ|_ttj|jƒ|j|jƒ|_|jj    ƒ|jj    ƒdS(N(
t_filterRtlistdirR*R.R/t    left_listR+t
right_listtsort(R0((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pytphase0{s  cCs»ttttjj|jƒ|jƒƒ}ttttjj|jƒ|jƒƒ}t|j    t
|j |ƒƒ|_ t|j    t |j |ƒƒ|_t|j    t |j |ƒƒ|_dS(N(tdictRRRtpathtnormcaseR6R7tmapt __getitem__Rt __contains__tcommonRt    left_onlyt
right_only(R0R1R2((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pytphase1ƒs
**!!c
Cs}g|_g|_g|_x[|jD]P}tjj|j|ƒ}tjj|j|ƒ}d}ytj    |ƒ}Wntj
k
r’}d}nXytj    |ƒ}Wntj
k
rÄ}d}nX|ret    j |j ƒ}t    j |j ƒ}    ||    kr|jj |ƒqut    j|ƒr0|jj |ƒqut    j|ƒrR|jj |ƒqu|jj |ƒq%|jj |ƒq%WdS(Nii(t common_dirst common_filest common_funnyR@RR;tjoinR*R+R    terrorRRtappendtS_ISDIRtS_ISREG(
R0txta_pathtb_pathtokta_stattwhytb_statta_typetb_type((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pytphase2Šs4            
 
 cCs7t|j|j|jƒ}|\|_|_|_dS(N(RR*R+REt
same_filest
diff_filest funny_files(R0txx((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pytphase3­scCssi|_xc|jD]X}tjj|j|ƒ}tjj|j|ƒ}t|||j|j    ƒ|j|<qWdS(N(
tsubdirsRDRR;RGR*R+RR/R.(R0RLta_xtb_x((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pytphase4±s
    cCs2|jƒx!|jjƒD]}|jƒqWdS(N(R^R[t
itervaluestphase4_closure(R0tsd((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyR`»s
cCs0dG|jG|jGH|jrC|jjƒdG|jGdG|jGHn|jrs|jjƒdG|jGdG|jGHn|jr˜|jjƒdG|jGHn|jr½|jjƒdG|jGHn|jrâ|jjƒdG|jGHn|jr|jjƒdG|jGHn|j    r,|j    jƒdG|j    GHndS(    NtdiffsOnly int:sIdentical files :sDiffering files :sTrouble with common files :sCommon subdirectories :sCommon funny cases :(
R*R+RAR8RBRVRWRXRDRF(R0((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pytreportÀs,                                   cCs3|jƒx"|jjƒD]}H|jƒqWdS(N(RdR[R_(R0Ra((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pytreport_partial_closureÙs
cCs3|jƒx"|jjƒD]}H|jƒqWdS(N(RdR[R_treport_full_closure(R0Ra((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyRfßs
R[RVRWRXRDRERFR@RARBR6R7cCs9||jkrt|‚n|j||ƒt||ƒS(N(t    methodmaptAttributeErrortgetattr(R0tattr((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyt __getattr__ës N(t__name__t
__module__t__doc__RR3R9RCRURZR^R`RdReRfR:RgRk(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyRMs"             #        
                cCskgggf}xU|D]M}tjj||ƒ}tjj||ƒ}|t|||ƒj|ƒqW|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
 
    Returns a tuple of three lists:
      files that compare equal
      files that are different
      filenames that aren't regular files.
 
    (RR;RGt_cmpRI(R1R2R@RtresRLtaxtbx((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyRñs  !cCs=y|||||ƒƒ SWntjtfk
r8dSXdS(Ni(RRHtIOError(R1R2tshtabsR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyRo scCstt|j|ƒƒS(N(tlistRR?(tflisttskip((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyR4scCsœddl}ddl}|j|jddƒ\}}t|ƒdkr^|jddƒ‚nt|d|dƒ}d    |krŽ|jƒn
|jƒdS(
Niÿÿÿÿitrisneed exactly two argsis-rt(s-rRz(    tsystgetopttargvRt GetoptErrorRRRfRd(R{R|toptionstargstdd((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pytdemos    t__main__i ((RnRR    t    itertoolsRRRRt__all__R RRRRRRRuRoR4R‚Rl(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/filecmp.pyt<module>
s   " &         ¤