Diff
Not logged in

Differences From Artifact [dfa0384d13]:

To Artifact [3e9426a583]:


1151
1152
1153
1154
1155














1156
1157
1158
1159
1160
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174





+
+
+
+
+
+
+
+
+
+
+
+
+
+





    #       request to be considered successful. 
    # 
    return [expr {$code eq "OK"}] 
  } 
 
  # 
  # NOTE: This procedure returns non-zero if the specified string value is a 
  #       valid package name.  The emptyOk argument can be non-zero if the 
  #       caller wishes to permit an empty string.  This procedure is shared 
  #       with the server. 
  # 
  proc isValidPackageName { name {emptyOk false} } { 
    if {$emptyOk && [string length $name] == 0} then { 
      return true 
    } 
 
    return [regexp -- {^[A-Za-z][0-9A-Za-z\.]*$} $name] 
  } 
 
  # 
  # NOTE: This procedure was stolen from the "common.tcl" script used by the 
  #       package repository server.  It has been modified to support both 
  #       native Tcl and Eagle.  It should be noted here that TIP #268 syntax 
  #       is not supported by Eagle.  For native Tcl, the requirement argument 
1225
1226
1227
1228
1229















1230
1231
1232
1233
1234
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263





+
+
+
+
+
+
+
+
+
+
+
+
+
+
+





  #       the literal string "handler". 
  # 
  proc extractAndVerifyLookupMetadata { result varName caller } { 
    variable strictUnknownLanguage 
 
    # 
    # NOTE: Grab the returned package name.  It cannot be an empty string 
    #       and it must conform to the general conventions for a package 
    #       name. 
    # 
    set name [getDictionaryValue $result Name] 
 
    if {[string length $name] == 0} then { 
      error "missing name" 
    } 
 
    if {![isValidPackageName $name false]} then { 
      error "bad name" 
    } 
 
    # 
    # NOTE: Grab the returned patch level.  It cannot be an empty string 
    #       and it must conform to the TIP #268 requirements for a single 
    #       package version. 
    # 
1268
1269
1270
1271
1272
1273

1274
1275
1276
1277
1278
1297
1298
1299
1300
1301

1302
1303
1304
1305
1306
1307





-
+





    #       this client.  In that case, just raise an error. 
    # 
    set certificate [getDictionaryValue $result Certificate] 
 
    if {[string length $certificate] == 0} then { 
      error "missing script certificate" 
      error "missing certificate" 
    } 
 
    # 
    # NOTE: Are we being called from the [package unknown] handler 
    #       in "strict" mode? 
1299
1300
1301
1302
1303

1304
1305
1306
1307
1308
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338





+





    #       array variable name. 
    # 
    if {[string length $varName] > 0} then { 
      upvar 1 $varName metadata 
 
      set metadata(name) $name 
      set metadata(patchLevel) $patchLevel 
      set metadata(language) $language 
      set metadata(script) $script 
      set metadata(certificate) $certificate 
    } 
1468
1469
1470
1471
1472







1473
1474
1475
1476
1477
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514





+
+
+
+
+
+
+





    # 
    if {![info exists metadata]} then { 
      error "missing metadata" 
    } 
 
    # 
    # NOTE: If the name for the package is mising, fail. 
    # 
    if {![info exists metadata(name)]} then { 
      error "missing name" 
    } 
 
    # 
    # NOTE: If the patch level for the package is mising, fail. 
    # 
    if {![info exists metadata(patchLevel)]} then { 
      error "missing patch level" 
1493
1494
1495
1496
1497
1498

1499
1500
1501
1502
1503
1530
1531
1532
1533
1534

1535
1536
1537
1538
1539
1540





-
+





 
    # 
    # NOTE: If the package script certificate is mising, fail. 
    # 
    if {![info exists metadata(certificate)]} then { 
      error "missing script certificate" 
      error "missing certificate" 
    } 
 
    # 
    # NOTE: Create common cleanup script block that deletes any temporary 
    #       files created for the script verification process. 
1800
1801
1802
1803
1804
1805

1806
1807
1808
1809
1810
1837
1838
1839
1840
1841

1842
1843
1844
1845
1846
1847





-
+





            error "unsupported metadata language" 
          } 
        } 
      } 
    } else { 
      error "unsupported script certificate" 
      error "unsupported certificate" 
    } 
  } 
 
  # 
  # NOTE: This procedure returns non-zero if the specified package appears to 
2590
2591
2592
2593
2594
2595

2596
2597
2627
2628
2629
2630
2631

2632
2633
2634





-
+


  setupPackageUnknownHandler 
 
  # 
  # NOTE: Provide the package to the interpreter. 
  # 
  package provide Eagle.Package.Repository 1.0.6 
  package provide Eagle.Package.Repository 1.0.8 
}