pcopy - copy files to a product structure


      pcopy [-t] [-i] [-v] [-V] [-l] [-f] [-p | -pd] [-d dir] [-c] [-g file
      mask] [-RCS] [-o | any cpp option ] [ -m file ... | pd_file


      The pcopy program copies components from a system structure or from a
      user working directories to a product structure.

      The program reads file named Product Description File (PD file) from
      the current directory. This file lists which components should be
      copied to a product structure.

      A PD file may be specified as a command parameter, or as an
      environment variable.

      The root destination directory is specified by the environment
      variable PRODUCT_ROOT. The program goes trough the PD file and reads
      which components should be copied. By default all the components are
      taken. Using options -m it is possible to select files to be copied.
      The option -g selects  files according to the specified mask. A
      specific file or directory (subsystem) or specific filetype may be

      The components taken from the PD files are searched for in the source
      If the same components already exist in the destination directory,
      then only the components that are newer then those in the destination
      directory are taken. Optionally, no date is tested.

      The format of the PD file is as follows:

                        /* comment */
                        src dest; commands ! file description

      PD files are processed by cpp preprocessor which means that it is
      possible to use statements like

                        #include "file"
                        #define name definition
      or conditional statements. All the cpp options (but -P) may be
      For more information see cpp(1).

      The item src denotes a file specification of the component(s) to be
      copied. Any legal filename specification can be used (including
      characters *,%,[]). It is also possible to define several files.
      Usually, only a filename should be specified, which denotes that the
      file(s) should be placed in the current directory or in the belonging
      RCS library. If the file is not placed in the current directory, that
      a complete or relative path may be specified. Normally, a path
      relative to the directory where the PD file is placed should be

      The item dest denotes the directory where the files should be copied.
      The first part of the directory (root) should be specified by the
      environment variable PRODUCT_ROOT. This variable denotes the root of a
      product version.

      After the first semicolon, commands that are applied on each component
      after its copying, may be specified. In these commands the environment
      variable FILE denotes the component that has been copied. The full
      path name is defined for file. So, if for example, only the filename
      is going to be used then the command basename $FILE should be used.
      Several commands may be written. In that case the commands must be
      separated by semicolons.

      Note that both  src and dest parts may contain enay environemnt
      variable that must be defined when the pcopy command is being

      The last part of the line begins with the "!" character which is
      followed by a file description. File names and their descriptions may
      be listed when the -p option is used.

           It is not possible to define the parameters specified below if
           the -m file file ...  option is used.

           It specifies the PD file name. If the parameter is not specified,
           then the environment variable WINSDE_PD is taken. If neither 
           WINSDE_PD exists, nor parameter is specified, then the command 
           prompts for the parameter.

           It defines the destination root specified as the environment
           variable PRODUCT_ROOT in the PD file. If the parameter is not
           specified, then the environment variable PRODUCT_ROOT must be

      -c   The destination directories will be created if they not already

      -m file file ...
           Process specified files. The files must be present in the
           directory and specified in the PD file.

      -g string_expression
           The option defines a selection mask for files. Any expression
           used by grep command may be specified.

      -i   The copy of each component will be asked for a confirmation.

      -v   The log messages about the components copied will be displayed.

      -V   Write log message only for files being copied

      -f   Force the copy. By default only the files that are newer than
           destination files, are copied.

      -l   Instead of copying, the selected components will be only listed.

      -p   The command will print the file names and their descriptions
           specified in the PD file. The output may be used for the product
           release documentation.

      -pd  The command prints source directory, source file, destination
           directory and finally the file description in each line. This
           format is suitable for further processing by other Unix commands.

      -t   All subdirectories starting from the current directory will be
           searched for the PD files with the specified name. The old option
           -s has the same function as -t. option.

           Note: If you are using #include cpp instruction, avoid to us -t
           option, because you may get inpredictable results (for example,
           if an include file is placed in a subdirectory, it will be
           processed twice).

      -d dir
           By default the components are taken from directories specified
           relative to the directory where the PD file is placed. This
           option defines the current directory as dir. This option cannot
           be used in combination with -t option.

      -RCS Look for files also in RCS directories.

      -o   Old format. Do not process cpp preprocessor and assume that the #
           character defines a start of comment.


      A PD file example:
           #include "sde_doc.pd"
           *.h $PRODUCT_ROOT/include; chmod 444 $FILE;
           pause $PRODUCT_ROOT/bin; chmod 755 $FILE ! lock the keyboard
           product_* $PRODUCT_ROOT/lib; chmod 755 $FILE ! product commands

      Command examples:

      pcopy prod.pd /ipa/products/prod/1.2-0
      The environment variable PRODUCT_ROOT defines the destination root
      directory. The environment variable WINSDE_PD defines the PD file name.
      Using wildcard "*" in a combination with "/" character will cause
      unpredictable behaviour because these characters together are
      recognized by the cpp pre-processor. For example, the specification
      man/*1 will denote the beginning of a comment.

      The cpp pre-processor includes a certain number of pre-defined symbol
      names. If you have a text that correspond to a predefined symbol, it
      will be replaced by the cpp definition. For example, the text
      file.hpux.txt will be changed to  file.1.txt, because the hpux symbol
      is defined to 1. To avoid this substitution, you may use -U option.
      You may see in man cpp which symbols are predefined.

      Files specified in a PD file must not contain the semicolon character
      Ivica Crnkovic