DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦868edebbb⟧ TextFile

    Length: 12105 (0x2f49)
    Types: TextFile
    Notes: R1k Text-file segment

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦218d78f08⟧ 
            └─⟦this⟧ 

TextFile

INSTALL_TESTMATE => (
    Do_Step
       (Step => "AUTHORIZATION_CHECK,
                 RELEASE_RESTORE,
                 INSTALL_PRODUCT,
                 START_PRODUCT,
                 MODEL_RESTORE,
                 RECORD_INSTALLATION");
)



AUTHORIZATION_CHECK => (
declare
    subtype Bogus is Natural range 0 .. 1;
    package Pp is new Parameter_Parser (Bogus);
    Iter : Pp.Iterator := Pp.Parse ("TestMate");
    Token_Iter : Pp.Iterator := Pp.Parse ("TestMate");
    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;
)

RELEASE_RESTORE => (
    Io.Set_Output
       ("Logs.Release_Restore_Log");
    Archive.Restore (Options => "promote, replace, Changed_Objects", Device => "Release");
    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;
    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");
)

INSTALL_PRODUCT => (
declare
    use Directory_Tools;              
    Starting_Context : constant string := Naming.Default_Context;
    Product : constant string := Naming.Simple_Name (Naming.Full_Name ("^"));
    Release : constant string :=  Naming.Simple_Name (Naming.Full_Name ("$"));
    Version : constant string := Release (Release'First + 7..Release'last);
    Install_Lib : constant string := "!Machine.Release." & Product & "." & Release;
    Found : Boolean := False;
begin
    Io.Set_Output ("Logs.Install_Product_Log");
    Library.Context (To_Be => Install_Lib, Response => "<PROFILE>");
    "Command_Data".Testmate_Buyout;
    Do_Step (Step => "~PAUSE, Install_Product", Step_File => "Install_Steps");
    Io.Reset_Output;
    Library.Context (To_Be => Starting_Context, Response => "<PROFILE>");
    Log.Filter_Errors
       (Log_File => "Logs.Install_Product_Log",
        Destination => "Logs.Install_Product_Log_Summary",
        Auxiliaries => False,
        Warnings => False,
        Exceptions => True);
    Common.Definition ("Logs.Install_Product_Log_Summary");

end;
)

MODEL_RESTORE => (
declare
    use Directory_Tools;              
    Starting_Context : constant string := Naming.Default_Context;
    Product : constant string := Naming.Simple_Name (Naming.Full_Name ("^"));
    Release : constant string :=  Naming.Simple_Name (Naming.Full_Name ("$"));
    Version : constant string := Release (Release'First + 7..Release'last);
    Install_Lib : constant string := "!Machine.Release." & Product & "." & Release;
begin
    Io.Set_Output ("Logs.Model_Restore_Log");
    Library.Context (To_Be => Install_Lib, Response => "<PROFILE>");
    Archive.Restore (Options => "promote, replace, Changed_Objects", Device => "Model");
    Io.Reset_Output;
    Library.Context (To_Be => Starting_Context, Response => "<PROFILE>");
    Log.Filter_Errors
       (Log_File => "Logs.Model_Restore_Log",
        Destination => "Logs.Model_Restore_Log_Summary",
        Auxiliaries => False,
        Warnings => False,
        Exceptions => True);
    Common.Definition ("Logs.Model_Restore_Log_Summary");
end;
)

START_PRODUCT => (
declare

    Count : Natural := 0;

    function Job_Running (Job_Name : String; Kill_It : Boolean := False)
                         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
                    Log.Put_Line ("Job " & System_Utilities.Job_Name (J) &
                                  " is running", Profile.Positive_Msg);
                    if Kill_It then
                        Log.Put_Line ("Killing " &
                                      System_Utilities.Job_Name (J),
                                      Profile.Positive_Msg);
                        Job.Kill (J, "*SYSTEM");
                    end if;
                    return True;
                end if;
            exception
                when others =>
                    null;
            end;
        end loop;
        return False;
    end Job_Running;

begin
    if Job_Running ("TestMate ", True) then
        null;
    end if;
    Log.Put_Line ("Starting TestMate", Profile.Positive_Msg);
    Program.Run_Job
       ("Start (Procedures_To_Run => ""TestMate_Start"", Effort_Only => False);",
        Context => "!Machine.Initialization");  
    Log.Put_Line ("Waiting for TestMate to elaborate");
    loop
        exit when Job_Running ("TestMate ");
        delay 1.0;
        Count := Count + 1;
        if Count > 120 then
            Log.Put_Line ("Failed to detect elaboration of TestMate.",
                          Profile.Error_Msg);
            exit;
        end if;
    end loop;
end;
)

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;
)

SCHEDULE_SHUTDOWN => (
declare
    use Directory_Tools;

    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 ("$"));
    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 " & Product & " " & Release);
    end if;
end;

)

CLEANUP => (
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 ("$"));
begin
    Log.Put_Line ("Deleting release archive and release objects");
    Compilation.Destroy
       (Unit => "!Machine.Release.[" & Product & ",Archive].[" & Product &
                   "." & Release & "," & Release & ".Segments]",
        Threshold => 99,
        Limit => "<ALL_WORLDS>",
        Response => "<ERRORS>");
end;
)

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);