There are two script types that may be modified. Scripts other than
those written in Perl may have any name convention. Perl
script should have a file suffix of ".sin" and contain in the
first line an alias for perl (see the template example below).
Procedure for modifying software in the kroot directory tree for NIRES.
- start xterm as niresbld on niresserver1
- cd /kroot/src/kss/nires/ to get to the development directory tree
- Determine where to install a new script or edit an old one.
- use "lwhich scriptname" to determine the released
path which should show you where to make mods in the
development area.
- Example: if lwhich scriptname (gois
in this case) returns
/kroot/rel/default/bin/gois -> ..//Versions/kss/nires/scripts/img/default/gois, then simply cd scripts/img
- If modifing an existing script, modify the script or its
corresponding *.sin file.
- If creating a new script:
- copy the template files (see below) to a new file.
- Edit the makefile in that script directory to
include the new script in compilation. If it is a perl
script, the script in the makefile should not include
the ".sin" suffix.
- Add to the CVS repository using cvs add scriptname .
- Run make to test compilation.
- If it has been a while since the last release OR more than one
script is changing, increase the release version number:
- Edit Makefile and increase the VERNUM (e.g., from 1.1 to 1.2)
- Run make install to release code into the release dir
(/kroot/bin/). Please provide a comment to the release
as instructed.
- cvs your changes: cvs commit -m "Updates made to scriptname"
- Now check that the script works in the released code. Run it as
lriseng and a numbered account on niresserver. You
might need to do a rehash.
Script Template for non perl scripts
Template below is found in the ~lris_sh dir.
#!/usr/local/bin/tcsh -f
#
# Name:
# script_template
#
# Purpose:
#
#
# Usage:
#
# where:
#
#
# Output:
#
#
# Modification history:
# 2000-Jul-25 MK template version
#-----------------------------------------------------------------------
# if debugging, do not make motor moves...
if ( "$1" == "-debug" ) then
echo "Entering DEBUG MODE!"
echo ""
shift
endif
exit
Perl Script Template
#!@PERL@ -w
#+
# NAME: template
#
# Purpose:
# Do nothing but provide a template for future use.
#
# Usage:
# template -debug
#
# Arguments:
# -debug = debug mode
#
# Output:
# to STDOUT
#
# Restrictions:
# none
#
# Exit values:
#
# Example:
#
# Modification history:
# 2006-Dec-20 MK template version
#-----------------------------------------------------------------------
# check for -verbose flag...
global verbose
set verbose 0
if { [lsearch -regexp $argv {^-v}] > -1 } {
set verbose 1
}
# check for -debug flag...
global debug
set debug 0
if { [lsearch -regexp $argv {^-d}] > -1 } {
set debug 1
set verbose 1
}
if { $debug }{echo "DEBUG MODE"}
if { $verbose } {echo "Verbose triggered"}