#!/bin/bash ################################################################################ # # File: ctmerge # Description: Merges from one branch to another. If the merge is successful # then a build is performed. If that is also successful then the # merged elements are checked in and optionally labeled. A cleanup # of .contrib files is also performed (only if the merge and build # succeed). After this email is set to SITE_ADMIN_EMAIL (default). # Author: Andrew@DeFaria.com # Created: Wed Jun 11 13:22:11 PDT 2003 # Language: Bash Shell # Modifications: # # (c) Copyright 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 # Commands used ssmtp=/usr/sbin/ssmtp # Set a logfile for the merge logfile=/tmp/$me.$$.log # File for merge commands merge_cmd=/tmp/$me.$$.cmd # File for exclusions exclusions=/tmp/$me.$$.exclude # How many elements merged declare -i nbr_merges=0 # How many exclusions were found declare -i nbr_exclusions=0 # Element exclusion list excluded_elements="\ " # Result of merging, building, etc. Codes are: # # 0: Success! Everything worked. # 1: Errors occured during merging # 2: Not all merges could be performed automatically # 3: No merging required # 4: Build failed # 5: Unable to checkin elements # 6: Problems applying label declare -i result_code=0 function usage { if [ ! -z "$1" ]; then error "$1\n" fi display "Usage: $me: -view -b|ranch " display "\t\t[-to ] [-cc ]" display "\t\t[-nocheckin] [-l|abel