Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
#! perl
2
########################################################################
297 dpurdie 3
# Copyright ( C ) 2009 ERG Limited, All rights reserved
227 dpurdie 4
#
5
# Module name   : jats.sh
6
# Module type   : Makefile system
7
# Compiler(s)   : n/a
8
# Environment(s): jats
9
#
297 dpurdie 10
# Description   : Create a buildable package based on a COTS package
11
#                 or other package image.
227 dpurdie 12
#
297 dpurdie 13
#                 Designed to simplify the process of version controlling
14
#                 handcrafted packages that have been dropped into dpkg_archive
227 dpurdie 15
#
297 dpurdie 16
# Usage:        See Embedded documentation below
17
#               jats gen_cots ...
227 dpurdie 18
#
297 dpurdie 19
#
227 dpurdie 20
#......................................................................#
21
 
255 dpurdie 22
require 5.006_001;
227 dpurdie 23
use Cwd;
24
use strict;
25
use warnings;
26
use JatsError;
27
use FileUtils;
28
use File::Basename;
29
use File::Find;
30
use File::Copy;
31
use File::Path;
32
 
33
use Pod::Usage;                             # required for help support
34
use Getopt::Long;
35
use Cwd;
36
 
37
#-------------------------------------------------------------------------------
38
#   Global variables
39
#
40
my $VERSION = "1.0.0";                      # Update this
41
my $GBE_DPKG = $ENV{ GBE_DPKG };
42
my %subdirs;
43
my %files;
44
my $DESTDIR = 'src';           # 'src'
45
my $last_result;
46
my @error_list;
47
my $vob_dir  = '';
48
my $vob_name = '';
49
my $src_dir;
50
 
51
#
52
#   Options
53
#
54
my $opt_debug   = $ENV{'GBE_DEBUG'};        # Allow global debug
55
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
56
my $opt_help = 0;
57
my $opt_manual = 0;
58
my $opt_label;
279 dpurdie 59
my $opt_vob;
227 dpurdie 60
my $opt_test;
61
my $opt_keep;
62
my $opt_subdir;
63
my $opt_image;
297 dpurdie 64
my $opt_clear_case = 1;
227 dpurdie 65
 
66
 
67
#-------------------------------------------------------------------------------
68
# Function        : Mainline Entry Point
69
#
70
# Description     :
71
#
72
# Inputs          :
73
#
74
my $result = GetOptions (
75
                "help+"         => \$opt_help,              # flag, multiple use allowed
76
                "manual"        => \$opt_manual,            # flag
77
                "verbose+"      => \$opt_verbose,           # flag, multiple use allowed
78
                "label=s"       => \$opt_label,             # String
79
                "vob=s"         => \$opt_vob,               # String
80
                "test"          => \$opt_test,              # Flag
81
                "keep"          => \$opt_keep,              # Flag
82
                "subdir=s"      => \$opt_subdir,            # string
83
                "image=s"       => \$opt_image,             # string
297 dpurdie 84
                "clearcase!"    => \$opt_clear_case,        # flag
227 dpurdie 85
 
86
                );
87
 
88
                #
89
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
90
                #
91
 
92
#
93
#   Process help and manual options
94
#
95
pod2usage(-verbose => 0, -message => "Version: $VERSION") if ($opt_help == 1 || ! $result);
96
pod2usage(-verbose => 1) if ($opt_help == 2 );
97
pod2usage(-verbose => 2) if ($opt_manual || ($opt_help > 2));
98
pod2usage(-verbose => 0, -message => "Version: $VERSION") if ( $#ARGV < 0 );
99
 
100
#
101
#   Configure the error reporting process now that we have the user options
102
#
103
ErrorConfig( 'name'    =>'gen_cots',
104
             'verbose' => $opt_verbose,
105
            );
106
 
107
#
108
#   Init the file uitilites
109
#
110
InitFileUtils();
111
Error ("This utility only runs on WINDOWS, not $::ScmHost") unless ( $::ScmHost eq 'WIN' );
112
Error ("No DPK_ARCHIVE") unless ( $GBE_DPKG );
297 dpurdie 113
Error ("Must specify a target VOB") unless ( $opt_vob || ! $opt_clear_case);
227 dpurdie 114
Error ("Need two arguments: package and version") unless ( $#ARGV eq 1 );
297 dpurdie 115
Error ("Use -keep when clearcase is not used") unless ( $opt_clear_case || $opt_keep );
227 dpurdie 116
 
117
#
118
#   Determine base image
119
#   Either from dpkg_archive or user image
120
#
121
if ( $opt_image )
122
{
123
    $src_dir =  AbsPath($opt_image);
124
    Error("Image directory is not present: $src_dir") unless ( -d $src_dir );
125
}
126
else
127
{
128
    #
129
    #   Ensure that the package source in dpkg_archive can be found
130
    #
131
 
132
    $src_dir = "$GBE_DPKG/$ARGV[0]/$ARGV[1]";
241 dpurdie 133
    Message ( "Testing $src_dir" );
227 dpurdie 134
    Error ("Package not found: $src_dir" ) unless ( -d $src_dir );
241 dpurdie 135
    Message ("Found source package");
227 dpurdie 136
}
137
 
138
#
139
#   Ensure target directory is not present
140
#
141
$opt_subdir = $ARGV[0] unless ( $opt_subdir );
303 dpurdie 142
$opt_subdir =~ s~\\~/~g;
143
 
279 dpurdie 144
my $temp_dir = $ENV{TMP} || $ENV{TEMP};
145
Error ("Cannot locate TEMP directory") unless ( $temp_dir );
146
$temp_dir =~ s~\\~/~g;
147
Error ("TEMPDIR is not a directory" ) unless ( -d $temp_dir );
148
my $dest_dir = "$temp_dir/gen_cots/$opt_subdir";
149
Verbose ("Work Dir: $dest_dir");
227 dpurdie 150
 
297 dpurdie 151
if ( $opt_clear_case )
152
{
153
    #
154
    #   Validate / locate the target VOB
155
    #
156
    locate_vob();
227 dpurdie 157
 
297 dpurdie 158
    #
159
    #   Generate a label, if the user has not already specified one
160
    #
161
    $opt_label = "$ARGV[0]_$ARGV[1]"
162
        unless ( $opt_label );
227 dpurdie 163
 
297 dpurdie 164
    #
165
    #   Ensure that the label is not locked
166
    #   The user will not be able to move the label if it is already locked
167
    #
168
    my $label_exists = 0;
169
    Verbose ("Check label exists");
170
    ClearCmd ("describe -short lbtype:$opt_label@/$vob_name" ) unless $opt_test;
171
    $label_exists = 1 unless( $opt_test || grep ( /Label type not found/, @error_list ));
172
    Verbose ("Check label: $label_exists");
227 dpurdie 173
 
297 dpurdie 174
    if ( $label_exists )
227 dpurdie 175
    {
297 dpurdie 176
        Verbose ("Check label not locked");
177
        ClearCmd ("describe -fmt %[locked]p lbtype:$opt_label@/$vob_name" );
178
        unless ( $last_result && $last_result =~ m~unlocked~ )
179
        {
180
            Error("Label is locked: $opt_label");
181
        }
227 dpurdie 182
    }
183
}
184
 
185
#
186
#   Transfer source to target and remove generated files
187
#
279 dpurdie 188
if ( -d $dest_dir )
227 dpurdie 189
{
279 dpurdie 190
    Message ("Delete temp directory from previous operation");
191
    rmtree( $dest_dir );
227 dpurdie 192
}
193
 
279 dpurdie 194
mkpath ($dest_dir,$opt_verbose);
195
Error( "Cannot create directory: $dest_dir") unless( -d $dest_dir);
227 dpurdie 196
 
241 dpurdie 197
mkpath ($dest_dir,$opt_verbose);
227 dpurdie 198
Error( "Cannot create target directory") unless ( -d $dest_dir);
199
 
241 dpurdie 200
Message ("Transfer package to local directory");
227 dpurdie 201
File::Find::find( \&CopyDir, $src_dir );
202
 
203
 
204
#
205
#   Create a build.pl file based on a template
206
#
241 dpurdie 207
Message ("Create build.pl");
227 dpurdie 208
open (BUILD, ">", "$dest_dir/build.pl" );
209
while ( <DATA> )
210
{
211
    chomp;
212
    last if ( /^__ENDBUILD/ );
213
 
214
    #
215
    #   Substitute values
216
    #
217
    s~__PACKAGENAME__~$ARGV[0]~g;
218
    s~__PACKAGEVERSION__~$ARGV[1]~g;
219
    if ( m/__BUILDNAME__/ )
220
    {
221
        if ( $ARGV[1] =~ m~^\d+\.\d+\.\d+[\s.]+(\w+)$~ )
222
        {
223
            print BUILD "BuildName       ( '$ARGV[0]', '$ARGV[1]' );\n";
224
        }
225
        elsif ( $ARGV[1] =~ m~^(.*)\.+(\D+)$~ )
226
        {
227
            my $ver = $1;
228
            my $prj = $2;
229
            print BUILD "BuildName       ( '$ARGV[0]', '$ver', '$prj', '--RelaxedVersion' );\n";
230
        }
231
        else
232
        {
233
            print BUILD "BuildName       ( '$ARGV[0]', '$ARGV[1]', '--RelaxedVersion' );\n";
234
            print "Buildname: '$ARGV[0]', '$ARGV[1]'\n";
235
        }
236
 
237
        next;
238
    }
239
 
240
    print BUILD "$_\n";
241
}
242
close (BUILD);
243
 
244
#
245
#   Create a makefile.pl based on a template
246
#
241 dpurdie 247
Message ("Create src/makefile.pl");
227 dpurdie 248
mkdir "$dest_dir/src";
249
open (MAKE, ">", "$dest_dir/src/makefile.pl" );
250
while ( <DATA> )
251
{
252
    chomp;
253
    last if ( /^__ENDMAKE/ );
254
 
255
    #
256
    #   Substitute values
257
    #
258
    s~__PACKAGENAME__~$ARGV[0]~g;
259
    s~__PACKAGEVERSION__~$ARGV[1]~g;
260
    if ( /__PACKAGEFILE__/ )
261
    {
262
        unless ( $DESTDIR )
263
        {
264
            foreach my $file ( sort keys %files )
265
            {
266
 
267
                print MAKE "PackageFile ( '*', '../$file', '--StripDir' );\n";
268
            }
269
        } else {
270
            foreach my $file ( sort keys %files )
271
            {
272
 
273
                print MAKE "PackageFile ( '*', '$file' );\n";
274
            }
275
        }
276
        foreach my $subdir ( sort keys %subdirs )
277
        {
278
            print MAKE "PackageFile ( '*', '--DirTree=$subdir' );\n";
279
        }
280
        next;
281
    }
282
    print MAKE "$_\n";
283
}
284
close (MAKE);
285
 
286
 
287
#
288
#   Determine the target directory within the VOB
289
#   This is the source directory tree, with the last element removed
290
#
291
my $target_path = "";
292
if ( $opt_subdir =~ m~/~ )
293
{
294
    $target_path = $opt_subdir;
295
    $target_path =~ s~/[^/]*$~~;
296
    $target_path = "/$target_path";
297
}
298
 
299
#
300
#   Transfer the image into the target VOB
301
#   The clearcase command will adjust the target directory to match the source
302
#
297 dpurdie 303
if ( $opt_clear_case )
304
{
305
    Message ("Import to clearcase vob: $opt_vob");
306
    my $cmd = "clearfsimport.exe -nsetevent -rec -rmname";
307
       $cmd .= " -preview" if $opt_test;
308
       $cmd .= " -mklabel $opt_label";
309
       $cmd .= " -c \"Package snapshot $ARGV[0]_$ARGV[1]\"";
310
       $cmd .= " $dest_dir $opt_vob$target_path";
227 dpurdie 311
 
297 dpurdie 312
    Verbose($cmd);
313
    @error_list = ();
314
    open(CMD, "$cmd 2>&1 |") || Error( "can't run command: $!");
315
    while (<CMD>)
316
    {
317
        #
318
        #   Filter output from the user
319
        #
320
        chomp;
321
        Verbose($_);
322
        push @error_list, $_ if ( m~Error:~ );
323
    }
324
    close(CMD);
325
    if ( @error_list )
326
    {
327
        display_error_list();
328
        Error("Problem encountered saving package image");
329
    }
227 dpurdie 330
 
331
    #
297 dpurdie 332
    #   Apply label to all directories upto the root of the VOB
333
    #   The label will have been applied to the TIP
227 dpurdie 334
    #
297 dpurdie 335
    Verbose ("Label package path");
336
    my $lpath = $opt_vob;
337
    foreach ( split ('/', $target_path) )
338
    {
339
        $lpath = $lpath . '/' . $_;
340
        Verbose ("Label package path: $lpath");
341
        ClearCmd ("mklabel -replace $opt_label $lpath" ) unless $opt_test;
342
        Error ("Program Terminated") if ( @error_list );
343
    }
227 dpurdie 344
 
297 dpurdie 345
    #
346
    #   Lock the label
347
    #
348
    Message ("Locking label: $opt_label");
349
    ClearCmd ("lock lbtype:$opt_label\@/$vob_name" ) unless $opt_test;
241 dpurdie 350
    Error ("Program Terminated") if ( @error_list );
351
}
227 dpurdie 352
#
353
#   Remove the created directory
354
#
355
if ( $opt_keep )
356
{
279 dpurdie 357
    Warning ("KEEP temp directory: $dest_dir");
227 dpurdie 358
}
359
else
360
{
241 dpurdie 361
    Message ("Delete temp directory");
279 dpurdie 362
    rmtree( $dest_dir );
227 dpurdie 363
}
364
 
365
#
366
#   All done
367
#
297 dpurdie 368
if ( $opt_clear_case )
369
{
370
    Message ("\n");
371
    Message ("Release Manager information");
372
    Message ("Package path : /$vob_name/$opt_subdir");
373
    Message ("Label        : $opt_label");
227 dpurdie 374
 
297 dpurdie 375
    Warning ("Test Mode: Not changes made to the VOB") if ( $opt_test );
376
}
227 dpurdie 377
exit 0;
378
 
379
 
380
#-------------------------------------------------------------------------------
381
# Function        : CopyDir
382
#
383
# Description     : Find callback function used to copy the archive
384
#
385
# Inputs          :
386
#
387
# Returns         :
388
#
389
sub CopyDir
390
{
391
    my $item = $File::Find::name;
392
    my $base = File::Basename::basename($item);
393
 
394
    #
395
    #   Skip generated files
396
    #
397
    return if ( $base =~ m/^descpkg$/ );
398
    return if ( $base =~ m/^RELEASE_NOTES_/ );
399
    return if ( $base =~ m/^built\./ );
400
 
401
    #
402
    #   Don't process directories
403
    #
404
    return if ( -d $item );
405
 
406
    #
407
    #   Calculate target directory
408
    #
241 dpurdie 409
    my $sdl = length ($src_dir);
410
    my $target = $dest_dir . '/' . $DESTDIR . substr ( $item, $sdl );
227 dpurdie 411
 
412
    #
413
    #   Determinate top level package directories
414
    #
241 dpurdie 415
    my $rootdir = substr ( $item, 1 + $sdl );
227 dpurdie 416
    $rootdir =~ s~/.*~~;
417
 
418
    if ( $rootdir eq $base )
419
    {
420
        $files{$base} = 1;
421
    } else {
422
        $subdirs{$rootdir} = 1;
423
    }
424
 
425
    my $tdir = $target;
426
    $tdir =~ s~/[^/]+$~~;
427
 
428
#    print "================$item, $base, $tdir, $target, $rootdir\n";
429
 
430
    mkpath ($tdir, 0) unless ( -d $tdir );
431
 
432
    Verbose( "Transfer: $target");
433
    File::Copy::copy( "$item", "$target") || Error("Copy Fault: $item, $target");
434
 
435
}
436
 
437
#-------------------------------------------------------------------------------
438
# Function        : locate_vob
439
#
440
# Description     : Locate the target VOB
297 dpurdie 441
#                   This is a bit tricky as it makes a few assumptions
227 dpurdie 442
#                       1) That clearcase dynamic views are mounted through the "o" drive
443
#                          This appears to be a standard(ish) configuration.
444
#
445
#                       2) There must be a dynamic view on the machine that does have the
446
#                          required VOB mounted
447
#
448
#                   Note: Assumes that the user is NOT trying to place the package
449
#                         into a subdir of the VOB.
450
#
451
# Inputs          : None
452
#
453
# Returns         : Global: $opt_vob
454
#
455
 
456
sub locate_vob
457
{
458
    #
459
    #   If the user has specified an absolute path then use the users VOB
460
    #
461
    $opt_vob =~ tr~\\/~/~s;
462
    if ( $opt_vob =~ m~[A-Za-z]\:/~ || $opt_vob =~ m~/~ )
463
    {
464
        Error ("User VOB does not exist: $opt_vob") unless ( -d $opt_vob );
465
 
466
        $opt_vob =~ m~(.*/)(.*)~;
467
        $vob_dir = $1;
468
        $vob_name = $2;
469
        return;
470
    }
471
 
472
    #
473
    #   Scan for a dynamic view
474
    #
241 dpurdie 475
    Message ("Scanning for suitable dynamic view");
227 dpurdie 476
    my @search_list = glob ("O:/*");
477
    my $found_vob;
478
    foreach my $dir ( @search_list )
479
    {
480
        my $test_vob = "$dir/$opt_vob";
481
        Verbose ("Testing vob: $test_vob" );
241 dpurdie 482
        next if ( $dir =~ m~solaris~i );                    # Take the hint
483
        next if ( $dir =~ '/administration_view$' );        # Known read-only VOB
484
 
227 dpurdie 485
        if ( -d $test_vob )
486
        {
487
            $found_vob = $dir;
488
            last;
489
        }
490
    }
491
    Error ("Cannot find a suitable view with the $opt_vob VOB mounted") unless ( $found_vob );
492
 
493
    $vob_dir = $found_vob;
494
    $vob_name = $opt_vob;
495
    $opt_vob = "$vob_dir/$vob_name";
241 dpurdie 496
    Message ("Using VOB: $opt_vob");
227 dpurdie 497
}
498
 
499
 
500
#-------------------------------------------------------------------------------
501
# Function        : ClearCmd
502
#
503
# Description     : Similar to the system command
504
#                   Does allow standard output and standard error to be captured
505
#                   to a log file
506
#
507
#                   Used since I was having problems with calling other programs
508
#                   and control-C. It could hang the terminal session.
509
#
510
# Inputs          :
511
#
512
# Returns         :
513
#
514
sub ClearCmd
515
{
516
    my( $cmd ) = @_;
517
    Verbose2 "cleartool $cmd";
518
 
519
        @error_list = ();
520
        open(CMD, "cleartool $cmd  2>&1 |")    || Error "can't run command: $!";
521
        while (<CMD>)
522
        {
523
            chomp;
524
            $last_result = $_;
525
            Verbose ( "cleartool resp:" . $_);
526
            push @error_list, $_ if ( m~Error:~ );
527
        }
528
        close(CMD);
529
 
530
    Verbose2 "Exit Status: $?";
531
    return $? / 256;
532
}
533
 
534
 
535
 
536
#-------------------------------------------------------------------------------
537
# Function        : display_error_list
538
#
539
# Description     : Display the error list
241 dpurdie 540
#                   The exit process will be handled by the caller
227 dpurdie 541
#
542
# Inputs          :
543
#
544
# Returns         :
545
#
546
sub display_error_list
547
{
548
    foreach ( @error_list )
549
    {
241 dpurdie 550
        ReportError ("$_");
227 dpurdie 551
    }
552
}
553
 
554
 
555
__DATA__
297 dpurdie 556
# Copyright (C) 1998-2009 ERG Limited, All rights reserved
227 dpurdie 557
#
558
# Module name   : build.pl
297 dpurdie 559
# Module type   : JATS Build File
560
# Environment(s): JATS Build System
227 dpurdie 561
#
562
# Description:    build.pl for package __PACKAGENAME__
563
#.........................................................................#
564
 
565
#..     Build system
566
#
567
$MAKELIB_PL     = "$ENV{ GBE_TOOLS }/makelib.pl";
568
$BUILDLIB_PL    = "$ENV{ GBE_TOOLS }/buildlib.pl";
569
 
570
require         "$BUILDLIB_PL";
571
require         "$MAKELIB_PL";
572
 
573
#..     Product configuration
574
#
575
BuildPlatforms   ( 'GENERIC' );
576
 
577
__BUILDNAME__ BuildName       ( '__PACKAGENAME__', '__PACKAGEVERSION__' );
578
BuildInterface  ( 'interface' );
579
 
580
#
581
#   Specify subdirectories to process
582
#
583
BuildSubDir    ( 'src' );
584
 
585
#
586
#   Generate Files
587
BuildDescpkg   ();
588
BuildMake      ();
589
__ENDBUILD
297 dpurdie 590
# Copyright (C) 1998-2009 ERG Limited, All rights reserved
227 dpurdie 591
#
592
# Module name   : Makefile.pl
297 dpurdie 593
# Module type   : JATS Build File
594
# Environment(s): JATS Build System
227 dpurdie 595
#
596
# Description:    makefile.pl for package __PACKAGENAME__
597
#
598
#.........................................................................#
599
 
600
die "Usage: Makefile.pl rootdir Makelib.pl\n"
601
    unless( $#ARGV+1 >= 2 );
602
require "$ARGV[1]";
603
 
604
#
605
# Build platform definitions ..
606
#
607
Platform( '*' );
608
 
609
############################################################################
610
#   Define the source files
611
#
612
 
613
#.............................................................................
614
# Packaging definitions
615
#
616
__PACKAGEFILE__ PackageFile ( '*', '--DirTree=jar' );
617
 
618
#..
619
#
620
Src         ( '*'   , 'descpkg' );
621
PackageFile ( '*'   , 'descpkg' );
622
 
623
#.............................................................................
624
# Finally generate the makefile
625
#
626
MakefileGenerate();
627
 
628
#..  Successful termination
629
1;
630
__ENDMAKE
631
 
632
#-------------------------------------------------------------------------------
633
#   Documentation
634
#
635
 
636
=pod
637
 
638
=head1 NAME
639
 
640
gen_cots - Create a buildable package from dpkg_archive and place it under
641
version control
642
 
643
=head1 SYNOPSIS
644
 
645
jats gen_cots package version
646
 
647
 
648
 Options:
649
    -help              - brief help message
650
    -help -help        - Detailed help message
651
    -man               - Full documentation
652
    -label=name        - Specify a label for the versions source
653
    -vob=vvv           - VOB to use, my be a full path. default is COTS
654
    -subdir=nnn        - Named subdir in VOB
297 dpurdie 655
    -test              - Do not perform operations that modify clearcase
227 dpurdie 656
    -keep              - Keep the creating dpkg_archive image
657
    -image=path        - Path to alternate source image
297 dpurdie 658
    -[no]clearcase     - ClearCase is not present
227 dpurdie 659
 
660
=head1 OPTIONS
661
 
662
=over 8
663
 
664
=item B<-help>
665
 
666
Print a brief help message and exits.
667
 
668
=item B<-help -help>
669
 
670
Print a detailed help message with an explanation for each option.
671
 
672
=item B<-man>
673
 
674
Prints the manual page and exits.
675
 
676
=item B<-label=name>
677
 
678
This option specifies an alternate label for the checked in source. The
679
default label is based on package and version.
680
 
681
=item B<-vob=vvv>
682
 
683
This option specifies the VOB into which the saved package will be placed.
684
 
685
There are two ways that this option may be used.
686
 
687
=over 8
688
 
689
=item 1
690
 
691
Simply name the VOB. (ie: COTS) The script will locate a dynamic view on the
363 dpurdie 692
users machine that contains the view. This is done by scanning dynamic views in
227 dpurdie 693
the "O:" drive.
694
 
695
=item 2
696
 
697
The full path to a VOB, including driver is provided. (ie: z:/COTS). This will
698
prevent the script from locating the VOB. It will use the named view.
699
 
700
=back
701
 
702
If this option is not provided, then the script will use the COTS vob in the
703
first dynamic view located on the "O:" drive.
704
 
705
=item B<-subdir=name>
706
 
707
This option specifies the name of a subdirectory in which the package will be created.
708
The default name it taken from the package name.
709
 
710
=item B<-test>
711
 
712
This option will suppress the clearcase operations.
713
No files will be checked in and the label will not be locked.
714
 
715
=item B<-keep>
716
 
717
If this option is selected then the program will retain the working directory
718
that it has created.
719
 
720
=item B<-image=path>
721
 
722
If this option is specified then the package will be created using the
723
specified source path, otherwise the package will be extracted from dpkg_acrhive.
724
 
725
This option allows a locally created image to be stored as a COTS package
726
before it is placed in dpkg_archive.
727
 
297 dpurdie 728
=item B<-[no]clearcase>
729
 
730
This option may be used to supress all clearcase operations. The utility will
731
simply create a directory tree containing a buildable image.
732
 
733
This option should be used in conjunction with -test, else the results will
734
be discarded.
735
 
227 dpurdie 736
=back
737
 
738
=head1 DESCRIPTION
739
 
740
This program will create a version controlled and JATS buildable package from
741
a dpkg_archive package version.
742
 
743
In doing this the program will:
744
 
745
=over 8
746
 
747
=item   *
748
 
749
Create a temporary directory in the users current directory. This will
750
be used to contain a copy of the package.
751
 
752
=item   *
753
 
754
Transfer the named package and version into the temp directory. The files will
755
be transferred in the a 'src' directory within the temp directory.
756
 
757
=item   *
758
 
759
Create JATS build.pl and makefile.pls to support the creation of the
760
package. The build.pl file will contain the package name and the package
761
version.
762
 
763
=item   *
764
 
765
Transfer the entire image into the named VOB. The files will be labeled
766
and the VOB view modified to mimic the temp directory view.
767
 
768
=item   *
769
 
770
Lock the label used to mark the files.
771
 
772
=item   *
773
 
774
Remove the temp work space.
775
 
776
=item   *
777
 
778
Display information to be entered into Release Manager.
779
 
780
=back
781
 
782
=head1 EXAMPLE
783
 
784
jats etool gen_cots -vob=z:/COTS mos_api 5.6.0.cr
785
 
786
This will take the version 5.6.0.cr of the mos_api package from dpkg_acrchive
787
place it under version control within the COTS vob and add files to allow the
788
dpkg_archive package to be recreated in an JATS buildable manner.
789
 
790
=cut
791