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 - metrics - download
Index: B T

⟦c3087174c⟧ TextFile

    Length: 6743 (0x1a57)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Log;
with Files;
with Errors;
with Library;
with Profile;
with Subtypes;
use Subtypes;
with Arguments;
with Pathnames;
with Structure;
with Assertions;
with Debug_Tools;
with Set_Defaults;
with System_Utilities;
with Structure_Utilities;
with Low_Level_File_Operations;
procedure Build_Version (Of_Catalog : in Simple_Name := "<DEFAULT>";
                         Old_Version : in Simple_Name := "<DEFAULT>";
                         New_Version : in Simple_Name :=
                            ">> VERSION IDENTIFIER <<";
                         Make_Default : in Boolean := True;
                         Response : in String := "<PROFILE>") is
    --
    Old_Response_Profile : Profile.Response_Profile := Profile.Get;
    New_Response_Profile : Profile.Response_Profile := Profile.Value (Response);
    --
    The_User : constant User_Name := System_Utilities.User_Name;
    --
    package Error is
       new Errors  
              (Old_Response_Profile, New_Response_Profile, "Build_Version");
    --
begin
    Profile.Set (New_Response_Profile);
    Log.Put_Line ("[Build_Version (Of_Catalog => """ & Of_Catalog &
                  """, Old_Version => """ & Old_Version &
                  """, New_Version => """ & New_Version &
                  """, Make_Default => " & Boolean'Image (Make_Default) &
                  ", Response => """ & Response & """)]",
                  Profile.Auxiliary_Msg);
    declare
        --
        The_Old_Version : constant Full_Name :=
           Arguments.Version_From (Of_Catalog, Old_Version);
        The_New_Version : constant Full_Name :=
           Arguments.Version_From (Of_Catalog, New_Version);
        --
        The_Catalog_Simple : constant Simple_Name :=
           Arguments.Simple_Catalog_From (Of_Catalog);
        The_New_Version_Simple : constant Simple_Name :=
           Arguments.Simple_Version_From (Of_Catalog, New_Version);
        --
    begin  
        Assertions.Assert_Version_Does_Not_Exist (The_New_Version);
        Library.Copy (From => The_Old_Version,
                      To => The_New_Version,
                      Recursive => False,
                      Response => "PROPAGATE," & Response,
                      Copy_Links => True);
        Assertions.Assert_Version_Exists (The_New_Version);
        Library.Copy (From =>
                         Pathnames.Document_Setup_File_For (The_Old_Version),
                      To => Pathnames.Document_Setup_File_For (The_New_Version),
                      Response => "PROPAGATE," & Response);
        Assertions.Assert_Has_Document_Setup_File (The_New_Version);
        Library.Copy (From =>
                         Pathnames.Printer_Options_File_For (The_Old_Version),
                      To => Pathnames.Printer_Options_File_For
                               (The_New_Version),
                      Response => "PROPAGATE," & Response);
        Assertions.Assert_Has_Printer_Options_File (The_New_Version);
        Library.Copy (From => Pathnames.Release_Notice_For (The_Old_Version),
                      To => Pathnames.Release_Notice_For (The_New_Version),
                      Response => "PROPAGATE," & Response);
        Assertions.Assert_Has_Release_Notice (The_New_Version);
        Library.Copy (From =>
                         Pathnames.Browser_View_Name_File_For (The_Old_Version),
                      To => Pathnames.Browser_View_Name_File_For
                               (The_New_Version),
                      Response => "PROPAGATE," & Response);
        Assertions.Assert_Has_Browser_View_Name_File (The_New_Version);
        Library.Copy (From => Pathnames.Data_File_For (The_Old_Version),
                      To => Pathnames.Data_File_For (The_New_Version),
                      Response => "PROPAGATE," & Response);
        Assertions.Assert_Has_Data_File (The_New_Version);
        begin
            Log.Put_Line ("Updating data file");
            Structure.Set_Version_Of
               (This_Data_File => Pathnames.Data_File_For (The_New_Version),
                To_This_Version => The_New_Version_Simple);
            Log.Put_Line ("Data file updated", Profile.Positive_Msg);
            --
        exception
            when Structure.Io_Failure =>
                Error.Report ("Unable to update data file, quitting",
                              Nested => True);
        end;
        Log.Put_Line ("Freezing old version");
        Library.Freeze (Existing => The_Old_Version,
                        Response => "PROPAGATE," & Response);
        Log.Put_Line ("Old version frozen", Profile.Positive_Msg);
        if (Make_Default) then
            begin
                Set_Defaults (User => The_User,
                              Catalog => The_Catalog_Simple,
                              Version => The_New_Version_Simple,
                              Response => "PROPAGATE," & Response);
                --
            exception
                when others =>
                    Error.Report ("Could not set defaults, quitting",
                                  Nested => True);
            end;
        end if;
    end;
    Log.Put_Line ("[end of Build_Version operation--no error(s) detected]");
    Profile.Set (Old_Response_Profile);
    --
exception
    when Arguments.Invalid_Catalog =>
        Error.Report ("Specified catalog is invalid");
    when Arguments.Invalid_Version =>
        Error.Report ("Version(s) is/are invalid");
    when Assertions.Version_Already_Exists =>
        Error.Report ("New version already exists");
    when Arguments.Io_Failure =>
        Error.Report ("Can't find default(s)--run ""Catalog.Set_Defaults""");
    when Assertions.No_Such_Version =>
        Error.Report ("Unable to create version");
    when Assertions.Has_No_Document_Setup_File =>
        Error.Report ("Unable to create document setup file");
    when Assertions.Has_No_Data_File =>
        Error.Report ("Unable to create data file");
    when Assertions.Has_No_Printer_Options_File =>
        Error.Report ("Unable to create printer options file");
    when Assertions.Has_No_Release_Notice =>
        Error.Report ("Unable to create release notice");
    when Assertions.Has_No_Browser_View_Name_File =>
        Error.Report ("Unable to create browser view name file");
    when Files.Io_Failure =>
        Error.Report ("Problem opening/reading exports file");
    when Low_Level_File_Operations.Io_Failure =>
        Error.Report ("Problem saving updated exports file");
    when Error.Propagate =>
        raise;
    when Error.Quit =>
        null;
    when others =>
        Error.Report ("EXCEPTION: " & Debug_Tools.Get_Exception_Name,
                      This_Type => Profile.Exception_Msg);
        --
end Build_Version;