?? extractlevelusingmapfile
字號(hào):
#!/usr/bin/ksh # Name: extractLevelUsingMapFile# # Purpose: To extract a committed Level using the Map File in the server.# This will use a File extract for each file involved, and will not# use the actual level extract code.# # IMPLEMENTATION NOTES: # This sample needs further improvement for handling input parameters# and error messages.## WARNING: This is AS-IS code.## EDITORIAL Notes:# 1) The ChangeView will return duplicate fileName/SID combinations # if multiple tracks were specified upon checkin of a file so you # may need to sort the output from Report -view ChangeView before # iusing "awk". It is possible that the following will work but may# not be too eloquent:# # Report -view ChangeView -where "fileId=$fileId and \ # versionId=$versionId and release Name='$RELEASE' " -raw |# sed "s/\|/:/g" | sort -u -k4,5 -t: | # awk -F":" ' {system("/usr/lpp/cmvc/bin/File -extract " $5 \ # " -relative /yourAFSDir -release " $1 " -version " $4)} ' # # 2) For destroyed files, the File -extract will not work since the# File entry in the database is destroyed. Therefore the only # thing you could do is issue a native SCCS command to get the # file from the CMVC server. This is NOT recommended since you # do not really want your users issuing native SCCS commands from the # CMVC server. # # The following could be made as input parameters export RELEASE=r1export LEVEL=l1 export mapsFile=$HOME/maps/$RELEASE/$LEVEL while read line do words=`print $line | wc -w | awk '{print $1}` if [ $words -eq 4 ] then # Process the pathNames that do not have blanks. pathName=`print $line | cut -d' ' -f1 ` # field 1 is pathName versionId=`print $line | cut -d' ' -f2 ` # field 2 is version id fileId=`print $line | cut -d' ' -f3 ` # field 3 is file id changeType=`print $line | cut -d' ' -f4 ` # field 4 is changeType else # Process the pathNames that do have blanks. changeType=`print ${line} | awk '{print ($(NF-0)) }` fileId=`print ${line} | awk '{print ($(NF-1)) }` versionId=`print ${line} | awk '{print ($(NF-2)) }` pathName=`print "$line" | sed "s/ ${versionId} ${fileId} ${changeType}//"` fi Report -view ChangeView -where "fileId=$fileId and \ versionId=$versionId and releaseName='$RELEASE' " -raw | awk -F"|" '{system("/usr/lpp/cmvc/bin/File -extract " $5 \ " -relative /yourAFSDir -release " $1 " -version " $4)} ' if [ $? -ne 0 ] then echo "This may have failed because it is a destroyed file" echo "Error found in Report -view ChangeView or File -extract" terminate fi done < $mapsFile exit# end of file
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -