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
[\¬Qc@s“dZdZddlZddlmZddlZddlmZddlm    Z    ddl
m Z ddl m Z ydd    lmZWnek
r¡dZnXydd
lmZWnek
rÏdZnXd „Zd „Zd ddddd„Zddd„Ziedgdfd6ed gdfd6ed!gdfd6ed"gdfd6egdfd6Zd„Zddddddd„ZdS(#sodistutils.archive_util
 
Utility functions for creating archive files (tarballs, zip files,
that sort of thing).s$Id$iÿÿÿÿN(twarn(tDistutilsExecError(tspawn(tmkpath(tlog(tgetpwnam(tgetgrnamcCs^tdks|dkrdSyt|ƒ}Wntk
rEd}nX|dk    rZ|dSdS(s"Returns a gid, given a group name.iN(RtNonetKeyError(tnametresult((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/archive_util.pyt_get_gids 
 cCs^tdks|dkrdSyt|ƒ}Wntk
rEd}nX|dk    rZ|dSdS(s"Returns an uid, given a user name.iN(RRR(R    R
((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/archive_util.pyt_get_uid's 
 tgzipics²idd6dd6dd6dd6}idd6dd6d    d6}|dk    rg||jƒkrgtd
‚n|d }    |dkr–|    |j|dƒ7}    nttjj|    ƒd |ƒd dl}
t    j
dƒt ˆƒ‰t ˆƒ‰‡‡‡‡fd†} |sC|
j |    d||ƒ} z| j|d| ƒWd| jƒXn|dkr®tdtƒ|    ||} tjdkr‹||    | g}n|d|    g}t|d |ƒ| S|    S(s-Create a (possibly compressed) tar file from all the files under
    'base_dir'.
 
    'compress' must be "gzip" (the default), "compress", "bzip2", or None.
    (compress will be deprecated in Python 3.2)
 
    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.
 
    The output tar file will be named 'base_dir' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2" or ".Z").
 
    Returns the output filename.
    tgzR tbz2tbzip2ttcompresss.gzs.bz2s.ZsEbad value for 'compress': must be None, 'gzip', 'bzip2' or 'compress's.tartdry_runiÿÿÿÿNsCreating tar archivecsFˆdk    r!ˆ|_ˆ|_nˆdk    rBˆ|_ˆ|_n|S(N(Rtgidtgnametuidtuname(ttarinfo(RtgrouptownerR(s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/archive_util.pyt _set_uid_gid[s            sw|%stfilters'compress' will be deprecated.twin32s-f(Rtkeyst
ValueErrortgetRtostpathtdirnamettarfileRtinfoR R topentaddtcloseRtPendingDeprecationWarningtsystplatformR(t    base_nametbase_dirRtverboseRRRttar_compressiont compress_extt archive_nameR$Rttartcompressed_nametcmd((RRRRs^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/archive_util.pyt make_tarball3s8"    
           c Cs…yddl}Wntk
r)d}nX|d}ttjj|ƒd|ƒ|dkrµ|rkd}nd}y td|||gd|ƒWqtk
r±td|‚qXnÌt    j
d    ||ƒ|s|j |d
d |j ƒ}xˆtj |ƒD]w\}}    }
xe|
D]]} tjjtjj|| ƒƒ} tjj| ƒr|j| | ƒt    j
d | ƒqqWqùW|jƒn|S( svCreate a zip file from all the files under 'base_dir'.
 
    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises DistutilsExecError.  Returns the name of the output zip
    file.
    iÿÿÿÿNs.zipRs-rs-rqtzipskunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilitys#creating '%s' and adding '%s' to ittwt compressions adding '%s'(tzipfilet ImportErrorRRR!R"R#RRRR%tZipFilet ZIP_DEFLATEDtwalktnormpathtjointisfiletwriteR(( R,R-R.RR9t zip_filenamet
zipoptionsR6tdirpathtdirnamest    filenamesR    R"((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/archive_util.pyt make_zipfileys<     
 
           
  ! Rsgzip'ed tar-filetgztarRsbzip2'ed tar-filetbztarscompressed tar filetztarsuncompressed tar fileR2sZIP fileR6cCs%x|D]}|tkr|SqWdS(sqReturns the first format from the 'format' list that is unknown.
 
    If all formats are known, returns None
    N(tARCHIVE_FORMATSR(tformatstformat((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/archive_util.pytcheck_archive_formats·s  cCsCtjƒ}|d    k    rStjd|ƒtjj|ƒ}|sStj|ƒqSn|d    krktj}ni|d6}    yt    |}
Wnt
k
r¦t d|‚nX|
d} x"|
dD]\} } | |    | <q¼W|dkrù||    d<||    d<nz| |||    }Wd    |d    k    r>tjd
|ƒtj|ƒnX|S( sêCreate an archive file (eg. zip or tar).
 
    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "ztar",
    or "gztar".
 
    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.
 
    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    schanging into '%s'Rsunknown archive format '%s'iiR6RRNschanging back to '%s'( R!tgetcwdRRtdebugR"tabspathtchdirtcurdirRKRR(R,RMtroot_dirR-R.RRRtsave_cwdtkwargst format_infotfunctargtvaltfilename((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/archive_util.pyt make_archiveÁs2      
 
  (scompresssgzip(scompresssbzip2(scompressscompress(scompressN(t__doc__t __revision__R!twarningsRR*tdistutils.errorsRtdistutils.spawnRtdistutils.dir_utilRt    distutilsRtpwdRR:RtgrpRR R R5RGRKRNR\(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/archive_util.pyt<module>s<   
 
            E6