HEPiX Scripts - Internals

Here are some internal details about the HEPiX scripts.


Master Repository

The master repository for the HEPiX scripts is in AFS under /afs/cern.ch/project/hepix/working-groups/scripts.

Terminology:

Conventions:

The relevant subdirectories are:

Internal Tools

High-level tools:

compile [-noprep] [-wipeout] <util> [where...]
compile the named utility on the given machine(s) (or locally by default), where can be 'all'; -noprep skips the preparation phase (create the directories, create the symbolic links...); -wipeout removes everything under comp/utils/<util> before compiling
compile-src -<pkg> [build-flags] <ver> <sys>...
compile (i.e. from src to comp) the given version of a package for the given <sys> (can be 'all')
prepare -<pkg> [-dst dir] [build-flags] <ver> <sys>...
prepare (i.e. replace the meta-variables in comp) the given version of a package for the given <sys> (can be 'all'); -dst can be 'asis' (will end up under /afs/.cern.ch/asis/packages/HEPiX/...) or 'unpack' (will end up under unpack/<pkg>-<ver>) or a real directory

Low-level tools:

build [-d] [-f] [-n] [-sys sys] src_dir dst_dir
call pp recursively on the tree under src_dir and put the processed files under dst_dir; the given sys will be used to choose a dictionary; src_dir/build.cfg will be used to customise the task, for more info RTSL!
csh2sh [csh-script [sh-script]]
a simple-minded program to convert some C shell scripts to Bourne shell syntax
pp [-d] [-o name] [-s file] [-i file] [-S expr] [-D expr] file
a simple (?) general purpose pre-processor taking a file name and spitting out the result on stdout; it usually replaces the strings of the form $[foo] and handles the directives starting with :foo; for more information, read the program!

Dictionaries

compile-src requires dictionaries that contain, for each supported <sys>, a mapping between command names and full paths (e.g. chmod -> /bin/chmod).

The dictionaries (as well as the related manipulation programs) are stored in the dico subdirectory of tools. The name of a dictionary is simply <sys>.

The dictionaries contain building information (who, when, where...) and a log file (named log) keeps track of all the changes made to the dictionaries.

The manipulation programs are:

build [-o file] [-p path] [template]
to build a dictionary from the given path (or $PATH by default) and a given template - list of commands - (or stdin by default) and put it in the given file (or stdout by default); it also stores the AFS @sys
check [dico]
to check all the paths apperaing in the given dictionary (or AFS' @sys by default)
store [-n] dico...
to store the given list of dictionaries (-n means show only the differences) in the current working directory; the names are taken from the AFS' @sys stored in the files and the changes are logged
usage [-v] dir
to check all the files under the given directory and report all the things looking like dictionary command names (i.e. $[foo]); -v means show also the line where the command appears

For instance, one would probably do something like:

# build a dico using current $PATH
host1> ./build -o test1 template
# build a dico using default (hard-coded) $PATH
host1> ./build -o test2 -p 0 template
# check the result
host1> diff test1 test2
# check that the commands exist on another machine
host2> ./check test
# see the differences with the current dictionary
host1> ./store -n test
# really store the dico
host1> ./store test


Lionel Cons, 5-Nov-1996