?? RIGHT := 110 ??
?? NEWTITLE := 'INSTALL_SOFTWARE Utility: LOAD_PACKING_LIST Subcommand.' ??
MODULE ram$load_packing_list_inss_cmd;

{ PURPOSE:
{   This module contains the INSTALL_SOFTWARE command interface to load the
{   packing list under the installation database catalog.
{
{ DESIGN:
{   The compiled module resides in RAF$LIBRARY.
{
{ NOTES:
{

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
?? POP ??
*copyc clp$evaluate_parameters
*copyc clp$trimmed_string_size
*copyc rap$load_packing_list
*copyc rav$installation_defaults

?? TITLE := 'Global Declarations Declared by This Module', EJECT ??

?? TITLE := '[XDCL] rap$load_packing_list_inss_cmd', EJECT ??

{ PURPOSE:
{   This is the command interface that loads the packing list from a
{   tailored product tape or tailored disk file into the installation
{   database.
{
{ DESIGN:
{   The LOAD_PACKING_LIST command has two versions.  This is the one used
{   by INSTALL_SOFTWARE and there is another used by PACKAGE_SOFTWARE.  The
{   only distinction between the two versions is how the loading
{   destination path is specified.  Otherwise, the actually loading
{   operation is exactly the same.  Because of this fact, this interface
{   constructs the destination path and then calls a shared interface
{   that does the actual parameter validation and loading.
{
{   The loading destination path is assembled by taking the current value
{   for the installation database catalog and appending the name specified
{   for the packing list by the caller.
{
{ NOTES:
{

  PROCEDURE [XDCL] rap$load_packing_list_inss_cmd
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{   PROCEDURE loapl_pdt (
{     packing_list, pl: name 1..16 = $required
{     external_vsn, evsn: any of
{         string 1..6
{         name 1..6
{       anyend = $optional
{     recorded_vsn, rvsn: any of
{         string 1..6
{         name 1..6
{       anyend = $optional
{     type, t: key mt9$1600, mt9$6250, mt18$38000 keyend = $optional
{     disk_file, df: file = $optional
{     unload_volume, uv: boolean = true
{     removable_media_group, rmg: (BY_NAME, ADVANCED) any of
{         key
{           none
{         keyend
{         name
{       anyend = osd$reqmt_removable_media_group, none
{     status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 15] of clt$pdt_parameter_name,
      parameters: array [1 .. 8] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 3] of clt$keyword_specification,
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
      type6: record
        header: clt$type_specification_header,
        default_value: string (4),
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        default_name: string (31),
        default_value: string (4),
      recend,
      type8: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [96, 8, 23, 15, 14, 52, 913],
    clc$command, 15, 8, 1, 1, 0, 0, 8, ''], [
    ['DF                             ',clc$abbreviation_entry, 5],
    ['DISK_FILE                      ',clc$nominal_entry, 5],
    ['EVSN                           ',clc$abbreviation_entry, 2],
    ['EXTERNAL_VSN                   ',clc$nominal_entry, 2],
    ['PACKING_LIST                   ',clc$nominal_entry, 1],
    ['PL                             ',clc$abbreviation_entry, 1],
    ['RECORDED_VSN                   ',clc$nominal_entry, 3],
    ['REMOVABLE_MEDIA_GROUP          ',clc$nominal_entry, 7],
    ['RMG                            ',clc$abbreviation_entry, 7],
    ['RVSN                           ',clc$abbreviation_entry, 3],
    ['STATUS                         ',clc$nominal_entry, 8],
    ['T                              ',clc$abbreviation_entry, 4],
    ['TYPE                           ',clc$nominal_entry, 4],
    ['UNLOAD_VOLUME                  ',clc$nominal_entry, 6],
    ['UV                             ',clc$abbreviation_entry, 6]],
    [
{ PARAMETER 1
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 33, clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 33, clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [13, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 118, clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0],
{ PARAMETER 6
    [14, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 4],
{ PARAMETER 7
    [8, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 69, clc$optional_default_parameter, 31, 4],
{ PARAMETER 8
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, 16]],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
    TRUE, 2],
    8, [[1, 0, clc$string_type], [1, 6, FALSE]],
    5, [[1, 0, clc$name_type], [1, 6]]
    ],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
    TRUE, 2],
    8, [[1, 0, clc$string_type], [1, 6, FALSE]],
    5, [[1, 0, clc$name_type], [1, 6]]
    ],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [3], [
    ['MT18$38000                     ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['MT9$1600                       ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['MT9$6250                       ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 5
    [[1, 0, clc$file_type]],
{ PARAMETER 6
    [[1, 0, clc$boolean_type],
    'true'],
{ PARAMETER 7
    [[1, 0, clc$union_type], [[clc$keyword_type,
    clc$name_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ,
    'OSD$REQMT_REMOVABLE_MEDIA_GROUP',
    'none'],
{ PARAMETER 8
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$packing_list = 1,
      p$external_vsn = 2,
      p$recorded_vsn = 3,
      p$type = 4,
      p$disk_file = 5,
      p$unload_volume = 6,
      p$removable_media_group = 7,
      p$status = 8;

    VAR
      pvt: array [1 .. 8] of clt$parameter_value;

    VAR
      length: integer,
      loading_destination: fst$path;

    status.normal := TRUE;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    STRINGREP (loading_destination, length, rav$installation_defaults.installation_database.
          path (1, rav$installation_defaults.installation_database.size), '.', pvt [p$packing_list].
          value^.name_value (1, clp$trimmed_string_size (pvt [p$packing_list].value^.name_value)));

    rap$load_packing_list (pvt [p$external_vsn], pvt [p$recorded_vsn], pvt [p$type],
          pvt [p$disk_file], loading_destination (1, length),
          pvt [p$unload_volume].value^.boolean_value.value,
          pvt [p$removable_media_group], status);

  PROCEND rap$load_packing_list_inss_cmd;
MODEND ram$load_packing_list_inss_cmd;
