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