⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 extractlevelusingmapfile

📁 CMVC是IBM和许多跨国公司的缺陷管理工具。这里给出了很多在Linux下用KSH编写的使用CMVC命令的例子。这些例子来自于IBM内部的CMVC培训。
💻
字号:
#!/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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -