Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
227 dpurdie 1
#!/usr/local/bin/perl
2
#
3
# Copyright (C) 1998-2003 ERG Limited, All rights reserved
4
#
5
#========================================================
6
# **** Source Information ****
7
#
8
# Source File Name    : create_dpkg.pl
9
#
10
# Source File Type    : Perl file
11
#
12
# Original Author(s)  : V.Chatzimichail(vasilic)
13
#                       D.D.Purdie(dpurdie)
14
#
15
# Description / Purpose:
16
#     This script is used to create a dpkg_archive. 
17
#
18
# References:
19
#    -None-
20
#
21
#========================================================
22
 
23
 
24
# Include Standard Perl Functions
25
#
26
use strict;
27
use Cwd;
28
use Getopt::Long;
29
use File::Basename;
30
use File::Find;
31
use File::Path;
32
use File::Copy;
33
use Pod::Usage;
34
 
35
use JatsError;
36
use DescPkg;
37
use FileUtils;
38
 
39
# define Global variables
40
#
41
my $VERSION = "2.4.0";
42
my $PROGNAME = "create_dpkg.pl";
43
 
44
 
45
my $GBE_MACHTYPE = $ENV{'GBE_MACHTYPE'} ||
46
                die "Need JATS 'GBE_MACHTYPE' environment variable\n";
47
 
48
my $DPKG_NAME     = "";
49
my $DESC_NAME     = "";
50
my $DPKG_VERSION  = "";
51
my $DESCPKG_FILE  = "";
52
my $DESCPKG_TYPE  = "";
53
my $CWD_DIR       = cwd;
54
my $SRC_ROOT;
55
my $DPKG_DIR;
56
my $DPKG_ROOT;
57
my $e_repository == "";
58
 
59
#
60
#   Option variables
61
#
62
my $opt_help = 0;
63
my $opt_manual = 0;
64
my $opt_verbose = 0;
65
my $opt_quiet = 0;
66
my $opt_override = 0;
67
my $opt_merge = 0;
68
my $opt_archive;
69
my $opt_generic;
70
my $opt_pname;
71
my $opt_pversion;
72
my $opt_test;
73
 
74
 
75
#
76
#   Structure to translate -archive=xxx option to archive variable
77
#   These are the various dpkg_archives known to JATS
78
#
79
my %Archive2Var =( 'main'       =>  'GBE_DPKG',
80
                   'store'      =>  'GBE_DPKG_STORE',
81
                   'cache'      =>  'GBE_DPKG_CACHE',
82
                   'local'      =>  'GBE_DPKG_LOCAL',
83
                   'sandbox'    =>  'GBE_DPKG_SBOX',
84
                   'deploy'     =>  'GBE_DPLY',
85
                   );
86
 
87
#------------------------------------------------------------------------------
88
#------------------------------------------------------------------------------
89
# Subroutines
90
#------------------------------------------------------------------------------
91
#------------------------------------------------------------------------------
92
 
93
#------------------------------------------------------------------------------
94
sub LogFileOp
95
#
96
# Description:
97
#       This sub-routine is used to generate a consistent informational log
98
#------------------------------------------------------------------------------
99
{
100
    my ($opr, $file) = @_;
101
    $file =~ s/$DPKG_ROOT/DPKG/;
102
 
103
    Information (sprintf( "%-15s [%s]", $opr, $file));
104
}
105
 
106
#------------------------------------------------------------------------------
107
sub Init
108
#
109
# Description:
110
#     This function is used to process any command line arguements
111
#     and print the start banner.
112
#
113
#------------------------------------------------------------------------------
114
{
115
    # Process any command line arguements...
116
    my $result = GetOptions (
117
                "help+"         => \$opt_help,              # flag, multiple use allowed
118
                "manual"        => \$opt_manual,            # flag
119
                "verbose+"      => \$opt_verbose,           # flag, multiple use allowed
120
                "override!"     => \$opt_override,          # [no]flag
121
                "merge|m!"      => \$opt_merge,             # [no]flag.
122
                "archive=s"     => \$opt_archive,           # string
123
                "quiet+"        => \$opt_quiet,             # Flag
124
                "generic!"      => \$opt_generic,           # [no]Flag
125
                "pname=s"       => \$opt_pname,             # string
126
                "pversion=s"    => \$opt_pversion,          # string
127
                "test!"         => \$opt_test,              # [no]flag
128
                );
129
 
130
 
131
    #
132
    #   Process help and manual options
133
    #
134
    pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
135
    pod2usage(-verbose => 1)  if ($opt_help == 2 );
136
    pod2usage(-verbose => 2)  if ($opt_manual || $opt_help > 2);
137
 
138
    #
139
    #   Init the error and message subsystem
140
    #
141
    ErrorConfig( 'name'    =>'CREATE_DPKG',
142
                 'verbose' => $opt_verbose,
143
                 'quiet'   => $opt_quiet );
144
 
145
    if ($opt_verbose)
146
    {
147
       Verbose ("Program: $PROGNAME");
148
       Verbose ("Version: $VERSION");
149
    }
150
 
151
    #
152
    #   Check for a "pkg" directory
153
    #   This may be in:
154
    #       1) The deploy directory (DEPLOY) build/deploy/descpkg
155
    #       2) The build directory (ANT)     build/pkg/descpkg
156
    #       3) The current directory (JATS)  pkg/xxxx/descpkg
157
    #
158
    my $PKG_BASE = "$CWD_DIR/build/deploy";
159
    Verbose2 ("Looking for descpkg: $PKG_BASE");
160
    if ( -f "$PKG_BASE/descpkg" )
161
    {
162
        #
163
        #   This is a deployment package.
164
        #   Force the use of the GBE_DPLY
165
        #
166
        $opt_archive = 'deploy' unless ( $opt_archive );
167
    }
168
    else
169
    {
170
        $PKG_BASE = "$CWD_DIR/build/pkg";
171
        Verbose ("Looking for descpkg: $PKG_BASE");
172
        if ( ! -f  "$PKG_BASE/descpkg" )
173
        {
174
            $PKG_BASE = "$CWD_DIR/pkg";
175
            Verbose ("Looking for descpkg: $PKG_BASE");
176
            Error("Failed to find a package to transfer. Looked in:",
177
                  "./build/deploy",
178
                  "./build/pkg",
179
                  "./pkg"
180
                  )
181
                unless( -d $PKG_BASE );
182
        }
183
    }
184
    Verbose("Package directory: $PKG_BASE");
185
 
186
    #
187
    #   Determine the target archive
188
    #   The default archive is GBE_DPKG, but this may be changed
189
    #
190
    $opt_archive = 'main' unless ( $opt_archive );
191
    my $archive_tag = $Archive2Var{$opt_archive};
192
    Error("Unknown archive specified: $opt_archive")
193
        unless ( $archive_tag );
194
 
195
    $DPKG_ROOT = $ENV{$archive_tag} || '';
196
    Verbose ("Archive Variable: $archive_tag" );
197
    Verbose2 ("Archive Path: $DPKG_ROOT" );
198
 
199
    Error("Repository location not specified: $archive_tag")
200
        unless $DPKG_ROOT;
201
 
202
    Error("Failed to find Repository: $DPKG_ROOT")
203
        unless ( -d $DPKG_ROOT );
204
 
205
    $e_repository = ("      *Non Standard archive")
206
        unless ( $opt_archive eq 'main' );
207
 
208
 
209
    #
210
    #   If the environment variable GBE_DPKG_SBOX is defined then the package
211
    #   is being built within a development sandbox. In such a sandbox the
212
    #   version numbers of the packages are ignored. Publishing a package
213
    #   fromm such an environment is certainly not reproducible - so don't allow
214
    #   it to happen
215
    #
216
    unless ( $opt_archive eq 'local' || $opt_archive eq 'sandbox'   )
217
    {
218
        if ( $ENV{GBE_DPKG_SBOX} )
219
        {
220
            Error ("Cannot publish a package that has been generated",
221
                   "within a Sandbox as the version of dependent packages",
222
                   "is not guaranteed.");
223
        }
224
    }
225
 
226
 
227
    #   Locate the package
228
    #   Packages are located by looking for a file called descpkg within the
229
    #   main package directory.
230
    #
231
    #   This installation process only handles one such file
232
    #
233
    File::Find::find( \&pkgFind, $PKG_BASE);
234
 
235
 
236
    # Get the dpkg_archive version number we are  going to create.
237
    #
238
    Error("Descpkg file not found in package directory: $PKG_BASE")
239
        unless ( -f "$DESCPKG_FILE" );
240
 
241
    #
242
    #   Read in the package description and validate essential fields
243
    #
244
    GetDpkgArchiveVersion($DESCPKG_FILE);
245
    unless ( "$DPKG_VERSION" )
246
    {
247
        Error ("Incorrect descpkg content detected.",
248
               "Check JATS build.pl config.");
249
    }
250
 
251
    #
252
    #   Need to support two forms of pkg subdirectory
253
    #       1) packages are in a named subdir within 'pkg'
254
    #       2) package is within 'pkg' or 'deploy'
255
    #
256
    if ( $DPKG_NAME eq 'pkg' || $DPKG_NAME eq 'deploy' )
257
    {
258
        $DPKG_NAME = $DESC_NAME;
259
        unless ( $DESC_NAME )
260
        {
261
            Error ("Cannot determine package name",
262
                   "The packages 'descpkg' file is bad or missing");
263
        }
264
    }
265
    elsif ( $DESC_NAME ne $DPKG_NAME )
266
    {
267
        Error ("Package name MUST match package description",
268
               "Check build.pl and package.pl",
269
               "Package name: $DPKG_NAME",
270
               "Description : $DESC_NAME" );
271
    }
272
 
273
    #
274
    # lets just check to see if we have a version number before
275
    # we proceed.
276
    #
277
    unless ( $DPKG_VERSION )
278
    {
279
        Error("Cannot determine dpkg_archive version number.",
280
              "Check JATS build config.");
281
    }
282
 
283
    #
284
    #   Sanity test package name and version, if provided
285
    #
286
    if ( $opt_pname )
287
    {
288
        ReportError ("Package Name does not match expected name",
289
                     "Expected: '$opt_pname'",
290
                     "Descpkg : '$DPKG_NAME'") unless ( $DPKG_NAME eq $opt_pname );
291
    }
292
    if ( $opt_pversion )
293
    {
294
        ReportError ("Package Version does not match expected version",
295
                     "Expected: '$opt_pversion'",
296
                     "Descpkg : '$DPKG_VERSION'") unless ( $DPKG_VERSION eq $opt_pversion );
297
    }
298
    ErrorDoExit();
299
 
300
    #
301
    #   Set up the target directory path and name
302
    #   It will be created later
303
    #
304
    $DPKG_DIR = "$DPKG_ROOT/$DPKG_NAME/$DPKG_VERSION";
305
 
306
    #
307
    #   Information for the user
308
    #
309
    Information ("---------------------------------------------------------------");
310
    Information ("Dpkg archive creation tool...");
311
    Information ("Version: $VERSION");
312
    Information ("");
313
    Information ("Information:");
314
    Information ("Working dir   = [$CWD_DIR]");
315
    Information ("Package Root  = [$SRC_ROOT]");
316
    Information ("Repository    = [$DPKG_ROOT]$e_repository");
317
    Information ("Target dir    = [$DPKG_DIR]");
318
    Information1("DPKG_NAME     = [$DPKG_NAME]");
319
    Information1("DPKG_VERSION  = [$DPKG_VERSION]");
320
    Information1("GBE_MACHTYPE  = [$GBE_MACHTYPE]");
321
    Information ("")                                if ( $opt_merge || $opt_override );
322
    Information ("Opt:Override  = Enabled")         if ( $opt_override );
323
    Information ("Opt:Merge     = Enabled")         if ( $opt_merge );
324
    Information ("Opt:TestMode  = Enabled. No Package Transferred") if ( $opt_test );
325
    Information ("---------------------------------------------------------------");
326
 
327
    # done.
328
    return 1;
329
}
330
 
331
#------------------------------------------------------------------------------
332
sub pkgFind
333
#
334
# Description:
235 dpurdie 335
#     This subroutine is used to locate the FIRST descpkg file in
227 dpurdie 336
#     the local pkg dir.
337
#
338
#------------------------------------------------------------------------------
339
{
340
    my($item)= "$File::Find::name";
341
    my($file)= File::Basename::basename($item);
342
 
343
    # we get the absolute path from the find, but we only require
344
    # a relative path from the starting dir.
345
    # so our start dir.
346
 
347
    # we need to determine which file we are dealing with
235 dpurdie 348
    if ( ! -d $item && $file =~ /^descpkg$/ )
227 dpurdie 349
    {
235 dpurdie 350
        #
351
        #   Only grab the first one
352
        #
353
        if ( $DESCPKG_FILE )
354
        {
355
            Warning ("Package contains multiple descpkg files");
356
            return;
357
        }
358
 
227 dpurdie 359
        $DESCPKG_FILE = $item;
360
        my($dir)= File::Basename::dirname($item);
361
        $DPKG_NAME = File::Basename::basename($dir);
362
        $SRC_ROOT = $dir;
363
    }
364
}
365
 
366
 
367
#------------------------------------------------------------------------------
368
sub GetDpkgArchiveVersion
369
#
370
# Description:
371
#     This subroutine is used to determine the version of the dpkg_archive.
372
#     We assume that the version number is in the descpkg file.
373
#
374
#     Need to allow for two forms of descpkg. Some one decided that a Java
375
#     Manifest would be a good descpkg file - a long time after the rest of the
376
#     world had been using an existing file format.
377
#
378
#     Lines are tagged
379
#
380
#     Once the version number is determined we set the
381
#     global DPKG_VERSION variable.
382
#
383
#------------------------------------------------------------------------------
384
{
385
    my ($path) = @_;
386
    my $line;
387
    my $type;
388
 
389
    #
390
    #   Use a common routine to parse the package descriptor
391
    #   There are several forms that may need to be processed
392
    #
393
    my $pkg_data = ReadDescpkg( $path );
394
    Error("Failed to open file [$path].") unless $pkg_data;
395
 
396
    $DESC_NAME    = $pkg_data->{'NAME'};
397
    $DPKG_VERSION = $pkg_data->{'VERSION_FULL'};
398
}
399
 
400
#-------------------------------------------------------------------------------
401
# Function        : TransferDescpkg
402
#
403
# Description     : Copy and process the descpkg file to the target
404
#
405
# Inputs          :
406
#
407
# Returns         :
408
#
409
sub TransferDescpkg
410
{
411
    my $result = CopyDescpkg( @_ );
412
    Error("Transfer descpkg: $result") if ( $result );
413
}
414
 
415
#------------------------------------------------------------------------------
416
sub CreateDpkgArchive
417
#
418
# Description:
419
#     This subroutine is used to create the dpkg_archive in the $DPKG_ROOT
420
#     location 
421
#
422
#     We use the global DPKG_DIR, DPKG_NAME, and DPKG_VERSION
423
#     to create the required directory structure.
424
#
425
#     If the dpkg_archive is new (ie not a new version) it is assumed the user
426
#     has access to create the top level dir for the new dpkg_archive.
427
#
428
#     The new dpkg_archive is created with the permission of the user 
429
#     executing this script.
430
#
431
#     If an error ocurs during the dpkg_archive creation the script
432
#     will terminate.
433
#
434
#------------------------------------------------------------------------------
435
{
436
 
437
    # first we need to ensure we have the top level directory
438
    #
439
    if ( -d $DPKG_DIR )
440
    {
441
        Warning("Detected previous dpkg_archive [$DPKG_DIR]");
442
        unless ( $opt_override )
443
        {
444
            Error ("Package already exists") if ( $opt_quiet );
445
            if ( !GetYesNo("Do you wish to continue?") )
446
            {
447
                Error("Script terminated by user.");
448
            }
449
        }
450
    }
451
    Information("");
452
 
453
    #
454
    #   Create the top level directory
455
    #
456
    mkpath($DPKG_DIR, 0, 0775);
457
 
458
 
459
    # lets process the files.
460
    #
461
    if ( -d $SRC_ROOT )
462
    {
463
        File::Find::find( \&pkgFind2, $SRC_ROOT );
464
    }
465
    else
466
    {
467
        Error("Failed to find dir [$SRC_ROOT]",
468
              "Check JATS config.");
469
    }
470
 
471
    #
472
    #   Transfer of data is complete
473
    #       Mark the archive with the build type to indicate which parts of
474
    #       a multi-machine build have been performed
475
    #
476
    #
477
    my $touchfile = $opt_generic ? "$DPKG_DIR/built.generic" : "$DPKG_DIR/built.$GBE_MACHTYPE";
478
    LogFileOp("Mark File",$touchfile);
479
    TouchFile ( $touchfile) && Error("Failed to create file [$touchfile].");
480
 
481
    #
482
    #   If there is a .lnk file in the archive then remove it now that the
483
    #   archive has been transferred. The .lnk files are created in 'local'
484
    #   archives in order to simplify multi-package builds
485
    #
486
    my $link_file = "$DPKG_ROOT/$DPKG_NAME/$DPKG_VERSION.lnk";
487
    if ( -f $link_file )
488
    {
489
        LogFileOp("Removing Link",$link_file);
490
        unlink $link_file;
491
    }
492
 
493
    return 1;
494
}
495
 
496
 
497
#------------------------------------------------------------------------------
498
sub pkgFind2
499
#
500
# Description:
501
#   This subroutine is used to locate all associated pkg files in
502
#   the local pkg dir.
503
#
504
#   This routine is called for each file and directory within the package
505
#   Some files and directories are treated in a special manner
506
#       - Top level directory is ignored
507
#
508
#
509
#
510
#------------------------------------------------------------------------------
511
{
512
    my $item = $File::Find::name;
513
    my $base = File::Basename::basename($item);
514
 
515
    #
516
    #   Calculate the target directory name
517
    #
518
    my $target = $item;
519
    $target =~ s/^$SRC_ROOT/$DPKG_DIR/;
520
 
521
    if ( -d $item )
522
    {
523
        #
524
        #   Ignore the top level directory
525
        #   It has already been created
526
        #
527
        return
528
            if ( $item eq $SRC_ROOT );
529
 
530
        #
531
        #   Directories are handled differently
532
        #       - Directories are created with nice permissions
533
        #       - If the directory already exists then it is being
534
        #         replaced or merged. It is not possible to merge some
535
        #         directories - they must be deleted first.
536
        #
537
        if ( ! -d "$target" )
538
        {
539
            LogFileOp("Creating Dir", $target);
540
            mkpath("$target", 0, 0775);
541
        }
542
        else
543
        {
544
            if ( !$opt_merge &&
545
                 "$base" !~ m/^lib$/ &&
546
                 "$base" !~ m/^bin$/ &&
547
                 "$base" !~ m/^jar$/ )
548
            {
549
                LogFileOp("Remove Prev Dir",$target);
550
                rmtree("$target");
551
            }
552
 
553
            unless ( -d $target )
554
            {
555
                LogFileOp("Creating Dir",$target);
556
                mkpath("$target", 0, 0775);
557
            }
558
        }
559
    }
560
    else
561
    {
562
        #
563
        #   File copy
564
        #   If merging then do not overwrite an existing file
565
        #
566
        unless ( $opt_merge && -f $target )
567
        {
568
            if ( $item =~ m~/descpkg$~ )
569
            {
570
                LogFileOp("Rewrite File",$target);
571
                TransferDescpkg( "$item", $target );
572
                CORE::chmod oct("0775"), $target;
573
            }
574
            else
575
            {
576
                #
577
                #   Copy file to destination
578
                #   If the file is a link, then duplicate the link contents
579
                #   Use: Unix libraries are created as two files:
580
                #        lib.xxxx.so -> libxxxx.so.vv.vv.vv
581
                #
582
                if ( -l $item )
583
                {
584
                    LogFileOp("Copying Link", $target);
585
                    my $link = readlink $item;
586
                    Verbose( "Link: $item, $link");
587
                    symlink ($link, $target );
588
                    unless ( $link && -l $target )
589
                    {
590
                        Error("Failed to copy link [$item] to [$target]: $!");
591
                    }
592
                }
593
                elsif (File::Copy::copy($item, $target))
594
                {
595
                    LogFileOp("Copying File",$target);
596
                    CORE::chmod oct("0775"), $target;
597
                }
598
                else
599
                {
600
                    Error("Failed to copy file [$item] to [$target]: $!");
601
                }
602
            }
603
        }
604
        else
605
        {
606
            #
607
            #   Merging packages
608
            #   Ensure that the descpkg file is "touched" so that caches
609
            #   that use this file as a timestamp can be updated
610
            #
611
            if ( $item =~ m~/descpkg$~ )
612
            {
613
                LogFileOp("Touch File",$target);
614
                TouchFile( $target ) && Error ( "Failed to touch: $target" );
615
            }
616
            else
617
            {
618
                LogFileOp("Merge Skip File",$target);
619
            }
620
        }
621
    }
622
}
623
 
624
 
625
# -------------------------------------------------------------------------
626
sub GetYesNo
627
#
628
# -------------------------------------------------------------------------
629
{
630
    my ($question) = @_;
631
    my ($u_tmp) = "";
632
    Question ("$question, (default: y) [y,n]: ");
633
 
634
    while ( <STDIN> )
635
    {
636
        $u_tmp = $_;
637
        chomp($u_tmp);
638
 
639
        return 1
640
            if ( "$u_tmp" eq "" );
641
 
642
        if( $u_tmp =~ /[yn]{1}/i )
643
        {
644
            return ( "$u_tmp" eq "y" );
645
        }
646
        else
647
        {
648
            Question("Please re-enter response? (default: y) [y,n]: ");
649
        }
650
    }
651
}
652
 
653
#-------------------------------------------------------------------------------
654
# Function        : TestDpkgArchive
655
#
656
# Description     : Test the structure of the source achive
657
#                   Ensure that it has some files
658
#                   Warn if files are present in the root directory
659
#
660
# Inputs          : None
661
#
662
# Returns         : Warnings
663
#
664
my $test_dir_count = 0;
665
my $test_file_count = 0;
666
my @test_root_file = ();
667
sub TestDpkgArchive
668
{
669
    Error("Failed to find dir [$SRC_ROOT]",
670
          "Check JATS config.") unless ( -d $SRC_ROOT );
671
 
672
 
673
    #
674
    #   Scan the package counting files and folders
675
    #
676
    $test_dir_count = 0;
677
    $test_file_count = 0;
678
    @test_root_file = ();
679
    File::Find::find( \&pkgFind3, $SRC_ROOT );
680
 
681
    Information ("Package contains:",
682
                 "Files: $test_file_count",
683
                 "Dirs: $test_dir_count",
684
                 );
685
    #
686
    #   There shouldn't be any files in the root directory
687
    #   other than the descpkg and incpkg.
688
    #
689
    Warning ("Unexpected files in package root:", @test_root_file)
690
        if ( @test_root_file  );
691
}
692
 
693
sub pkgFind3
694
{
695
 
696
    #
697
    #   Calculate the target directory name
698
    #
699
    my $target = $File::Find::dir;
700
    $target =~ s~^$SRC_ROOT/*~~;
701
 
702
    if ( -d $_ ) {
703
        $test_dir_count++;
704
    } else {
705
        $test_file_count++;
706
        unless ( $target )
707
        {
708
            next if ( $_ eq 'descpkg' );
709
            next if ( $_ eq 'incpkg' );
710
            push @test_root_file, $_;
711
        }
712
    }
713
}
714
 
715
# ---------------------------------------------------------
716
# ---------------------------------------------------------
717
# Main
718
# ---------------------------------------------------------
719
# ---------------------------------------------------------
720
 
721
 
722
# Initialise our world
723
#
724
Init();
725
 
726
 
727
# Check with the user they want to proceed
728
#
729
unless ( $opt_test )
730
{
731
    Information("Creating dpkg_archive package:", $DPKG_DIR);
732
    unless( $opt_override || $opt_quiet )
733
    {
734
        if ( !GetYesNo( "Do you wish to continue?" ) )
735
        {
736
            Error ("Script terminated by user.");
737
        }
738
    }
739
 
740
    # Create the archive and copy the files
741
    #
742
    CreateDpkgArchive();
743
}
744
else
745
{
746
    TestDpkgArchive();
747
}
748
 
749
# Done
750
#
751
Information ("Done.");
752
exit 0;
753
 
754
 
755
#-------------------------------------------------------------------------------
756
#   Documentation
757
#
758
 
759
=pod
760
 
761
=head1 NAME
762
 
763
create_dpkg - Create a dpkg_archive entry
764
 
765
=head1 SYNOPSIS
766
 
767
 jats create_dpkg [options]
768
 
769
 Options:
770
    -help              - Brief help message
771
    -help -help        - Detailed help message
772
    -man               - Full documentation
773
    -quiet             - Suppress progress messages, then warning messages
774
    -verbose           - Display additional progress messages
775
    -override          - Override any previous version of the package
776
    -merge             - merge with existing version of the package
777
    -archive=name      - Specify archive (cache, local, main, store, sandbox, deploy)
778
    -pname=name        - Ensure package is named correctly
779
    -pversion=version  - Ensure package version is correct
780
    -generic           - Create a built.generic file
781
    -test              - Test package. Do not transfer.
782
 
783
 
784
=head1 OPTIONS
785
 
786
=over 8
787
 
788
=item B<-help>
789
 
790
Print a brief help message and exits.
791
 
792
=item B<-help -help>
793
 
794
Print a detailed help message with an explanation for each option.
795
 
796
=item B<-man>
797
 
798
Prints the manual page and exits.
799
 
800
=item B<-quiet>
801
 
802
This option will suppress almost all of the progress messages, except for a single
803
copy message. It is intended to be used when the program is called from another
804
script.
805
 
806
=item B<-override>
807
 
808
If this option is enabled then any previous version of the target package will
809
be deleted, without any user intervention.
810
 
811
=item B<-merge>
812
 
813
If this option is enabled then the package will be merged with any existing
814
package, without any user intervention. This option is used by the auto build
815
tool to assemble multi-machine packages in dpkg_archive.
816
 
817
=item B<-archive=name>
818
 
819
This option specifies the destination archive to be used. The following names
820
are supported:
821
 
822
=item B<-pname=name>
823
 
824
If this option is provided, the utility will ensure that the package is named
825
correctly.
826
 
827
=item B<-pversion=version>
828
 
829
If this option is provided, the utility will ensure that the package version is
830
that expected.
831
 
832
=item B<-test>
833
 
834
If this option is enabled the utility will perform initial sanity testing, but
835
it will not perform the copy.
836
 
837
=over 8
838
 
839
=item cache
840
 
841
The location of the target archive will be taken from GBE_DPKG_CACHE.
842
 
843
=item local
844
 
845
The location of the target archive will be taken from GBE_DPKG_LOCAL.
846
 
847
=item main (default)
848
 
849
The location of the target archive will be taken from GBE_DPKG. This is the
850
default target archive.
851
 
852
=item store
853
 
854
The location of the target archive will be taken from GBE_DPKG_STORE.
855
 
856
=item sandbox
857
 
858
The location of the target archive will be taken from GBE_DPKG_SBOX.
859
 
860
=item deploy
861
 
862
The location of the target archive will be taken from GBE_DPLY. This is the
863
default target archive is a deployment package is detected.
864
 
865
=back
866
 
867
=item B<-generic>
868
 
869
This option will create a built.generic file, instead of one based on the machine
870
that actually built the package. This is used by the AutoBuilder toolchain.
871
 
872
=back
873
 
874
=head1 DESCRIPTION
875
 
876
This utility program is used to transfer a package that has been built into
877
dpkg_archive. The package is then available for general consumption.
878
 
879
=head2 PACKAGE LOCATION
880
 
881
The utility will locate a package by examining the following directores for
882
the package description file(descpkg).
883
 
884
=over 8
885
 
886
=item ./build/deploy
887
 
888
This format is generated by the deployment builds. The default target archive
889
will be taken from the environment variable GBE_DPLY.
890
 
891
=item ./pkg
892
 
893
This format is generated by JATS builds.
894
 
895
=item ./build/pkg
896
 
897
This format is generated by ANT builds.
898
 
899
=back
900
 
901
The program should be run in the same directory as the build control files as
902
the package subdirectory will be created in that directory.
903
 
904
=head1 EXAMPLE
905
 
906
=head2 jats create_dpkg
907
 
908
This will locate a generated package and install it into the dpkg_archive repository.
909
 
910
=cut
911