DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦085a6bcea⟧ TextFile

    Length: 7618 (0x1dc2)
    Types: TextFile
    Names: »B«

Derivation

└─⟦407de186f⟧ Bits:30000749 8mm tape, Rational 1000, RCFSUN
    └─ ⟦e5cd75ab4⟧ »DATA« 
        └─⟦this⟧ 

TextFile

separate (Library_Extensions)
procedure Import_Postprocess (Views_To_Import : Directory.Naming.Iterator;
                              Into_View : String;
                              Status : in out Simple_Status.Condition) is

    Imports : Directory.Naming.Iterator := Views_To_Import;

    Machine_Result : constant Library_Interface.String_Result :=
       Library_Interface.Remote_Machine (View => Into_View);

    Directory_Result : constant Library_Interface.String_Result :=
       Library_Interface.Remote_Directory (View => Into_View);

    Remote_Machine : constant String :=
       Machine_Result.Result (1 .. Machine_Result.Size);
    Remote_Directory : constant String :=
       Directory_Result.Result (1 .. Directory_Result.Size);

    Old_Context : Directory.Naming.Context;
    procedure Display_Information is
    begin
        if Remote_Machine = "" then
            Log.Put_Line (Message => "A null remote machine name was provided.",
                          Kind => Profile.Warning_Msg);
        end if;
        if Remote_Directory = "" then
            Log.Put_Line (Message =>
                             "A null remote directory name was provided.",
                          Kind => Profile.Warning_Msg);
        end if;
    end Display_Information;

    procedure Perform_Remote_Import (Imported_Views : Directory.Naming.Iterator;
                                     Host_View : String;
                                     Remote_Machine : String;
                                     Status : in out Simple_Status.Condition) is

        View_Directory : constant String :=
           Library_Interface.Remote_Directory (View => Host_View).Result;
        Imports : Directory.Naming.Iterator := Imported_Views;
        Unit_Iterator : Directory.Naming.Iterator;
        Name_Status : Directory.Naming.Name_Status;

        Remote_Connection : Remote_Command_Interface.Context;

        function Get_Remote_Library (From_View : in String) return String is
        begin
            return Library_Interface.Remote_Directory (View => From_View).
                      Result & "/adalib";
        end Get_Remote_Library;

        function Acquire_Link_Command (For_Unit : in String;
                                       From_Library : in String;
                                       To_Library : in String) return String is

        begin
            return " ada unit_manager\(" & To_Library &
                      " update\).acquire units=" & For_Unit &
                      " kind=SPECIFICATION" & " from=" &
                      From_Library & " by=link overwrite=yes";
        end Acquire_Link_Command;



    begin
        Log.Put_Line (Message => "Executing Perform_Remote_Import",
                      Kind => Profile.Debug_Msg);

        Remote_Command_Interface.Acquire
           (Remote_Connection => Remote_Connection,
            Status => Status,
            Target_Key => Target_Key_Id,
            Set_Directory => "cd " & View_Directory,
            Remote_Machine => Remote_Machine);

        if Simple_Status.Error (Status) then
            Log.Put_Line (Message => Simple_Status.Message (Status),
                          Kind => Profile.Negative_Msg);
            Set_Status (Status => Status,
                        Message => "Unable to acquire connection to " &
                                      Remote_Machine);
            return;
        end if;


        while not Directory.Naming.Done (Imports) loop

            declare
                Imported_View : constant String :=
                   Directory.Naming.Source_Name (Imports);
            begin
                Directory.Naming.Resolve
                   (Iter => Unit_Iterator,
                    Source => Imported_View & ".units?'spec",
                    Status => Name_Status);
                while not Directory.Naming.Done (Unit_Iterator) loop  

                    declare
                        Remote_Command : constant String :=
                           Acquire_Link_Command
                              (For_Unit => Directory.Naming.Get_Simple_Name
                                              (Directory.Naming.Source_Name
                                                  (Unit_Iterator)),
                               From_Library => Get_Remote_Library
                                                  (From_View => Imported_View),
                               To_Library => Get_Remote_Library
                                                (From_View => Host_View));
                    begin
                        Log.Put_Line (Message => "Executing remote command: " &
                                                    Remote_Command,
                                      Kind => Profile.Debug_Msg);
                        Remote_Command_Interface.Execute_Command
                           (Command_Line => Remote_Command,
                            Remote_Connection => Remote_Connection,
                            Status => Status,
                            Error_Pattern => "",
                            Parse_Error_Output => False,
                            Parse_Standard_Output => False,
                            Show_Parsed_Output => True,
                            Trace_Command => False);
                    end;

                    if Simple_Status.Error (Status) then
                        Log.Put_Line (Message => Simple_Status.Message (Status),
                                      Kind => Profile.Negative_Msg);
                        Set_Status
                           (Status => Status,
                            Message =>
                               "Acquisition of Import Links was Unsuccessful.");
                        Remote_Command_Interface.Release
                           (Remote_Connection => Remote_Connection,
                            Status => Status);
                        return;
                    end if;
                    Directory.Naming.Next (Unit_Iterator);
                end loop;  
            end;

            Directory.Naming.Next (Imports);
        end loop;

        Remote_Command_Interface.Release
           (Remote_Connection => Remote_Connection, Status => Status);

    exception
        when others =>
            Unhandled_Exception (Status, "Perform_Remote_Import");
            begin
                Remote_Command_Interface.Release
                   (Remote_Connection => Remote_Connection, Status => Status);
            exception
                when others =>
                    null;
            end;

    end Perform_Remote_Import;

begin
    Log.Put_Line (Message => "Executing Import_Postprocess",
                  Kind => Profile.Note_Msg);


    -- set context
    Simple_Status.Initialize (Status);
    -- reset context

    if Remote_Machine = "" or else Remote_Directory = "" then
        Display_Information;
        Set_Status
           (Status => Status,
            Message => "Insufficient remote program library information.",
            Severity => Simple_Status.Problem);
        return;
    end if;

    Set_Context (Old_Context => Old_Context,
                 View => Into_View,
                 Status => Status);
    Perform_Remote_Import (Imported_Views => Views_To_Import,
                           Host_View => Into_View,
                           Remote_Machine => Remote_Machine,
                           Status => Status);
    Reset_Context (Old_Context);

exception
    when others =>
        Unhandled_Exception (Status, "Import_Postprocess");
        Reset_Context (Old_Context);

end Import_Postprocess;