#!/bin/bash ################################################################################ # # File: unlockedbugs # Description: Displays all remaining unlocked bugs # Author: Andrew@DeFaria.com # Created: Mon Jun 2 11:19:46 PDT 2003 # Language: bash # # (c) Copyright 2001-2003, Andrew@DeFaria.com, all rights reserved. # ################################################################################ # Set me to command name me=$(basename $0) # Source /etc/site_parms if [ -f /etc/site_parms ]; then . /etc/site_parms else echo "$me: WARNING: /etc/site_parms does not exist!" fi # Set adm_base adm_base="$SITE_TOOLS_PATH/adm" # Set adm_fpath adm_fpath=${adm_fpath:-$adm_base/functions} # Source functions . $adm_fpath/common # Admin user ccadmin="ccadmin" if [[ $USER != $ccadmin ]]; then error "This command must be executed by $ccadmin" 1 fi # Set release_web_area release_web_area=~adefaria/www/Internal/Release # Set view area view="$SITE_SNAPSHOT_VIEW_PATH/$SITE_OFFICIAL_VIEW/salira" # Commands used cqc="$SITE_TOOLS_PATH/bin/cqc" # Cd there to operate on files cd $release_web_area if [ $? -ne 0 ]; then echo "$me: Error: Unable to cd to release web area" exit 1 fi # Current release is now stored in a file current_release="$(cat addbug/current_release).bugs" # Declare some counters declare -i bugs=0 declare -i resolved_bugs=0 declare -i already_locked_bugs=0 declare -i locked_bugs=0 declare -i errors=0 declare -i status=0 # Get and process a list of bugs buglist=$(grep -ve ^# -e ^* "$current_release" | cut -f1) # Must be in a view/vob context cd "$view" if [ $? -ne 0 ]; then echo "$me: Error: Unable cd to official view ($view)" exit 1 fi for bugid in $buglist; do # Count the bug let bugs=bugs+1 # Get state of bug state=$($cqc $bugid state) # Check to see if bug is already locked locked=$(cleartool lslock -short lbtype:$bugid 2> /dev/null) if [ "$locked" != "" ]; then let locked_bugs=locked_bugs+1 elif [ "$state" = "Closed" -o "$state" = "Verified" ]; then let locked_bugs=locked_bugs+1 else let unlocked_bugs=unlocked_bugs+1 owner=$(cqc $bugid owner) headline=$(cqc $bugid headline) echo "Bug ID $bugid $state \"$headline\" <$owner@salira.com> is still unlocked" fi done # Report results echo -e "Bugs processed:\t\t$bugs" echo -e "Locked bugs:\t\t$locked_bugs" echo -e "Unlocked bugs:\t\t$unlocked_bugs"