DIRECTORY Commander, CommandTool, Convert, FS, IO, Rope, SummonerLoadDeps, SymTab; SummonerLoadDepsCmds: CEDAR PROGRAM IMPORTS Commander, CommandTool, Convert, FS, IO, Rope, SummonerLoadDeps, SymTab ~ BEGIN OPEN SummonerLoadDeps; RederiveSummonerLoadCmd: Commander.CommandProc = { args: CommandTool.ArgumentVector ~ CommandTool.Parse[cmd: cmd, starExpand: TRUE]; FOR k: NAT IN [1..args.argc) DO BuildGFI: PROC [loadName: ROPE] ~ { stream: IO.STREAM; stream _ FS.StreamOpen[fileName: loadName ! FS.Error => GOTO Exit]; DO line: ROPE ~ IO.GetLineRope[stream ! IO.EndOfStream => EXIT]; IF Rope.Match[pattern: "* (*)*", object: line] THEN { module: ROPE ~ Rope.Substr[base: line, len: Rope.Find[s1: line, s2: " "]]; number: ROPE _ Rope.Substr[base: line, start: Rope.Find[s1: line, s2: "("]+1]; value: NAT; number _ Rope.Substr[base: number, len: Rope.Find[s1: number, s2: ")"]]; value _ Convert.CardFromRope[r: number ! Convert.Error => LOOP]; [] _ SymTab.Store[x: gfi, key: module, val: NEW[NAT _ value]]; }; ENDLOOP; EXITS Exit => {}; }; EachPackageName: SymTab.EachPairAction = { RETURN [FALSE] }; Other: PROC [line: ROPE] ~ { s: IO.STREAM ~ IO.RIS[line]; [] _ IO.SkipWhitespace[stream: s]; IF ~ IO.EndOf[s] THEN { IO.PutF[stream: cmd.out, format: "%lUnrecognized line: \"%g\".", v1: [rope["i"]], v2: [rope[line]], v3: [rope[" "]]]; result _ $Failure; }; }; Run: PROC [package: ROPE] ~ { EstimatedGFIs: PROC [module: ROPE] RETURNS [gfis: NAT _ 1] ~ { ref: REF; IF (ref _ (SymTab.Fetch[x: gfi, key: module].val)) # NIL THEN gfis _ NARROW[ref, REF NAT]^; }; IF SymTab.Fetch[x: x, key: package].found THEN RETURN; --Don't run a package more than once IO.PutF[stream: s, format: "%g (%g)\n", v1: [rope[package]], v2: [cardinal[EstimatedGFIs[package]]]]; [] _ SymTab.Store[x: x, key: package, val: NIL]; }; x: SymTab.Ref ~ SymTab.Create[case: FALSE]; --Packages listed in the file y: SymTab.Ref ~ SymTab.Create[case: FALSE]; --Version Map warnings gfi: SymTab.Ref ~ SymTab.Create[case: FALSE]; --Version Map warnings s: IO.STREAM; loadName: ROPE ~ Rope.Cat[args[k], ".summonerLoad"]; fileName: ROPE ~ FS.ExpandName[name: Rope.Cat[args[k], ".summonerInstall"] ! FS.Error => {msg _ IO.PutFR[format: "Could not find %g.summonerInstall.\n", v1: [rope[args[k]]]]; EXIT}].fullFName; BuildGFI[loadName]; s _ FS.StreamOpen[fileName: loadName, accessOptions: create]; IO.PutF[stream: s, format: "-- %g\n-- Copyright 1986 by Xerox Corporation. All rights reserved.\n\n", v1: [rope[Rope.Cat[args[k], ".summonerLoad"]]]]; { ENABLE { CantFind => { IF SymTab.Fetch[x: y, key: full].found THEN RESUME; IO.PutF[stream: cmd.out, format: "%lNeed \"%g\".%l\n", v1: [rope["i"]], v2: [rope[full]], v3: [rope[" "]]]; [] _ SymTab.Store[x: y, key: full, val: NIL]; result _ $Failure; --Consider having to looking at the version map a flop RESUME; }; }; RecurseThroughInstall[file: fileName, install: NIL, run: Run, other: Other, recurseVMap: FALSE]; }; IO.Close[self: s]; ENDLOOP; }; Commander.Register[key: "RederiveSummonerLoad", proc: RederiveSummonerLoadCmd]; END. @ SummonerLoadDepsCmds.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Eric Nickell, September 30, 1986 4:22:14 pm PDT Mike Spreitzer February 9, 1987 2:37:51 pm PST [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL] [key: SymTab.Key, val: SymTab.Val] RETURNS [quit: BOOL] Κ7•NewlineDelimiter ™™Icodešœ Οmœ1™[s1: ROPE, s2: ROPE, pos1: INT _ 0, case: BOOL _ TRUE]šœžœ>˜JK–>[s1: ROPE, s2: ROPE, pos1: INT _ 0, case: BOOL _ TRUE]šœžœB˜NKšœžœ˜ K–>[s1: ROPE, s2: ROPE, pos1: INT _ 0, case: BOOL _ TRUE]˜HKšœ:žœ˜@K–-[r: ROPE, defaultBase: Convert.Base _ 10]šœ,žœžœ ˜>Kšœ˜—Kšžœ˜—Kšžœ ˜K˜—˜*Kš 7™7Kšžœžœ˜K˜—š‘œžœžœ˜Kš œžœžœžœžœ˜K–0[stream: STREAM, flushComments: BOOL _ TRUE]šœžœ˜"šžœžœ žœ˜K–―[stream: STREAM, format: ROPE _ NIL, v1: IO.Value _ [null[]], v2: IO.Value _ [null[]], v3: IO.Value _ [null[]], v4: IO.Value _ [null[]], v5: IO.Value _ [null[]]]šžœmΟtœ˜vKšœ˜Kšœ˜—K˜—š‘œžœ žœ˜–8[mod: SymTab.SeqIndex _ 21B (17), case: BOOL _ TRUE]š ‘ œžœ žœžœžœ ˜>K–$[x: SymTab.Ref, key: SymTab.Key]šœžœ˜ Kš žœ3žœžœžœžœžœ˜[K˜—Kšžœ(žœžœΟc$˜[K–―[stream: STREAM, format: ROPE _ NIL, v1: IO.Value _ [null[]], v2: IO.Value _ [null[]], v3: IO.Value _ [null[]], v4: IO.Value _ [null[]], v5: IO.Value _ [null[]]]šžœc˜eKšœ+žœ˜0K˜—Kšœ$žœ£˜IK–8[mod: SymTab.SeqIndex _ 21B (17), case: BOOL _ TRUE]šœ$žœ£˜BK–8[mod: SymTab.SeqIndex _ 21B (17), case: BOOL _ TRUE]šœ&žœ£˜DKšœžœžœ˜ Kšœ žœ&˜4Kšœ žœžœ’œ(žœžœMžœ’ ˜ΐK–“[fileName: ROPE, accessOptions: FS.AccessOptions _ read, streamOptions: FS.StreamOptions _ (5)[TRUE, TRUE, TRUE, TRUE, TRUE], keep: CARDINAL _ 1B (1), createByteCount: FS.ByteCount _ 2560, streamBufferParms: FS.StreamBufferParms _ [vmPagesPerBuffer: 8, nBuffers: 2], extendFileProc: FS.ExtendFileProc, wantedCreatedTime: GMT _ nullGMT, remoteCheck: BOOL _ TRUE, wDir: ROPE _ NIL]˜Kšœžœ7˜=K–―[stream: STREAM, format: ROPE _ NIL, v1: IO.Value _ [null[]], v2: IO.Value _ [null[]], v3: IO.Value _ [null[]], v4: IO.Value _ [null[]], v5: IO.Value _ [null[]]]šžœ•˜—šœ˜–I[cmd: Commander.Handle, starExpand: BOOL _ FALSE, switchChar: CHAR]šžœ˜šœ ˜ K–$[x: SymTab.Ref, key: SymTab.Key]šžœ%žœžœ˜3KšžœP’œ’œ˜kK–7[x: SymTab.Ref, key: SymTab.Key, val: SymTab.Val]šœ(žœ˜-Kšœ£6˜IKšžœ˜Kšœ˜—Kšœ˜—Kšœ/žœ'žœ˜`Kšœ˜—K–'[self: STREAM, abort: BOOL _ FALSE]šžœ˜Kšžœ˜—L˜—L–x[key: ROPE, proc: Commander.CommandProc, doc: ROPE _ NIL, clientData: REF ANY _ NIL, interpreted: BOOL _ TRUE]˜O—K˜Kšžœ˜—…— ζ]