Rev 7299 | Blame | Compare with Previous | Last modification | View Log | RSS feed
######################################################################### COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.## Module name : jats_vcsrelease.pl# Module type : JATS Utility# Compiler(s) : Perl# Environment(s): JATS## Description : BuildTool abstraction utility# Determine the Version control system in use# and invoke required utility## Usage : See POD below##......................................................................#require 5.008_002;use strict;use warnings;use Pod::Usage;use Getopt::Long qw(:config pass_through);use JatsError qw(:name=RELEASE);use JatsSystem;## Options#my $opt_help = 0;my $opt_verbose = $ENV{'GBE_VERBOSE'}; # Allow global verbosemy $opt_spec;## VCS to program conversion#my $VERSION = "1.0.0"; # Update thismy %vcs = ('SVN' => 'jats_svnrelease.pl','CC' => 'jats_ccrelease.pl',);################################################################################# Mainline### Parse the user options# Leave unknown options alone and don't complain#my @FULL_ARGV = @ARGV;Verbose ("Parsing Options");my $result = GetOptions ("help:+" => \$opt_help, # flag, multiple use allowed"manual:3" => \$opt_help, # flag"v|verbose:+" => \$opt_verbose, # flag, multiple use allowed"label=s" => \$opt_spec, # Array of build specs);## UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!### Process help and manual options# Only if we arn't parsing stuff to other routines#$opt_help = 0 if ( $opt_spec );pod2usage(-verbose => 0, -message => "Version: $VERSION") if ($opt_help == 1 || ! $result);pod2usage(-verbose => 1) if ( $opt_help == 2 );pod2usage(-verbose => 2) if ( $opt_help > 2 );ErrorConfig( 'verbose' => $opt_verbose );## Label must be provided - its how we determine the type of VCS#Error ("No label provided") unless ( defined $opt_spec );## Examine the label and determine the VCS encode method# Label MUST be of the form# XXX::text# Where XXX specifies the Version Control System#$opt_spec =~ m~^(.+?)::.+~;my $protocol = $1;Error ("Badly formatted label. Does not identify VCS", "Label: $opt_spec" )unless ( $protocol );Verbose3("Protocol: $protocol");Error ("Unknown VCS in label: $opt_spec")unless ( exists $vcs{$protocol});## Pass control to the required utility#exit JatsTool ( $vcs{$protocol}, @FULL_ARGV );#-------------------------------------------------------------------------------# Documentation#=pod=head1 NAMEjats_vcsrelease - Extract /Release a Package=head1 SYNOPSISjats etool vcsrelease [options]Options:-help[=n] - brief help message-help -help - Detailed help message-man[=n] - Full documentation-verbose[=n] - Verbose operation-label=label - LabelOthers - Passed on=head1 OPTIONS=over 8=item B<-help[=n]>Print a brief help message and exits.The verbosity of the help text can be controlled by setting the help level to anumber in the range of 1 to 3, or by invoking the option multiple times.=item B<-man[=n]>Without a numeric argument this is the same as -help=3. Full help will bedisplayed.With a numeric argument, this option is the same as -help=n.=item B<-verbose[=n]>This option will increase the level of verbosity of the utility.If an argument is provided, then it will be used to set the level, otherwise theexisting level will be incremented. This option may be specified multiple times.=item B<-label=text>This option is used to determine the VCS system to use to create the workspacerequired for the build.=back=head1 DESCRIPTIONThis utility is used by the automated build system to create a workspacefor the view. The main function of this utility is to invoke the correctutility for the creation of a workspace.The utility will examine the -label option and detect the required VersionControl System. It will then invoke a suitable tools to create the workspace.The label must start with a Version Control Header. This is of the form of:XXX::DataWhere XXX identifies the Version Control System. Valid values are:=over 8=item CC - ClearCaseThe remainder of the label contains a path and a label.The L<ccrelease|TOOLS::jats_ccrelease> utility will be invoked with the command lineoptions passed through.=item SVN - SubVersionThe remainder of the label contains a URL without the site-specific protocolor server.The L<svnrelease|TOOLS::jats_svnrelease> utility will be invoked with the command lineoptions passed through.=backAll other command line options are passed to the tool. Thus the tools musthave a common set of options.=cut