1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
|
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
|
+
|
# [getPlatform] procedure. An empty string means that the associated
# entity does not require a specific platform. The varName argument
# is the name of a variable in the context of the immediate caller
# that will receive a modified platform name, if applicable. Upon
# failure, a script error will be raised. The return value is
# undefined.
#
# <internal>
proc verifyPlatform { platform varName } {
#
# NOTE: The platform name must be matched exactly and case-sensitively.
#
switch -exact -- $platform {
"" {
#
|
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
|
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
|
+
+
+
+
+
+
|
if {[info exists usePgp]} then {
set localUsePgp $usePgp
} else {
set localUsePgp false
}
#
# NOTE: Since not all potential callers to this procedure may login
# first, attempt to do that now, if necessary.
#
maybeResetCookieAndLoginSimple
#
# NOTE: Download the list of platforms associated with this package
# from the package repository server. This may fail and raise
# a script error.
#
set platforms [downloadAllPlatforms \
$language $version $localPackageName $localFileNames $localUsePgp]
|
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
|
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
if {[string length $publicUserName] > 0 && \
[string length $publicPassword] > 0} then {
return [resetCookieAndLogin $publicUserName $publicPassword]
}
error "missing API keys and no public login credentials configured"
}
#
# NOTE: This procedure attempts to login using the configured package
# repository server API key -OR- using the public access account,
# if not already logged in. Upon success, it will set the login
# cookie to the one from the raw response data. Upon failure, a
# script error will be raised. There are no arguments.
#
# <internal>
proc maybeResetCookieAndLoginSimple {} {
variable loginCookie
#
# NOTE: Attempt to verify that we are currently logged in. If so, do
# nothing; otherwise, attempt to login.
#
if {![info exists loginCookie] || [llength $loginCookie] != 2} then {
resetCookieAndLoginSimple
}
}
#
# NOTE: This procedure resets the currently configured login cookie, if
# any, and then attempts to login using the specified user name and
# password. Upon success, it will set the login cookie to the one
# from the raw response data. Upon failure, a script error will be
# raised. The userName argument must be the name of a package file
|