︙ | | |
24
25
26
27
28
29
30
31
32
33
34
|
24
25
26
27
28
29
30
31
32
33
34
|
-
+
|
# NOTE: This procedure sets up the default values for all URN configuration
# parameters used by the package downloader client. If the force
# argument is non-zero, any existing values will be overwritten and
# set back to their default values.
#
proc setupDownloadUrnVars { force } {
proc setupDownloadServerVars { force } {
#
# NOTE: The URN, relative to the base URI, where the Package Signing Key
# may be downloaded.
#
variable openPgpKeyUrn; # DEFAULT: pkg_key
|
︙ | | |
76
77
78
79
80
81
82
83
84
85
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
if {$force || ![info exists logoutUrn]} then {
set logoutUrn pkgd_logout
}
}
#
# NOTE: This procedure sets up the default values for all version
# configuration parameters used by the package downloader client.
# If the force argument is non-zero, any existing values will be
# overwritten and set back to their default values.
#
proc setupDownloadVersionVars { force } {
#
# NOTE: The name of the branch where the package files should be fetched
# from.
#
variable branchName; # DEFAULT: trunk
if {$force || ![info exists branchName]} then {
set branchName trunk
}
}
#
# NOTE: This procedure sets up the default values for all URI configuration
# parameters used by the package downloader client. If the force
# argument is non-zero, any existing values will be overwritten and
# set back to their default values.
|
︙ | | |
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
-
+
-
+
|
# package may be found.
#
variable platformsUri; # DEFAULT: ${baseUri}/${platformsUrn}?...
if {$force || ![info exists platformsUri]} then {
set platformsUri {${baseUri}/${platformsUrn}?download&name=trunk}
set platformsUri {${baseUri}/${platformsUrn}?download&name=${branchName}}
}
#
# NOTE: The URI where a single package file may be found. This file will
# belong to a specific version of one package.
#
variable downloadUri; # DEFAULT: ${baseUri}/${downloadUrn}?...
if {$force || ![info exists downloadUri]} then {
set downloadUri [appendArgs \
{${baseUri}/${downloadUrn}?download&ci=trunk&} \
{${baseUri}/${downloadUrn}?download&ci=${branchName}&} \
{[uriEscape filename $fileName]}]
}
#
# NOTE: The URI where a logout request should be sent. This should
|
︙ | | |
270
271
272
273
274
275
276
277
278
279
280
|
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
set logoutUrn [appendArgs pkgd_logout_ $serverId]
} else {
#
# NOTE: Forcibly reset URN variables to their default values.
#
setupDownloadUrnVars true
setupDownloadServerVars true
}
}
#
# NOTE: This procedure modifies the version variables used by the package
# downloader client so that a specific version will be used. The
# versionId argument must consist only of hexadecimal characters.
#
# <public>
proc useVersionId { {versionId ""} } {
variable branchName
if {[string length $versionId] > 0 && \
![regexp -nocase -- {^[0-9A-F]*$} $versionId]} then {
error "version Id must be hexadecimal"
}
if {[string length $versionId] > 0} then {
#
# NOTE: Set the variables to values that should cause the specified
# version Id to be used (assume the version Id itself is valid
# and active).
#
set branchName $versionId; # TODO: Translations here?
} else {
#
# NOTE: Forcibly reset the variables to their default values.
#
setupDownloadVersionVars true
}
}
#
# NOTE: This procedure escapes a single name/value pair for use in a URI
|
︙ | | |
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
|
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
|
+
|
# The usePgp argument should be non-zero when an OpenPGP signature
# needs to be verified for the downloaded file.
#
proc downloadAllPlatforms { language version packageName fileNames usePgp } {
variable baseUri
variable branchName
variable platformsUri
variable platformsUrn
variable temporaryRootDirectory
set temporaryDirectory [file join \
|
︙ | | |
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
|
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
|
+
|
# file.
#
proc downloadOneFile {
language version platform fileName localFileName usePgp } {
variable baseUri
variable branchName
variable downloadUri
variable downloadUrn
#
# NOTE: First, build the full relative file name to download from
|
︙ | | |
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
|
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
|
-
-
+
+
+
+
-
+
|
# NOTE: Setup the variables, within this namespace, used by this script.
#
setupDownloadVars [info script]
#
# NOTE: Setup the URI and URN variables, within this namespace, used by
# this script.
# NOTE: Setup the server, version, and URI variables, in this namespace,
# that are used by this script.
#
setupDownloadServerVars false
setupDownloadVersionVars false
setupDownloadUriVars false; setupDownloadUrnVars false
setupDownloadUriVars false
#
# NOTE: If necessary, add the package persistence root directory to the
# auto-path for the current language. This will only be done if
# it falls outside of the existing auto-path.
|
︙ | | |