#perl -w use strict; my $view; my $labelold; my $labelnew; my $ab; my $ba; my $element; my $rc; my $path; my $path2; my $input; my $comment; my @VOBs; my @lijst; #system("cls"); print "\nThis script will apply a label to all objects of another label."; print "\nplease enter the name of the active view (e.g.: u12345-1): "; chomp ($view = ); while(){ print "\nEnter the name of a VOB you want to access (e.g.: PowerCenter, PowerCenter_s), press Enter when finished:"; chomp ($ab = ); unless($ab){last;} push(@VOBs, $ab); } print "\nGive the name of the old label (e.g.: DXOPRJ0-1.0.0): "; chomp($labelold = ); print "\nGive the name of the new label (e.g.: DXOPRJ0-1.0.1): "; chomp($labelnew = ); print "\n Give the comment for the new label: "; chomp($comment =); $path = "u:\\$view\\"; chdir($path); foreach $element(@VOBs){ $path2 = $path . "\\$element"; chdir($path2); $ab = "cleartool mklbtype -c \"$comment\" $labelnew"; $rc = system "$ab"; while($rc!=0){ $rc = 0; print "\nlabel $labelnew already existed! Do you want to replace it(y\/n)?"; chomp($input = ); unless($input eq 'n'||$input eq 'no'||$input eq 'N'||$input eq 'NO'){ $ba = "cleartool rmtype –rmall lbtype:$labelnew"; #121#print "$ba"; $rc = system("$ba"); if($rc!=0){print "\ndeletion of CC label failed!";} $rc = system "$ab"; } } chdir($path); $ab = "cleartool find $element -version \"lbtype($labelold)\" -exec \"cleartool mklabel -replace $labelnew %CLEARCASE_XPN%\""; $rc = system "$ab"; if($rc!=0){ die "\nan error occured..."; } else{ print "\nlabelling $element succesfull!";} } #### #perl -w use strict; print "cleartool rmtype -rmall lbtype:LABEL";