[Next] [Previous] [Up] [Top] [Contents] [Index]
Appendix B. UNIX Product Support (UPS) Overview
On a FUE-compliant system the standard default login files (also known as Fermi files[87]) set your environment to facilitate UPS operations, among other things. Regarding shells, UPS supports both UNIX shell families, C (Berkeley) and Bourne[88]. At login time, the environment variable UPS_SHELL gets set to indicate the family of the shell in use. Any shell within that family can then be used for UPS operations.
The Fermi files are designed for interactive use only and will break if they are called from a non-interactive script. You need to explicitly include the following actions in the order shown in any script that you will use to setup products (i.e. in which you use the setup command to access one or more products; setup is described in section 10.2.2):
source /usr/local/etc/setpath.cshsource /usr/local/etc/setups.csh. /usr/local/etc/setpath.sh. /usr/local/etc/setups.sh The setpath script sets a reasonable default starting path. The setups script (read "set UPS") sets the UPS environment variables described below[89].
The login files also set the alias for setup. Note that if you change shells or processes, this alias is no longer available to you. In this case you need to manually re-source the setups script in your new shell.
If you have made any changes to your login files, make sure that the following lines are still included before using UPS:
.cshrc includes source /usr/local/etc/fermi.cshrc
.login includes source /usr/local/etc/fermi.login
.profile includes . /usr/local/etc/fermi.profile
.shrc includes . /usr/local/etc/fermi.shrc
Three environment variables get set by the setups script at login:
If only one UPS database is defined, this points to it; if two or more are defined, this variable can be set as the space-separated list of UPS databases. The order of the databases in this list reflects the order of precedence for accessing products.
This points to the top level directory (called the product root directory) of the current instance of UPS (read sections B.8 through B.10 -- they're short! -- to understand the term "current instance").
As mentioned above, this indicates the shell family in use; it is set to either sh or csh.
You can use the environment variable PRODUCTS to list all the available products. For example, if it is set to the following list of UPS databases:
/home/dcdsv0_lv0/aheavey/ups_play/ups_database/declared/usr/products/ups_database/declared /afs/fnal/products/ups_database/declaredthen the command:
% ls $PRODUCTS
will yield information similar to the following (edited for brevity)[90]:
|
When you setup a product, the environment variable {PRODUCT}_DIR gets defined, where {PRODUCT} is the name of the product in upper case, for example WWW_DIR. This variable points to the root directory of the particular copy of the product that you setup; for example after running:
% setup www v2_7
the variable WWW_DIR is defined as something like /{ups_dirs}/products/SunOS+5/www/v2_7. You can then run a command like the following:
% ls -al $WWW_DIR
which returns a list of the files and subdirectories in the product root directory for www version v2_7, for example:
|
ls command does not list the databases in the order of precedence according to the PRODUCTS variable, but rather, alphabetically.