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

⟦959c6bdfa⟧ TextFile

    Length: 18674 (0x48f2)
    Types: TextFile
    Notes: R1k Text-file segment

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦e6ebd4d0b⟧ 
            └─⟦this⟧ 

TextFile

INSTALL_DTIA => (Do_Step("AUTHORIZATION_CHECK,
                          RELEASE_RESTORE,
                          LOAD_EEDB,
                          UPDATE_LOCALHOST,
                          INSTALL_PRODUCT,
                          MACHINE_INITIALIZE_UPDATE,
                          ASSIGN_TCP_PORTS,
                          RECORD_INSTALLATION",
                  "!Machine.Release.Archive.Dtia.Release2_1_6.Command_Data.Steps");)


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, DTIA");
    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.Note_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);
        Do_Step ("PROMPT=AUTHORIZE_PRODUCT");
    end if;
end;
)

RELEASE_RESTORE => (
    Io.Set_Output
       ("!Machine.Release.Archive.Dtia.Release2_1_6.Logs.Restore_Release_Log");
    Archive.Restore (Options => "promote replace",
                     Device => "Release");
    Io.Reset_Output;
    Log.Filter_Errors
       (Log_File =>
           "!Machine.Release.Archive.Dtia.Release2_1_6.Logs.Restore_Release_Log",
        Destination =>
           "!Machine.Release.Archive.Dtia.Release2_1_6.Logs.Restore_Release_Log_Summary",
        Auxiliaries => False,
        Warnings => False,
        Exceptions => True);
    Common.Definition
       ("!Machine.Release.Archive.Dtia.Release2_1_6.Logs.Restore_Release_Log_Summary");
)

LOAD_EEDB => (
declare
    subtype Bogus is Natural range 0 .. 1;
    package Pp is new Parameter_Parser (Bogus);
    Subsystem_Iter : Pp.Iterator := Pp.Parse ("Tools_Integration=110100");        -- *** Fill In ***
    -- NAME    : EEDB Subsystem Name (ex. Design_Facility, Cross_Development)
    -- VERSION : format is XXYYZZ (6 digits) (ex. 110000 for 11.0.1)

    function Get_Version (Subsystem : String) return Natural is

        Eedb_Configuration : constant String := "!Machine.Temporary.EEDB_Configuration";
        Eedb_Commands : constant String := "!Machine.Temporary.EEDB_Commands";

        procedure Gen_Config_File is
            Fin, Fcmds : Io.File_Type;
        begin
            Io.Create (Fcmds, Name => Eedb_Commands);
            Io.Put_Line (Fcmds, "set_verbosity configuration all_code_segments false");
            Io.Put_Line (Fcmds, "set_verbosity configuration date false");
            Io.Put_Line (Fcmds, "set_verbosity configuration elab_code_segment false");
            Io.Put_Line (Fcmds, "set_verbosity configuration library true");
            Io.Put_Line (Fcmds, "set_verbosity configuration module_key false");
            Io.Put_Line (Fcmds, "set_verbosity configuration name false");
            Io.Put_Line (Fcmds, "set_verbosity configuration subsystem_dependencies false");
            Io.Put_Line (Fcmds, "set_verbosity configuration user false");
            Io.Put_Line (Fcmds, "vd $");
            Io.Put (Fcmds, Ascii.Etx);
            Io.New_Line (Fcmds, 2);
            Io.Put_Line (Fcmds, "quit");
            Io.Reset (Fcmds, Io.In_File);
            Io.Set_Input (Fcmds);
            Io.Set_Output (Eedb_Configuration);
            Operator.Internal_System_Diagnosis;
            Io.Reset_Output;
            Io.Reset_Input;
        end Gen_Config_File;

        function Extract (S : String) return Natural is
            Start : Natural := String_Utilities.Locate ('.', S);
            Stop : Natural := String_Utilities.Locate (':', S);
            P1 : Natural := String_Utilities.Locate ('.', S (Start + 1 .. Stop - 1));
            P2 : Natural := String_Utilities.Locate ('.', S (P1 + 1 .. Stop - 1));
            subtype Numeric is Character range '0' .. '9';

        begin
            if Start = 0 or Stop = 0 then
                return 0;
            else
                if not (S (Stop - 1) in Numeric) then
                    Stop := Stop - 1;
                end if;
                return (Natural'Value (S (Start + 1 .. P1 - 1)) * 10000) +
                          (Natural'Value (S (P1 + 1 .. P2 - 1)) * 100) + Natural'Value (S (P2 + 1 .. Stop - 1));
            end if;
        end Extract;

    begin
        Gen_Config_File;
        Io.Set_Input (Eedb_Configuration);
        while not Io.End_Of_File loop
            declare
                S1 : constant String := Io.Get_Line;
                Index : Natural := String_Utilities.Locate (Subsystem & '.', S1);
                Lib_Index : Natural := String_Utilities.Locate (":LIBRARIES:", S1);
            begin
                if Index /= 0 then
                    if Lib_Index = 0 then
                        declare
                            S2 : constant String := String_Utilities.Strip (Io.Get_Line);
                        begin
                            Io.Reset_Input;
                            return Extract (S1 (Index .. S1'Last) & S2);
                        end;
                    else
                        Io.Reset_Input;
                        return Extract (S1 (Index .. S1'Last));
                    end if;
                end if;
            end;
        end loop;
        Io.Reset_Input;
        return 0;
    end Get_Version;

begin
    -- Log.Put_Line ("Restoring Segment Files");
    -- Archive.Restore (Options => "promote, replace",
    --                  Device => "Segments",
    --                  Response => "<ERRORS>");
    while not Pp.Done (Subsystem_Iter) loop
        declare
            Current_Version : Natural := Get_Version (Pp.Name (Subsystem_Iter));
        begin
            if Current_Version = 0 then
                Log.Put_Line (Pp.Name (Subsystem_Iter) &
                              " is not present in the current Environment configuration." &
                              " Verify the current Environment configuration is at least " &
                              " D_12_1_1.", Profile.Error_Msg);
                -- Program.Run
                --    ("""!Machine.Release.Archive.Dtia.Release2_1_6.Segments"".Get_Xfer " &
                --     "(Xfer_File => ""!Machine.Release.Archive.Dtia.Release2_1_6.Segments:DTIA"", Verbose => True);",
                --     "!Machine.Release.Archive.Dtia.Release2_1_6.Segments");

            elsif Pp.Get_Integer (Subsystem_Iter) < Current_Version then
                Log.Put_Line
                   ("Current version of " & Pp.Name (Subsystem_Iter) &
                    " is more recent than that included with this release." &
                    "  Assumption is there will be no compatibility issues; skipping update of this subsystem." &
                    "  It is NOT necessary to reboot the R1000 for this installation.",
                    Profile.Note_Msg);
            elsif Pp.Get_Integer (Subsystem_Iter) = Current_Version then
                Log.Put_Line ("Current version of " & Pp.Name (Subsystem_Iter) &
                              " is the same as that included with this release." &
                              "  Skipping update of this subsystem." &
                              "Is is NOT necessary to reboot the R1000 for this installation.",
                              Profile.Note_Msg);
            else
                Log.Put_Line ("Updating " & Pp.Name (Subsystem_Iter) & 
                              ".  The R1000 MUST BE REBOOTED for these changes to take effect.",
                              Profile.Warning_Msg);
                Program.Run
                   ("""!Machine.Release.Archive.dtia.Release2_1_6.Segments"".Get_Xfer " &
                    "(Xfer_File => ""!Machine.Release.Archive.Dtia.Release2_1_6.Segments:DTIA"", Verbose => True);",
                    "!Machine.Release.Archive.Dtia.Release2_1_6.Segments");

            end if;
        end;
        Pp.Next (Subsystem_Iter);
    end loop;
end;
)

UPDATE_LOCALHOST => (
declare
    use Editor, Common;
    package Tn renames "!tools.networking".Transport_Name;
    Lh : constant String := "localhost";
    F : Io.File_Type;
    Name_Map : constant String := "!machine.transport_name_map";
    Name_Map_Entry : constant String := "tcp/ip 127.0.0.1 localhost";
begin
    Io.Put_Line (Lh & " => " & String (Tn.Host_To_Network_Name (Lh)));
    Log.Put_Line ("Resolution of localhost successful.", Profile.Positive_Msg);
exception
    when Tn.Undefined =>
        Log.Put_Line ("Resolution of localhost unsuccessful, updating !Machine.Transport_Name_Map", Profile.Warning_Msg);
        Operator.Enable_Privileges;
        Common.Edit (Name => Name_Map, In_Place => False, Visible => True);
        Editor.Image.Beginning_Of;
        Editor.Line.Beginning_Of;
        Editor.Char.Insert_String (Name_Map_Entry);      
        Editor.Line.Indent (Repeat => 1);
        Common.Commit;
        Common.Definition("!Machine.Release.Archive.Dtia.Release2_1_6");
    when others => 
        Log.Put_Line ("Error updating !Machine.Transport_Name_Map.  Manually add the entry: '" &
                      Name_Map_Entry, Profile.Error_Msg);
end;
)

INSTALL_PRODUCT => (
    Library.Context (To_Be => "!Machine.Release.Dtia.Release2_1_6");
    System_Utilities.Set_Page_Limit (16_000);
    "!Machine.Release.Dtia.Release2_1_6".Install_Product;
    Common.Definition
       ("!Machine.Release.Dtia.Release2_1_6.Install_Dtia_Log_Problems");
)

MACHINE_INITIALIZE_UPDATE => (
    if File_Utilities.Found (Pattern => "initialize_dtia",
                             File => "!machine.initialize'body",
                             Wildcards => False,
                             Ignore_Case => True) = 0 then
        -- we must add the program.run for dtia.
        if File_Utilities.Found (Pattern => ".Gateway_Class.Boot_Time_Initialization",
                                 File => "!machine.initialize'body",
                                 Wildcards => False,
                                 Ignore_Case => True) = 0 then
            -- ERROR! Gateway_Class.Boot_Time_Initialization is not there!
            Log.Put_Line ("The call to Gateway_Class.Boot_Time_Initialization does not " &
                          "exist in !Machine.Initialize'body.  Verify D2 " &
                          "is installed on this machine.");
        else
            --Common.Definition ("!machine.initialize'body");
            Common.Edit (Name => "!machine.initialize'body", In_Place => False, Visible => True);
            Editor.Image.Beginning_Of;
            Editor.Search.Next (Target => ".Gateway_Class.Boot_Time_Initialization",
                                Wildcard => False);  

            Editor.Line.Beginning_Of;
            Editor.Char.Insert_String
                 ("Program.Run (""""""!Machine"""".Initialize_Dtia;""); ");
            Common.Promote;
            Common.Promote;
            Common.Definition("!Machine.Release.Archive.Dtia.Release2_1_6");
        end if;
    else
        Log.Put_Line ("Initialize_Dtia already is in !Machine.Initialize.");
    end if;
)

ASSIGN_TCP_PORTS => (
 declare
    use Editor, Ada, Common, Debug;  
    C : Transport.Connection_Id;
    Status : Transport_Defs.Status_Code;
begin
    loop
        Transport.Open (C, Status, "TCP/IP");
        exit when Transport_Defs."/=" (Status, Transport_Defs.Ok);
        declare
            Port : constant Transport_Defs.Socket_Id :=
               Transport.Local_Socket (C);
        begin
            Transport.Close (C);
            exit when Byte_Defs.">=" (Port (Port'First), 4);
        end;
    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
    Log.Put_Line ("Allowing unlimited logins", Profile.Positive_Msg);
    Operator.Limit_Login;
    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;
)

SHUTDOWN_SYSTEM => (
declare
    use Editor, Text, Common;
    Current_Terminal_Type : constant String := System_Utilities.Terminal_Type;
begin
    if Directory_Tools.Ada_Object."="
          (Directory_Tools.Ada_Object.State ("!machine.initialize'body"),
           Directory_Tools.Ada_Object.Coded) then

        -- !Machine.initialize'body is coded, let's check keymaps
        if Directory_Tools.Ada_Object."="
              (Directory_Tools.Ada_Object.State
                  ("!machine.editor_data.rational_commands'body"),
               Directory_Tools.Ada_Object.Coded) or
           Directory_Tools.Ada_Object."="
              (Directory_Tools.Ada_Object.State
                  ("!machine.editor_data.rational_commands'body"),
               Directory_Tools.Ada_Object.Installed) then

            -- rational_commands'body is installed or coded

            if Directory_Tools.Ada_Object."="
                  (Directory_Tools.Ada_Object.State
                      ("!machine.editor_data.facit_commands'body"),
                   Directory_Tools.Ada_Object.Coded) or
               Directory_Tools.Ada_Object."="
                  (Directory_Tools.Ada_Object.State
                      ("!machine.editor_data.facit_commands'body"),
                   Directory_Tools.Ada_Object.Installed) then

                -- o.k. facit_commands'body is fine, check the current terminal type.
                if Directory_Tools.Ada_Object."="
                      (Directory_Tools.Ada_Object.State
                          ("!machine.editor_data." &
                           Current_Terminal_Type & "_commands'body"),
                       Directory_Tools.Ada_Object.Coded) or
                   Directory_Tools.Ada_Object."="
                      (Directory_Tools.Ada_Object.State
                          ("!machine.editor_data." &
                           Current_Terminal_Type & "_commands'body"),
                       Directory_Tools.Ada_Object.Installed) then

                    -- o.k. current terminal type is fine, let's shutdown in 5 min.

                    Op.Shutdown_Warning (300.0);
                    Op.Shutdown (Reason => "Release",
                                 Explanation => "Install Dtia Release2_1_6");
                else
                    -- Current terminal type is NOT installed or coded
                    Log.Put_Line (Message => "!Machine.Editor_Data." &
                                                Current_Terminal_Type &
                                                "_Commands'Body " &
                                                "is not INSATLLED or CODED.",
                                  Kind => Profile.Error_Msg);
                end if;
            else
                -- Facit commands is NOT installed or coded
                Log.Put_Line (Message =>
                                 "!Machine.Editor_Data.Facit_Commands'Body " &
                                    "is not INSATLLED or CODED.",
                              Kind => Profile.Error_Msg);
            end if;
        else
            -- rational_commands'body is NOT installed or coded
            Log.Put_Line (Message =>
                             "!Machine.Editor_Data.Rational_Commands'Body " &
                                "is not INSATLLED or CODED.",
                          Kind => Profile.Error_Msg);
        end if;
    else
        -- !Machine.initialize'body is not coded, tell 'em.
        Log.Put_Line (Message => "!Machine.Initialize is NOT coded.  Promote " &
                                    "to coded and run this step again",
                      Kind => Profile.Error_Msg);
    end if;
end;
)          

TESTS_RESTORE => (
    Io.Set_Output
       ("!Machine.Release.Archive.Dtia.Release2_1_6.Logs.Restore_Tests_Log");
    Archive.Restore (Options => "Promote", Device => "Tests");
    Io.Reset_Output;
    Log.Filter_Errors
       (Log_File =>
           "!Machine.Release.Archive.Dtia.Release2_1_6.Logs.Restore_Tests_Log",
        Destination =>
           "!Machine.Release.Archive.Dtia.Release2_1_6.Logs.Restore_Tests_Log_Summary",
        Auxiliaries => False,
        Warnings => False,
        Exceptions => True);
    Common.Definition
       ("!Machine.Release.Archive.Dtia.Release2_1_6.Logs.Restore_Tests_Log_Summary");
)

CLEAN_UP => (
    Library.Delete ("!Machine.Release.Archive.Dtia.Release2_1_6");
    Library.Delete ("!Machine.Release.Dtia.Release2_1_6");
)


AUTHORIZE_PRODUCT => (
    "!Implementation".Product_Authorization.Register
            (Product_Name => ">>Product Name<<",
             Authorization_Code => ">> Code <<");
)


USERS_CHECK => (
    declare
        Iter : System_Utilities.Session_Iterator;
        Total : Natural := 0;
        use System_Utilities;
    begin
        Operator.Limit_Login (Sessions => 1);
        Log.Put_Line ("Limited logins to 1 user", Profile.Positive_Msg);
        Init (Iter);
        while not Done (Iter) loop
            if Value (Iter) /= Get_Session then
                Log.Put_Line
                   ("User " & User_Name (Value (Iter)) &
                    " is still logged in.  Have s/he log off before proceeding",
                    Profile.Warning_Msg);
            end if;
            Next (Iter);
        end loop;
    end;
)