Programming Utilities Guide

Administering SCCS Files

By convention, history files and all temporary SCCS files reside in the SCCS subdirectory. In addition to the standard file protection mechanisms, SCCS allows certain releases to be frozen, and access to releases to be restricted to certain users (see sccs admin(1) for details). History files normally have permissions set to 444 (read-only for everyone), to prevent modification by utilities other than SCCS. In general, it is not a good idea to edit the history files.

A history file should have just one link. SCCS utilities update the history file by writing out a modified copy (x.file), then renaming the copy.

Interpreting Error Messages: sccs help

The help subcommand displays information about SCCS error messages and utilities.

help normally expects either the name of an SCCS utility, or the code (in parentheses) from an SCCS error message. If you supply no argument, help prompts for one. The directory /usr/ccs/lib/help contains files with the text of the various messages help displays.

Altering History File Defaults: sccs admin

A number of parameters that can be set using the admin command. The most interesting of these are flags. Flags can be added by using the -f option.

For example, the following command sets the d flag to the value 1:

$ sccs admin -f d1 program.c

This flag can be deleted by using:

$ sccs admin -d d program.c

The most useful flags are:

b

Allow branches to be made using the -b option to sccs edit (see "Branches ").

dSID

Default SID to be used on an sccs get or sccs edit . If this is just a release number it constrains the version to a particular release only.

i

Give a fatal error if there are no ID keywords in a file. This prevents a version from being checked in when the ID keywords are missing or expanded by mistake.

y

The value of this flag replaces the %Y% ID keyword.

-tfile

Stores descriptive text from file in the s.file. This descriptive text might be the documentation or a design and implementation document. Using the -t option ensures that if the s.file is passed on to someone else, the documentation goes along with it. If file is omitted, the descriptive text is deleted. To see the descriptive text, use prt -t.

The sccs admin command can be used safely any number of times on files. A current version need not be retrieved for admin to work.

Validating the History File

You can use the val subcommand to check certain assertions about a history file. val always checks for the following conditions:

If you use the -r option, val checks to see if the indicated SID exists.

Restoring the History File

In particularly bad circumstances, the history file itself can become corrupted, usually by someone editing it. Since the file contains a checksum, you will get errors every time you read a corrupted file. To correct the checksum, use:

$ sccs admin -z program.c

Note -

When SCCS says that the history file is corrupted, it may indicate serious damage beyond an incorrect checksum. Be careful to safeguard your current changes before attempting to correct a history file.