︙ | | |
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
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
|
+
+
+
+
+
+
+
+
+
+
+
|
lappend ::auto_path [file join $pkgr_path Eagle1.0]
} else {
lappend ::auto_path [file join [file dirname [file dirname \
[file dirname $pkgr_path]]] externals Eagle lib Eagle1.0]
}
}
variable pkgr_harpy_path; # DEFAULT: <unset>
if {![info exists pkgr_harpy_path]} then {
set pkgr_harpy_path [file normalize [file dirname [info script]]]
if {![file isfile [file join $pkgr_harpy_path sign.eagle]]} then {
set pkgr_harpy_path [file join [file dirname [file dirname \
[file dirname $pkgr_harpy_path]]] externals Harpy Tools]
}
}
#
# NOTE: This package requires several packages from the Eagle core script
# library, even when it is being used by native Tcl. If necessary,
# prior to evaluating this file in native Tcl, its auto-path should
# be modified to include an "Eagle1.0" directory (i.e. a directory
# containing the Eagle core script library files "auxiliary.eagle",
# "file1.eagle", and "platform.eagle").
|
︙ | | |
492
493
494
495
496
497
498
499
500
501
502
503
504
505
|
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
} else {
error "cannot sign with OpenPGP: passphrase file does not exist"
}
} else {
error "cannot sign with OpenPGP: passphrase file is not configured"
}
}
#
# NOTE: This procedure attempts to create a Harpy (script) certificate for
# the specified (named) file. Non-zero is only returned if the Harpy
# (script) certificate is created successfully. A script error should
# not be raised by this procedure. The fileName argument must be the
# fully qualified path and file name of the file to be signed. This
# procedure assumes that the Harpy package for Eagle is installed and
# ready for use (i.e. it can find a valid license certificate).
#
# <internal>
proc createHarpyCertificate { fileName } {
variable harpySignCommand
variable pkgr_harpy_path
set toolFileName \
[file nativename [file join $pkgr_harpy_path sign.eagle]]
set scriptFileName [file nativename $fileName]
set vendor "Mistachkin Systems"; # NOTE: System default.
if {[isEagle]} then {
set shellFileName [formatExecArgument [info nameofexecutable]]
set toolFileName [formatExecArgument $toolFileName]
set scriptFileName [formatExecArgument $scriptFileName]
set vendor [formatExecArgument $vendor]
if {[catch {
eval exec -success Success [subst $harpySignCommand]
}] == 0} then {
return true
}
} else {
#
# HACK: Make sure that Eagle is loaded into this process so that we
# can figure out the shell for it and then [exec] out to that
# shell.
#
makeEagleReady
set shellFileName [eagle {
file join [file dirname [lindex [info assembly] end]] EagleShell.exe
}]
if {[catch {
eval exec [subst $harpySignCommand] 2>@1
} result] == 0} then {
return true
}
}
return false
}
#
# NOTE: This procedure attempts to create an OpenPGP signature for the
# specified (named) file. Non-zero is only returned if the OpenPGP
# signature is created successfully. A script error should not be
# raised by this procedure. The fileName argument must be the fully
# qualified path and file name of the file to be signed.
|
︙ | | |
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
|
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
|
+
|
}
#
# NOTE: This procedure is designed for Eagle. It attempts to load the
# "best" native Tcl library. It may raise any number of script
# errors. There are no arguments.
#
# <internal>
proc makeTclReady {} {
#
# NOTE: This procedure is useless when running in native Tcl; therefore,
# forbid its use there.
#
if {![isEagle]} then {
error "already running in Tcl language"
|
︙ | | |
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
|
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
|
+
|
}
#
# NOTE: This procedure, which may only be used from a native Tcl script,
# checks if Garuda and Eagle are loaded and ready. If not, a script
# error is raised. There are no arguments.
#
# <internal>
proc eagleMustBeReady {} {
#
# NOTE: This procedure is useless when running in Eagle; therefore,
# forbid its use there.
#
if {[isEagle]} then {
error "already running in Eagle language"
|
︙ | | |
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
|
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
|
+
|
}
#
# NOTE: This procedure is designed for native Tcl. It attempts to load
# the Garuda package and gain access to Eagle. It may raise any
# number of script errors. There are no arguments.
#
# <internal>
proc makeEagleReady {} {
#
# NOTE: This procedure is useless when running in Eagle; therefore,
# forbid its use there.
#
if {[isEagle]} then {
error "already running in Eagle language"
|
︙ | | |
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
|
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
append openPgpSignCommand {gpg2 --detach-sign --armor}
append openPgpSignCommand \
{ --passphrase-file [formatExecArgument [getOpenPgpPassphraseFile]]}
append openPgpSignCommand { --batch --yes {${fileName}}}
}
#
# NOTE: The command to use when creating Harpy signatures for downloaded
# package scripts.
#
variable harpySignCommand; # DEFAULT: {${shellFileName}} -file ...
if {![info exists harpySignCommand]} then {
set harpySignCommand ""
append harpySignCommand {{${shellFileName}}}
append harpySignCommand { -noArgumentsFileName -file {${toolFileName}}}
append harpySignCommand { {${scriptFileName}} {${vendor}}}
}
#
# NOTE: Verify that the package script matches the current language
# when called from the [package unknown] handler?
#
variable strictUnknownLanguage; # DEFAULT: true
|
︙ | | |