2 ################################################################################
5 # Description: Updates a snapshot view
6 # Author: Andrew@DeFaria.com
7 # Created: Thu Dec 13 19:11:15 2001
11 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
13 ################################################################################
14 # Set me to command name
17 # Source /etc/site_parms
18 if [ -f /etc/site_parms ]; then
21 echo "$me: WARNING: /etc/site_parms does not exist!"
25 adm_base="$SITE_TOOLS_PATH/adm"
28 adm_fpath=${adm_fpath:-$adm_base/functions}
34 if [ ! -z "$1" ]; then
37 display "$me: [-q|uiet ] [-v|erbose] [-d|ebug] [-usage] <view_tag>"
38 display "\t [ <view_tag>... ]"
41 display "\t-quiet:\t\tBe quiet"
42 display "\t-verbose:\tTurn on verbose mode"
43 display "\t-debug:\t\tTurn on debug mode"
44 display "\t-usage:\t\tDisplay usage"
45 display "\t<viewtag>\tView tag(s) to update"
51 while [ $# -ge 1 ]; do
70 views_tags_to_update="$views_tags_to_update $1"
77 for viewtag in $views_tags_to_update; do
78 # First check to see if there is a snapshot view
79 viewpath="$SITE_SNAPSHOT_VIEW_PATH/$viewtag"
80 if [ -d "$viewpath" ]; then
81 verbose "Updating view $viewtag..."
84 if [ $quiet = "yes" ]; then
85 # If quiet then the logfile is discarded as well as the output from
88 cleartool update -force -log $logfile . > /dev/null 2>&1
90 # If not quiet then we let cleartool update place the .updt file
91 # normally (i.e. in the view root directory) and capture the output
92 # of cleartool update so we can extract that pathname later
93 logfile=/tmp/$viewtag.update.log
94 cleartool update -force . > $logfile 2>&1
98 verbose "Successfully updated $viewtag"
99 if [ -f $logfile ]; then
100 # Note that [ -f /dev/null ] fails (i.e. there is no real /dev/null
101 # file) so we skip the following, which is what we want to do here.
102 update_logfile_name=$(tail -1 $logfile | cut -f2 -d'"' | tr '\\\\' '/')
106 The view $viewtag was successfully updated. Check logfile for results.
108 Logfile: $update_logfile_name
110 You can double click on a view update logfile from the Windows Explorer to
111 view the results in Clearcase.
113 WARNING: Remember view update logfiles will accumulate unless you remove them!
117 warning "Update of $viewtag failed"
118 display "See $logfile for more information"
121 warning "View tag does not exist for the snapshot view: $viewtag"