2 ################################################################################
4 # File: $RCSfile: clearcase,v $
5 # Revision: $Revision: 1.8 $
6 # Description: This script set up some useful environment variables and aliases
7 # for Clearcase execution. File should be sourced (e.g .
9 # Author: Andrew@DeFaria.com
10 # Created: Wed Jun 5 21:08:03 PDT 1996
11 # Modified: $Date: 2006/05/15 17:59:30 $
12 # Assumptions: ARCH is set represent the host's architecture (e.g. "sun",
16 # (c) Copyright 2000-2005, Andrew@DeFaria.com, all rights reserved.
18 ################################################################################
19 if [ $ARCH = "cygwin" ]; then
20 export CCHOME=${CCHOME:-"$SYSTEMDRIVE/Program Files/Rational/ClearCase"}
22 export CCHOME=/opt/rational/clearcase
25 if [ ! -d "$CCHOME" ]; then
30 export CLEARTOOL="$CCHOME/bin/cleartool"
31 export CLEARCASE_BLD_HOST_TYPE=unix
33 if [ -f "$CCHOME/etc/utils/creds" ]; then
34 if [ $ARCH = "cygwin" ]; then
35 alias creds=$(cygpath "$CCHOME/etc/utils/creds")
37 alias creds="$CCHOME/etc/utils/creds"
41 if [ -x "$CLEARTOOL" ]; then
42 alias clist='ct lsco -short -cview -all'
43 alias ciwork='ct ci -cq `ct lsco -cview -me -all -sh`'
44 alias lsbr='ct lstype -brtype'
45 alias lslab='ct lstype -lbtype'
46 #export WINEDITOR=edit
47 export RGY="$CCHOME/var/atria/rgy"
48 export LOGS="$CCHOME/var/log"
52 if [ -x "$CLEARTOOL" ]; then
55 echo "ClearCase is not installed on this system!"
59 # View related functions
61 if [ $ARCH = "cygwin" ]; then
62 # Save off where we are
71 # Chdir to the view root
80 # Chdir back to were we started
101 ct endview -server "$@"
115 elif [ $# = 1 ]; then
116 ct lsview | grep "$1"
123 # Well they asked for my "views"...
124 if [ $(whence fortune) ]; then
129 # List my views and their associated activities
130 for view in $(ct lsview -s 2>&1 | tr -d
\r | grep $USER); do
131 headline=$(ct lsact -cact -fmt "%[headline]p" -view $view 2> /dev/null)
133 if [ "$headline" = "" ]; then
134 headline="<no activity set>"
137 echo -e "$view\t$headline"
143 ct lsview -long | $PAGER
149 # Vob related functions
153 elif [ $# = 1 ]; then
162 ct lsvob -long | $PAGER
168 # Config spec functions
200 echo "vtree: Error: Must specify a file to view."
202 if [ $ARCH = "cygwin" ]; then
212 echo "unco: Error: No files specified"
228 ct diff -graphical -pred $1
230 ct diff -graphical -diff "$@"
236 ct xdiff -vstack -pred $1
242 # Administrative functions
251 function unregister {
255 # Information functions
264 ct lstype trtype:$trig_name@$vob
266 ct lstype -kind trtype "$@" | $PAGER
272 ct lstype -long trtype:$1
274 ct lstype -long -kind trtype "$@"| $PAGER
278 # UCM oriented functions
289 ct lsstream -l | $PAGER
309 ct lsproject | $PAGER
317 ct lsproject -l | $PAGER
333 ct lsstgloc -l | $PAGER
349 ct lsstream -l | $PAGER