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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
]\¬Qc@swdZddlmZedddƒddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z ddl Z ddl Z ddlZddlZddlZddlZddd    d
d d d
gZd ZdZdZdZdZdddgZdZdZe jjƒZdZed„Z d„Z!dfd„ƒYZ"de"fd„ƒYZ#de"fd„ƒYZ$dfd „ƒYZ%d!e%fd"„ƒYZ&d#e%fd$„ƒYZ'd%e'e(fd&e'e(fd'e'e(fd(e'e(fd)e'e(fd*e&d+fgZ)dfd,„ƒYZ*dfd-„ƒYZ+d.d/d0d1d2d3d4d5d6d7d8d9d:d;gZ,d    fd<„ƒYZ-d=e-fd>„ƒYZ.d?e-fd@„ƒYZ/dAe-fdB„ƒYZ0dCfdD„ƒYZ1dE„Z2dF„Z3e4dGkr]yddl5Z5Wne6k
rnCXe5jekrPddlZej7dHe5jefƒn
ddIl5Tne4dJkrse3ƒndS(Ks{Package Install Manager for Python.
 
This is currently a MacOSX-only strawman implementation.
Despite other rumours the name stands for "Packman IMPlementation".
 
Tools to allow easy installation of packages. The idea is that there is
an online XML database per (platform, python-version) containing packages
known to work with that combination. This module contains tools for getting
and parsing the database, testing whether packages are installed, computing
dependencies and installing packages.
 
There is a minimal main program that works as a command line tool, but the
intention is that the end user will use this through a GUI.
iÿÿÿÿ(twarnpy3ks#In 3.x, the pimp module is removed.t
stackleveliNtPimpPreferencest PimpDatabaset PimpPackagetmaintgetDefaultDatabaset PIMP_VERSIONspimp._scriptExc_NotInstalledspimp._scriptExc_OldInstalledspimp._scriptExc_BadInstalledis0.5tsourcetbinaryt    installers/tmps=http://www.python.org/packman/version-%s/%s-%s-%s-%s-%s.plistcCsŠ|rd}nd}tj\}}}}}d||f}|dkrl|dkrl|d||f}ntjjƒ}|jdƒ\}    }
} |    dkrØtjjd    ƒrºd
}    qØtjjd ƒrØd }    qØn|
} x¥tr…t    t
|||    | | f} yt j | ƒWnt j k
r,}nXP| sTt    t
|||    |
| f} Pn| jd ƒ}|dkrxd} qá| | } qáW| S(Ntexptprods%d.%ditfinals%s%dt-tdarwins+/System/Library/Frameworks/Python.frameworkt darwin_apples$/Library/Frameworks/Python.frameworktdarwin_macpythont.t(tsyst version_infot    distutilstutilt get_platformtsplittprefixt
startswithtTruetDEFAULT_PIMPDATABASE_FMTRturllib2turlopent    HTTPErrortrfind(t experimentaltstatustmajortminortmicrotstatetextratpyverst longplatformtosnametreleasetmachinetrelturltargtidx((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR7s<                   c
Gs·d|dj|ƒ}|r1|jd|ƒntr;dStj|dtdtjdtjdtjƒ}|jj    ƒx2|j
j ƒ}|s”Pn|r{|j|ƒq{q{|j ƒS(    s=Internal routine to run a shell command in a given directory.s    cd "%s"; t s+ %s
itshelltstdintstdouttstderr( tjointwritet
NO_EXECUTEt
subprocesstPopenRtPIPEtSTDOUTR4tcloseR5treadlinetwait(toutputtdirtcmditemstcmdtchildtline((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt_cmdds tPimpDownloadercBs2eZdZddd„Zdd„Zd„ZRS(s-Abstract base class - Downloader for archivesRcCs||_||_||_dS(N(targumentt_dirt_watcher(tselfRIRBtwatcher((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt__init__zs        cCsdS(N(tNone(RLR/tfilenameRA((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytdownloadscCs|jr|jj|ƒStS(N(RKtupdateR(RLtstr((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRR„s    N(t__name__t
__module__t__doc__RORNRQRR(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRHws
  tPimpCurlDownloadercBseZdd„ZRS(cCsE|jd|ƒt||jdd||ƒ}|jd|ƒ| S(NsDownloading %s...tcurls--outputsDownloading %s: finished(RRRGRJ(RLR/RPRAt
exitstatus((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRQ‹s     N(RTRURORQ(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRW‰stPimpUrllibDownloadercBseZdd„ZRS(c
Csgt|dƒ}|jd|ƒt}tj|ƒ}d|jkrZt|jdƒ}nd}|jdƒ}d}d}    xË|rH|t|ƒ}t|ƒdkrªPn|j    |ƒt
t j ƒƒ|    kr6t
t j ƒƒ}    |dkr    |jd||fƒ}q6|jd|t
d    ||ƒ|fƒ}n|jdƒ}q~W|rc|jd
|ƒn|S( Ntwbs"Downloading %s: opening connectionscontent-lengthiÿÿÿÿiisDownloading %s: %d bytes...s"Downloading %s: %d%% (%d bytes)...gY@sDownloading %s: finished( topenRRRRRtheaderstlongtreadtlenR8tintttime(
RLR/RPRAt    keepgoingRQtlengthtdatatdlsizetlasttime((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRQ–s0      -N(RTRURORQ(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRZ”st PimpUnpackercBs>eZdZeZdgdd„Zddd„Zd„ZRS(s+Abstract base class - Unpacker for archivesRcCsD||_|r%|j r%td‚n||_||_||_dS(Ns!This unpacker cannot rename files(RIt _can_renamet RuntimeErrorRJt_renamesRK(RLRIRBtrenamesRM((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRNºs              cCsdS(N(RO(RLtarchiveRAtpackage((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytunpackÅscCs|jr|jj|ƒStS(N(RKRRR(RLRS((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRRÈs    N(    RTRURVtFalseRiRORNRoRR(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRhµs tPimpCommandUnpackercBs#eZdZeZddd„ZRS(s)Unpack archives by calling a Unix utilitycCs*|j|}t||j|ƒr&dSdS(Nsunpack command failed(RIRGRJ(RLRmRARnRD((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRoÒs N(RTRURVRpRiRORo(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRqÍstPimpTarUnpackercBs#eZdZeZddd„ZRS(s0Unpack tarfiles using the builtin tarfile modulec Cs!tj|dƒ}|jƒ}g}|jrXx(|D]}x|jD]ü\}}    |t|jƒ |jkr‚|t|jƒ}
nd}
|jt|ƒ |krç|    dkr½|j|ƒn&|    |jt|ƒ|_dG|jGHPqD|
rD|jt|
ƒ |
krD|    dkr"|j|ƒn|    |jt|
ƒ|_PqDqDW|j|ƒq4Wnx[|D]S}||kr‹|j    d|jƒq_n|j    d|jƒ|j
||jƒq_W|rg|D]"}|jddkrÃ|j^qÃ} |r|j | ƒ} n| rddj | ƒSndS(    Ntrs    s Skipping %ss Extracting %siÿÿÿÿt/sNot all files were unpacked: %sR2( ttarfileR\t
getmembersRkR`RJROtnametappendRRtextracttfilterExpectedSkipsR7( RLRmRARnttftmemberstskiptmembert    oldprefixt    newprefixt
oldprefix2tnames((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRoÜsB           /N(RTRURVRRiRORo(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRr×ss.tar.Zs.tazs.tar.gzs.tgzs.tar.bzs.zips
unzip "%s"cBsVeZdZdddddd„Zd„Zdd„Zd„Zd„Zd„Z    RS(sbContainer for per-user preferences, such as the database to use
    and where to install packages.cCs}|st}n|st}n|s-t}n|s?tƒ}n|j|ƒ||_||_||_||_d|_
dS(N( tDEFAULT_FLAVORORDERtDEFAULT_DOWNLOADDIRtDEFAULT_BUILDDIRRt setInstallDirt flavorOrdert downloadDirtbuildDirt pimpDatabaseRORM(RLR‡RˆR‰t
installDirRŠ((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRNs                              cCs ||_dS(N(RM(RLRM((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt
setWatcher)scCs@|r$d|fdddg|_nt}g|_||_dS(Ns --install-libs--install-headerss--install-scriptss--install-data(s--install-headersN(s--install-scriptsN(s--install-dataN(ROtinstallLocationstDEFAULT_INSTALLDIRR‹(RLR‹((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR†,s        cCs |jtkS(N(R‹RŽ(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt isUserInstall9scCsd}tjtjBtjB}tjj|jƒsF|d|j7}n)tj|j|ƒso|d|j7}ntjj|jƒs˜|d|j7}n)tj|j|ƒsÁ|d|j7}ntjj|j    ƒsê|d|j    7}n“tj|j    |ƒs|d|j    7}njtjj
|j    ƒ}xRt jD]6}ytjj
|ƒ}WnnX||kr2Pq2q2W|d|j    7}|S(    s}Check that the preferences make sense: directories exist and are
        writable, the install directory is on sys.path, etc.Rs0Warning: Download directory "%s" does not exist
sAWarning: Download directory "%s" is not writable or not readable
s-Warning: Build directory "%s" does not exist
s>Warning: Build directory "%s" is not writable or not readable
s/Warning: Install directory "%s" does not exist
s@Warning: Install directory "%s" is not writable or not readable
s3Warning: Install directory "%s" is not on sys.path
( tostR_OKtW_OKtX_OKtpathtexistsRˆtaccessR‰R‹trealpathR(RLtrvtRWX_OKR‹tpR—((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytcheck<s0 cCsg||jkrG||jkrCt|jj|ƒ|jj|ƒƒSdS||jkrZdSt||ƒS(sŠCompare two flavor strings. This is part of your preferences
        because whether the user prefers installing from source or binary is.iÿÿÿÿi(R‡tcmptindex(RLtlefttright((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytcompareFlavors[s%N(
RTRURVRORNRŒR†RR›R (((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRs             cBs}eZdZd„Zd„Zd„Zd„Zd„Zd„Zdd„Z    d    „Z
d
„Z d „Z d „Z d „ZRS(sçClass representing a pimp database. It can actually contain
    information from multiple databases through inclusion, but the
    toplevel database is considered the master, as its maintainer is
    "responsible" for the contents.cCsCg|_||_d|_g|_d|_d|_d|_dS(NR(t    _packagest preferencest_urlt_urllistt_versiont _maintainert _description(RLtprefs((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRNls                        cCs|jS(N(R£(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR/vscCs|jS(N(R¥(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytversionwscCs|jS(N(R¦(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt
maintainerxscCs|jS(N(R§(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt descriptionyscCsg|_d|_dS(sClean upN(R¡ROR¢(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR>{s    icCs‡||jkrdS|jj|ƒtj|ƒj}tjj|ƒ}|r‘|jdƒ}|r'||j    kr't
j j d||fƒq'n–|jdƒ|_    |j    s¿t
j j dƒn/|j    t krît
j j d|j    t fƒn|jddƒ|_|jddƒjƒ|_||_|j|d    |ƒ|jd
gƒ}x3|D]+}tj||ƒ}|j|d d ƒqTWdS( s¸Append packages from the database with the given URL.
        Only the first database should specify included=0, so the
        global information (maintainer, description) get stored.NtVersions5Warning: included database %s is for pimp version %s
s-Warning: database has no Version information
s8Warning: database version %s newer than pimp version %s
t
MaintainerRt DescriptiontPackagestIncludetincludedi(R¤RxRRtfptplistlibtPlisttfromFiletgetR¥RR6R8RR¦tstripR§R£t_appendPackagesturllibtbasejoint    appendURL(RLR/R±R²t    plistdataR©tothersto((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR»€s0           cCsöxï|D]ç}t|ƒ}d|krBtj||dƒ|d<n|jdƒ}|dkrot||ƒ}no|dkrt||ƒ}nQ|dkr«t||ƒ}n3|dkrÉt||ƒ}nt|t|ƒƒ}|jj    |ƒqWdS(s”Given a list of dictionaries containing package
        descriptions create the PimpPackage objects and append them
        to our internal storage.s Download-URLtFlavorRR    R
thiddenN(
tdictR¹RºR¶tPimpPackage_sourcetPimpPackage_binarytPimpPackage_installerRR¡Rx(RLtpackagesR/Rštflavortpkg((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR¸ s       cCs|jS(s9Return a list of all PimpPackage objects in the database.(R¡(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytlist¶scCs;g}x$|jD]}|j|jƒƒqW|jƒ|S(s7Return a list of names of all packages in the database.(R¡Rxtfullnametsort(RLR˜RÇ((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt    listnames»s
 
cCsxg}x$|jD]}|j|jƒƒqWi|jd6|jd6|jd6|d6}tj|}|j|ƒdS(sºDump the contents of the database to an XML .plist file.
 
        The file can be passed as either a file object or a pathname.
        All data, including included databases, is dumped.R¬R­R®R¯N(    R¡RxtdumpR¥R¦R§R³R´R8(RLt
pathOrFileRÅRÇR¼tplist((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRÌÄs
 
 
 
c
Csyt|ƒtkrÐ|ddkrB|ddkrB|dd!}n|jdƒ}t|ƒdksut|ƒdkryd S|d}t|ƒdkr¢|d}nd }t|ƒdkrÇ|d}qød }n(|d    }|jd
ƒ}|jd ƒ}d }xt|jD]i}||jƒkr| s9||jƒkr| sR||j    ƒkr| se||krq|}qqqqW|S( s(Find a package. The package can be specified by name
        or as a dictionary with name, version and flavor entries.
 
        Only name is obligatory. If there are multiple matches the
        best one (higher version number, flavors ordered according to
        users' preference) is returned.it(iÿÿÿÿt)iRiitNameR¬R¿N(
ttypeRSRR`ROR¶R¡RwR©RÆ(RLtidenttfieldsRwR©RÆtfoundRš((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytfindÖs0 $
      
(RTRURVRNR/R©RªR«R>R»R¸RÈRËRÌRÖ(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRfs    
                                         RÑR¬R¿R®s    Home-pages Download-URLs Install-testsInstall-commandsPre-install-commandsPost-install-commandt PrerequisitestMD5SumsUser-install-skipssSystemwide-onlycBséeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „Zd „Zd„Zd„Zdd„Zd„Zdd„Zdd„Zdd„Zd„Zd„Zd„ZRS(s$Class representing a single package.cCs`||_|d}x=|jƒD]/}|tkr tjjd||fƒq q W||_dS(NRÑsWarning: %s: unknown key %s
(t_dbtkeyst ALLOWED_KEYSRR6R8t_dict(RLtdbR¼Rwtk((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRNs     
 !cCs |j|S(N(RÜ(RLtkey((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt __getitem__scCs |jdS(NRÑ(RÜ(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRwscCs|jjdƒS(NR¬(RÜR¶(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR©scCs|jjdƒS(NR¿(RÜR¶(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRÆscCs|jdjƒS(NR®(RÜR·(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR«scCs|jƒjƒdS(Ni(R«t
splitlines(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytshortdescriptionscCs|jjdƒS(Ns    Home-page(RÜR¶(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pythomepage scCs|jjdƒS(Ns Download-URL(RÜR¶(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt downloadURL!scCs|jjdƒS(NsSystemwide-only(RÜR¶(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytsystemwideOnly"scCs„|jd}d|jkr4|d|jd}nd|jkr[|d|jd}n|jjdƒdkr€d|}n|S(sÀReturn the full name "name-version-flavor" of a package.
 
        If the package is a pseudo-package, something that cannot be
        installed through pimp, return the name in (parentheses).RÑR¬s-%sR¿RÀs(%s)(RÜR¶(RLR˜((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRÉ$s  cCs|jS(s?Return a dict object containing the information on the package.(RÜ(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRÌ4scCs­t|tƒs(tt|ƒt|ƒƒS|jƒ|jƒkrYt|jƒ|jƒƒS|jƒ|jƒkr‹t|jƒ|jƒƒ S|jjj|j    ƒ|j    ƒƒS(s=Compare two packages, where the "better" package sorts lower.(
t
isinstanceRRœtidRwR©RÙR¢R RÆ(RLtother((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt__cmp__8scBs‰ied6ed6ed6ed6ed6}|jdjƒd}y ||UWn6ek
rn}de|ƒfSek
r}de|ƒfSek
r¬}d    e|ƒfSek
rË}d
e|ƒfSej    j
d ƒej    j
d |j ƒƒej    j
d ƒej    j
|ƒej    j
dƒddl }|j dej    ƒ|jjrpej    j
d|jjƒnej    j
d ƒdSXdS(s$Test wheter the package is installed.
 
        Returns two values: a status indicator which is one of
        "yes", "no", "old" (an older version is installed) or "bad"
        (something went wrong during the install test) and a human
        readable string which may contain more details.t NotInstalledt OldInstalledt BadInstalledRRs Install-tests
tnotoldtbads&-------------------------------------
s$---- %s: install test got exception
s ---- source:
s---- exception:
iÿÿÿÿNtfiles%---- Please copy this and mail to %s
s"Package install test got exceptiontyesR(Rïs"Package install test got exception(RñR(t_scriptExc_NotInstalledt_scriptExc_OldInstalledt_scriptExc_BadInstalledRRRÜR·t ImportErrorRSR6R8RÉt    tracebackt    print_excRÙR¦(RLt    namespacet installTestR0Rö((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt    installedCs<
   cCsog}|jjdƒsQ|jƒ\}}|dkr:gSd d|jƒfgS|jƒr†|jjjƒr†d d|jƒfgS|jjdƒsœgSxÌ|jdD]½}t    |ƒt
kr×d }t
|ƒ}n}|d}d|kr|d|d}nd    |kr#|d|d    }n|jj |ƒ}|sHd
|}n |j ƒ}|j ||fƒqªW|S( s€Return a list of prerequisites for this package.
 
        The list contains 2-tuples, of which the first item is either
        a PimpPackage object or None, and the second is a descriptive
        string. The first item can be None if this package depends on
        something that isn't pimp-installable, in which case the descriptive
        string should tell the user what to do.s Download-URLRñsAPackage %s cannot be installed automatically, see the descriptions,Package %s can only be installed system-wideR×RÑR¬RR¿sRequires unknown %sN(RÜR¶RúRORÉRåRÙR¢RRÒRSRÖRâRx(RLR˜R#t_titemRÇtdescrRw((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt prerequisitesks:     
    c    Cstj|jdƒ\}}}}}tj|ƒ}tjj|ƒd}tjj|j    j
j |ƒ|_ |j ƒsÛ|dkrŽd|j Std    |j    j
j d|j    j
jƒ}|j|jd|j |ƒsÛdSntjj|j ƒ rüt rüdS|j ƒs dSd    S(
s}Download a single package, if needed.
 
        An MD5 signature is used to determine whether download is needed,
        and to test that we actually downloaded what we expected.
        If output is given it is a file-like object that will receive a log
        of what happens.
 
        If anything unforeseen happened the method returns an error message
        string.
        s Download-URLitmanuals/Please download package manually and save as %sRMsdownload command faileds archive not found after downloads*archive does not have correct MD5 checksumN(turlparseturlsplitRÜR¹t url2pathnameRR”RR7RÙR¢RˆtarchiveFilenamet
_archiveOKRZRORMRQR•R9(    RLRAtschemetlocR”tquerytfragRPt
downloader((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytdownloadPackageOnly—s  %!    cCs‡tjj|jƒsdS|jjdƒsItjjd|j    ƒƒdSt
|jdƒj ƒ}t j |ƒjƒ}||jdkS(sHTest an archive. It should exist and the MD5 checksum should be correct.iRØsWarning: no MD5Sum for %s
itrb(RR”R•RRÜR¶RR6R8RÉR\R_thashlibtmd5t    hexdigest(RLRetchecksum((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR´scCsºtjj|jƒd}x:tD]*\}}}|t|ƒ |kr Pq q Wd|S|t|ƒ  |_||d|jjj    d|jjj
ƒ}|j |jd|ƒ}|r¶|SdS(s$Unpack a downloaded package archive.is&unknown extension for archive file: %sRBRMRAN( RR”RRtARCHIVE_FORMATSR`tbasenameRÙR¢R‰RMRo(RLRARPtextt unpackerClassR0tunpackerR˜((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytunpackPackageOnlyÀscCs#d|jƒ|jjtdƒfS(s6Default install method, to be overridden by subclassessL%s: This package needs to be installed manually (no support for flavor="%s")R(RÉRÜR¶RÆ(RLRA((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytinstallPackageOnlyÐscCs|jjdƒs d|jƒS|j|ƒ}|rId|jƒ|fS|j|ƒ}|rrd|jƒ|fS|j|ƒS(sžDownload, unpack and install a single package.
 
        If output is given it should be a file-like object and it
        will receive a log of what happened.s Download-URLsG%s: This package needs to be installed manually (no Download-URL field)s%s: download: %ss%s: unpack: %s(RÜR¶RÉR
RR(RLRAtmsg((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytinstallSinglePackageÕscCstj|jjjƒ|_dS(sGBookkeeping before installation: remember what we have in site-packagesN(RtlistdirRÙR¢R‹t _old_contents(RL((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt beforeInstallçscBs]ej|jjjƒ}x>|D]6}||jkr:qn|ddkrPqnejj|jjj|ƒ}e|ƒ}xØ|j    ƒD]Ê}|s™q‡n|ddkr¯q‡n|d dkrÍ|dUq‡n|dd    krê|d }nejj
|ƒsejj|jjj|ƒ}nejj |ƒ}|e jkr‡e jj |ƒq‡q‡WqWdS(
sWBookkeeping after installation: interpret any new .pth files that have
        appearediüÿÿÿs.pthit#itimportNiÿÿÿÿs
(RRRÙR¢R‹RR”R7R\t    readlinestisabsR—RRx(RLt new_contentstfnRÉtfRF((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt afterInstallës.   !cCs…|jjjƒs|S|jjdƒ}|s2|Sg}xF|D]>}x5|D] }|t|ƒ |krLPqLqLW|j|ƒq?W|S(s2Return a list that contains only unpexpected skipssUser-install-skips(RÙR¢RRÜR¶R`Rx(RLR‚texpected_skipstnewnamesRwR}((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRzs  N(RTRURVRNRàRwR©RÆR«RâRãRäRåRÉRÌRéRúRþROR
RRRRRR#Rz(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR s0                                                        (    ,                RÃcBs eZdd„Zdd„ZRS(cCsdS(s0We don't unpack binary packages until installingN((RLRA((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRsc Csåd|jkrd|jƒSd|jkrct|d|jdƒrcd|jƒ|jdfSn|jƒtjj|jƒd}xFtD]*\}}}|t    |ƒ |krPqqWd|jƒ|fS|t    |ƒ  |_
g}xe|j j j D]T\}}|sqùn|dkr&t}    nd    |jƒ|fS|j|    |fƒqùW||d
d d |ƒ}
|
j|jd |d|ƒ} | r‘| S|jƒd|jkrát|d|jdƒrád|jƒ|jdfSndS(sInstall a single source package.
 
        If output is given it should be a file-like object and it
        will receive a log of what happened.sInstall-commands.%s: Binary package cannot have Install-commandsPre-install-commands/tmps#pre-install %s: running "%s" failedis*%s: unknown extension for archive file: %ss --install-libs!%s: Don't know installLocation %sRBRtRlRARnsPost-install-commands%%s: post-install: running "%s" failedN(RÜRÉRGRRR”RRRR`RRÙR¢RRŽRxRoR#RO( RLRARPRRR0tinstall_renamesRÞtnewloctoldlocRR˜((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRs>
     
N(RTRURORR(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRÃs RÂcBs eZdd„Zdd„ZRS(cCsntj||ƒtjj|jjj|jƒ|_    tjj|j    dƒ}tjj
|ƒ rjt rjdSdS(s6Unpack a source package and check that setup.py existsssetup.pys)no setup.py found after unpack of archiveN( RRRR”R7RÙR¢R‰Rt _buildDirnameR•R9(RLRAt    setupname((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRQs
$c    CsÒd|jkrIt||j|jdƒrId|jƒ|jdfSn|jƒ|jjdƒ}|rx|jrxdSd }|sød}xU|jj    j
D]D\}}|sÊ|sÁt j ƒ}n|}n|d||f}qšWdt j|f}nt||j|ƒr!d|jƒ|fS|r{tjj|ƒr{tj|ƒ}|rdd    d
j|ƒ}nd }tj|ƒ|S|jƒd |jkrÎt||j|jd ƒrÎd |jƒ|jd fSnd S(sInstall a single source package.
 
        If output is given it should be a file-like object and it
        will receive a log of what happened.sPre-install-commands#pre-install %s: running "%s" failedsInstall-commandsJPackage has install-command and can only be installed to standard locationRs %s "%s"s"%s" setup.py install %ssinstall %s: running "%s" faileds*Warning: some files were not installed: %sR2sPost-install-commands$post-install %s: running "%s" failedN(RÜRGR)RÉRR¶t_install_renamesRORÙR¢RttempfiletmkdtempRt
executableRR”R•RR7tshutiltrmtreeR#(    RLRAt
installcmdtunwanted_install_dirt
extra_argsRÞtvtunwanted_filesR˜((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRZsD
     
N(RTRURORR(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRÂOs    RÄcBs eZdd„Zdd„ZRS(cCsdS(s-We don't unpack dmg packages until installingN((RLRA((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRscCsÜd|jkrd|jƒSd|jkrct|d|jdƒrcd|jƒ|jdfSn|jƒ|jjdƒ}|r¤d|kr±||j}q±n d|j}t|d|ƒrÑd    |jƒSd
|jS( sInstall a single source package.
 
        If output is given it should be a file-like object and it
        will receive a log of what happened.sPost-install-commands6%s: Installer package cannot have Post-install-commandsPre-install-commands/tmps#pre-install %s: running "%s" failedsInstall-commandt%s    open "%s"s4%s: install command failed (use verbose for details)sG%s: downloaded and opened. Install manually and restart Package Manager(RÜRÉRGRR¶R(RLRAR1((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR‘s
  N(RTRURORR(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRċs t PimpInstallercBsPeZdZd„Zd„Zd„Zddd„Zddd„Zd„ZRS(    sUInstaller engine: computes dependencies and installs
    packages in the right order.cCs(g|_||_g|_g|_dS(N(t_todoRÙt_curtodot _curmessages(RLRÝ((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRN¯s            cCs ||jkS(N(R8(RLRn((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt __contains__µscCs7x0|D](}||jkr|jj|ƒqqWdS(N(R8Rx(RLRÅRn((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt _addPackages¸s iic    CsÁ|s+|jƒ\}}|dkr+dSn||jksI||jkrMdS|jjd|ƒ|sjdS|jƒ}xD|D]<\}}|r¥|j|t|ƒq}|jjd|ƒq}WdS(söInternal routine, recursive engine for prepareInstall.
 
        Test whether the package is installed and (if not installed
        or if force==1) prepend it to the temporary todo list and
        call ourselves recursively on all prerequisites.RñNisProblem with dependency: %s(    RúR8R9tinsertRþt_prepareInstallRpR:Rx(    RLRntforcet    recursiveR#tmessagetprereqsRÇRý((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR>½s  cCsMg|_g|_|j|||ƒ|j|jf}g|_g|_|S(s6Prepare installation of a package.
 
        If the package is already installed and force is false nothing
        is done. If recursive is true prerequisites are installed first.
 
        Returns a list of packages (to be passed to install) and a list
        of messages of any problems encountered.
        (R9R:R>(RLRnR?R@R˜((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytprepareInstallÔs
               cCsP|j|ƒg}x6|jD]+}|j|ƒ}|r|j|ƒqqW|S(sInstall a list of packages.(R<R8RRx(RLRÅRAR#RÇR((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pytinstallæs (    RTRURVRNR;R<R>RCRD(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyR7«s            cCswt|}|r"|j|ƒn|jƒ}|rGtjj|ƒnt|ƒ}|j|jƒ|dkr‚|j    tjƒnñ|dkro|s£|j
ƒ}nddGHHxÃ|D]´}    |j |    ƒ}
|
rê|
j ƒ} |
j ƒ}    nd} d|    | fGH|r´dG|
jƒGHydG|
jƒGHWntk
r:nX|
jƒ} d    j| jƒƒ} d
| GHq´q´Wn|d krg|sš|j
ƒ}d dGHHnxÖ|D]¿}    |j |    ƒ}
|
rÝ|
jƒ\} } |
j ƒ}    n d} d} d|    | | fGH|r¡| dkr¡|
jƒ}xD|D]9\}
} |
s;d}
n |
j ƒ}
dd|
| fGHq Wq¡q¡Wn |dkrs|sŽdGHtjdƒnt|ƒ}xÖ|D]Ë}    |j |    ƒ}
|
sËd|    GHq¡n|j|
|ƒ\}}|r| rd|    GHxp|D]}dG|GHqWq¡|r(tj}nd}|j||ƒ}|r¡d|    GHx|D]}dG|GHqVWq¡q¡WndS(sEngine for the main programRÌRÈs %-20.20s    %stPackageR®sError: no such packages    Home page:    s    Download URL:    s
                   s    Description:    %sR#s%-20.20s    %s    %st    InstalledtMessageterrorsNo such packages%-20.20s    %-9.9s    %sRíRs%-20.20s    Requirement: %s %sRDs"Please specify packages to installis%s: No such packages%s: Not installed:s    N(REs Description(RERFRG(RRŒR›RR5R8RR»RŠRÌRËRÖRâRÉRãRätKeyErrorR«R7RáRúRþtexitR7RCRORD(tmodetverboseR?targstprefargsRMR¨R˜RÝtpkgnameRÇR«R#RtprereqtinstRÈtmessagestmRA((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt_runós”                                              c Csddl}d„}ddd„ƒY}y#|jtjddƒ\}}Wn|jk
rh|ƒnX| r| r|ƒnd}d}d}i}d}    x"|D]\}
} |
d    kr×|rÎ|ƒnd
}n|
d krü|ró|ƒnd }n|
d kr!|r|ƒnd}n|
dkrF|r=|ƒnd}n|
dkr[d}n|
dkrpd}n|
dkrŽd}|ƒ}    n|
dkr§| |d<n|
dkr¦| |d<q¦q¦W|sÔ|ƒn|dkròdttfGHnt||||||    ƒdS(s'Minimal commandline tool to drive pimp.iÿÿÿÿNcSsLdGHdGHdGHdGHdGHdGHdGHdGHd    GHd
tGHd GHtjd ƒdS( Ns=Usage: pimp [options] -s [package ...]  List installed statuss@       pimp [options] -l [package ...]  Show package informations8       pimp [options] -i package ...    Install packagess?       pimp -d                          Dump database to stdouts<       pimp -V                          Print version numbersOptions:s       -v     Verboses        -f     Force installations'       -D dir Set destination directorys              (default: %s)s       -u url URL for databasei(RŽRRJ(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt_helpKs    t_WatchercBseZd„ZRS(cSstjj|dƒdS(Ns i(RR6R8(RLR((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRRZs(RTRURR(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRVYsis slifvdD:Vu:is-sR#s-lRÈs-dRÌs-VR©s-iRDs-fs-vs-DR‹s-uRŠs"Pimp version %s; module name is %s((tgetoptRtargvt GetoptErrorRORRTRT( RWRURVtoptsRMRKR?RLRNRMR¾ta((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyRGs^     # 
 
     
     
     
                   
 t pimp_updates9pimp_update is version %s, not newer than pimp version %s(t*t__main__(8RVtwarningsRRRR:R¹RRR³tdistutils.utilRtdistutils.sysconfigR RuR,R/Rbt__all__RòRóRôR9RRƒR„R…t    sysconfigtget_python_libRŽRRpRRGRHRWRZRhRqRrRORRRRÛRRÃRÂRÄR7RTRRTR\Rõtwarn(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/pimp.pyt<module>sœ                -     !
1     V—    ÿ 8< H    T    I