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:
335
#     This subroutine is used to locate all associated pkg files in
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
348
    if ( ! -d "$item" && "$file" =~ /^descpkg$/ )
349
    {
350
        $DESCPKG_FILE = $item;
351
        my($dir)= File::Basename::dirname($item);
352
        $DPKG_NAME = File::Basename::basename($dir);
353
        $SRC_ROOT = $dir;
354
    }
355
}
356
 
357
 
358
#------------------------------------------------------------------------------
359
sub GetDpkgArchiveVersion
360
#
361
# Description:
362
#     This subroutine is used to determine the version of the dpkg_archive.
363
#     We assume that the version number is in the descpkg file.
364
#
365
#     Need to allow for two forms of descpkg. Some one decided that a Java
366
#     Manifest would be a good descpkg file - a long time after the rest of the
367
#     world had been using an existing file format.
368
#
369
#     Lines are tagged
370
#
371
#     Once the version number is determined we set the
372
#     global DPKG_VERSION variable.
373
#
374
#------------------------------------------------------------------------------
375
{
376
    my ($path) = @_;
377
    my $line;
378
    my $type;
379
 
380
    #
381
    #   Use a common routine to parse the package descriptor
382
    #   There are several forms that may need to be processed
383
    #
384
    my $pkg_data = ReadDescpkg( $path );
385
    Error("Failed to open file [$path].") unless $pkg_data;
386
 
387
    $DESC_NAME    = $pkg_data->{'NAME'};
388
    $DPKG_VERSION = $pkg_data->{'VERSION_FULL'};
389
}
390
 
391
#-------------------------------------------------------------------------------
392
# Function        : TransferDescpkg
393
#
394
# Description     : Copy and process the descpkg file to the target
395
#
396
# Inputs          :
397
#
398
# Returns         :
399
#
400
sub TransferDescpkg
401
{
402
    my $result = CopyDescpkg( @_ );
403
    Error("Transfer descpkg: $result") if ( $result );
404
}
405
 
406
#------------------------------------------------------------------------------
407
sub CreateDpkgArchive
408
#
409
# Description:
410
#     This subroutine is used to create the dpkg_archive in the $DPKG_ROOT
411
#     location 
412
#
413
#     We use the global DPKG_DIR, DPKG_NAME, and DPKG_VERSION
414
#     to create the required directory structure.
415
#
416
#     If the dpkg_archive is new (ie not a new version) it is assumed the user
417
#     has access to create the top level dir for the new dpkg_archive.
418
#
419
#     The new dpkg_archive is created with the permission of the user 
420
#     executing this script.
421
#
422
#     If an error ocurs during the dpkg_archive creation the script
423
#     will terminate.
424
#
425
#------------------------------------------------------------------------------
426
{
427
 
428
    # first we need to ensure we have the top level directory
429
    #
430
    if ( -d $DPKG_DIR )
431
    {
432
        Warning("Detected previous dpkg_archive [$DPKG_DIR]");
433
        unless ( $opt_override )
434
        {
435
            Error ("Package already exists") if ( $opt_quiet );
436
            if ( !GetYesNo("Do you wish to continue?") )
437
            {
438
                Error("Script terminated by user.");
439
            }
440
        }
441
    }
442
    Information("");
443
 
444
    #
445
    #   Create the top level directory
446
    #
447
    mkpath($DPKG_DIR, 0, 0775);
448
 
449
 
450
    # lets process the files.
451
    #
452
    if ( -d $SRC_ROOT )
453
    {
454
        File::Find::find( \&pkgFind2, $SRC_ROOT );
455
    }
456
    else
457
    {
458
        Error("Failed to find dir [$SRC_ROOT]",
459
              "Check JATS config.");
460
    }
461
 
462
    #
463
    #   Transfer of data is complete
464
    #       Mark the archive with the build type to indicate which parts of
465
    #       a multi-machine build have been performed
466
    #
467
    #
468
    my $touchfile = $opt_generic ? "$DPKG_DIR/built.generic" : "$DPKG_DIR/built.$GBE_MACHTYPE";
469
    LogFileOp("Mark File",$touchfile);
470
    TouchFile ( $touchfile) && Error("Failed to create file [$touchfile].");
471
 
472
    #
473
    #   If there is a .lnk file in the archive then remove it now that the
474
    #   archive has been transferred. The .lnk files are created in 'local'
475
    #   archives in order to simplify multi-package builds
476
    #
477
    my $link_file = "$DPKG_ROOT/$DPKG_NAME/$DPKG_VERSION.lnk";
478
    if ( -f $link_file )
479
    {
480
        LogFileOp("Removing Link",$link_file);
481
        unlink $link_file;
482
    }
483
 
484
    return 1;
485
}
486
 
487
 
488
#------------------------------------------------------------------------------
489
sub pkgFind2
490
#
491
# Description:
492
#   This subroutine is used to locate all associated pkg files in
493
#   the local pkg dir.
494
#
495
#   This routine is called for each file and directory within the package
496
#   Some files and directories are treated in a special manner
497
#       - Top level directory is ignored
498
#
499
#
500
#
501
#------------------------------------------------------------------------------
502
{
503
    my $item = $File::Find::name;
504
    my $base = File::Basename::basename($item);
505
 
506
    #
507
    #   Calculate the target directory name
508
    #
509
    my $target = $item;
510
    $target =~ s/^$SRC_ROOT/$DPKG_DIR/;
511
 
512
    if ( -d $item )
513
    {
514
        #
515
        #   Ignore the top level directory
516
        #   It has already been created
517
        #
518
        return
519
            if ( $item eq $SRC_ROOT );
520
 
521
        #
522
        #   Directories are handled differently
523
        #       - Directories are created with nice permissions
524
        #       - If the directory already exists then it is being
525
        #         replaced or merged. It is not possible to merge some
526
        #         directories - they must be deleted first.
527
        #
528
        if ( ! -d "$target" )
529
        {
530
            LogFileOp("Creating Dir", $target);
531
            mkpath("$target", 0, 0775);
532
        }
533
        else
534
        {
535
            if ( !$opt_merge &&
536
                 "$base" !~ m/^lib$/ &&
537
                 "$base" !~ m/^bin$/ &&
538
                 "$base" !~ m/^jar$/ )
539
            {
540
                LogFileOp("Remove Prev Dir",$target);
541
                rmtree("$target");
542
            }
543
 
544
            unless ( -d $target )
545
            {
546
                LogFileOp("Creating Dir",$target);
547
                mkpath("$target", 0, 0775);
548
            }
549
        }
550
    }
551
    else
552
    {
553
        #
554
        #   File copy
555
        #   If merging then do not overwrite an existing file
556
        #
557
        unless ( $opt_merge && -f $target )
558
        {
559
            if ( $item =~ m~/descpkg$~ )
560
            {
561
                LogFileOp("Rewrite File",$target);
562
                TransferDescpkg( "$item", $target );
563
                CORE::chmod oct("0775"), $target;
564
            }
565
            else
566
            {
567
                #
568
                #   Copy file to destination
569
                #   If the file is a link, then duplicate the link contents
570
                #   Use: Unix libraries are created as two files:
571
                #        lib.xxxx.so -> libxxxx.so.vv.vv.vv
572
                #
573
                if ( -l $item )
574
                {
575
                    LogFileOp("Copying Link", $target);
576
                    my $link = readlink $item;
577
                    Verbose( "Link: $item, $link");
578
                    symlink ($link, $target );
579
                    unless ( $link && -l $target )
580
                    {
581
                        Error("Failed to copy link [$item] to [$target]: $!");
582
                    }
583
                }
584
                elsif (File::Copy::copy($item, $target))
585
                {
586
                    LogFileOp("Copying File",$target);
587
                    CORE::chmod oct("0775"), $target;
588
                }
589
                else
590
                {
591
                    Error("Failed to copy file [$item] to [$target]: $!");
592
                }
593
            }
594
        }
595
        else
596
        {
597
            #
598
            #   Merging packages
599
            #   Ensure that the descpkg file is "touched" so that caches
600
            #   that use this file as a timestamp can be updated
601
            #
602
            if ( $item =~ m~/descpkg$~ )
603
            {
604
                LogFileOp("Touch File",$target);
605
                TouchFile( $target ) && Error ( "Failed to touch: $target" );
606
            }
607
            else
608
            {
609
                LogFileOp("Merge Skip File",$target);
610
            }
611
        }
612
    }
613
}
614
 
615
 
616
# -------------------------------------------------------------------------
617
sub GetYesNo
618
#
619
# -------------------------------------------------------------------------
620
{
621
    my ($question) = @_;
622
    my ($u_tmp) = "";
623
    Question ("$question, (default: y) [y,n]: ");
624
 
625
    while ( <STDIN> )
626
    {
627
        $u_tmp = $_;
628
        chomp($u_tmp);
629
 
630
        return 1
631
            if ( "$u_tmp" eq "" );
632
 
633
        if( $u_tmp =~ /[yn]{1}/i )
634
        {
635
            return ( "$u_tmp" eq "y" );
636
        }
637
        else
638
        {
639
            Question("Please re-enter response? (default: y) [y,n]: ");
640
        }
641
    }
642
}
643
 
644
#-------------------------------------------------------------------------------
645
# Function        : TestDpkgArchive
646
#
647
# Description     : Test the structure of the source achive
648
#                   Ensure that it has some files
649
#                   Warn if files are present in the root directory
650
#
651
# Inputs          : None
652
#
653
# Returns         : Warnings
654
#
655
my $test_dir_count = 0;
656
my $test_file_count = 0;
657
my @test_root_file = ();
658
sub TestDpkgArchive
659
{
660
    Error("Failed to find dir [$SRC_ROOT]",
661
          "Check JATS config.") unless ( -d $SRC_ROOT );
662
 
663
 
664
    #
665
    #   Scan the package counting files and folders
666
    #
667
    $test_dir_count = 0;
668
    $test_file_count = 0;
669
    @test_root_file = ();
670
    File::Find::find( \&pkgFind3, $SRC_ROOT );
671
 
672
    Information ("Package contains:",
673
                 "Files: $test_file_count",
674
                 "Dirs: $test_dir_count",
675
                 );
676
    #
677
    #   There shouldn't be any files in the root directory
678
    #   other than the descpkg and incpkg.
679
    #
680
    Warning ("Unexpected files in package root:", @test_root_file)
681
        if ( @test_root_file  );
682
}
683
 
684
sub pkgFind3
685
{
686
 
687
    #
688
    #   Calculate the target directory name
689
    #
690
    my $target = $File::Find::dir;
691
    $target =~ s~^$SRC_ROOT/*~~;
692
 
693
    if ( -d $_ ) {
694
        $test_dir_count++;
695
    } else {
696
        $test_file_count++;
697
        unless ( $target )
698
        {
699
            next if ( $_ eq 'descpkg' );
700
            next if ( $_ eq 'incpkg' );
701
            push @test_root_file, $_;
702
        }
703
    }
704
}
705
 
706
# ---------------------------------------------------------
707
# ---------------------------------------------------------
708
# Main
709
# ---------------------------------------------------------
710
# ---------------------------------------------------------
711
 
712
 
713
# Initialise our world
714
#
715
Init();
716
 
717
 
718
# Check with the user they want to proceed
719
#
720
unless ( $opt_test )
721
{
722
    Information("Creating dpkg_archive package:", $DPKG_DIR);
723
    unless( $opt_override || $opt_quiet )
724
    {
725
        if ( !GetYesNo( "Do you wish to continue?" ) )
726
        {
727
            Error ("Script terminated by user.");
728
        }
729
    }
730
 
731
    # Create the archive and copy the files
732
    #
733
    CreateDpkgArchive();
734
}
735
else
736
{
737
    TestDpkgArchive();
738
}
739
 
740
# Done
741
#
742
Information ("Done.");
743
exit 0;
744
 
745
 
746
#-------------------------------------------------------------------------------
747
#   Documentation
748
#
749
 
750
=pod
751
 
752
=head1 NAME
753
 
754
create_dpkg - Create a dpkg_archive entry
755
 
756
=head1 SYNOPSIS
757
 
758
 jats create_dpkg [options]
759
 
760
 Options:
761
    -help              - Brief help message
762
    -help -help        - Detailed help message
763
    -man               - Full documentation
764
    -quiet             - Suppress progress messages, then warning messages
765
    -verbose           - Display additional progress messages
766
    -override          - Override any previous version of the package
767
    -merge             - merge with existing version of the package
768
    -archive=name      - Specify archive (cache, local, main, store, sandbox, deploy)
769
    -pname=name        - Ensure package is named correctly
770
    -pversion=version  - Ensure package version is correct
771
    -generic           - Create a built.generic file
772
    -test              - Test package. Do not transfer.
773
 
774
 
775
=head1 OPTIONS
776
 
777
=over 8
778
 
779
=item B<-help>
780
 
781
Print a brief help message and exits.
782
 
783
=item B<-help -help>
784
 
785
Print a detailed help message with an explanation for each option.
786
 
787
=item B<-man>
788
 
789
Prints the manual page and exits.
790
 
791
=item B<-quiet>
792
 
793
This option will suppress almost all of the progress messages, except for a single
794
copy message. It is intended to be used when the program is called from another
795
script.
796
 
797
=item B<-override>
798
 
799
If this option is enabled then any previous version of the target package will
800
be deleted, without any user intervention.
801
 
802
=item B<-merge>
803
 
804
If this option is enabled then the package will be merged with any existing
805
package, without any user intervention. This option is used by the auto build
806
tool to assemble multi-machine packages in dpkg_archive.
807
 
808
=item B<-archive=name>
809
 
810
This option specifies the destination archive to be used. The following names
811
are supported:
812
 
813
=item B<-pname=name>
814
 
815
If this option is provided, the utility will ensure that the package is named
816
correctly.
817
 
818
=item B<-pversion=version>
819
 
820
If this option is provided, the utility will ensure that the package version is
821
that expected.
822
 
823
=item B<-test>
824
 
825
If this option is enabled the utility will perform initial sanity testing, but
826
it will not perform the copy.
827
 
828
=over 8
829
 
830
=item cache
831
 
832
The location of the target archive will be taken from GBE_DPKG_CACHE.
833
 
834
=item local
835
 
836
The location of the target archive will be taken from GBE_DPKG_LOCAL.
837
 
838
=item main (default)
839
 
840
The location of the target archive will be taken from GBE_DPKG. This is the
841
default target archive.
842
 
843
=item store
844
 
845
The location of the target archive will be taken from GBE_DPKG_STORE.
846
 
847
=item sandbox
848
 
849
The location of the target archive will be taken from GBE_DPKG_SBOX.
850
 
851
=item deploy
852
 
853
The location of the target archive will be taken from GBE_DPLY. This is the
854
default target archive is a deployment package is detected.
855
 
856
=back
857
 
858
=item B<-generic>
859
 
860
This option will create a built.generic file, instead of one based on the machine
861
that actually built the package. This is used by the AutoBuilder toolchain.
862
 
863
=back
864
 
865
=head1 DESCRIPTION
866
 
867
This utility program is used to transfer a package that has been built into
868
dpkg_archive. The package is then available for general consumption.
869
 
870
=head2 PACKAGE LOCATION
871
 
872
The utility will locate a package by examining the following directores for
873
the package description file(descpkg).
874
 
875
=over 8
876
 
877
=item ./build/deploy
878
 
879
This format is generated by the deployment builds. The default target archive
880
will be taken from the environment variable GBE_DPLY.
881
 
882
=item ./pkg
883
 
884
This format is generated by JATS builds.
885
 
886
=item ./build/pkg
887
 
888
This format is generated by ANT builds.
889
 
890
=back
891
 
892
The program should be run in the same directory as the build control files as
893
the package subdirectory will be created in that directory.
894
 
895
=head1 EXAMPLE
896
 
897
=head2 jats create_dpkg
898
 
899
This will locate a generated package and install it into the dpkg_archive repository.
900
 
901
=cut
902