Installing Files

Files get installed between wwwudev and www or wwwdev and www. This action is separate from pushing files to the production web servers, although a push can be initiated with the -push flag to the wwwuinst or wwwdinst.

The wwwuinst and wwwdinst programs are a Perl script which uses the correct directory depending on what command name is used.

The general steps for the install program are:

  1. Verify paths given on the command line are valid and writable by the user.
  2. Check if any of the paths are under RCS control (an RCS version file exists in the same directory or in an RCS subdirectory). If there are RCS-controlled files, make sure they're unlocked and checked out.
  3. Try to fix up permissions for every file (group write enabled, everything world readable, directories world executable).
  4. Prompt for the user's password to become the install user.
  5. For installs, copy every path on the command line from the develpment directory to the production directory:
    1. For every directory or parent directory of files and symbolic links, test for a .wwwinstmk file in that directory. Run the UNIX make program with that file if it exists.
    2. For files, make sure files under RCS control are unlocked.
    3. For files, update the production directory if the file size, timestamp, or permissions differ from the deveopment copy.
    4. For symlinks, update production if the destination is different than the development directory's symlink.
    5. For directoriees, remove files from production if they do not exist in the development directory.
    6. For directories, repeat step 5 for every file in that directory (except files listed in the .wwwinstrc file, .wwwinstrc files themselves, .wwwinstmk files, or RCS-related files and directories).
    If the -show flag is given, display what actions would be taken instead of actually doing them. If the -delete flag is given remove files instead.
  6. If the -push flag is given, call wwwpush.

Triggering UNIX make

All directories, before installing, are checked for existence of a .wwwinstmk file. If it exists, the install program uses it as the input file to UNIX make. This allows developers to make sure that generated files are up-to-date before the install happend.

As an example, the UW Campus Maps Case Study shows that there is a data file which contains information about the different buildings, and different include files are generated so each map page can have an index of buildings. A .wwwinstmk file makes sure that the include files are up-to-date if the data file has been changed.

RCS Files

It is often valuable to be able to use RCS on a file for version control, locking, or both. Since it's not necessary to have RCS files in production, the install programs ignore any directory named RCS or any file ending with ,v (which are RCS version files).

During the install, if a file has write permission enabled, the install program will notify the user that the file is locked and will skip that file.

The install process does not force files to be checked out, so it's possible that a file under RCS control will be removed from the production web servers, but those files can be replaced by checking out the current version of the file and re-installing.