Commit fce29af0 authored by hrchilds's avatar hrchilds

Move elements from clearcase_bin to svn_bin.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@3194 18c085ea-50e0-402c-830e-de6fd14e8384
parent befc1bc3
NOT_DISTRIB= windowsprojects.tar
#!/bin/sh
ssh -x visit@hoth "/usr/atria/bin/cleartool startview visit_VOBowner_main ; /view/visit_VOBowner_main/data_vobs/VisIt/clearcase_bin/lockmain.script `whoami` $* ; /usr/atria/bin/cleartool endview visit_VOBowner_main"
#!/bin/env perl
# This script locks the mainline branch to the current user so that no one else
# can modify the mainline branch. This is useful for doing merges.
#
# Modifications:
# Mark C. Miller, Tue Jun 20 09:01:19 PDT 2006
# Added support for locking Silo vob
#
# Mark C. Miller, Thu Feb 8 17:35:43 PST 2007
# Made a 'no' answer to poll for lock exit with 13, not 1
# to distinguish this exit status from other 'normal' errors
#
$projnm = "visit";
$vobnm = "VisIt";
$user = shift;
if ($user eq "")
{
print STDERR "I don't know who you are!\n";
exit(1);
}
# Print out some help
sub help
{
print <<"EOF";
USAGE: lockmain [-silo] [-ls] [-nospin] [-nc] [-c comment] [-help]
-silo Lock the silo vob
-ls Lists any lock on the main branch.
-help Prints this help message.
-nospin Doesn't attempt to poll for the lock.
-nc Does not request a comment.
-c comment Specifies a comment on the command line
EOF
}
# Process the options including error checking on the options.
require "newgetopt.pl";
&NGetOpt("silo","ls","help","nospin","nc","c:s");
if ($opt_help)
{
&help();
exit(0);
}
if ($opt_nc && $opt_c)
{
print "Illegal to specify -nc and -c options at the same time.\n";
&help();
exit(0);
}
if ($opt_ls)
{
$opt_list = 1;
}
$projnm = "visit";
$vobnm = "VisIt";
$silo_opt = "";
if ($opt_silo)
{
$projnm = "silo";
$vobnm = "Silo";
$silo_opt = "-silo";
}
# The options are alright. Now check to see who we are.
# We have to be visit.
$cleartool = "/usr/atria/bin/cleartool";
$who = `whoami`;
chop($who);
# We must be visit to have this stuff work.
if ($who ne "visit")
{
# We're not visit, so either we're not setuid or we didn't use ssh.
print STDERR <<"EOF";
This script is not set up correctly. Contact the VOB administrator.
EOF
exit(-1);
}
# Make sure that we have a path into the VOB.
print STDERR "Checking lock status...\n";
$view = `$cleartool lsview '${projnm}_VOBowner_main'`;
if ($view !~ /^\*/)
{
system("$cleartool endview ${projnm}_VOBowner_main");
$status = system("$cleartool startview ${projnm}_VOBowner_main");
$status /= 256;
die "Unable to start the ${projnm}_VOBowner_main view.\n" if ($status != 0);
}
$status = chdir("/view/${projnm}_VOBowner_main/data_vobs/$vobnm");
die "Unable to chdir to the $vobnm VOB ($status).\n" if ($status != 1);
# Get the status of any lock that exists.
$lock_owner = "";
$users = "";
$users = `$cleartool lslock -fmt "%c" brtype:main@/data_vobs/$vobnm`;
chop($users);
($lock_owner) = ($users =~ /^Locked except for users: (\w*)/);
$MULTILINE_MATCHING = 1;
$comment = $users;
$comment =~ s/^Locked except for users:.*//;
$comment =~ s/^\s*//;
# If we're just listing, output appropriate information.
if ($opt_list)
{
if ($lock_owner =~ /^\s*$/)
{
print STDERR "The \"main\" branch is not locked.\n";
exit(0);
} else
{
print STDERR "The \"main\" branch is locked by $lock_owner.\n";
print STDERR "Comment for lock:\n$comment\n";
exit(1);
}
}
# Attempt to lock the mainline branch.
# If the lock owner is non-null, then it's already locked.
if ($lock_owner !~ /^\s*$/)
{
if ($lock_owner eq $user)
{
print STDERR <<"EOF";
You already have the \"main\" branch locked. Your comment:
$comment.
EOF
exit(2);
} else
{
print STDERR <<"EOF";
The "main" branch is already locked by $lock_owner. You
may not modify the "main" branch until $lock_owner unlocks
it. If you know for sure that $lock_owner is done with the
"main" branch, you may try to remove the lock by calling
"unlockmain -notme" and then locking it yourself.
The comment for ${lock_owner}'s lock is:
$comment
EOF
if ($opt_nospin)
{
exit(1);
} else {
print STDERR "Would you like to poll for the lock? [y/(n)]: ";
$query = <STDIN>;
if ($query =~ /^y/i)
{
exec("/view/visit_VOBowner_main/data_vobs/VisIt/clearcase_bin/spinlock main $user $silo_opt");
} else {
exit(13);
}
}
}
}
# Everything's fine, let's try and lock the branch.
$date = `date`;
$comment = "";
if ($opt_c)
{
$comment .= "$opt_c" . "\n";
}
if (!$opt_nc && !$opt_c)
{
print STDERR "Comment for the lock on the main branch: (\".\" or ^D ends comment)\n";
while(<STDIN>)
{
last if (/^\.$/);
$comment .= $_;
}
}
$comment = $date . $comment;
# Save the comment in a temp file since it might be long and/or contain
# shell meta characters.
open (TMP, "> /tmp/lock_main.$$") || die "cannot save comment to a temp file";
print TMP $comment;
close (TMP);
$status = system("$cleartool lock -cfile /tmp/lock_main.$$ -nusers $user,visit brtype:main@/data_vobs/$vobnm");
system "/bin/rm","-f","/tmp/lock_main.$$";
$status /= 256;
if ($status != 0)
{
print STDERR "An error occurred while locking branch type \"main\": $!\n";
exit($status);
} else
{
# Store off the name of the user in the "public_html/modifiers"
# file for use by the testing scripts.
print STDERR "Branch \"main\" locked successfully\n";
if (!$opt_silo)
{
open(CH,">>/home/visit/public_html/modifiers") || die "Can't append to the \"modifiers\" file.";
print CH "$user\n";
close(CH);
}
}
exit(4);
#!/bin/sh
ssh -x visit@hoth "/usr/atria/bin/cleartool startview visit_VOBowner_main ; /view/visit_VOBowner_main/data_vobs/VisIt/clearcase_bin/lockrc.script `whoami` $* ; /usr/atria/bin/cleartool endview visit_VOBowner_main"
#!/bin/env perl
# This script locks the RC branch to the current user so that no one else
# can modify the RC branch. This is useful for doing merges.
#
# Modifications:
#
# Mark C. Miller, Thu Feb 8 17:35:43 PST 2007
# Made a 'no' answer to poll for lock exit with 13, not 1
# to distinguish this exit status from other 'normal' errors
#
$projnm = "visit";
$user = shift;
if ($user eq "")
{
print STDERR "I don't know who you are!\n";
exit(1);
}
# Print out some help
sub help
{
print <<"EOF";
USAGE: lockrc [-silo] [-ls] [-nospin] [-nc] [-c comment] [-help]
-silo Lock the Silo rc
-ls Lists any lock on the rc branch.
-help Prints this help message.
-nospin Doesn't attempt to poll for the lock.
-nc Does not request a comment.
-c comment Specifies a comment on the command line
EOF
}
# Process the options including error checking on the options.
require "newgetopt.pl";
&NGetOpt("ls","help","nospin","nc","c:s");
if ($opt_help)
{
&help();
exit(0);
}
if ($opt_nc && $opt_c)
{
print "Illegal to specify -nc and -c options at the same time.\n";
&help();
exit(0);
}
if ($opt_ls)
{
$opt_list = 1;
}
$projnm = "visit";
$vobnm = "VisIt";
$silo_opt = "";
if ($opt_silo)
{
$projnm = "silo";
$vobnm = "Silo";
$silo_opt = "-silo";
}
# The options are alright. Now check to see who we are.
# We have to be visit.
$cleartool = "/usr/atria/bin/cleartool";
$who = `whoami`;
chop($who);
# We must be visit to have this stuff work.
if ($who ne "visit")
{
# We're not visit, so either we're not setuid or we didn't use ssh.
print STDERR <<"EOF";
This script is not set up correctly. Contact the VOB administrator.
EOF
exit(-1);
}
# Make sure that we have a path into the VOB.
print STDERR "Checking lock status...\n";
$view = `$cleartool lsview '${projnm}_VOBowner_rc'`;
if ($view !~ /^\*/)
{
system("$cleartool endview ${projnm}_VOBowner_rc");
$status = system("$cleartool startview ${projnm}_VOBowner_rc");
$status /= 256;
die "Unable to start the ${projnm}_VOBowner_rc view.\n" if ($status != 0);
}
$status = chdir("/view/${projnm}_VOBowner_rc/data_vobs/$vobnm");
die "Unable to chdir to the $vobnm VOB ($status).\n" if ($status != 1);
# Get the branch name of the release candidate
chomp($branchline = `$cleartool catcs | grep 'branch:'`);
($branchname = $branchline) =~ s/^.*branch:\s*(.*)$/$1/;
# Get the status of any lock that exists.
$lock_owner = "";
$users = "";
$users = `$cleartool lslock -fmt "%c" brtype:$branchname@/data_vobs/$vobnm`;
chop($users);
if ($users eq "Locked for all users.")
{
print STDERR "Branch \"$branchname\" is locked for all users.\n";
exit(1);
}
($lock_owner) = ($users =~ /^Locked except for users: (\w*)/);
$MULTILINE_MATCHING = 1;
$comment = $users;
$comment =~ s/^Locked except for users:.*//;
$comment =~ s/^\s*//;
# If we're just listing, output appropriate information.
if ($opt_list)
{
if ($lock_owner =~ /^\s*$/)
{
print STDERR "The \"$branchname\" branch is not locked.\n";
exit(0);
} else
{
print STDERR "The \"$branchname\" branch is locked by $lock_owner.\n";
print STDERR "Comment for lock:\n$comment\n";
exit(1);
}
}
# Attempt to lock the RC branch.
# If the lock owner is non-null, then it's already locked.
if ($lock_owner !~ /^\s*$/)
{
if ($lock_owner eq $user)
{
print STDERR <<"EOF";
You already have the \"$branchname\" branch locked. Your comment:
$comment.
EOF
exit(2);
} else
{
print STDERR <<"EOF";
The "$branchname" branch is already locked by $lock_owner. You
may not modify the "$branchname" branch until $lock_owner unlocks
it. If you know for sure that $lock_owner is done with the
"$branchname" branch, you may try to remove the lock by calling
"unlockrc -notme" and then locking it yourself.
The comment for ${lock_owner}'s lock is:
$comment
EOF
if ($opt_nospin)
{
exit(1);
} else {
print STDERR "Would you like to poll for the lock? [y/(n)]: ";
$query = <STDIN>;
if ($query =~ /^y/i)
{
exec("/view/visit_VOBowner_main/data_vobs/VisIt/clearcase_bin/spinlock $branchname $user $silo_opt");
} else {
exit(13);
}
}
}
}
# Everything's fine, let's try and lock the branch.
$date = `date`;
$comment = "";
if ($opt_c)
{
$comment .= "$opt_c" . "\n";
}
if (!$opt_nc && !$opt_c)
{
print STDERR "Comment for the lock on the $branchname branch: (\".\" or ^D ends comment)\n";
while(<STDIN>)
{
last if (/^\.$/);
$comment .= $_;
}
}
$comment = $date . $comment;
# Save the comment in a temp file since it might be long and/or contain
# shell meta characters.
open (TMP, "> /tmp/lock_rc.$$") || die "cannot save comment to a temp file";
print TMP $comment;
close (TMP);
$status = system("$cleartool lock -cfile /tmp/lock_rc.$$ -nusers $user,visit brtype:$branchname@/data_vobs/$vobnm");
system "/bin/rm","-f","/tmp/lock_rc.$$";
$status /= 256;
if ($status != 0)
{
print STDERR "An error occurred while locking branch type \"$branchname\": $!\n";
exit($status);
} else
{
# Store off the name of the user in the "public_html/modifiers"
# file for use by the testing scripts.
print STDERR "Branch \"$branchname\" locked successfully\n";
if (!$opt_silo)
{
open(CH,">>/home/visit/public_html/modifiers") || die "Can't append to the \"modifiers\" file.";
print CH "$user\n";
close(CH);
}
}
exit(4);
#!/bin/csh -f
###############################################################################
#
# Script: makehelp
#
# Purpose: This script creates small html documents from the User's Manual
# and also creates an XML file called visit.helpml to index the
# html documents for the help viewer.
#
# Author: Brad Whitlock
# Date: Thurs, July 11 2002
#
# Modifications:
# Brad Whitlock, Fri Aug 30 14:42:09 PST 2002
# I added code to add fmbatch to the path if we're on sunspot/sunburn and
# rebuild the mif2help conversion program. I also added the new Help chapter.
#
# Brad Whitlock, Fri Jun 18 10:21:12 PDT 2004
# I added a new chapter to the manual and some that were missing.
#
# Brad Whitlock, Fri Oct 7 13:26:46 PST 2005
# I added an argument that converts the files to MIF but does not convert
# the MIF files into HTML.
#
# Mark C. Miller, Mon Jun 18 15:18:48 PDT 2007
# Added suport to run from a host that doesn't have 'fmbatch' but will
# copy files to the 'fmHost' (default sunpost.llnl.gov) host which can
# be specified on the command line
#
###############################################################################
set MIFOnly = "FALSE"
set Help = "FALSE"
set fmHost = ""
#
# Parse the argument list.
#
while ($#argv >= 1)
switch ($1)
case -mifonly:
set MIFOnly = TRUE
breaksw
case -mifhost:
set fmHost = "$2"
shift
breaksw
case -h:
case -help:
set Help = TRUE
breaksw
default:
echo " "
echo ">>>>>>>>>> Illegal option $1 <<<<<<<<<<"
echo " "
breaksw
endsw
shift
end
if ($Help == TRUE) then
echo "Usage: makehelp [-mifonly] [-h | -help]"
echo ""
echo " -mifonly Just convert the frame documents to MIF files."
echo " -mifhost Specify the host where fmbatch exists [sunspot.llnl.gov]."
echo " -h Print this message."
exit (1)
endif
# Keep this until we get our sysadmins to add fmbatch to the path.
if(`hostname` == "sunspot.llnl.gov" || `hostname` == "sunburn.llnl.gov") then
set path = (/usr/local/framemaker/bin $path)
set fmHost = ""
set haveFrame = `which fmbatch | grep no`
else
if ("$fmHost" == "") then
set fmHost = "sunspot.llnl.gov"
endif
set haveFrame = `ssh -x $fmHost "set path = (/usr/local/framemaker/bin $path) ; which fmbatch | grep no"`
endif
# Make sure that we have Frame Maker's fmbatch program in our path.
if("$haveFrame" != "") then
echo "ERROR: fmbatch not found! It is required to convert the User manual"
echo " into MIF files which are then turned into help HTML files"
echo " Try running this script on hyper."
exit
endif
# Init some variables
set inputFiles = "Intro WorkingWithFiles Plots Operators SavingPrinting VisualizationWindows Subsetting Quantitative MakingItPretty Animation InteractiveTools MultipleDatabaseAndWindows RemoteVisualization Preferences Help"
set inputPath = "/data_vobs/VisIt/docs/UserManual"
set outputPath = "/tmp/frameconvert"
set helpPath = "/data_vobs/VisIt/help"
set fmCommands = "$outputPath/fmcommands"
set startDir = `pwd`
# First make sure the mif2help tool is built.
cd $helpPath
# If there is no Makefile, run configure.
if(!(-e Makefile)) then
cd ..
echo "No Makefile was found. We need to configure\!"
if(-e config.cache) then
rm -f config.cache
endif
configure
cd $helpPath
else
# Remove the current version of the mif2help program in case it is old.
make clean
endif
# Rebuild the mif2help tool to ensure that it is up to date.
make
# Create a temp directory if one does not exist.
if(!(-e $outputPath)) then
mkdir $outputPath
endif
if ("$fmHost" != "") then
ssh -x $fmHost "mkdir -p $outputPath"
endif
# Create MIF files for each of the input frame maker files.
foreach input ($inputFiles)
if(-e $fmCommands) then
rm -f $fmCommands
endif
# Copy the frame maker file to the temp directory
set srcFile = "$outputPath/$input.fm"
cp -f $inputPath/$input.fm $srcFile
chmod 600 $srcFile
# Create the frame maker command file
set mifName = "$outputPath/$input.mif"
echo "Open $srcFile\
SaveAs m $srcFile $mifName\
Quit" > $fmCommands
# Convert the file to MIF.
if ("$fmHost" != "") then
scp $inputPath/$input.fm ${fmHost}:$srcFile
scp $fmCommands ${fmHost}:$fmCommands
ssh -x $fmHost "set path = (/usr/local/framemaker/bin $path) ; chmod 600 $srcFile $fmCommands ; cd $outputPath ; fmbatch $fmCommands > /dev/null"
scp ${fmHost}:$mifName $mifName
else
fmbatch $fmCommands > /dev/null
endif
if(!(-e $mifName)) then
echo "Framemaker could not convert $input.fm to a MIF file."
endif
end
# If we're doing more than converting then run mif2help.
if ("$MIFOnly" == "FALSE") then
# If the tool is built then proceed.
if(-e $helpPath/mif2help) then
# Create a list of MIF files to pass to mif2help.
set mifargs = " "
foreach input ($inputFiles)
set mifName = "$outputPath/$input.mif"
set tmpvar = "$mifargs $mifName"
set mifargs = "$tmpvar"
end
$helpPath/mif2help $mifargs
else
echo "The mif2help tool failed to build."
endif
# Remove the temp directory
rm -rf $outputPath
if ("$fmHost" != "") then
ssh -x $fmHost "rm -rf $outputPath"
endif
endif
# Go back to the starting directory.
cd $startDir
#!/usr/bin/env perl
$vobnm = "VisIt";
$nargs = scalar(@ARGV);
if ($nargs == 1)
{
$branch = shift(@ARGV);
} elsif ($nargs == 2)
{
$branch = shift(@ARGV);
$vobnm = "Silo";
} else {
print STDERR "Invalid number of arguments. Please specify one branch and, optionally '-silo'.\n";
exit(1);
}
if ($branch eq "main")
{
system("cleartool findmerge /data_vobs/$vobnm -fver /main -merge -gmerge -whynot");
} else {
system("cleartool findmerge /data_vobs/$vobnm -fver /main/$branch -merge -gmerge -whynot");
}
#!/bin/env perl
# Mark C. Miller, Mon Jun 19 19:25:02 PDT 2006
# Added support for working with silo vob
use Env;
chomp($prog = `basename $0`);
$projnm = "visit";
$vobnm = "VisIt";
if ($prog =~ /silo/)
{
$projnm = "silo";
$vobnm = "Silo";
}
$usage = <<"EOF";
USAGE: $prog tag
$prog branch tag
$prog coll branch tag
Arguments:
tag The base name the view tag to create. It will have "${projnm}_" and
your name prepended. If you do not wish to use your login name, set
the environment variable VIEW_NAME.
branch
The name of the branch type to create.
coll The name of the collaboration branch to work on.
EOF
$who = $USER;
$tag = "";
$brtype = undef;
$coll = undef;
sub CheckArguments
{
$nargs = scalar(@ARGV);
if ($nargs == 0)
{
print STDERR "$usage\n";
exit(0);
}
if ($nargs == 1)
{
$tag = shift(@ARGV);
} elsif ($nargs == 2)
{
$brtype = shift(@ARGV);
$tag = shift(@ARGV);
} elsif ($nargs == 3)
{
$coll = shift(@ARGV);
$brtype = shift(@ARGV);
$tag = shift(@ARGV);
} else {
print STDERR "ERROR: Invalid number of arguments.\n";
print STDERR "\n$usage\n";
exit(-1);
}
if (defined($brtype) && ($brtype =~ /\s/))
{
print STDERR <<"EOF";
ERROR: The branch type "$brtype" contains whitespace.
ERROR: This is not allowed.
EOF
exit(-1);
}
if ($tag =~ /\s/)
{
print STDERR <<"EOF";
ERROR: The view tag "$tag" contains whitespace.
ERROR: This is not allowed.
EOF
exit(-1);
}
}
sub CreateVariables()