Subversion Repositories DevTools

Rev

Rev 1552 | Rev 1556 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1552 Rev 1554
Line 156... Line 156...
156
 
156
 
157
my ($VENDOR_DESC)            = "ERG Transit Systems Ltd";
157
my ($VENDOR_DESC)            = "ERG Transit Systems Ltd";
158
my ($CATEGORY_DESC)          = "application";
158
my ($CATEGORY_DESC)          = "application";
159
my ($ERGAFC_BASEDIR)         = "/afc";
159
my ($ERGAFC_BASEDIR)         = "/afc";
160
my ($MAXINST)                = "1000";
160
my ($MAXINST)                = "1000";
161
my ($PROJECT_ACRONYM_LENGTH) = 3;
-
 
162
my ($PKG_OVERVIEW)           = "To Be Defined.";
161
my ($PKG_OVERVIEW)           = "To Be Defined.";
163
 
162
 
164
my (@PATCH_INFO_FILES) = qw (
163
my (@PATCH_INFO_FILES) = qw (
165
    checkinstall 
164
    checkinstall 
166
    copyright 
165
    copyright 
Line 456... Line 455...
456
        }
455
        }
457
    }
456
    }
458
 
457
 
459
    if ($opt_v)
458
    if ($opt_v)
460
    {
459
    {
461
        if( "$opt_v" =~ m/^[0-9]*\.[0-9]*\.[0-9]*-[0-9]*\.[a-z][a-z][a-z]$/ ) # N.N.N-N.ppp
460
        if( "$opt_v" =~ m/^(\d*)\.(\d*)\.(\d*)-(\d*)\.([a-z]{2,3})$/ ) # N.N.N-N.ppp
462
        {
461
        {
463
            my ($s1, $s2) = split (/-/, $opt_v);
-
 
464
            my ($s1a, $s1b, $s1c) = split (/\./, $s1);
462
            my ($s1, $s2, $s3, $s4, $s5) = ($1, $2, $3, $4, $5);
465
            my ($s2a, $s2b) = split (/\./, $s2);
-
 
466
 
463
 
467
            $PkgVersionStr = sprintf("%02s%02s%02s", $s1a,$s1b,$s1c);
464
            $PkgVersionStr = sprintf("%02s%02s%02s", $s1,$s2,$s3);
468
            $PkgVersion  = "$s1";
465
            $PkgVersion  = "$s1\.$s2\.$s3";
469
            $PkgBuildNum = "$s2a";
466
            $PkgBuildNum = $s4;
470
 
-
 
471
            if ( length("$s2b") == $PROJECT_ACRONYM_LENGTH )
-
 
472
            {
-
 
473
                $ProjectAcronym   = $s2b;
467
            $ProjectAcronym   = $s5;
474
            }
-
 
475
            else
-
 
476
            {
-
 
477
                Error("-v command line arg [$opt_v] has invalid format",
-
 
478
                      "Required format is N.N.N-B.ppp where:",
-
 
479
                      "    N is an integer",
-
 
480
                      "    B is an integer",
-
 
481
                      "    ppp is the project acronym",
-
 
482
                      "Check propject acronym.");
-
 
483
            }
-
 
484
        }
468
        }
485
        elsif( "$opt_v" =~ m/^[0-9]*\.[0-9]*\.[0-9]*\.[a-z][a-z][a-z]$/ ) # N.N.N.ppp 
469
        elsif( "$opt_v" =~ m/^(\d*)\.(\d*)\.(\d*)\.([a-z]{2,3})$/ ) # N.N.N.ppp
486
        {
470
        {
487
            my ($tmpVar) = $opt_v;
-
 
488
            $tmpVar =~ s/^([0-9]*)\.([0-9]*)\.([0-9]*)\.([a-z][a-z][a-z])$/$1,$2,$3,$4/g;
-
 
489
            my ($s1, $s2, $s3, $s4) = split (/,/, $tmpVar);
471
            my ($s1, $s2, $s3, $s4) = ($1, $2, $3, $4);
490
 
472
 
491
            $PkgVersionStr = sprintf("%02s%02s%02s", $s1,$s2,$s3);
473
            $PkgVersionStr = sprintf("%02s%02s%02s", $s1,$s2,$s3);
492
            $PkgVersion  = "$s1\.$s2\.$s3";
474
            $PkgVersion  = "$s1\.$s2\.$s3";
493
            $PkgBuildNum = "1";
475
            $PkgBuildNum = "1";
494
 
-
 
495
            if ( length("$s4") == $PROJECT_ACRONYM_LENGTH )
-
 
496
            {
-
 
497
                $ProjectAcronym   = $s4;
476
            $ProjectAcronym   = $s4;
498
            }
-
 
499
            else
-
 
500
            {
-
 
501
                Error("-v command line arg [$opt_v] has invalid format",
-
 
502
                      "Required format is N.N.N.ppp where:",
-
 
503
                      "    N is an integer",
-
 
504
                      "    ppp is the project acronym",
-
 
505
                      "Check propject acronym.");
-
 
506
            }
-
 
507
        }
477
        }
508
        else
478
        else
509
        {
479
        {
510
            Error("-v command line arg [$opt_v] has invalid format",
480
            Error("-v command line arg [$opt_v] has invalid format",
511
                  "Allowed formats are N.N.N-B.ppp and N.N.N.ppp where:",
481
                  "Allowed formats are N.N.N-B.ppp and N.N.N.ppp where:",
Line 513... Line 483...
513
                  "    B is an integer",
483
                  "    B is an integer",
514
                  "    ppp is the project acronym",
484
                  "    ppp is the project acronym",
515
                  "Check propject acronym.");
485
                  "Check propject acronym.");
516
 
486
 
517
        }
487
        }
518
 
-
 
519
        $PkgVersionUser  = $opt_v;
488
        $PkgVersionUser  = $opt_v;
520
    }
489
    }
521
    else
490
    else
522
    {
491
    {
523
        Error("Package Version not supplied!");
492
        Error("Package Version not supplied!");
Line 3339... Line 3308...
3339
#
3308
#
3340
#       The sub routine also updates to the prototype file with an appropriate
3309
#       The sub routine also updates to the prototype file with an appropriate
3341
#       entry for the associated file.
3310
#       entry for the associated file.
3342
# Inputs:
3311
# Inputs:
3343
#       sDirTag                 - Source directory tag
3312
#       sDirTag                 - Source directory tag
-
 
3313
#                                 Or --Package=name,subdir
-
 
3314
#                                 Or --Interface=subdir
3344
#       sfile                   - Source File Name [Mandatory]
3315
#       sfile                   - Source File Name [Mandatory]
3345
#       tfile                   - Not sure. Used in the prototype file.
3316
#       tfile                   - Not sure. Used in the prototype file.
3346
#                                 Suggest using the same name as sfile
3317
#                                 Suggest using the same name as sfile
3347
#
3318
#
3348
#       If it has any problems it will log an error and stop processing.
3319
#       If it has any problems it will log an error and stop processing.
Line 3439... Line 3410...
3439
#       The sub routine also updates to the prototype file with an appropriate
3410
#       The sub routine also updates to the prototype file with an appropriate
3440
#       entry for the associated file.
3411
#       entry for the associated file.
3441
#
3412
#
3442
#       If it has any problems it will log an error and stop processing.
3413
#       If it has any problems it will log an error and stop processing.
3443
#
3414
#
-
 
3415
# Inputs:
-
 
3416
#       sDirTag                 - Source directory tag
-
 
3417
#                                 Or --Package=name,subdir
-
 
3418
#                                 Or --Interface=subdir
-
 
3419
#       sfile                   - Source File Name [Mandatory]
-
 
3420
#       tfile                   - Not sure. Used in the prototype file.
-
 
3421
#                                 Suggest using the same name as sfile
-
 
3422
#       class                   - Class Name
3444
#------------------------------------------------------------------------------
3423
#------------------------------------------------------------------------------
3445
{
3424
{
3446
    # correct number of parameters?
3425
    # correct number of parameters?
3447
    if ( ($#_+1) != 4 )
3426
    if ( ($#_+1) != 4 )
3448
    {
3427
    {
Line 4186... Line 4165...
4186
{
4165
{
4187
    Information("Cleaning any previous target file items...");
4166
    Information("Cleaning any previous target file items...");
4188
 
4167
 
4189
    my ($i);
4168
    my ($i);
4190
 
4169
 
4191
    # Clean out PkgBaseDir
4170
    #   Clean out PkgBaseDir
4192
    # This is the directory in whcih the final package image will be assembled
4171
    #   This is the directory in which the final package image will be assembled
-
 
4172
    #   Recreate the directory. Ensure that it does not have setgid on the directory
-
 
4173
    #   as this will affect all the subdirectories that are created and will
-
 
4174
    #   propergate into the target package.
4193
    #
4175
    #
4194
    rmDirectory("$PkgBaseDir");
4176
    rmDirectory( $PkgBaseDir );
-
 
4177
    make_directory( $PkgDir, 0777, "Create target base dir");
4195
 
4178
 
4196
    # lets create.
4179
    # lets create.
4197
    #
4180
    #
4198
    Information ("Creating target directory structure...");
4181
    Information ("Creating target directory structure...");
4199
    make_directory( "$PkgBaseDir/$TargetBaseDir", 0777, "Create target dir");
4182
    make_directory( "$PkgBaseDir/$TargetBaseDir", 0777, "Create target dir");
Line 6315... Line 6298...
6315
# Description     : This sub-routine is used to copy a local deployment file into
6298
# Description     : This sub-routine is used to copy a local deployment file into
6316
#                   the target destination dir.
6299
#                   the target destination dir.
6317
#
6300
#
6318
# Inputs          : m_srcDirTag             - Tag for Source Dir name
6301
# Inputs          : m_srcDirTag             - Tag for Source Dir name
6319
#                                             Tag defined in %LocalSrcDirStructure
6302
#                                             Tag defined in %LocalSrcDirStructure
-
 
6303
#                                             Or --Package=name,subdir
-
 
6304
#                                             Or --Interface=subdir
-
 
6305
#
6320
#                   m_sfile                 - Name of the source file
6306
#                   m_sfile                 - Name of the source file
6321
#                   m_targetDirTag          - Tag for the target directory
6307
#                   m_targetDirTag          - Tag for the target directory
6322
#                                             Tag defined in %TargetDstDirStructure
6308
#                                             Tag defined in %TargetDstDirStructure
6323
#                   m_nfile                 - Target filename
6309
#                   m_nfile                 - Target filename
6324
#                                             Must be specified. If set to "", then
6310
#                                             Must be specified. If set to "", then
Line 6818... Line 6804...
6818
    {
6804
    {
6819
        Warning("Unable to retrieve Release Manager Release Notes: LWP module missing");
6805
        Warning("Unable to retrieve Release Manager Release Notes: LWP module missing");
6820
        return 0;
6806
        return 0;
6821
    }
6807
    }
6822
 
6808
 
-
 
6809
    our $GBE_RM_URL;
-
 
6810
    EnvImport('GBE_RM_URL');
-
 
6811
    
6823
    Information("Retrieving Release Notes From Release Manager...Please wait...");
6812
    Information("Retrieving Release Notes From Release Manager...Please wait...");
6824
 
6813
 
6825
    my $user_agent = LWP::UserAgent->new( timeout => 30 );
6814
    my $user_agent = LWP::UserAgent->new( timeout => 30 );
6826
    my $response = $user_agent->get('http://erg:8002/ManagerSuite/Release_Manager/_adhoc_release_notes.asp?pv_id='. $RmPkgDetails->pv_id(), 
6815
    my $response = $user_agent->get( $GBE_RM_URL . '/_adhoc_release_notes.asp?pv_id='. $RmPkgDetails->pv_id(),
6827
                                    ':content_file' => "$PkgReleaseNote\.html");
6816
                                    ':content_file' => "$PkgReleaseNote\.html");
6828
    if ( $response->is_success )
6817
    if ( $response->is_success )
6829
    {
6818
    {
6830
        Verbose("Retrieved Release Manager HTML Release note [$PkgReleaseNote\.html]");
6819
        Verbose("Retrieved Release Manager HTML Release note [$PkgReleaseNote\.html]");
6831
        return 1;
6820
        return 1;
Line 7587... Line 7576...
7587
    }
7576
    }
7588
    else
7577
    else
7589
    {
7578
    {
7590
        Verbose2 ( "$text: $name [$umask_text] - already exists");
7579
        Verbose2 ( "$text: $name [$umask_text] - already exists");
7591
    }
7580
    }
-
 
7581
 
-
 
7582
    #
-
 
7583
    #   Ensure that the target directory is not setgid
-
 
7584
    #   as this will mess up the Solaris packaging process. The setgid on the
-
 
7585
    #   directories will be propergated into the final package. This is not good.
-
 
7586
    #
-
 
7587
    #   If the user gets directories with SETGID, then they  must be created
-
 
7588
    #   specifically after the directory has been created.
-
 
7589
    #
-
 
7590
    #   Why is this a problem? Seen when a build user has directory setgid
-
 
7591
    #   for the purposes of making the directory accessible by many.
-
 
7592
    #
-
 
7593
    if ( -g $name )
-
 
7594
    {
-
 
7595
        system ('chmod', 'g-s', $name );
-
 
7596
        Error ("Cannot remove setGID on directory.", "Dir: $name") if ( -g $name );
-
 
7597
    }
7592
}
7598
}
7593
 
7599
 
7594
 
7600
 
7595
#-------------------------------------------------------------------------------
7601
#-------------------------------------------------------------------------------
7596
# Function        : ActivePlatform
7602
# Function        : ActivePlatform