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

📄 mrclean.pl

📁 CMVC是IBM和许多跨国公司的缺陷管理工具。这里给出了很多在Linux下用KSH编写的使用CMVC命令的例子。这些例子来自于IBM内部的CMVC培训。
💻 PL
📖 第 1 页 / 共 2 页
字号:
    #  Get list of all outstanding changes    #  group by file, latest change first (= higher versionid) => desc    #  include the type in order clause.  If there is rename and delta    #  at same sid, the desc will put renames ahead of delta    #  Gather tracks from the changes for same pathname, version, type    #  When something differs or end of list, perform File -undo        #  Just worry about this release.  If its common to another dead    #  release, we'll get to it later.  If common to "live" release,    #  we want to leave it alone anyway.    print LOG "  Finding changes to undo.\n";    print     "  Finding changes to undo.\n";    $rptcmd = "Report -vi changeview -raw -where \"releasename='$rel'";    $rptcmd = $rptcmd . " and levelid=0 order by fileid asc, versionid desc, type desc\"";    open (REP, "$rptcmd|");    undef $oldpath;    undef $oldSID;    undef $oldtype;    while ($chgline=<REP>) {        chop $chgline;        ($rels,$defect,$lev,$SID,$path,$type) = split(/\|/, $chgline);        if ($path eq $oldpath & $SID eq $oldSID & $type eq $oldtype) {            $defect_names .= $defect . " ";        }        else {            if ($oldpath ne undef) {      print LOG "File -undo $oldpath -release $rel -force -defect $defect_names\n";      print     "File -undo $oldpath -release $rel -force -defect $defect_names\n";                `File -undo "$oldpath" -release $rel -force -defect $defect_names`;            }            $defect_names = $defect . " ";            $oldpath = $path;            $oldSID = $SID;            $oldtype = $type;        }    }    close (REP);        if ($oldpath ne undef) {      print LOG "File -undo $oldpath -release $rel -force -defect $defect_names\n";      print     "File -undo $oldpath -release $rel -force -defect $defect_names\n";        `File -undo "$oldpath" -release $rel -force -defect $defect_names`;    }        #  Find all the tracks and cancel them.    print LOG "  Finding tracks to cancel.\n";    print     "  Finding tracks to cancel.\n";   $rptcmd = "Report -vi trackview -raw -where \"releasename='$rel'";   $rptcmd = $rptcmd . " and state in ('approve','fix')\"";        open (REP, "$rptcmd|");    undef $defect_names;    while ($trkline=<REP>) {        chop $trkline;        ($rels,$defect,$ref,$st,$targ,$addd,$usrL,$usrN,$usrA,$act,$last,$prefix) = split(/\|/, $trkline);        $defect_names .= $defect . " ";        if ($prefix eq "f") {            $f_canned{$defect} = 1;        }        else {            $d_canned{$defect} = 1;        }    }    close (REP);    if ($defect_names ne undef) {        print LOG "    The tracks are $defect_names.\n";        print     "    The tracks are $defect_names.\n";        `Track -cancel -release $rel -defect $defect_names`;    }    else {        print LOG "    No such tracks were found.\n";        print     "    No such tracks were found.\n";    }    }if ($any_rel ne undef) {    #  Look at the defect/feature for each cancelled track.  If there are    #  no other tracks for the defect/feature, return it.    print LOG "\n  Finding defects for which all tracks were deleted.\n";    print     "\n  Finding defects for which all tracks were deleted.\n";    undef $d_to_can;    undef $d_to_verify;    foreach $defect (keys %d_canned) {        undef $something_left;        open (REP,        "Report -vi trackview -raw -where \"defectname='$defect'\"|");        while ($trkline=<REP>) {            $something_left = 1;            last;        }        close (REP);        if ($something_left eq undef) {            $d_to_can .= $defect . " ";        }        else {            $rptcmd = "Report -vi trackview -raw -where \"defectname='$defect'";            $rptcmd = $rptcmd . " and state='complete'";            $rptcmd = $rptcmd . " and exists (select id from defects D where name='$defect'";            $rptcmd = $rptcmd . " and state='working'";            $rptcmd = $rptcmd . " and exists (select id from Components";            $rptcmd = $rptcmd . " where id=D.compId and defectVerify='yes'))";            $rptcmd = $rptcmd . " and not exists (select id from trackview where";            $rptcmd = $rptcmd . " defectname='$defect' and state<>'complete')\"";            open (REP, "$rptcmd|");            while ($trkline=<REP>) {                $d_to_verify .= $defect . " ";                last;            }            close (REP);        }    }    if ($d_to_can ne undef) {        undef $ret_answer;        open (REP,        "Report -general config -select name -where \"type='answerReturn' and name is not null order by dflt desc\"|");                 while ($ansline=<REP>) {            chop $ansline;            $ret_answer = "-answer " . $ansline;            last;        }            close (REP);        `Defect -return $d_to_can $ret_answer -remarks \" This defect is being returned because all tracks for it were deleted     by the dead release cleanup process.  If this defect is applicable to an     active release, please reopen it.  Otherwise, cancel it.\"`;        print LOG "\n  Defect -return $d_to_can\n";    }    if ($d_to_verify ne undef) {        `Defect -verify $d_to_verify -remarks \" This defect is being moved to the verify state     by the dead release cleanup process.\"`;    }    print LOG "\n  Finding features for which all tracks were deleted.\n";    print     "\n  Finding features for which all tracks were deleted.\n";    undef $d_to_can;    undef $d_to_verify;    foreach $defect (keys %f_canned) {        undef $something_left;        open (REP,        "Report -vi trackview -raw -where \"defectname='$defect'\"|");        while ($trkline=<REP>) {            $something_left = 1;            last;        }        close (REP);        if ($something_left eq undef) {            $d_to_can .= $defect . " ";        }	else {            $rptcmd = "Report -vi trackview -raw -where \"defectname='$defect'";            $rptcmd = $rptcmd . " and state='complete'";            $rptcmd = $rptcmd . " and exists (select id from defects D where name='$defect'";            $rptcmd = $rptcmd . " and state='working'";            $rptcmd = $rptcmd . " and exists (select id from Components";            $rptcmd = $rptcmd . " where id=D.compId and featureVerify='yes'))";            $rptcmd = $rptcmd . " and not exists (select id from trackview where";            $rptcmd = $rptcmd . " defectname='$defect' and state<>'complete')\"";            open (REP, "$rptcmd|");            while ($trkline=<REP>) {                $d_to_verify .= $defect . " ";                last;            }            close (REP);        }    }    if ($d_to_can ne undef) {        undef $ret_answer;        open (REP,        "Report -general config -select name -where \"type='featureReturn' and name is not null order by dflt desc\"|");                 while ($ansline=<REP>) {            chop $ansline;            $ret_answer = "-answer " . $ansline;            last;        }            close (REP);        `Feature -return $d_to_can $ret_answer -remarks \" This feature is being returned because all tracks for it were deleted     by the dead release cleanup process.  If this feature is applicable to an     active release, please reopen it.  Otherwise, cancel it.\"`;        print LOG "\n  Feature -return $d_to_can\n";    }    if ($d_to_verify ne undef) {        `Feature -verify $d_to_verify -remarks \" This feature is being moved to the verify state     by the dead release cleanup process.\"`;    }}print LOG "\nCompleted.\n";print     "\nCompleted.\n";exit 0;

⌨️ 快捷键说明

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