|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 25690 (0x645a)
Types: TextFile
Notes: R1k Text-file segment
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦7f851a4ee⟧
└─⟦this⟧
INSTALL_RCF => (
Do_Step
(Step => "AUTHORIZATION_CHECK,
CHECK_RCF,
UNCODE_UNITS,
RELEASE_RESTORE,
INSTALL_PRODUCT,
BUILD_PL,
START_RCF,
RECORD_INSTALLATION");
)
AUTHORIZATION_CHECK => (
declare
subtype Bogus is Natural range 0 .. 1;
package Pp is new Parameter_Parser (Bogus);
Iter : Pp.Iterator := Pp.Parse ("CMVC, CMVC.Source_Control, RCF");
Token_Iter : Pp.Iterator := Pp.Parse ("RCF");
Error : Natural := 0;
function Product_Name (Iter : Pp.Iterator) return String is
begin
if String_Utilities.Equal (Pp.Name (Iter), "NAME") then
return Pp.Get_Image (Iter);
else
return Pp.Name (Iter);
end if;
end Product_Name;
begin
while not Pp.Done (Iter) loop
declare
Name : constant String := Product_Name (Iter);
begin
if "!Implementation".Product_Authorization.Is_Registered
(Name) then
Log.Put_Line (Name & " is authorized", Profile.Positive_Msg);
else
Log.Put_Line ("Need to Authorize " & Name,
Profile.Error_Msg);
Error := Error + 1;
end if;
end;
Pp.Next (Iter);
end loop;
if Error /= 0 then
Log.Put_Line
("Do not proceed until all these products have been authorized",
Profile.Error_Msg);
end if;
if Get_Site /= "" and then not Pp.Done (Token_Iter) then
Error := 0;
Log.Put_Line ("Checking Token Count");
declare
Limit, Current, Buy_Out : Natural;
begin
while not Pp.Done (Token_Iter) loop
"Command_Data".
Token_Information
(Product_Name (Token_Iter), Limit, Buy_Out, Current);
if Limit = 0 then
Error := Error + 1;
Log.Put_Line
("No tokens (sessions) for " &
Product_Name (Token_Iter) &
" have been authorized. Do not proceed until you have authorized tokens for this product",
Profile.Error_Msg);
elsif (Buy_Out /= Current) and Current = Limit then
Log.Put_Line
("Tokens (Sessions) have been authorized for " &
Product_Name (Token_Iter) & ", but all are in use",
Profile.Error_Msg);
Log.Put_Line
("Have users which are using these tokens log off (and then back on) before continuing",
Profile.Error_Msg);
Show_Tokens (Product_Filter =>
Product_Name (Token_Iter));
else
Log.Put_Line (Product_Name (Token_Iter) &
" has available tokens",
Profile.Positive_Msg);
end if;
Pp.Next (Token_Iter);
end loop;
end;
else
Log.Put_Line
("Machine has not been configured for per session pricing (product tokens)." &
" Skipping product token check");
end if;
end;
)
CHECK_RCF => (
declare
use Directory_Tools;
Count : Natural := 0;
Rel : constant String := Naming.Simple_Name (Naming.Full_Name ("$"));
Rev : constant String := Rel (Rel'Last - 4 .. Rel'Last);
package Pp is new Parameter_Parser (Boolean);
function Job_Running (Job_Name : String) return Boolean is
begin
for J in System_Utilities.Job_Id loop
begin
if String_Utilities.Locate
(Job_Name, System_Utilities.Job_Name (J)) /= 0 then
return True;
end if;
exception
when others =>
null;
end;
end loop;
return False;
end Job_Running;
begin
if Object.Is_Ok (The_Object =>
Naming.Resolution
("!Targets.Implementation.RCF_User_Interface")) then
if not Job_Running ("Rcf_Compiler Rev") then
Log.Put_Line ("RCF_Compiler is not running", Profile.Error_Msg);
Log.Put_Line
("Before continuing, ensure the RCF compiler and all customization extension jobs are running",
Profile.Negative_Msg);
else
Log.Put_Line ("RCF_Compiler appears to be executing",
Profile.Positive_Msg);
end if;
else
Log.Put_Line
("The RCF has not been installed on this machine");
end if;
end;
)
UNCODE_UNITS => (
declare
Time_Stamp : constant String :=
Time_Utilities.Image (Time_Utilities.Get_Time,
Time_Utilities.Ada, Time_Utilities.Ada);
begin
if Directory_Tools.Object.Is_Ok
(The_Object => Directory_Tools.Naming.Resolution
("!Targets.Implementation.RCF_User_Interface")) then
Io.Set_Output ("Logs.Uncode_Units_Log");
if not Directory_Tools.Object.Is_Ok
(The_Object => Directory_Tools.Naming.Resolution
("!Machine.RCF")) then
Library.Create_World (Name => "!Machine.RCF",
Kind => Library.World,
Vol => Library.Nil,
Model => "",
Response => "<PROFILE>");
end if;
if Directory_Tools.Object.Is_Ok
(The_Object => Directory_Tools.Naming.Resolution
("!Machine.RCF")) then
Archive.Restore
(Objects =>
"!TARGETS.IMPLEMENTATION.RCF_RELEASE1_2_2.[RCF_UNCODE_UNITS,RCF_RECODE_UNITS]",
Options => "Promote,Replace",
Device => "Release",
Response => "<PROFILE>");
Lib.Delete
(Existing => "!TARGETS.IMPLEMENTATION.RCF_RELEASE1_2_2.RCF_@");
Lib.Copy (From => "Release_Unrecode.@",
To => "!TARGETS.IMPLEMENTATION.RCF_RELEASE1_2_2");
Program.Run
(S => "RCF_UNCODE_UNITS",
Context => "!TARGETS.IMPLEMENTATION.RCF_RELEASE1_2_2",
Response => "<PROFILE>");
-- Save output from compute recoding incase UNCODE is run again
Library.Copy (From => "!Machine.Rcf.Rcf1_2_@",
To => "!Machine.Rcf.Rcf1_2_@_" & Time_Stamp,
Response => "<PROFILE>");
else
Log.Put_Line
("Aborting execution of UNCODE_UNITS: Couldn't create !Machine.RCF",
Profile.Error_Msg);
end if;
Io.Reset_Output;
Log.Filter_Errors (Log_File => "Logs.Uncode_Units_Log",
Destination => "Logs.Uncode_Units_Log_Summary",
Auxiliaries => False,
Warnings => False,
Exceptions => True);
Common.Definition ("Logs.Uncode_Units_Log_Summary");
else
Log.Put_Line
("The RCI has not been previously installed on this machine, skipping UNCODE_UNITS step",
Profile.Warning_Msg);
end if;
end;
)
RELEASE_RESTORE => (
declare
Dependents : constant String := "Logs.Dependent_Objects";
Dependents_Log : constant String := Dependents & "_Log";
Frozen : constant String := "Logs.Frozen_Objects";
function Job_Running (Job_Name : String) return Boolean is
begin
for J in System_Utilities.Job_Id loop
begin
if String_Utilities.locate
(Job_Name, System_Utilities.Job_Name (J)) /= 0 then
return True;
end if;
exception
when others =>
null;
end;
end loop;
return False;
end Job_Running;
procedure Unfreeze_Spec_Dependents is
use Directory_Tools;
Iter : Object.Iterator;
Status : Object.Error_Code;
F : Io.File_Type;
begin
Io.Set_Output (Dependents_Log);
Comp.Dependents
(Unit =>
"[!Targets.Implementation.[Rcf_Customization_Interface,Rcf_Programmatic_Interface,Rcf_User_Interface].@'c(Spec_View).Units.?'Spec]",
Transitive => False,
Response => "");
Io.Reset_Output;
Io.Set_Output (Dependents);
Io.Set_Input (Dependents_Log);
while not Io.End_Of_File loop
declare
Line : constant String := Io.Get_Line;
begin
if Line (Line'First) = ' ' then
Io.Put_Line (Line);
end if;
end;
end loop;
Io.Reset_Output;
Io.Reset_Input;
Iter := Naming.Resolution ("[[_" & Dependents & "]$,[_" & Dependents & "]?]");
Io.Create (F, Name => Frozen);
while not Object.Done (Iter) loop
if Any_Object.Is_Frozen (Object.Value (Iter)) then
Any_Object.Unfreeze (Object.Value (Iter), False, Status);
if Object.Is_Bad (Status) then
Object.Report (Status);
Log.Put_Line ("Cannot unfreeze " &
Naming.Full_Name (Object.Value (Iter)),
Profile.Negative_Msg);
end if;
Io.Put_Line (F, Naming.Full_Name (Object.Value (Iter)) &
Naming.Part_Attribute
(Naming.Unique_Full_Name
(Object.Value (Iter))));
end if;
Object.Next (Iter);
end loop;
Io.Close (F);
end Unfreeze_Spec_Dependents;
procedure Refreeze_Spec_Dependents is
use Directory_Tools;
Iter : Object.Iterator;
Status : Object.Error_Code;
begin
Iter := Naming.Resolution ('_' & Frozen);
while not Object.Done (Iter) loop
Any_Object.Freeze (Object.Value (Iter), False, Status);
if Object.Is_Bad (Status) then
Object.Report (Status);
Log.Put_Line ("Cannot re-freeze " &
Naming.Full_Name (Object.Value (Iter)),
Profile.Negative_Msg);
end if;
Object.Next (Iter);
end loop;
end Refreeze_Spec_Dependents;
begin
Io.Set_Output ("Logs.Release_Restore_Log");
if Job_Running ("Rcf_Compiler Rev") then
Program.Run
(S => "KILL_RCF_MAIN",
Context =>
"!TARGETS.IMPLEMENTATION.RCF_USER_INTERFACE'SPEC_VIEW.UNITS",
Response => "<PROFILE>");
if Job_Running ("Rcf_Compiler Rev") then
Io.Reset_Output;
Log.Put_Line ("Failed to kill RCF compiler", Profile.Error_Msg);
Log.Put_Line ("Aborting RELEASE_RESTORE", Profile.Negative_Msg);
return;
end if;
end if;
Unfreeze_Spec_Dependents;
Archive.Restore (Options => "REMAKE, REPLACE, CHANGED_OBJECTS",
Device => "Release");
Lib.Delete (Existing => "!TARGETS.IMPLEMENTATION.RCF_RELEASE1_2_2.RCF_@");
Lib.Copy (From => "Release_Unrecode.@",
To => "!TARGETS.IMPLEMENTATION.RCF_RELEASE1_2_2");
Archive.Restore (Options => "REMAKE, REPLACE, CHANGED_OBJECTS",
Device => "Release_Reusable_Components");
Refreeze_Spec_Dependents;
if Directory_Tools.Object.Is_Ok (The_Objects =>
Directory_Tools.Naming.Resolution
("Release_Notes.[Data,Index]")) then
Archive.Restore (Options => "promote, replace",
Device => "Release_Notes");
end if;
if Directory_Tools.Object.Is_Ok
(The_Object => Directory_Tools.Naming.Resolution
("!Machine.Initialization.Rational")) then
if Directory_Tools.Object.Is_Ok
(The_Object =>
Directory_Tools.Naming.Resolution
("!Machine.Initialization.Rational.Initialize_RCF")) then
Compilation.Destroy
(Unit => "!Machine.Initialization.Rational.Initialize_RCF",
Threshold => 2,
Limit => "<WORLDS>",
Response => "<ERRORS>");
end if;
Library.Move
(From => "!Machine.Initialize_RCF",
To => "!Machine.Initialization.Rational.Compilation_Integrator");
else
Log.Put_Line ("Missing !Machine.Initialization.Rational; pre D_12_5_0 Environment suspected",
Profile.Error_Msg);
Log.Put_Line ("This release of the RCF is designed to be installed on D_12_5_0 or later systems",
Profile.Error_Msg);
end if;
Io.Reset_Output;
Log.Filter_Errors
(Log_File => "Logs.Release_Restore_Log",
Destination => "Logs.Release_Restore_Log_Summary",
Auxiliaries => False,
Warnings => False,
Exceptions => True);
Common.Definition ("Logs.Release_Restore_Log_Summary");
end;
)
INSTALL_PRODUCT => (
declare
use Directory_Tools;
F : Io.File_Type;
Context : constant string := Naming.Default_Context;
begin
Io.Set_Output ("Logs.Install_Product_Log");
Library.Context (To_Be => "!Targets.Implementation.Rcf_Release1_2_2");
System_Utilities.Set_Page_Limit (16_000);
begin
Log.Put_Line ("Localhost name resolved " &
String (Transport_Name.Host_To_Network_Name
("localhost")), Profile.Positive_Msg);
exception
when Transport_Name.Undefined =>
Log.Put_Line ("Adding Localhost to Transport_Name_Map",
Profile.Positive_Msg);
Io.Append (F, Name => ("!Machine.Transport_Name_Map"));
Io.Put_Line (F, "tcp/ip 127.0.0.1 localhost");
Io.Close (F);
begin
Log.Put_Line ("Localhost name resolved " &
String (Transport_Name.Host_To_Network_Name
("localhost")), Profile.Positive_Msg);
exception
when Transport_Name.Undefined =>
Log.Put_Line
("Failed to successfully add Localhost to Transport_Name_Map",
Profile.Error_Msg);
Log.Put_Line
("Check for blank lines before the 'localhost' entry in !Machine.Transport_Name_Map; remove them if present",
Profile.Negative_Msg);
end;
end;
"!Targets.Implementation.Rcf_Release1_2_2".Install_Product;
Io.Reset_Output;
Library.Context (To_Be => Context, Response => "<ERRORS>");
Log.Filter_Errors
(Log_File => "Logs.Install_Product_Log",
Destination => "Logs.Install_Product_Log_Summary",
Auxiliaries => False,
Exceptions => True);
Common.Definition ("Logs.Install_Product_Log_Summary");
end;
)
BUILD_PL => (
declare
use Directory_Tools;
Iter : Object.Iterator;
Pl_Log : constant String := "!Machine.RCF.Build_Program_Libraries_@";
Count : Natural := 0;
Rel : constant String := Naming.Simple_Name (Naming.Full_Name ("$"));
Rev : constant String := Rel (Rel'Last - 4 .. Rel'Last);
function Job_Running (Job_Name : String) return Boolean is
begin
for J in System_Utilities.Job_Id loop
begin
if String_Utilities.Locate
(Job_Name, System_Utilities.Job_Name (J)) /= 0 then
return True;
end if;
exception
when others =>
null;
end;
end loop;
return False;
end Job_Running;
begin
Library.Delete (Existing => "!Machine.RCF.Program_Library_Version",
Response => "");
Log.Put_Line ("Killing any running RCF jobs");
Kill_Rcf_Main;
Log.Put_Line ("Starting RCF compiler; building program libraries");
Program.Run_Job (S => "Start_RCF_Main", Response => "<ERRORS>");
Log.Put_Line
("Waiting for RCF compiler to finish building program libraries");
loop
exit when Job_Running ("Rcf_Compiler Rev");
delay 30.0;
end loop;
Log.Put_Line ("RCF compiler finished building program libraries");
Iter := Naming.Resolution (Pl_Log);
if Object.Is_Ok (Iter) then
Object.Invert (Iter); -- get last log made
loop
exit when not "Command_Data".File_Is_Locked
(Naming.Full_Name (Object.Value (Iter)));
Log.Put_Line ("Waiting for log file to complete writing");
Count := Count + 1;
exit when Count > 48;
delay 5.0;
end loop;
Log.Put_Line ("Summarizing " &
Naming.Simple_Name (Object.Value (Iter)));
Library.Copy (Naming.Full_Name (Object.Value (Iter)),
"Logs." & Naming.Simple_Name (Object.Value (Iter)),
Response => "<ERRORS>");
Log.Filter_Errors
(Log_File => "Logs." & Naming.Simple_Name (Object.Value (Iter)),
Destination =>
"Logs." & Naming.Simple_Name (Object.Value (Iter)) & "_Summary",
Auxiliaries => False,
Warnings => True,
Exceptions => True);
Common.Definition
("Logs." & Naming.Simple_Name (Object.Value (Iter)) & "_Summary");
Log.Put_Line ("Examine .Logs." &
Naming.Simple_Name (Object.Value (Iter)) &
"_Summary for RCF related errors", Profile.Warning_Msg);
else
Log.Put_Line ("Could not find " & Pl_Log, Profile.Negative_Msg);
end if;
Kill_Rcf_Main; -- now setup to start everything using system init routine
end;
)
START_RCF => (
declare
use Directory_Tools;
Iter : Object.Iterator;
Count : Natural := 0;
Rel : constant String := Naming.Simple_Name (Naming.Full_Name ("$"));
Rev : constant String := Rel (Rel'Last - 4 .. Rel'Last);
function Job_Running (Job_Name : String) return Boolean is
begin
for J in System_Utilities.Job_Id loop
begin
if String_Utilities.Locate
(Job_Name, System_Utilities.Job_Name (J)) /= 0 then
return True;
end if;
exception
when others =>
null;
end;
end loop;
return False;
end Job_Running;
begin
Kill_Rcf_Main; -- setup to start everything using system init routine
if Directory_Tools.Object.Is_Ok
(The_Object => Directory_Tools.Naming.Resolution
("!Machine.Initialization.Rational")) then
Program.Run_Job
(S => """!Machine.Initialization.Rational"".Compilation_Integrator;",
Options => "Output=!Machine.Error_Logs.RCF_Log",
Response => "<PROFILE>");
loop
delay 1.0;
if Job_Running ("Rcf_Compiler Rev") then
Log.Put_Line ("RCF_Compiler has started", Profile.Positive_Msg);
exit;
end if;
Count := Count + 1;
if Count > 120 then
Log.Put_Line ("RCF_Compiler job has not started",
Profile.Error_Msg);
Log.Put_Line
("Examine Compilation_Integrator_Initialization_Log for errors",
Profile.Negative_Msg);
Common.Definition
(Name =>
"!Machine.Error_Logs.Compilation_Integrator_Initialization_Log");
exit;
end if;
end loop;
else
Log.Put_Line
("Pre D_12_5_0 Environment present, will not run RCF initialization procedure",
Profile.Error_Msg);
end if;
end;
)
SETUP_INITIALIZE => (
if Directory_Tools.Naming.Full_Name ("!Machine.Initialization.Rational") =
"" then
Common.Definition ("!Machine.Initialize'Body");
Editor.Image.Beginning_Of (Offset => 0);
Editor.Search.Next (Target => "io.reset_output", Wildcard => False);
Editor.Line.Beginning_Of (Offset => 0);
Ada.Install_Unit;
Common.Object.Insert;
Editor.Char.Insert_String
(Value => "Program.Run (""""""!Machine"""".Initialize_RCF;"");");
Common.Promote;
Common.Promote;
else
Log.Put_Line
("New machine initialization scheme appears to be present; no setup necessary.");
end if;
)
RECORD_INSTALLATION => (
declare
Product : constant String := Directory_Tools.Naming.Simple_Name
(Directory_Tools.Naming.Full_Name ("^"));
Release : constant String := Directory_Tools.Naming.Simple_Name
(Directory_Tools.Naming.Full_Name ("$"));
Product_Info : constant String :=
"(RELEASE => " & Release & ", DATE => (" &
Time_Utilities.Image (Time_Utilities.Get_Time,
Time_Utilities.Year_Month_Day) &
"), USER => " & System_Utilities.User_Name &
'.' & System_Utilities.Session_Name & ")";
Product_Filename : constant String := "!Machine.Release.Current.Products";
F : Io.File_Type;
begin
Io.Append (F, Name => Product_Filename);
Io.Put_Line (F, Product & " => " & Product_Info);
Io.Close (F);
Log.Put_Line ("Recording product " & Product &
" current release as " & Release,
Profile.Positive_Msg);
end;
)
RECODE_UNITS => (
declare
use Directory_Tools;
Iter : Object.Iterator := Naming.Resolution ("!Machine.Rcf.Rcf1_2_@");
begin
if Directory_Tools.Object.Is_Ok (The_Objects => Iter) then
Log.Put_Line ("Running Rcf_Recode_Units");
Io.Set_Output ("Logs.Recode_Units_Log");
Program.Run
(S => "RCF_RECODE_UNITS",
Context => "!TARGETS.IMPLEMENTATION.RCF_RELEASE1_2_2",
Response => "<PROFILE>");
Io.Reset_Output;
Log.Filter_Errors (Log_File => "Logs.Recode_Units_Log",
Destination => "Logs.Recode_Units_Log_Summary",
Auxiliaries => False,
Exceptions => True);
Common.Definition ("Logs.Recode_Units_Log_Summary");
else
Log.Put_Line
("Cannot find unit state files; appears that UNCODE_UNITS step was not run or there were no units to uncode",
Profile.Warning_Msg);
end if;
end;
)
SCHEDULE_SHUTDOWN => (
declare
use Directory_Tools;
Rel : constant String := Naming.Simple_Name (Naming.Full_Name ("$"));
Current_Terminal_Type : constant String := System_Utilities.Terminal_Type;
function Is_State (Object : String;
Goal_State : Directory_Tools.Ada_Object.Unit_State)
return Boolean;
function Is_Coded (Object : String;
Goal_State : Directory_Tools.Ada_Object.Unit_State :=
Directory_Tools.Ada_Object.Coded) return Boolean
renames Is_State;
function Is_Installed
(Object : String;
Goal_State : Directory_Tools.Ada_Object.Unit_State :=
Directory_Tools.Ada_Object.Installed) return Boolean
renames Is_State;
function Is_State (Object : String;
Goal_State : Directory_Tools.Ada_Object.Unit_State)
return Boolean is
use Directory_Tools.Ada_Object;
Is_Ok : Boolean := (Unit_State'Pos (State (Object)) >=
Unit_State'Pos (Goal_State));
begin
if not Is_Ok then
Log.Put_Line (Object & " is not at the " &
Unit_State'Image (Goal_State) & " state",
Profile.Error_Msg);
end if;
return Is_Ok;
end Is_State;
begin
if (Object.Is_Ok (The_Object =>
Naming.Resolution
("!Machine.Initialization.Rational")) or else
Is_Coded ("!Machine.Initialize'Body")) and
Is_Installed ("!Machine.Editor_Data.Rational_Commands'Body") and
Is_Installed ("!Machine.Editor_Data.Facit_Commands'Body") and
Is_Installed ("!Machine.Editor_Data." &
Current_Terminal_Type & "_Commands'Body") then
Log.Put_Line ("Scheduling shutdown in 5 minutes");
Op.Shutdown_Warning (300.0);
Op.Shutdown (Reason => "Release",
Explanation => "Install RCF " & Rel);
end if;
end;
)
CLEANUP => (
Compilation.Destroy
(Unit =>
"[$,!Targets.Implementation.RCF_Release1_2_2.[@,~Install_Activity]]",
Threshold => 999,
Limit => "<ALL_WORLDS>",
Response => "<ERRORS>");
)
STEP_CHECK => (
-- This must remain the last step in the step file and is used
-- as a first level verification of the step file parse and
-- tape load.
Log.Put_Line ("Step File parses correctly", Profile.Positive_Msg);