问题描述
(这是对已删除问题的转发)(应要求提供)
最佳的ClearCase View删除脚本是什么?我在 http://www.cmcrossroads.com/上找到了以下内容下方的Yossi Sidi撰写的forums?func = view& id = 44045& catid = 31
此脚本缺少的两件事是删除session.dat文件中CCRC视图的条目以及清理服务器视图存储和缓存的文件目录.
可以在此处找到手动步骤: 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: [email protected]
# 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的$'.... mini bug之后,stackoverflow colorcoding变得疯狂了)
我提到了一个有点冗长的脚本,但是该脚本不会删除任何本地存储,也不会清理CCRC会话.
> nuke_view.pl
:您可以使用它从工作站中删除所有视图(可能不再可用)
cleartool lsview -host myHostname -quick | xargs ccperl nuke_view.pl
-quick
选项对于快速获取给定工作站的视图列表非常重要.
## This script should be used to cleanup a view when 'ct rmview' will not
## work (such as when the viewstore directory has been deleted.
##
## Note: The view storage directory will have to manually deleted if it still exists.
use strict;
#sub NukeView();
#sub DoIt();
foreach(@ARGV) {
NukeView($_);
}
##############################################################
sub NukeView {
my $view2del = $_[0];
print "Processing $view2del...\n";
my @lines = `cleartool lsview -l $view2del`;
my $tag;
my $uuid;
foreach(@lines) {
chomp;
$tag = $1 if /^Tag: (\S+)/;
$uuid = $1 if /^View uuid: (\S+)/;
s/^/\t/;
print "$_\n";
}
if ( $tag eq '' or $uuid eq '' ) {
print "Error! $view2del: unable to get tag and/or uuid\n";
return 0;
}
my $err_count = 0;
print "\tremoving tag...\n";
my $cmd = "cleartool rmtag -view $tag";
$err_count += 1 if DoIt($cmd);
print "\tunregistering view storage...\n";
$cmd = "cleartool unreg -view -uuid $uuid";
$err_count += 1 if DoIt($cmd);
print "\tremoving view references...\n";
$cmd = "cleartool rmview -force -avobs -uuid $uuid";
$err_count += 1 if DoIt($cmd);
if ( $err_count == 0 ) {
print "Success! removed view $view2del\n";
}
else {
print "Error! errors occured while removing $view2del\n";
}
}
#############################################
sub DoIt {
my $ret = system($_[0]) / 256;
print "Error! cmd failed: $_[0]\n" if $ret != 0;
return $ret;
}
此 IBM技术说明:
注意:对于ClearCase 7.1.1.1或7.1.1.2,由于 APAR PM03334 :session.dat不再需要清除.
删除视图存储和CCWeb服务器上存储的缓存文件.
C:\Documents and Settings\<user-name>\.ccase_wvreg
(This is a repost of a deleted question) (on request)
What is the best ClearCase View deletion Script? I found the following on http://www.cmcrossroads.com/forums?func=view&id=44045&catid=31 written by Yossi Sidi below
The 2 things this script misses are the deletion of the entries in the session.dat file for CCRC views and the cleaning of server view storage and cached file directories.
The manual steps can be found here: 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: [email protected]
# 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;
(hmmm... interesting here is that the stackoverflow colorcoding goes wild after Perl's $' .... mini bug)
I mentioned a script a little bit verbose, but which won't remove any local storage and won't either clean the CCRC session.dat:
nuke_view.pl
: you can use it to remove all views from a workstation (which may not be available anymore)
cleartool lsview -host myHostname -quick | xargs ccperl nuke_view.pl
The -quick
option is very important to quickly get the list of views for a given workstation.
## This script should be used to cleanup a view when 'ct rmview' will not
## work (such as when the viewstore directory has been deleted.
##
## Note: The view storage directory will have to manually deleted if it still exists.
use strict;
#sub NukeView();
#sub DoIt();
foreach(@ARGV) {
NukeView($_);
}
##############################################################
sub NukeView {
my $view2del = $_[0];
print "Processing $view2del...\n";
my @lines = `cleartool lsview -l $view2del`;
my $tag;
my $uuid;
foreach(@lines) {
chomp;
$tag = $1 if /^Tag: (\S+)/;
$uuid = $1 if /^View uuid: (\S+)/;
s/^/\t/;
print "$_\n";
}
if ( $tag eq '' or $uuid eq '' ) {
print "Error! $view2del: unable to get tag and/or uuid\n";
return 0;
}
my $err_count = 0;
print "\tremoving tag...\n";
my $cmd = "cleartool rmtag -view $tag";
$err_count += 1 if DoIt($cmd);
print "\tunregistering view storage...\n";
$cmd = "cleartool unreg -view -uuid $uuid";
$err_count += 1 if DoIt($cmd);
print "\tremoving view references...\n";
$cmd = "cleartool rmview -force -avobs -uuid $uuid";
$err_count += 1 if DoIt($cmd);
if ( $err_count == 0 ) {
print "Success! removed view $view2del\n";
}
else {
print "Error! errors occured while removing $view2del\n";
}
}
#############################################
sub DoIt {
my $ret = system($_[0]) / 256;
print "Error! cmd failed: $_[0]\n" if $ret != 0;
return $ret;
}
The extra steps needed for removing CCWeb Views are described in this IBM technote:
Note: For ClearCase 7.1.1.1 or 7.1.1.2 the session.dat file is no longer generated from ClearCase 7.1.1.1 as a result of APAR PM03334: session.dat no longer need to be cleaned.
Remove the view storage and cached files stored on CCWeb server.
C:\Documents and Settings\<user-name>\.ccase_wvreg
这篇关于删除ClearCase Views脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!