2 ################################################################################
5 # Description: Locks all bugs in the current release (Must be run by $ccadmin)
6 # Author: Andrew@DeFaria.com
7 # Created: Mon Jun 2 11:19:46 PDT 2003
10 # (c) Copyright 2001-2003, Andrew@DeFaria.com, all rights reserved.
12 ################################################################################
13 # Set me to command name
16 # Source /etc/site_parms
17 if [ -f /etc/site_parms ]; then
20 echo "$me: WARNING: /etc/site_parms does not exist!"
24 adm_base="$SITE_TOOLS_PATH/adm"
27 adm_fpath=${adm_fpath:-$adm_base/functions}
35 if [[ $USER != $ccadmin ]]; then
36 error "This command must be executed by $ccadmin" 1
39 # Set release_web_area
40 release_web_area=~adefaria/www/Internal/Release
43 view="$SITE_SNAPSHOT_VIEW_PATH/$SITE_OFFICIAL_VIEW/salira"
46 cqc="$SITE_TOOLS_PATH/bin/cqc"
48 # Cd there to operate on files
52 echo "$me: Error: Unable to cd to release web area"
56 # Current release is now stored in a file
57 current_release="$(cat addbug/current_release).bugs"
59 # Declare some counters
61 declare -i resolved_bugs=0
62 declare -i already_locked_bugs=0
63 declare -i locked_bugs=0
68 # Get and process a list of bugs
69 buglist=$(grep -ve ^# -e ^* "$current_release" | cut -f1)
71 # Must be in a view/vob context
75 echo "$me: Error: Unable cd to official view ($view)"
79 for bugid in $buglist; do
84 state=$($cqc $bugid state)
86 # Check to see if bug is already locked
87 locked=$(cleartool lslock -short lbtype:$bugid 2> /dev/null)
89 if [ ! -z "$locked" -o \
90 "$state" = "Closed" -o \
91 "$state" = "Verified" ]; then
92 let already_locked_bugs=already_locked_bugs+1
95 # Process only Resolved bugs
96 if [ "$state" = "Resolved" ]; then
97 let resolved_bugs=resolved_bugs+1
99 if [ -z "$locked" ]; then
100 # If not already locked then lock it
101 echo "Found unlocked, resolved bug $bugid - attempting to lock it..."
106 if [ $status -eq 0 ]; then
107 let locked_bugs=locked_bugs+1
111 let errors=errors+status
117 declare -i not_resolved=bugs-resolved_bugs
119 echo -e "Bugs processed:\t\t$bugs"
120 echo -e "Resolved:\t\t$resolved_bugs"
121 echo -e "Not resolved:\t\t$not_resolved"
122 echo -e "Currently locked:\t$already_locked_bugs"
123 echo -e "Newly locked:\t\t$locked_bugs"
124 echo -e "Errors:\t\t\t$errors"