commonfilecheckin
来自「CMVC是IBM和许多跨国公司的缺陷管理工具。这里给出了很多在Linux下用KS」· 代码 · 共 175 行
TXT
175 行
#!/bin/ksh## SAMPLE NAME: commonFileCheckin## FUNCTIONS: This sample shell script checks in a common file to multiple# releases.## USAGE: commonFileCheckin filePathName releaseName defectNumber Remarks## ENVIRONMENT# VARIABLE(S): CMVC_FAMILY [CMVC_BECOME]## 5765-207 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5765-202 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5622-063 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5765-397 (C) COPYRIGHT International Business Machines Corp. 1994# All Rights Reserved# Licensed Materials - Property of IBM## US Government Users Restricted Rights - Use, duplication or# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.### NOTICE TO USERS OF THE SOURCE CODE EXAMPLES## INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOURCE CODE# EXAMPLES, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT# WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT# LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A# PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE# OF THE SOURCE CODE EXAMPLES, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS,# IS WITH YOU. SHOULD ANY PART OF THE SOURCE CODE EXAMPLES PROVE# DEFECTIVE, YOU (AND NOT IBM OR AN AUTHORIZED RISC System/6000* WORKSTATION# DEALER) ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR# CORRECTION.## * RISC System/6000 is a trademark of International Business Machines# Corporation.## /usr/lpp/cmvc/samples/commonFileCheckin## Programmer - ZAEPFEL##--------------------------------------------------------------------# set traceset +x; # make sure CMVC family variable is setif [ -z "$CMVC_FAMILY" ]then echo "The CMVC family must be set with the CMVC_FAMILY environment variable." exit 1;fi # make sure enough parameters have been givenif [ $# -le 2 ]then echo "\nusage: $0 filePathName releaseName defectNumber Remarks\n" echo "This shell script checks a CMVC part into all common Releases.\n"; exit 1;fi # save parameters so that remarks are $*PART=$1;RELEASE=$2;DEFECT=$3;shift 3;REMARK=$*; # CMVC Report to find all common release for this partReport -view FileView -raw -where "nuDropDate is null and \releaseName<>'$RELEASE' and \nuVersionId=(select nuVersionId from FileView where nuPathName='$PART' and \releaseName='$RELEASE')" > /tmp/cmvcchin$$; # what to do if there are no common releasesif [ ! -s /tmp/cmvcchin$$ ]then # ask user if they want to continue echo; echo "There are no common Releases for $PART."; echo; print -n 'Do you want to continue and check it in? (y/n): ' read ANSWER; # check part in if answer is yes if [ $ANSWER = 'y' ] || [ $ANSWER = 'Y' ] then echo $* | File -checkin $PART -release $RELEASE \ -feature $DEFECT -remarks -; fielse # display common releases echo; echo "You are about to check in $PART into the following releases:"; echo; echo 'CMVC Release|Pathname'; echo; echo $RELEASE'|'$PART; cut -f2,12 -d'|' /tmp/cmvcchin$$ # set variable with all common releases RELS=`cut -f2 -d'|' /tmp/cmvcchin$$`; # set variable to use in cmvc for all releases CRELS=\'$RELEASE\'; for NAME in $RELS do CRELS=$CRELS,\'$NAME\'; done # add input release to list of releases RELS=`echo $RELEASE $RELS`; # remove temp file holding all common releases rm /tmp/cmvcchin$$; # ask user if they want to continue echo; echo "CMVC Tracks will be created for Releases that do not already have them!" echo; print -n 'Do you want to continue? (y/n): ' read ANSWER; # check part in if answer is yes if [ $ANSWER = 'y' ] || [ $ANSWER = 'Y' ] then # find all tracks Report -view TrackView -raw -where "releaseName in ($CRELS) and \ defectName = '$DEFECT'" > /tmp/cmvcchin$$; # if tracks are found, determine what releases need tracks if [ -s /tmp/cmvcchin$$ ] then # set variable with all tracks TRACKS=`cut -f1 -d'|' /tmp/cmvcchin$$`; TRACKS=`echo $TRACKS`; # for each common release, test if it has a track for NAME in $RELS do RELFOUND=`echo $TRACKS | grep $NAME`; # do if release does not have track if [ -z "$RELFOUND" ] then echo creating a track for $NAME; # create a CMVC track Track -create -defect $DEFECT -release $NAME; fi done # remove temp file holding track report rm /tmp/cmvcchin$$; # create tracks for all common releases when none of them have tracks else for NAME in $RELS do echo create a track for $NAME; # create a CMVC track Track -create -defect $DEFECT -release $NAME; done fi; # check in part against all common releases echo $REMARK | File -checkin $PART -release $RELEASE -common $RELS \ -feature $DEFECT -remarks -; fifi exit;# end of file
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?