(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: 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
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)
See Question&Answers more detail:os