Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cdc(1)

comb(1)

delta(1)

ed(1)

red(1)

get(1)

prs(1)

rmdel(1)

sact(1)

sccsdiff(1)

sccshelp(1)

unget(1)

val(1)

what(1)

sccsfile(4)

admin(1)  —  Commands

OSF

NAME

admin − Creates and initializes SCCS files

SYNOPSIS

admin [-auser ...] [-dheader_flag ...] [-euser ...] [-fheader_flag]
[value ...] [value] [-h]
[-i][file] | [-n] [-m[MRlist]] [-z] [-rnumber.number] [-tfile]
[-y[comment]]
sccs_file | sccs_directory | -

The admin command creates new Source Code Control System (SCCS) files or changes specified parameters in existing SCCS files. 

FLAGS

You can enter the flags and input filenames in any order.  All flags apply to all the files. 

-auserAdds the specified user to the list of users who can make sets of changes (deltas) to the SCCS file.  user can be either a username, a group name, or a group ID.  Specifying a group name or number is the same as specifying the names of all users in that group.  You can specify more than one -a flag on a single admin command line.  If an SCCS file contains an empty user list, then anyone can add deltas.  If a file has a user list, the creator of the file must be included in the list in order for the creator to make deltas to the file.

-dheader_flag
Removes the specified header flag from the SCCS file.  You can specify this flag only with existing SCCS files.  You can also specify more than one -d flag in a single admin command. 

-euserRemoves the specified user from the list of users allowed to make deltas to the SCCS file.  Specifying a group ID is equivalent to specifying all usernames common to that group.  You can specify several -e flags on a single admin command line. 

-fheader_flag[value]
Places the specified header flag and value in the SCCS file.  You can specify more than one header flag in a single admin command. 

-hChecks the structure of the SCCS file and compares a newly computed checksum with the checksum that is stored in the first line of the SCCS file.  When the checksum value is not correct, the file was improperly modified or damaged.  This flag helps you detect damage caused by the improper use of non-SCCS commands to modify SCCS files, as well as accidental damage.  The -h flag prevents writing to the file, so it cancels the effect of any other flags supplied.  If an error message is returned indicating the file is damaged, use the -z flag to recompute the checksum.  Then test to see if the file is corrected by using the -h flag again. 

-i[file]Gets the text for a new SCCS file from file.  This text is the first delta of the file.  If you specify the -i flag but you omit the file, admin reads the text from standard input until it reaches End-of-File(Ctrl\D).  If you do not specify the -i flag, but you do specify the -n flag, admin creates an empty SCCS file.  admin can only create one file containing text at a time.  If you are creating two or more SCCS files with one call to admin, you must use the -n flag, and the SCCS files created are empty. 

-m[MRlist]
Specifies a list of Modification Request (MR) numbers to be inserted into the SCCS file as the reason for creating the initial delta.  The v flag must be set.  The MR numbers are validated if the v flag has a value (the name of an MR number validation program).  admin reports an error if the v flag is not set or if MR validation fails. 

-nCreates a new, empty SCCS file.  Do not specify this flag when you use the -i flag. See desription of the -i flag for more detail. 

-rnumber[.number]
Inserts the initial delta into number.number, the release and version, respectively.  You can specify -r only if you also specify the -i or -n flag.  If you do not specify this flag, the initial delta becomes release 1, version 1.  Use this flag only when creating an SCCS file.  If version is omitted, version is set to 1 by default. 

-t[file]Takes descriptive text for the SCCS file from file.  If you use -t when creating a new SCCS file, you must supply a filename.  In the case of existing SCCS files:

       •Without a filename, -t causes removal of the descriptive text (if any) currently in the SCCS file. 

       •With a filename, -t causes text in the named file to replace the descriptive text (if any) currently in the SCCS file. 

-y[comment]
Inserts comment text into the initial delta in a manner identical to that of the delta command.  Use this flag only when you create an SCCS file.  If you do not specify a comment, admin inserts a line of the following form:

date and time created YY/MM/DD HH:MM:SS by login

-zRecomputes the SCCS file checksum and stores it in the first line of the SCCS file (see the -h flag). 

Using admin with this flag on a damaged file can prevent future detection of the damage.  Use this flag only if the SCCS file is changed using non-SCCS commands because of a previous serious error. 

DESCRIPTION

The parameters that can be modified by admin control how the get command builds the files that you can edit.  The parameters also provide information about who can access the file, who can make changes, and when changes were made. 

If the named file exists, admin modifies its parameters as specified by the flags.  If it does not exist and you supply the -i flag or the -n flag, admin creates the new file and provides default values for unspecified flags. 

If you specify a directory name for file, admin performs the requested actions on all SCCS files in that directory (all files with the s. prefix).  If you specify a - (dash) as a filename, admin reads standard input and interprets each line as the name of an SCCS file.  An End-of-File character ends input. 

The admin command is most often used to create new SCCS files without setting parameters. 

If you are not familiar with the delta numbering system, see get(1), sccs(1), and Guide to Programming Support Tools. 

Creating an SCCS File

All SCCS filenames must have the form s.file.  New SCCS files are created with read-only permission.  You must have write permission in the directory to create a file (see the chmod command for an explanation of file permissions).  admin writes to a temporary x-file, which it calls x.file.  The x-file has the same permissions as the original SCCS file if it already exists, and it is read-only if admin creates a new file.  After successful completion of admin, the x-file is moved to the name of the SCCS file.  This ensures that changes are made to the SCCS file only if admin does not detect any errors while it is running. 

Create directories containing SCCS files with permission code 755 (read, write, and execute permissions for owner, read and execute permissions for group members and others).  Create SCCS files themselves as read-only files (444).  With these permissions, only the owner can use non-SCCS commands to modify SCCS files.  If a group can access and modify the SCCS files, then the directories should include group write permission. 

The admin command also uses a temporary lock file (called z.file), to prevent simultaneous updates to the SCCS file by different users.  See the get(1) command for additional information on the z.file file. 

Header Flags

The following table contains the header flags that can be set with the -f flag and unset with the -d flag.  The header flags control the format of the g-file created with the get(1) command (see the get command for details on the g-file). 

FlagPurpose

bLets you use the -b flag of a get command to create branch deltas. 

cnumberMakes number the highest release number that a get -e can use.  The value of number must be less than or equal to 9999 (its default value is 9999). 

dSIDMakes SID (SCCS ID) the default delta supplied to a get command. 

fnumberMakes number the lowest release number that a get -e can retrieve.  number must be greater than 0 and less than 9999 (its default value is 1). 

iTreats the message "There are no SCCS identification keywords in the file. (cm7)" (issued by the get(1) or delta(1) command) as an error instead of a warning. 

jPermits concurrent get commands for editing the same SID of an SCCS file.  This allows multiple concurrent updates to the same version of the SCCS file. 

lnumber[,number]...
Locks the releases specified by number... against editing, so that a get -e against one of these releases fails.  You can lock all releases against editing by specifying -fla and unlock specific releases with the -d flag. 

mmoduleSubstitutes module for all occurrences of the %M% keyword in an SCCS text file retrieved by a get command.  The default module is the name of the SCCS file without the s. prefix. 

nCauses delta to create a null delta in any releases that are skipped when a delta is made in a new release.  For example, if you make delta 5.1 after delta 2.7, releases 3 and 4 will be null.  The resulting null deltas can serve as points from which to build branch deltas.  Without this flag, skipped releases do not appear in the the SCCS file. 

qtextSubstitutes text for all occurrences of the %Q% keyword in an SCCS text file retrieved by a get command. 

ttypeSubstitutes type for all occurrences of the %Y% keywords in a g-file retrieved by get. 

v[program]Makes delta prompt for Modification Request (MR) numbers as the reason for creating a delta.  program specifies the name of an MR number validity checking program (see the delta command).  If v is set in the SCCS file, the admin -m flag must also be used, even if its value is null. 

EXAMPLES

     1.To create an empty SCCS file named s.test.c, enter:

admin  -n  s.test.c

     2.To convert an existing text file into an SCCS file, enter:

admin -itest.c s.test.c

The admin command responds with the message:

There are no SCCS identification keywords in the file. (cm7)

Rename the original text file.  For example, enter:

mv test.c  back.c

The following message does not indicate an error.

There are no SCCS identification keywords in the file. (cm7)

Identification keywords are variables that can be placed in an SCCS file.  The values of these variables provide information, such as date, time, SID, or filename.  See the get command for an explanation of identification keywords.  Whether creating new files or converting an existing file, you can name the SCCS file anything you like, as long as it begins with the s. prefix.  In the preceding example, the original file and the SCCS file have the same name, but that is not necessary. 

     3.When you do not specify a release number, as in both of the preceding examples, admin gives the SCCS file an SID of 1.1.  SCCS does not use the number 0 to identify deltas.  Therefore, a file cannot have an SID of 1.0 or 2.1.1.0.  All new releases start with level 1.  To start the s.test.c file with a release number of 3, use the -r flag with the admin command, and enter:

admin -itest.c -r3 s.test.c

     4.To restrict permission to change SCCS files to a specific set of user IDs, list the user ID or group ID numbers in the user list of the SCCS file by using the -a flag.  These IDs then appear in the SCCS file header.  Without the -a flag to restrict access, all user IDs can change the SCCS files.  To restrict permissions to the user ID julie, enter:

admin -ajulie s.test.c

     5.Although SCCS provides some error protection, you may need to recover a file that was accidentally damaged.  This damage may result from a system malfunction, operator error, or changing an SCCS file without using SCCS commands.  SCCS commands use the checksum to determine whether a file was changed since it was last used.  The only SCCS command that processes a damaged file is the admin command when used with the -h or -z flags.  The -h flag tells admin to compare the checksum stored in the SCCS file header against the computed checksum.  The -z flag tells admin to recompute the checksum and store it in the file header.  Check the SCCS files for possible damage on a regular basis. For example, enter:

admin -h s.file1  s.file2 ...
admin -h directory1  directory2  ...

If admin finds a file where the computed checksum is not equal to the checksum listed in the SCCS file header, it displays the message:

[s.file]: The file is damaged. (co6)

     6.If a file is damaged, try to edit the file again, or read a backup copy.  After fixing the file, run the admin command with the -z flag and the repaired filename by entering:

admin -z s.file

This operation replaces the old checksum in the SCCS file header with a new checksum based on the repaired file contents.  Other SCCS commands can now process the file.

RELATED INFORMATION

Commands:  cdc(1), comb(1), delta(1), ed(1), red(1), get(1), prs(1), rmdel(1), sact(1), sccsdiff(1), sccshelp(1), unget(1), val(1), what(1). 

Files:  sccsfile(4). 

Guide to Programming Support Tools

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026