这是一个已删除问题的转载(应请求)。
什么是最好的ClearCase视图删除脚本?我在http://www.cmcrossroads.com/forums?func=view&id=44045&catid=31上找到了以下由Yossi Sidi编写的内容。
此脚本缺少的两个事项是删除CCRC视图中session.dat文件中的条目以及清理服务器视图存储和缓存文件目录。
手动步骤可以在此处找到:http://www-01.ibm.com/support/docview.wss?uid=swg21172246。
(译注:$'是Perl中一个特殊变量,表示匹配操作中匹配成功的字符串之后的部分。在代码中使用这个变量可能会导致问题)
什么是最好的ClearCase视图删除脚本?我在http://www.cmcrossroads.com/forums?func=view&id=44045&catid=31上找到了以下由Yossi Sidi编写的内容。
此脚本缺少的两个事项是删除CCRC视图中session.dat文件中的条目以及清理服务器视图存储和缓存文件目录。
手动步骤可以在此处找到:http://www-01.ibm.com/support/docview.wss?uid=swg21172246。
rmview.pl
==============
#
# rmview.pl
#
# This script is used to delete a view..
# ---------------------------------------------------
# Fetching the UUID of the view :
# Cleartool describe -long vob:vob_name (lists all views)
# -or-
# cleartool lsview -long <View_name>
# ------------------------------------------------------------------------
# Remove sequence:-
# Cleartool rmview -force -uuid <uuid> (from a VIEW contents directory)
# Cleartool unreg -view -uuid <uuid>
# Cleartool rmtag -view VIEW_NAME
#
# Arguments:
# view tag name :
#
# ASSUMED: You must be in a VOB with a view set when this tool
# is used.
#
# Author: Yossi Sidi
# email: yossis@corrigent.com
# URL: [url=http://www.corrigent.com" target="_blank]http://www.corrigent.com[/url]
# Date: Sep. 14, 2003
############################################################
# History: 14/10/03 : Created for Corrigent
############################################################
########################
######## MAIN ########----------------------------------------------------------------
########################
$DIV1="*************************************************************n";
$USAGE=""USAGE ccperl.exe $0 view tag name \n EXAMPLE: ccperl.exe $0 ""My_view"" "";
if ($#ARGV == 0)
{
$view_name = $ARGV[0];
}
else
{
`clearprompt yes_no -mask abort -default abort -pre -prompt $USAGE`;
exit 1;
}
select STDOUT;
$| = 1; # Do not buffer the STDOUT file so ccperl prog.pl >out.txt
# will have the correct sequence of report lines
printf ($DIV1);
printf ("View Propertiesn");
printf (" View Tag: $view_namen");
printf ($DIV1);
printf ("n");
$COMMAND = "cleartool lsview -l $view_name";
@dl = `"$COMMAND"`;
$view_uuid = "";
foreach $dl (@dl) {
chomp ($dl);
printf ("$dln");
if ( $dl =~ /^View uuid: / ) {
$view_uuid = $'; #' reset syntax highlighter
}
}
if ( $#dl > 0 ) {
# Cleartool rmview -force -all -uuid <uuid> (from a VIEW contents directory)
# Cleartool unreg -view -uuid <uuid>
# Cleartool rmtag -view VIEW_NAME
$rmview = "cleartool rmview -force -all -uuid $view_uuid";
$unreg = "cleartool unreg -view -uuid $view_uuid";
$rmtag = "cleartool rmtag -view $view_name";
printf ($DIV1);
printf ("Removing commandsn");
printf ($DIV1);
printf ("n");
printf ("n$rmview n");
@dl = `"$rmview"`;
printf ("n$unreg n");
@dl = `"$unreg"`;
printf ("n$rmtag n");
@dl = `"$rmtag"`;
}
exit 0;
有趣的是,在Perl的$'后,stackoverflow的颜色编码会出现问题。
(译注:$'是Perl中一个特殊变量,表示匹配操作中匹配成功的字符串之后的部分。在代码中使用这个变量可能会导致问题)