2 ################################################################################
5 # Description: Displays the files related to a bug ID
6 # Author: Andrew@DeFaria.com
7 # Created: Wed Jun 11 13:22:11 PDT 2003
9 # Modifications:06/17/2003 AD: Changed 2310_onu -> onu2310 as the card directory
10 # has changed. Also added -to and -cc options.
12 # (c) Copyright 2003, Andrew@DeFaria.com, all rights reserved
14 ################################################################################
15 # Set me to command name
19 adm_base="$SITE_TOOLS_PATH/adm"
22 adm_fpath="${adm_fpath:-$adm_base/functions}"
28 display "$me: [ -view <viewtag> ] <bugid> [<bugid>]"
32 display "\t-view\tView path to use (default $SITE_OFFICIAL_VIEW)"
33 display "\t<bugid>\tBug ID(s) to search for"
45 trap cleanup INT EXIT ERR
76 if [ -z "$view_path" ]; then
77 vob="$SITE_SNAPSHOT_VIEW_PATH/$SITE_OFFICIAL_VIEW/salira"
78 view_name="$SITE_OFFICIAL_VIEW"
80 vob="$view_path/salira"
83 cd $vob > /dev/null 2>&1
86 error "Unable to cd to $vob" 1
89 if [ -z "$view_name" ]; then
90 view_name=$(cleartool pwv -short)
94 # Check for bug IDs supplied as numbers only. Prepend "BUGS2" and
95 # number of required zeros to make bug ID. IOW you can specify "7"
96 # or BUGS200000007 but not "BUGS07", etc
97 if ((${#bug} < 13)); then
98 declare -i len=13-${#bug}
100 # Can't even prepend "BUGS2"!
101 display "Invalid bug id \"$bug\" encounterd - skipping..."
105 declare -i zeros=len-5
106 while (($zeros > 0)); do
111 declare -i nbr=${newbug:4}
112 declare str=${newbug:4}
113 if [ $nbr != $str ]; then
114 warning "Invalid bug ID encountered: $bug"
121 display "Files involved in bug ID $bug:"
122 cleartool find -all -version "lbtype($bug)" -print | tr "\\\\" "/" >/tmp/$me.$$
126 while read element_version; do
128 # Chop off leading view path
129 element_version=$(echo ${element_version##*$view_name})
130 # Extract element portion
131 element=$(echo $element_version | cut -f1 -d@)
132 # Extract version portion
133 version=$(echo $element_version | cut -f3 -d@)
134 display "\t$element\t$version"
138 display "No files involved in bug ID $bug"
139 elif [ $i -eq 1 ]; then
140 display "1 file involved in bug ID $bug"
142 display "$i files involved in bug ID $bug"