ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/scripts/cms-scram-install.pl
Revision: 1.3
Committed: Mon Nov 11 16:40:16 2002 UTC (22 years, 6 months ago) by sashby
Content type: application/x-perl
Branch: MAIN
CVS Tags: V1_pre0, HEAD
Branch point for: SCRAM_V1_BRANCH
Changes since 1.2: +0 -0 lines
State: FILE REMOVED
Error occurred while calculating annotation data.
Log Message:
Removed cms-scram-install.pl

File Contents

# Content
1 #!/usr/bin/env perl
2 #===========================================================================#
3 # NAME: cms-scram-install.pl #
4 #===========================================================================#
5 # #
6 # DATE: Wed Jan 23 16:02:38 2002 #
7 # #
8 # AUTHOR: Shaun Ashby #
9 # #
10 # MOD LOG: #
11 # #
12 # #
13 #===========================================================================#
14 # DESCRIPTION: A simple script to install and set links for a new #
15 # version of scram #
16 #===========================================================================#
17
18 use strict;
19
20 # Some local configuration stuff:
21 #my $CMSRELDIR="/afs/cern.ch/cms/Releases/";
22 my $CMSRELDIR="$ENV{HOME}/w1/work/CMS/Projects/";
23 # Check for an argument (a version to install):
24 my $VERSIONTOINSTALL=shift;
25 chomp($VERSIONTOINSTALL);
26
27 do
28 {
29 &usage();
30 exit (1);
31 } if (! defined $VERSIONTOINSTALL);
32
33 ##################################################################
34
35 print "Dir: ",$CMSRELDIR."SCRAM/","\n";
36
37 if ( -d $CMSRELDIR."SCRAM/".$VERSIONTOINSTALL)
38 {
39 chdir($CMSRELDIR."SCRAM/");
40 # OK, so this version exists (has been checked out of the repository):
41 if ( -l $CMSRELDIR."SCRAM/current" )
42 {
43 print "Updating link \"current\" for SCRAM version $VERSIONTOINSTALL","\n";
44 system("rm -f ".$CMSRELDIR."SCRAM/current","ln -s $VERSIONTOINSTALL current");
45 }
46 if ( -l $CMSRELDIR."SCRAM/recommended" )
47 {
48 print "Updating link \"recommended\" for SCRAM version $VERSIONTOINSTALL","\n";
49 system("rm -f recommended","ln -s $VERSIONTOINSTALL recommended");
50 }
51 }
52 else
53 {
54 die "The SCRAM version $VERSIONTOINSTALL could not be found.","\n";
55 }
56
57 print "Done","\n";
58
59
60
61 sub usage
62 {
63 ###############################################################
64 # usage #
65 ###############################################################
66 # modified : Wed Jan 23 16:07:58 2002 / SFA #
67 # params : #
68 # : #
69 # : #
70 # : #
71 # function : Print a usage message then exit #
72 # : #
73 # : #
74 # : #
75 ###############################################################
76 print <<EOFUSAGE;
77 No argument given.
78 Usage:
79
80 cms-scram-install.pl <VERSIONTOINSTALL>
81
82 EOFUSAGE
83 }