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

⟦5b90428aa⟧ TextFile

    Length: 10841 (0x2a59)
    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« 
        └─⟦30844a0c2⟧ 
            └─⟦this⟧ 

TextFile

INSTALL_RATIONAL_ACCESS => (do_step("RELEASE_RESTORE,
                                     INSTALL_PRODUCT,
                                     RECORD_INSTALLATION",
"!Machine.Release.Archive.Rational_Access.Release1_0_2.Command_Data.Steps");)



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

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


INSTALL_PRODUCT => (
declare
    Refresh : Boolean := True;

    function Get_Input (Querie_String : String) return Boolean is
    begin
        loop
            Io.Put_Line ("");
            Io.Put (Querie_String);
            declare
                Accepts : constant String := Io.Get_Line;
            begin
                return (Accepts'Length = 0 or else
                        (Accepts (Accepts'First) = 'y' or
                         Accepts (Accepts'First) = 'Y'));
            end;
        end loop;
    end Get_Input;
begin  
    Library.Context (To_Be => "!Machine.Release.Rational_Access.Release1_0_2");
    System_Utilities.Set_Page_Limit (16_000);
    Io.Set_Output
       ("!Machine.Release.Archive.Rational_Access.Release1_0_2.Logs.Install_Product_Log");
    "!Machine.Release.Rational_Access.Release1_0_2".R1000_Install;
    Io.Reset_Output;
    Log.Filter_Errors
       (Log_File =>
           "!Machine.Release.Archive.Rational_Access.Release1_0_2.Logs.Install_Product_Log",
        Destination =>
           "!Machine.Release.Archive.Rational_Access.Release1_0_2.Logs.Install_Product_Log_Summary",
        Auxiliaries => False,
        Exceptions => True);
    Common.Definition
       ("!Machine.Release..Archive.Rational_Access.Release1_0_2.Logs.Install_Product_Log_Summary");
    Refresh := Get_Input ("Should I run refresh_terminal_information now? [y] ");
    if Refresh then
       Refresh_Terminal_Information;
    else         
       Io.Put_Line (" ");
       Io.Put_Line ("Don't forget to execute Refresh_Terminal_Information at a later");
       Io.Put_Line ("to enable the new Rational Access keymap.");
       Io.Put_Line (" ");
    end if;
end;
)


-- RESTORE_NOTES => (
--    Archive.Restore (Device => "Release_Notes");
)


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

SCHEDULE_SHUTDOWN => (
declare
    use Directory_Tools;

    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 Rational_Access 1_0_2");
    end if;
end;

)

CLEANUP => (
    Library.Delete ("!Machine.Release.[Rational_Access,Archive].[Rational_Access.Release1_0_2,Release1_0_2]",
                    Limit => "<ALL_WORLDS>");
)

VERIFY_RELEASE_OBJECTS => (
declare
    function Get_Line (Prompt : String; Default : String := "") return String is
    begin
        Io.Put (Prompt);
        if Default /= "" then
            Io.Put (" [" & Default & "] : ");
        end if;
        declare
            S : constant String := Io.Get_Line;
        begin
            if S = "" then
                return Default;
            else
                return S;
            end if;
        end;
    end Get_Line;

    function Strip (N : String; S : String) return String is
        Index : Natural := String_Utilities.Locate (N, S);
    begin
        if Index /= 0 then
            return S (Index + N'Length .. S'Last);
        else
            return "";
        end if;
    end Strip;

begin
    loop
        begin
            declare
                use Directory_Tools;
                Default_Product : constant String :=
                   Strip ("!Machine.Release.Archive.", Directory_Tools.Naming.Full_Name ("^"));
                Default_Release : constant String :=
                   Strip ("Release", Directory_Tools.Naming.Simple_Name
                                        (Directory_Tools.Naming.Full_Name ("$")));
                Product : constant String := Get_Line ("Enter Product Name : ", Default_Product);
                Release : constant String := Get_Line ("Enter Release (X_Y_Z) : ", Default_Release);
                Display_Missing : Boolean :=
                   Boolean'Value (Get_Line ("Display Missing Objects (True|False)?", "FALSE"));
                Total_Missing : Natural := 0;
                Total_Objects : Natural := 0;
                Product_Release : constant String :=
                   "!Machine.Release.Versions." & Product & "_Release" & Release;
                Release_File_Exists : Boolean := Object.Is_Ok
                                                    (The_Object => Naming.Resolution (Product_Release));
                Iter : Object.Iterator := Naming.Resolution ('_' & Product_Release);
                Hdl : Object.Handle;
            begin
                if Release_File_Exists then
                    if Object.Is_Bad (Object.Err_Code (Iter)) then
                        Io.Set_Input (Product_Release);
                        while not Io.End_Of_File loop
                            Hdl := Naming.Resolution (Io.Get_Line);
                            if Object.Is_Bad (Hdl) then
                                Total_Missing := Total_Missing + 1;
                                if Display_Missing then
                                    Log.Put_Line (Object.Message (Hdl), Profile.Error_Msg);
                                end if;
                            end if;
                            Total_Objects := Total_Objects + 1;
                        end loop;
                        if Total_Missing = Total_Objects then
                            Log.Put_Line ("None of the objects in the release are present",
                                          Profile.Error_Msg);
                        else
                            Log.Put_Line ("There are" & Natural'Image (Total_Missing) &
                                          " objects missing from a total of" &
                                          Natural'Image (Total_Objects) & " objects in the release",
                                          Profile.Error_Msg);
                        end if;
                    else
                        Log.Put_Line ("The release is present", Profile.Positive_Msg);
                    end if;
                else
                    Log.Put_Line ("The release file does not exist, cannot verify release installation",
                                  Profile.Warning_Msg);
                end if;
            end;
            exit;
        exception
            when others =>
                Log.Put_Line ("Error in input", Profile.Error_Msg);
        end;
    end loop;
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);