Subversion Repositories DevTools

Rev

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

Rev 1532 Rev 1534
Line 36... Line 36...
36
use File::Path;
36
use File::Path;
37
use Cwd;
37
use Cwd;
38
use Carp;
38
use Carp;
39
use DBI;
39
use DBI;
40
use LWP::UserAgent;
40
use LWP::UserAgent;
41
use DeployUtils::Logger;
-
 
42
use DeployUtils::RmPkgInfo;
41
use DeployUtils::RmPkgInfo;
43
use BuildConfig;
42
use BuildConfig;
44
use Exporter();
43
use Exporter();
-
 
44
 
45
use ArrayHashUtils;
45
use ArrayHashUtils;
-
 
46
use JatsError;
-
 
47
use JatsSystem;
46
 
48
 
47
#-------------------------------------------------------------------------------
49
#-------------------------------------------------------------------------------
48
#   Export variables and function into the users name space
50
#   Export variables and function into the users name space
49
#-------------------------------------------------------------------------------
51
#-------------------------------------------------------------------------------
50
our @ISA    = qw(Exporter);
52
our @ISA    = qw(Exporter);
Line 122... Line 124...
122
                    &convertFile
124
                    &convertFile
123
 
125
 
124
                    &getErgAfcBaseDir
126
                    &getErgAfcBaseDir
125
                    &getGenericNameNoVersionForLib
127
                    &getGenericNameNoVersionForLib
126
                    &getGenericNameForLib
128
                    &getGenericNameForLib
-
 
129
                    &createZip
127
 
130
 
128
                    %TargetDstDirStructure
131
                    %TargetDstDirStructure
129
                    %LocalSrcDirStructure
132
                    %LocalSrcDirStructure
130
                    %BuildPkgArchive
133
                    %BuildPkgArchive
131
                    $MachType
134
                    $MachType
Line 282... Line 285...
282
 
285
 
283
#------------------------------------------------------------------------------
286
#------------------------------------------------------------------------------
284
# Initialization actions
287
# Initialization actions
285
#------------------------------------------------------------------------------
288
#------------------------------------------------------------------------------
286
 
289
 
-
 
290
#
-
 
291
#   Init the error and message subsystem
-
 
292
#
-
 
293
ErrorConfig( 'name'    => 'DEPLOYLIB' ,
-
 
294
             'debug'   => $ENV{GBE_DEBUG},
-
 
295
             'verbose' => $ENV{GBE_VERBOSE},
-
 
296
             );
-
 
297
 
287
 
298
 
288
#------------------------------------------------------------------------------
299
#------------------------------------------------------------------------------
289
# Package Interface Subroutines
300
# Package Interface Subroutines
290
#
301
#
291
# The following functions are used by the Makefile.pl scripts.  Programmers
302
# The following functions are used by the Makefile.pl scripts.  Programmers
Line 328... Line 339...
328
    #  	Previous (old) version number                                  (-o)
339
    #  	Previous (old) version number                                  (-o)
329
    #  	Platform                                                       (-m)
340
    #  	Platform                                                       (-m)
330
    # 	Product (optional)                                             (-k)
341
    # 	Product (optional)                                             (-k)
331
    #  	Machine Type (optional)                                        (-g)
342
    #  	Machine Type (optional)                                        (-g)
332
    
343
    
333
    setLogLevel($ENV{DEPLOYLIB_DEBUG}) if ( defined($ENV{DEPLOYLIB_DEBUG}) && $ENV{DEPLOYLIB_DEBUG} >= 1 && $ENV{DEPLOYLIB_DEBUG} <= 5);
-
 
334
    
-
 
335
    $CurrentDir = cwd;
344
    $CurrentDir = cwd;
336
 
345
 
337
    my ($i);
346
    my ($i);
338
    Getopt::Std::getopts ('v:n:r:t:m:d:p:o:k:g:');
347
    Getopt::Std::getopts ('v:n:r:t:m:d:p:o:k:g:');
339
    if ( $opt_n )
348
    if ( $opt_n )
340
    {
349
    {
341
        $PkgName      = $opt_n;
350
        $PkgName      = $opt_n;
342
    }
351
    }
343
    else
352
    else
344
    {
353
    {
345
        LogError("Package Name not supplied!");
354
        Error("Package Name not supplied!");
346
    }
355
    }
347
 
356
 
348
    if ( $opt_r )
357
    if ( $opt_r )
349
    {
358
    {
350
        # lets change to root dir and get fully qualified path from cwd and return back
359
        # lets change to root dir and get fully qualified path from cwd and return back
Line 354... Line 363...
354
 
363
 
355
        $SandBoxName      = File::Basename::basename($RootDir);
364
        $SandBoxName      = File::Basename::basename($RootDir);
356
    }
365
    }
357
    else
366
    else
358
    {
367
    {
359
        LogError("GBE_ROOT not supplied!");
368
        Error("GBE_ROOT not supplied!");
360
    }
369
    }
361
 
370
 
362
    if ( $opt_t )
371
    if ( $opt_t )
363
    {
372
    {
364
        $BuildType = $opt_t;
373
        $BuildType = $opt_t;
365
    }
374
    }
366
    else
375
    else
367
    {
376
    {
368
        LogError("GBE_TYPE not supplied!");
377
        Error("GBE_TYPE not supplied!");
369
    }
378
    }
370
 
379
 
371
    #
380
    #
372
    #   Target machine type ( Underlying machine type in a Product Family)
381
    #   Target machine type ( Underlying machine type in a Product Family)
373
    #   If not provided, the assume that its the same as the platform (compat)
382
    #   If not provided, the assume that its the same as the platform (compat)
Line 388... Line 397...
388
        {
397
        {
389
            $MachType = 'win32';
398
            $MachType = 'win32';
390
        }
399
        }
391
        else
400
        else
392
        {
401
        {
393
            LogError("Unknown target [$opt_g] supplied!");
402
            Error("Unknown target [$opt_g] supplied!");
394
        }
403
        }
395
    }
404
    }
396
 
405
 
397
    #
406
    #
398
    #   Platform
407
    #   Platform
Line 402... Line 411...
402
    {
411
    {
403
        $Platform = $opt_m;
412
        $Platform = $opt_m;
404
    }
413
    }
405
    else
414
    else
406
    {
415
    {
407
        LogError("Platform not supplied!");
416
        Error("Platform not supplied!");
408
    }
417
    }
409
 
418
 
410
    #
419
    #
411
    #   Setup Product
420
    #   Setup Product
412
    #   If not defined then use the platform
421
    #   If not defined then use the platform
Line 417... Line 426...
417
    {
426
    {
418
        $TargetBaseDir = $opt_d;
427
        $TargetBaseDir = $opt_d;
419
    }
428
    }
420
    else
429
    else
421
    {
430
    {
422
        LogError("Package base directory not supplied!");
431
        Error("Package base directory not supplied!");
423
    }
432
    }
424
 
433
 
425
    if ( $opt_p )
434
    if ( $opt_p )
426
    {
435
    {
427
        my $pNum = sprintf("%02s", $opt_p);
436
        my $pNum = sprintf("%02s", $opt_p);
Line 429... Line 438...
429
        {
438
        {
430
            $PkgPatchNum = $pNum;
439
            $PkgPatchNum = $pNum;
431
        }
440
        }
432
        else
441
        else
433
        {
442
        {
434
            LogError("-p command line arg [$opt_p] has invalid format,\n" .
443
            Error("-p command line arg [$opt_p] has invalid format",
435
                     "required format is an integer value.");
444
                     "Required format is an integer value.");
436
        }
445
        }
437
    }
446
    }
438
 
447
 
439
    if ($opt_v)
448
    if ($opt_v)
440
    {
449
    {
Line 452... Line 461...
452
            {
461
            {
453
                $ProjectAcronym   = $s2b;
462
                $ProjectAcronym   = $s2b;
454
            }
463
            }
455
            else
464
            else
456
            {
465
            {
457
                LogError("-v command line arg [$opt_v] has invalid format, " .
466
                Error("-v command line arg [$opt_v] has invalid format",
458
                         "required format is N.N.N-B.ppp where N is an integer and ppp is the project acronym.\n" .
467
                      "Required format is N.N.N-B.ppp where:",
-
 
468
                      "    N is an integer",
-
 
469
                      "    B is an integer",
-
 
470
                      "    ppp is the project acronym",
459
                         "Check propject acronym.");
471
                      "Check propject acronym.");
460
            }
472
            }
461
        }
473
        }
462
        elsif( "$opt_v" =~ m/^[0-9]*\.[0-9]*\.[0-9]*\.[a-z][a-z][a-z]$/ ) # N.N.N.ppp 
474
        elsif( "$opt_v" =~ m/^[0-9]*\.[0-9]*\.[0-9]*\.[a-z][a-z][a-z]$/ ) # N.N.N.ppp 
463
        {
475
        {
464
            my ($tmpVar) = $opt_v;
476
            my ($tmpVar) = $opt_v;
Line 473... Line 485...
473
            {
485
            {
474
                $ProjectAcronym   = $s4;
486
                $ProjectAcronym   = $s4;
475
            }
487
            }
476
            else
488
            else
477
            {
489
            {
478
                LogError("-v command line arg [$opt_v] has invalid format, " .
490
                Error("-v command line arg [$opt_v] has invalid format",
479
                         "required format is N.N.N.ppp where N is an integers and ppp is the project acronym.\n" .
491
                      "Required format is N.N.N.ppp where:",
-
 
492
                      "    N is an integer",
-
 
493
                      "    ppp is the project acronym",
480
                         "Check propject acronym.");
494
                      "Check propject acronym.");
481
            }
495
            }
482
        }
496
        }
483
        else
497
        else
484
        {
498
        {
485
            LogError("-v command line arg [$opt_v] has invalid format, " .
499
            Error("-v command line arg [$opt_v] has invalid format",
-
 
500
                  "Allowed formats are N.N.N-B.ppp and N.N.N.ppp where:",
-
 
501
                  "    N is an integer",
486
                     "possible formats include:\n\n" .
502
                  "    B is an integer",
487
                     "\tN.N.N-B.ppp where N and B are integers and ppp is the project acronym,\n" .
503
                  "    ppp is the project acronym",
488
                     "\tN.N.N.ppp where N is an integer and ppp is the project acronym, B=0.\n");
504
                  "Check propject acronym.");
-
 
505
 
489
        }
506
        }
490
 
507
 
491
        $PkgVersionUser  = $opt_v;
508
        $PkgVersionUser  = $opt_v;
492
    }
509
    }
493
    else
510
    else
494
    {
511
    {
495
        LogError("Package Version not supplied!");
512
        Error("Package Version not supplied!");
496
    }
513
    }
497
 
514
 
498
 
515
 
499
    # lets check to see if we have a previous version 
516
    # lets check to see if we have a previous version 
500
    if ($opt_o)
517
    if ($opt_o)
Line 531... Line 548...
531
    #   InstallShield files are provided via a package
548
    #   InstallShield files are provided via a package
532
    #   Ensure that a suitable package has been provided
549
    #   Ensure that a suitable package has been provided
533
    #
550
    #
534
    if ( ! -d  $PKG_UTIL_DIR )
551
    if ( ! -d  $PKG_UTIL_DIR )
535
    {
552
    {
536
        LogError('-x', "No deployment support files found");
553
        Error("No deployment support files found",
537
        LogError(      "These MUST be provided by a dependant package in build.pl");
554
              "These MUST be provided by a dependant package in build.pl");
538
    }
555
    }
539
 
556
 
540
 
557
 
541
    $Username     = getlogin || getpwuid($<);
558
    $Username     = getlogin || getpwuid($<);
542
 
559
 
Line 631... Line 648...
631
            }
648
            }
632
        }
649
        }
633
 
650
 
634
    }
651
    }
635
 
652
 
636
    LogNorm("------------------------------------------------------------");
653
    Information("------------------------------------------------------------");
637
 
654
 
638
 
655
 
639
    # lets generate the patch id if we are building a patch
656
    # lets generate the patch id if we are building a patch
640
    #
657
    #
641
    if ( "x$PkgPatchNum" ne "x" )
658
    if ( "x$PkgPatchNum" ne "x" )
642
    {
659
    {
643
        LogNorm("This is a PATCH build...");
660
        Information("This is a PATCH build...");
644
 
661
 
645
        $PkgPatchName = uc ($PkgName);
662
        $PkgPatchName = uc ($PkgName);
646
 
663
 
647
 
664
 
648
        my ($_tmpStr) = sprintf("%s%s", $PkgPatchName, 
665
        my ($_tmpStr) = sprintf("%s%s", $PkgPatchName, 
Line 669... Line 686...
669
        #
686
        #
670
        $PkgOutputFile = "na"; 
687
        $PkgOutputFile = "na"; 
671
    }
688
    }
672
    else
689
    else
673
    {
690
    {
674
        LogNorm("This is a normal RELEASE build...");
691
        Information("This is a normal RELEASE build...");
675
        $PkgReleaseNote = "$ReleaseDir" . "/" .
692
        $PkgReleaseNote = "$ReleaseDir" . "/" .
676
                                                                "$PkgName" . "-" . 
693
                                                                "$PkgName" . "-" . 
677
                                                                "$PkgVersion" . "." .
694
                                                                "$PkgVersion" . "." .
678
                                                                "$ProjectAcronym" . "-" .
695
                                                                "$ProjectAcronym" . "-" .
679
                                                                "$Platform";
696
                                                                "$Platform";
Line 691... Line 708...
691
                         "$ProjectAcronym" . "-" .
708
                         "$ProjectAcronym" . "-" .
692
                         "$Platform" . "-" .
709
                         "$Platform" . "-" .
693
                         "$BuildType\.pkg";
710
                         "$BuildType\.pkg";
694
    }
711
    }
695
 
712
 
696
    LogNorm("------------------------------------------------------------");
713
    Information("------------------------------------------------------------");
697
 
714
 
698
 
715
 
699
    # lets just show what we have determined.
716
    # lets just show what we have determined.
700
    #
717
    #
701
    LogNorm("Current environment definitions (Increase Debug Level to see all definitions)...");
718
    Information("Current environment definitions (Increase Verbose Level to see all definitions)...");
702
 
719
 
703
    LogInfo("DeployFiles      =[$PKG_UTIL_DIR]");
720
    Verbose("DeployFiles      =[$PKG_UTIL_DIR]");
704
 
721
 
705
    LogNorm("PkgName          =[$PkgName]");
722
    Information("PkgName          =[$PkgName]");
706
    LogNorm("PkgVersionUser   =[$PkgVersionUser]");
723
    Information("PkgVersionUser   =[$PkgVersionUser]");
707
 
724
 
708
    LogNorm("PkgVersion       =[$PkgVersion]");
725
    Information("PkgVersion       =[$PkgVersion]");
709
    LogNorm("PkgVersionStr    =[$PkgVersionStr]");
726
    Information("PkgVersionStr    =[$PkgVersionStr]");
710
 
727
 
711
    LogNorm("PkgBuildNum      =[$PkgBuildNum]");
728
    Information("PkgBuildNum      =[$PkgBuildNum]");
712
 
729
 
713
    if ( "x$PkgPatchID" ne "x" )
730
    if ( "x$PkgPatchID" ne "x" )
714
    {
731
    {
715
        LogNorm("PkgPatchName     =[$PkgPatchName]");
732
        Information("PkgPatchName     =[$PkgPatchName]");
716
        LogNorm("PkgPatchNum      =[$PkgPatchNum]");
733
        Information("PkgPatchNum      =[$PkgPatchNum]");
717
        LogNorm("PkgPatchID       =[$PkgPatchID]");
734
        Information("PkgPatchID       =[$PkgPatchID]");
718
        LogNorm("PkgPatchTmpDir   =[$PkgPatchTmpDir]");
735
        Information("PkgPatchTmpDir   =[$PkgPatchTmpDir]");
719
    }
736
    }
720
 
737
 
721
    LogNorm("PkgReleaseNote   =[$PkgReleaseNote]") unless ($autobuild);
738
    Information("PkgReleaseNote   =[$PkgReleaseNote]") unless ($autobuild);
722
    LogNorm("PkgReleaseNote   =[Delayed by ABT]") if ($autobuild);
739
    Information("PkgReleaseNote   =[Generated later by ABT]") if ($autobuild);
723
    LogNorm("PkgLabel         =[$PkgLabel]");
740
    Information("PkgLabel         =[$PkgLabel]");
724
 
741
 
725
    LogNorm("PkgPreviousVersionStr=[$PkgPreviousVersionStr]");
742
    Information("PkgPreviousVersionStr=[$PkgPreviousVersionStr]");
726
 
743
 
727
    LogNorm("ProjectAcronym   =[$ProjectAcronym]");
744
    Information("ProjectAcronym   =[$ProjectAcronym]");
728
    LogNorm("BuildType        =[$BuildType]");
745
    Information("BuildType        =[$BuildType]");
729
    LogNorm("MachType         =[$MachType]");
746
    Information("MachType         =[$MachType]");
730
    LogNorm("Platform         =[$Platform]");
747
    Information("Platform         =[$Platform]");
731
    LogNorm("Product          =[$Product]");
748
    Information("Product          =[$Product]");
732
    LogNorm("Target           =[$Target]");
749
    Information("Target           =[$Target]");
733
    LogInfo("BuildParts       =[" . join(',',$BuildFileInfo->getPlatformParts($Platform)) . "]");
750
    Verbose("BuildParts       =[" . join(',',$BuildFileInfo->getPlatformParts($Platform)) . "]");
734
    
751
    
735
    LogNorm("CurrentDir       =[$CurrentDir]");
752
    Information("CurrentDir       =[$CurrentDir]");
736
    LogNorm("RootDir          =[$RootDir]");
753
    Information("RootDir          =[$RootDir]");
737
    LogNorm("SandBoxName      =[$SandBoxName]");
754
    Information("SandBoxName      =[$SandBoxName]");
738
    LogNorm("Username         =[$Username]");
755
    Information("Username         =[$Username]");
739
 
756
 
740
    LogNorm("TargetBaseDir    =[$TargetBaseDir]");
757
    Information("TargetBaseDir    =[$TargetBaseDir]");
741
    LogNorm("TargetHomeDir    =[$TargetHomeDir]");
758
    Information("TargetHomeDir    =[$TargetHomeDir]");
742
 
759
 
743
    LogNorm("PkgBaseDir       =[$PkgBaseDir]");
760
    Information("PkgBaseDir       =[$PkgBaseDir]");
744
    LogNorm("SrcDir           =[$SrcDir]");
761
    Information("SrcDir           =[$SrcDir]");
745
    LogNorm("PkgDir           =[$PkgDir]");
762
    Information("PkgDir           =[$PkgDir]");
746
    LogNorm("ReleaseDir       =[$ReleaseDir]");
763
    Information("ReleaseDir       =[$ReleaseDir]");
747
 
764
 
748
    LogInfo("InterfaceDir     =[$InterfaceDir]");
765
    Verbose("InterfaceDir     =[$InterfaceDir]");
749
    LogInfo("DpkgScriptsDir   =[$DpkgScriptsDir]");
766
    Verbose("DpkgScriptsDir   =[$DpkgScriptsDir]");
750
    LogInfo("DpkgBinDir(s)    =[");
767
    Verbose("DpkgBinDir(s)    =[");
751
    foreach $i (@{$DpkgBinDirList{'_ALL_'}})
768
    foreach $i (@{$DpkgBinDirList{'_ALL_'}})
752
    {
769
    {
753
        LogInfo("                   $DpkgBinDir/$i");
770
        Verbose("                   $DpkgBinDir/$i");
754
    }
771
    }
755
    LogInfo("                  ]");
772
    Verbose("                  ]");
756
 
773
 
757
 
774
 
758
    LogInfo("DpkgLibDir(s)    =[");
775
    Verbose("DpkgLibDir(s)    =[");
759
    foreach $i (@{$DpkgLibDirList{'_ALL_'}})
776
    foreach $i (@{$DpkgLibDirList{'_ALL_'}})
760
    {
777
    {
761
        LogInfo("                   $DpkgLibDir/$i");
778
        Verbose("                   $DpkgLibDir/$i");
762
    }
779
    }
763
    LogInfo("                  ]");
780
    Verbose("                  ]");
764
 
781
 
765
 
782
 
766
    LogInfo("DpkgEtcDir       =[$DpkgEtcDir]");
783
    Verbose("DpkgEtcDir       =[$DpkgEtcDir]");
767
    LogInfo("DpkgJarDir       =[$DpkgJarDir]");
784
    Verbose("DpkgJarDir       =[$DpkgJarDir]");
768
    LogInfo("DpkgSarDir       =[$DpkgSarDir]");
785
    Verbose("DpkgSarDir       =[$DpkgSarDir]");
769
    LogInfo("DpkgWarDir       =[$DpkgWarDir]");
786
    Verbose("DpkgWarDir       =[$DpkgWarDir]");
770
    LogInfo("DpkgSqlDir       =[$DpkgSqlDir]");
787
    Verbose("DpkgSqlDir       =[$DpkgSqlDir]");
771
    LogInfo("DpkgJspDir       =[$DpkgJspDir]");
788
    Verbose("DpkgJspDir       =[$DpkgJspDir]");
772
    LogInfo("DpkgRoxDir       =[$DpkgRoxDir]");
789
    Verbose("DpkgRoxDir       =[$DpkgRoxDir]");
773
    LogInfo("DpkgRptDir       =[$DpkgRptDir]");
790
    Verbose("DpkgRptDir       =[$DpkgRptDir]");
774
    LogInfo("DpkgAcHtmlDir    =[$DpkgAcHtmlDir]");
791
    Verbose("DpkgAcHtmlDir    =[$DpkgAcHtmlDir]");
775
    LogInfo("DpkgIncludeDir   =[$DpkgIncludeDir]");
792
    Verbose("DpkgIncludeDir   =[$DpkgIncludeDir]");
776
    LogInfo("DpkgDevcdDir     =[$DpkgDevcdDir]");
793
    Verbose("DpkgDevcdDir     =[$DpkgDevcdDir]");
777
    LogInfo("DpkgDatDir       =[$DpkgDatDir]");
794
    Verbose("DpkgDatDir       =[$DpkgDatDir]");
778
    LogInfo("DpkgThxDir       =[$DpkgThxDir]");
795
    Verbose("DpkgThxDir       =[$DpkgThxDir]");
779
    LogInfo("DpkgMugDir       =[$DpkgMugDir]");
796
    Verbose("DpkgMugDir       =[$DpkgMugDir]");
780
    LogInfo("DpkgDocDir       =[$DpkgDocDir]");
797
    Verbose("DpkgDocDir       =[$DpkgDocDir]");
781
 
798
 
782
    LogInfo("DpkgInfoFilesDir =[$DpkgInfoFilesDir]");
799
    Verbose("DpkgInfoFilesDir =[$DpkgInfoFilesDir]");
783
    LogInfo("DpkgPkgDir       =[$DpkgPkgDir]");
800
    Verbose("DpkgPkgDir       =[$DpkgPkgDir]");
784
 
801
 
785
    LogInfo("PkgInfoFile      =[$PkgInfoFile]");
802
    Verbose("PkgInfoFile      =[$PkgInfoFile]");
786
    LogInfo("ProtoTypeFile    =[$ProtoTypeFile]");
803
    Verbose("ProtoTypeFile    =[$ProtoTypeFile]");
787
 
804
 
788
    foreach $i ( $BuildFileInfo->getDpkgArchiveList() )
805
    foreach $i ( $BuildFileInfo->getDpkgArchiveList() )
789
    {
806
    {
790
        my $moduleInfo = $BuildFileInfo->getDpkgArchiveInfo($i);
807
        my $moduleInfo = $BuildFileInfo->getDpkgArchiveInfo($i);
791
        
808
        
792
        LogInfo(  "Build Dependency =" .
809
        Verbose(  "Build Dependency =" .
793
                  "[$moduleInfo->{type}] " .
810
                  "[$moduleInfo->{type}] " .
794
                  "[$i] " .
811
                  "[$i] " .
795
                  "[$moduleInfo->{version}] " .
812
                  "[$moduleInfo->{version}] " .
796
                  "[$moduleInfo->{proj}]");
813
                  "[$moduleInfo->{proj}]");
797
    }
814
    }
798
 
815
 
799
    if ( "$MachType" eq "sparc" )
816
    if ( "$MachType" eq "sparc" )
800
    {
817
    {
801
        LogNorm("PkgOutputFile    =[$PkgOutputFile]");
818
        Information("PkgOutputFile    =[$PkgOutputFile]");
802
    }
819
    }
803
 
820
 
804
    LogNorm("PkgOverview      =[$PKG_OVERVIEW]");
821
    Information("PkgOverview      =[$PKG_OVERVIEW]");
805
 
822
 
806
 
823
 
807
    # Lets evaluate TargetDstDirStructure to expand any vars
824
    # Lets evaluate TargetDstDirStructure to expand any vars
808
    foreach $i ( keys %TargetDstDirStructure )
825
    foreach $i ( keys %TargetDstDirStructure )
809
    {
826
    {
810
        if ( $TargetDstDirStructure{$i} =~ /\$/ )
827
        if ( $TargetDstDirStructure{$i} =~ /\$/ )
811
        {
828
        {
812
            LogDebug("-n", "Expanding TargetDstDirStructure [$TargetDstDirStructure{$i}] to ");
829
            Debug("-n", "Expanding TargetDstDirStructure [$TargetDstDirStructure{$i}] to ");
813
            $TargetDstDirStructure{$i} = eval "sprintf " . qq/"$TargetDstDirStructure{$i}"/;
830
            $TargetDstDirStructure{$i} = eval "sprintf " . qq/"$TargetDstDirStructure{$i}"/;
814
            print("[$TargetDstDirStructure{$i}]\n");
831
            print("[$TargetDstDirStructure{$i}]\n");
815
        }
832
        }
816
    }
833
    }
817
 
834
 
Line 841... Line 858...
841
#------------------------------------------------------------------------------
858
#------------------------------------------------------------------------------
842
{
859
{
843
    # correct number of parameters?
860
    # correct number of parameters?
844
    if ( ($#_+1) != 1 )
861
    if ( ($#_+1) != 1 )
845
    {
862
    {
846
        LogError("Incorrect number of params passed to " .
863
        Error("Incorrect number of params passed to setPkgDescription() function.",
847
                  "setPkgDescription() function. " .
-
 
848
                  "Check deploy config.");
864
              "Check deploy config.");
849
    }
865
    }
850
    my ($lpkgDesc) = shift;
866
    my ($lpkgDesc) = shift;
851
   
867
   
852
    # we use what was defined in deployfile if
868
    # we use what was defined in deployfile if
853
    # the RM details are not available
869
    # the RM details are not available
Line 892... Line 908...
892
#------------------------------------------------------------------------------
908
#------------------------------------------------------------------------------
893
{
909
{
894
    # correct number of parameters?
910
    # correct number of parameters?
895
    if ( ($#_+1) != 1 )
911
    if ( ($#_+1) != 1 )
896
    {
912
    {
897
        LogError("Incorrect number of params passed to " .
913
        Error("Incorrect number of params passed to " .
898
                  "setPkgName() function. " .
914
                  "setPkgName() function. ",
899
                  "Check deploy config.");
915
                  "Check deploy config.");
900
    }
916
    }
901
    $PkgNameLong = shift;
917
    $PkgNameLong = shift;
902
 
918
 
903
    # done
919
    # done
Line 917... Line 933...
917
    # if TargetBaseDir is empty then init has not been called yet so we can set 
933
    # if TargetBaseDir is empty then init has not been called yet so we can set 
918
    # base dir, if however it is not null then init has been called and setting
934
    # base dir, if however it is not null then init has been called and setting
919
    # base dir after init causes problems in some cases.
935
    # base dir after init causes problems in some cases.
920
    if ( $TargetBaseDir ne "" )
936
    if ( $TargetBaseDir ne "" )
921
    {
937
    {
922
        LogError("setErgAfcBaseDir() cannot be called after Init(), place before Init() in deployfile.pl");
938
        Error("setErgAfcBaseDir() cannot be called after Init(), place before Init() in deployfile.pl");
923
    }
939
    }
924
 
940
 
925
    # correct number of parameters?
941
    # correct number of parameters?
926
    if ( ($#_+1) != 1 )
942
    if ( ($#_+1) != 1 )
927
    {
943
    {
928
        LogError("Incorrect number of params passed to " .
944
        Error("Incorrect number of params passed to " .
929
                  "setErgBaseDir() function. " .
945
                  "setErgBaseDir() function. ",
930
                  "Check deploy config.");
946
                  "Check deploy config.");
931
    }
947
    }
932
 
948
 
933
    my ($newDir) = @_;
949
    my ($newDir) = @_;
934
    $ERGAFC_BASEDIR = "$newDir";
950
    $ERGAFC_BASEDIR = "$newDir";
Line 948... Line 964...
948
#------------------------------------------------------------------------------
964
#------------------------------------------------------------------------------
949
{
965
{
950
    # correct number of parameters?
966
    # correct number of parameters?
951
    if ( ($#_+1) != 0 )
967
    if ( ($#_+1) != 0 )
952
    {
968
    {
953
        LogError("Incorrect number of params passed to " .
969
        Error("Incorrect number of params passed to " .
954
                  "getErgBaseDir() function. " .
970
                  "getErgBaseDir() function. ",
955
                  "Check deploy config.");
971
                  "Check deploy config.");
956
    }
972
    }
957
 
973
 
958
    return "$ERGAFC_BASEDIR";
974
    return "$ERGAFC_BASEDIR";
959
}
975
}
Line 969... Line 985...
969
#------------------------------------------------------------------------------
985
#------------------------------------------------------------------------------
970
{
986
{
971
    # correct number of parameters?
987
    # correct number of parameters?
972
    if ( ($#_+1) != 1 )
988
    if ( ($#_+1) != 1 )
973
    {
989
    {
974
        LogError("Incorrect number of params passed to " .
990
        Error("Incorrect number of params passed to " .
975
                  "setPkgOverview() function. " .
991
                  "setPkgOverview() function. ",
976
                  "Check deploy config.");
992
                  "Check deploy config.");
977
    }
993
    }
978
 
994
 
979
    my ($mStr) = @_;
995
    my ($mStr) = @_;
980
    $PKG_OVERVIEW = "$mStr";
996
    $PKG_OVERVIEW = "$mStr";
Line 993... Line 1009...
993
#------------------------------------------------------------------------------
1009
#------------------------------------------------------------------------------
994
{
1010
{
995
    # correct number of parameters?
1011
    # correct number of parameters?
996
    if ( ($#_+1) != 0 )
1012
    if ( ($#_+1) != 0 )
997
    {
1013
    {
998
        LogError("Incorrect number of params passed to " .
1014
        Error("Incorrect number of params passed to " .
999
                  "getPkgOverview() function. " .
1015
                  "getPkgOverview() function. ",
1000
                  "Check deploy config.");
1016
                  "Check deploy config.");
1001
    }
1017
    }
1002
 
1018
 
1003
    return "$PKG_OVERVIEW";
1019
    return "$PKG_OVERVIEW";
1004
}
1020
}
Line 1025... Line 1041...
1025
    my @files;
1041
    my @files;
1026
 
1042
 
1027
    # lets just check to see if we can execute this function on this machine.
1043
    # lets just check to see if we can execute this function on this machine.
1028
    if ( "$MachType" eq "sparc" )
1044
    if ( "$MachType" eq "sparc" )
1029
    {
1045
    {
1030
        LogInfo("addInstallshieldFiles() not supported on this machine type.");
1046
        Warning("addInstallshieldFiles() not supported on this machine type.");
1031
        return 1;
1047
        return 1;
1032
    }
1048
    }
1033
 
1049
 
1034
    foreach my $i ( @_ )
1050
    foreach my $i ( @_ )
1035
    {
1051
    {
1036
        @files = glob("$PKG_UTIL_DIR/$i.*");
1052
        @files = glob("$PKG_UTIL_DIR/$i.*");
1037
        foreach my $j ( @files )
1053
        foreach my $j ( @files )
1038
        {
1054
        {
1039
            $j = basename($j);
1055
            $j = basename($j);
1040
            LogNorm("Adding Installshield file $j");
1056
            Verbose("Adding Installshield file $j");
1041
            push(@PKG_ISHIELD_FILES, $j);
1057
            push(@PKG_ISHIELD_FILES, $j);
1042
        }
1058
        }
1043
    }
1059
    }
1044
    return 1;
1060
    return 1;
1045
}   # addInstallshieldFiles
1061
}   # addInstallshieldFiles
Line 1149... Line 1165...
1149
    my @dir_tree_exclude;
1165
    my @dir_tree_exclude;
1150
    my @dir_tree_include;
1166
    my @dir_tree_include;
1151
    my $flatten = 0;
1167
    my $flatten = 0;
1152
    my $dstDir;
1168
    my $dstDir;
1153
 
1169
 
1154
    LogNorm("Installing all Prepared pkg files...");
1170
    Information("Installing all Prepared pkg files...");
1155
    
1171
    
1156
    #
1172
    #
1157
    #   Process the arguments and extract parameters and options
1173
    #   Process the arguments and extract parameters and options
1158
    #
1174
    #
1159
    foreach ( @_ )
1175
    foreach ( @_ )
1160
    {
1176
    {
1161
        if ( m/^--Srcdir=(.*)/ ) {
1177
        if ( m/^--Srcdir=(.*)/ ) {
1162
            LogError("installAllDpkgArchivePkgFiles2: Multiple --Srcdir not allowed")
1178
            Error("installAllDpkgArchivePkgFiles2: Multiple --Srcdir not allowed")
1163
                if ( $src_base_dir );
1179
                if ( $src_base_dir );
1164
            $src_base_dir = "$InterfaceDir/$1";
1180
            $src_base_dir = "$InterfaceDir/$1";
-
 
1181
            $src_base_dir =~ s~/\.$~~;
-
 
1182
            $src_base_dir =~ s~/$~~;
1165
 
1183
 
1166
        } elsif ( /^--Dstdir=(.*)/ ) {
1184
        } elsif ( /^--Dstdir=(.*)/ ) {
1167
            LogError("installAllDpkgArchivePkgFiles2: Multiple target directories not allowed")
1185
            Error("installAllDpkgArchivePkgFiles2: Multiple target directories not allowed")
1168
                if ( $dstDir );
1186
                if ( $dstDir );
1169
            $dstDir = $1;
1187
            $dstDir = $1;
1170
 
1188
 
1171
        } elsif ( m/^--NoRecurse/ ) {
1189
        } elsif ( m/^--NoRecurse/ ) {
1172
            $recurse = 0;
1190
            $recurse = 0;
Line 1191... Line 1209...
1191
 
1209
 
1192
        } elsif ( /^--NoFlatten/ ) {
1210
        } elsif ( /^--NoFlatten/ ) {
1193
            $flatten = 0;
1211
            $flatten = 0;
1194
 
1212
 
1195
        } elsif ( m/^--/ ) {
1213
        } elsif ( m/^--/ ) {
1196
            LogError("installAllDpkgArchivePkgFiles2: Unknown option: $_")
1214
            Error("installAllDpkgArchivePkgFiles2: Unknown option: $_")
1197
 
1215
 
1198
        } else {
1216
        } else {
1199
            LogError("installAllDpkgArchivePkgFiles2: Multiple target directories not allowed")
1217
            Error("installAllDpkgArchivePkgFiles2: Multiple target directories not allowed")
1200
                if ( $dstDir );
1218
                if ( $dstDir );
1201
 
1219
 
1202
            #   Convert the symbolic target directory name into a real path
1220
            #   Convert the symbolic target directory name into a real path
1203
            
1221
            
1204
            $dstDir = getTargetDstDirValue($_, "A");
1222
            $dstDir = getTargetDstDirValue($_, "A");
Line 1208... Line 1226...
1208
    #
1226
    #
1209
    #   Ensure that we have a valid source directory
1227
    #   Ensure that we have a valid source directory
1210
    #   Data taken from the 'pkg' directory unless otherwise specified by the user
1228
    #   Data taken from the 'pkg' directory unless otherwise specified by the user
1211
    #
1229
    #
1212
    $src_base_dir = $DpkgPkgDir unless $src_base_dir;
1230
    $src_base_dir = $DpkgPkgDir unless $src_base_dir;
1213
    LogError("installAllDpkgArchivePkgFiles2: Package directory not found: $src_base_dir")
1231
    Error("installAllDpkgArchivePkgFiles2: Package directory not found: $src_base_dir")
1214
        unless ( -d $src_base_dir );
1232
        unless ( -d $src_base_dir );
1215
 
1233
 
1216
    #
1234
    #
1217
    #   Ensure that the user has specified a target directory
1235
    #   Ensure that the user has specified a target directory
1218
    #
1236
    #
1219
    LogError("installAllDpkgArchivePkgFiles2: No target directories specified")
1237
    Error("installAllDpkgArchivePkgFiles2: No target directories specified")
1220
        unless ( $dstDir );
1238
        unless ( $dstDir );
1221
 
1239
 
1222
    #
1240
    #
1223
    #   Build up a list of files to copy
1241
    #   Build up a list of files to copy
1224
    #   Creating a list allows:
1242
    #   Creating a list allows:
Line 1239... Line 1257...
1239
        #   Split into directory and file as we may need to make the directory
1257
        #   Split into directory and file as we may need to make the directory
1240
        #   since the copy operation will not
1258
        #   since the copy operation will not
1241
        #
1259
        #
1242
        my $dir;                                # Target directory
1260
        my $dir;                                # Target directory
1243
        my $tfile;                              # Target path
1261
        my $tfile;                              # Target path
1244
       (my $fname = $sfile )=~ s~^.*/+~~;        # Filename(only)
1262
       (my $fname = $sfile )=~ s~^.*/+~~;       # Filename(only)
1245
 
1263
 
1246
        unless ( $flatten )
1264
        unless ( $flatten )
1247
        {
1265
        {
1248
            $sfile =~ m~^(.*/)~;
1266
            $sfile =~ m~^(.*/)~;
1249
            $dir = "$dstDir/$1";
1267
            $dir = "$dstDir/$1";
Line 1256... Line 1274...
1256
        }
1274
        }
1257
 
1275
 
1258
        #
1276
        #
1259
        #   Ensure the target directory is present
1277
        #   Ensure the target directory is present
1260
        #
1278
        #
1261
        unless ( -d $dir )
-
 
1262
        {
-
 
1263
            LogInfo ( "mkdir $dir");
-
 
1264
            mkpath ( $dir, 0, 0775);
1279
        make_directory ( $dir, 0775 );
1265
        }
-
 
1266
 
1280
 
1267
        #
1281
        #
1268
        #   Copy the file
1282
        #   Copy the file
1269
        #   Ensure that the target file does not already exist
1283
        #   Ensure that the target file does not already exist
1270
        #   This is most likely to occur when flattening the directory structure
1284
        #   This is most likely to occur when flattening the directory structure
Line 1272... Line 1286...
1272
        my $m_sfile = "$src_base_dir$sfile";
1286
        my $m_sfile = "$src_base_dir$sfile";
1273
        my $m_tfile = "$dstDir/$tfile";
1287
        my $m_tfile = "$dstDir/$tfile";
1274
 
1288
 
1275
        if ( -f $m_tfile  )
1289
        if ( -f $m_tfile  )
1276
        {
1290
        {
1277
            LogError("Failed to copy file [$m_sfile] to [$m_tfile]: File already exists");
1291
            Error("Failed to copy file [$m_sfile] to [$m_tfile]: File already exists");
1278
        }
1292
        }
1279
 
1293
 
1280
        if( File::Copy::copy("$m_sfile", "$m_tfile") )
1294
        if( File::Copy::copy("$m_sfile", "$m_tfile") )
1281
        {
1295
        {
1282
            LogNorm("Copied [$fname] to [$m_tfile] ...");
1296
            Verbose("Copied [$fname] to [$m_tfile] ...");
1283
        }
1297
        }
1284
        else
1298
        else
1285
        {
1299
        {
1286
            LogError("Failed to copy file [$m_sfile] to [$m_tfile]: $!");
1300
            Error("Failed to copy file [$m_sfile] to [$m_tfile]: $!");
1287
        }
1301
        }
1288
    }
1302
    }
1289
 
1303
 
1290
    return 1;
1304
    return 1;
1291
}
1305
}
Line 1467... Line 1481...
1467
#------------------------------------------------------------------------------
1481
#------------------------------------------------------------------------------
1468
{
1482
{
1469
    # correct number of parameters?
1483
    # correct number of parameters?
1470
    if ( ($#_+1) != 1 )
1484
    if ( ($#_+1) != 1 )
1471
    {
1485
    {
1472
        LogError("Incorrect number of params passed to " .
1486
        Error("Incorrect number of params passed to " .
1473
                  "installAllDpkgArchiveDevcdFiles() function. " .
1487
              "installAllDpkgArchiveDevcdFiles() function. ",
1474
                  "Check deploy config.");
1488
              "Check deploy config.");
1475
    }
1489
    }
1476
 
1490
 
1477
    LogNorm("Installing all Prepared Day 0 devcd files...");
1491
    Information("Installing all Prepared Day 0 devcd files...");
1478
 
1492
 
1479
 
1493
 
1480
    my ($targetTag) = @_;
1494
    my ($targetTag) = @_;
1481
    
1495
    
1482
    # lets check to see if the target tag exists
1496
    # lets check to see if the target tag exists
Line 1512... Line 1526...
1512
            }
1526
            }
1513
 
1527
 
1514
            my ($tmp_dItem) = $i;
1528
            my ($tmp_dItem) = $i;
1515
            $tmp_dItem =~ s/$tmp_SrcDir/$tmp_DstDir/;
1529
            $tmp_dItem =~ s/$tmp_SrcDir/$tmp_DstDir/;
1516
 
1530
 
1517
            if ( -d "$i")
1531
            if ( -d $i )
1518
            {
1532
            {
1519
                # we have a directory
-
 
1520
                if ( ! -d "$tmp_dItem" )
-
 
1521
                {
-
 
1522
                    mkpath ( "$tmp_dItem", 0, 0775);
1533
                make_directory ( $tmp_dItem, 0775 );
1523
                    LogInfo ( "mkdir $tmp_dItem");
-
 
1524
                }
-
 
1525
            }
1534
            }
1526
            else
1535
            else
1527
            {
1536
            {
1528
                if(File::Copy::copy("$i", "$tmp_dItem"))
1537
                if(File::Copy::copy( $i , $tmp_dItem ))
1529
                {
1538
                {
1530
                    LogNorm("Copied [$base] to [$tmp_dItem] ...");
1539
                    Verbose("Copied [$base] to [$tmp_dItem] ...");
1531
                }
1540
                }
1532
                else
1541
                else
1533
                {
1542
                {
1534
                    LogError("Failed to copy pkg file [$tmp_dItem] to [$i]: $!");
1543
                    Error("Failed to copy pkg file [$tmp_dItem] to [$i]: $!");
1535
                }
1544
                }
1536
            }
1545
            }
1537
        }
1546
        }
1538
    }
1547
    }
1539
 
1548
 
Line 1567... Line 1576...
1567
    $tmp_dItem =~ s/$tmp_SrcDir/$tmp_DstDir/;
1576
    $tmp_dItem =~ s/$tmp_SrcDir/$tmp_DstDir/;
1568
 
1577
 
1569
    # we need to determine what type of item we are dealing with file we are dealing with
1578
    # we need to determine what type of item we are dealing with file we are dealing with
1570
    if ( -d "$item")
1579
    if ( -d "$item")
1571
    {
1580
    {
1572
        # we have a directory
-
 
1573
        if ( ! -d "$tmp_dItem" )
-
 
1574
        {
-
 
1575
            mkpath ( "$tmp_dItem", 0, 0775);
1581
        make_directory( $tmp_dItem, 0775 );
1576
            LogInfo ( "mkdir $tmp_dItem");
-
 
1577
        }
-
 
1578
    }
1582
    }
1579
    else
1583
    else
1580
    {
1584
    {
1581
        if(File::Copy::copy("$item", "$tmp_dItem"))
1585
        if(File::Copy::copy("$item", "$tmp_dItem"))
1582
        {
1586
        {
1583
            LogNorm("Copied [$base] to [$tmp_dItem] ...");
1587
            Verbose("Copied [$base] to [$tmp_dItem] ...");
1584
        }
1588
        }
1585
        else
1589
        else
1586
        {
1590
        {
1587
            LogError("Failed to copy pkg file [$tmp_dItem] to [$item]: $!"); 
1591
            Error("Failed to copy pkg file [$tmp_dItem] to [$item]: $!"); 
1588
        }
1592
        }
1589
    }
1593
    }
1590
}
1594
}
1591
 
1595
 
1592
#------------------------------------------------------------------------------
1596
#------------------------------------------------------------------------------
Line 1607... Line 1611...
1607
#------------------------------------------------------------------------------
1611
#------------------------------------------------------------------------------
1608
{
1612
{
1609
    # correct number of parameters?
1613
    # correct number of parameters?
1610
    if ( ($#_+1) != 2 )
1614
    if ( ($#_+1) != 2 )
1611
    {
1615
    {
1612
        LogError("Incorrect number of params passed to " .
1616
        Error("Incorrect number of params passed to " .
1613
                  "installAllDpkgArchiveFiles() function. " .
1617
              "installAllDpkgArchiveFiles() function. ",
1614
                  "Check deploy config.");
1618
              "Check deploy config.");
1615
    }
1619
    }
1616
 
1620
 
1617
    my ($targetType, $targetTag) = @_;
1621
    my ($targetType, $targetTag) = @_;
1618
 
1622
 
1619
    # lets check to see if the target tag exists
1623
    # lets check to see if the target tag exists
Line 1647... Line 1651...
1647
    elsif ( "$targetType" eq "rpt" )        { $src_dir = $DpkgRptDir; }
1651
    elsif ( "$targetType" eq "rpt" )        { $src_dir = $DpkgRptDir; }
1648
    elsif ( "$targetType" eq "doc" )        { $src_dir = $DpkgDocDir; }
1652
    elsif ( "$targetType" eq "doc" )        { $src_dir = $DpkgDocDir; }
1649
    elsif ( "$targetType" eq "jsp" )        { $src_dir = $DpkgJspDir; }
1653
    elsif ( "$targetType" eq "jsp" )        { $src_dir = $DpkgJspDir; }
1650
#    elsif ( "$targetType" eq "achtml" )     { $src_dir = $DpkgAcHtmlDir; }
1654
#    elsif ( "$targetType" eq "achtml" )     { $src_dir = $DpkgAcHtmlDir; }
1651
    else  {
1655
    else  {
1652
        LogError("installAllDpkgArchiveFiles() passed unknown target type [$targetType].");
1656
        Error("installAllDpkgArchiveFiles() passed unknown target type [$targetType].");
1653
    }
1657
    }
1654
 
1658
 
1655
    opendir(DIR, $src_dir) or
1659
    opendir(DIR, $src_dir) or
1656
            LogError("can't opendir $src_dir: $!");
1660
            Error("Can't opendir $src_dir: $!");
1657
 
1661
 
1658
 
1662
 
1659
    # lets process what we have found
1663
    # lets process what we have found
1660
    #
1664
    #
1661
    my ($file);
1665
    my ($file);
Line 1666... Line 1670...
1666
        {
1670
        {
1667
            my ($m_fLoc) = "$src_dir/$file";
1671
            my ($m_fLoc) = "$src_dir/$file";
1668
 
1672
 
1669
            if(File::Copy::copy("$m_fLoc", "$targetValue"))
1673
            if(File::Copy::copy("$m_fLoc", "$targetValue"))
1670
            {
1674
            {
1671
                LogNorm("Copied [$targetType] item [$file] to [$targetValue] ...");
1675
                Verbose("Copied [$targetType] item [$file] to [$targetValue] ...");
1672
            }
1676
            }
1673
            else
1677
            else
1674
            {
1678
            {
1675
                LogError("Failed to copy [$targetType] item [$m_fLoc]: $!"); 
1679
                Error("Failed to copy [$targetType] item [$m_fLoc]: $!"); 
1676
            }
1680
            }
1677
        }
1681
        }
1678
    }
1682
    }
1679
 
1683
 
1680
    closedir(DIR);
1684
    closedir(DIR);
Line 1704... Line 1708...
1704
#------------------------------------------------------------------------------
1708
#------------------------------------------------------------------------------
1705
{
1709
{
1706
    # correct number of parameters?
1710
    # correct number of parameters?
1707
    if ( ($#_+1) != 2 )
1711
    if ( ($#_+1) != 2 )
1708
    {
1712
    {
1709
        LogError("Incorrect number of params passed to " .
1713
        Error("Incorrect number of params passed to " .
1710
                  "installAllDpkgArchiveAcHtmlFiles() function. " .
1714
              "installAllDpkgArchiveAcHtmlFiles() function. ",
1711
                  "Check deploy config.");
1715
              "Check deploy config.");
1712
    }
1716
    }
1713
    my ($targetType, $targetTag) = @_;
1717
    my ($targetType, $targetTag) = @_;
1714
 
1718
 
1715
    # lets check to see if the target tag exists
1719
    # lets check to see if the target tag exists
1716
    # if does not the process with log an error.
1720
    # if does not the process with log an error.
Line 1720... Line 1724...
1720
    # lets check to see if the source type dir actually exists
1724
    # lets check to see if the source type dir actually exists
1721
    #
1725
    #
1722
    my($m_sDirLoc)  = "$DpkgAcHtmlDir/$targetType";
1726
    my($m_sDirLoc)  = "$DpkgAcHtmlDir/$targetType";
1723
    if( ! -d "$m_sDirLoc" )
1727
    if( ! -d "$m_sDirLoc" )
1724
    {
1728
    {
1725
        LogError("Failed to locate [$targetType] AcHtml dir [$m_sDirLoc].");
1729
        Error("Failed to locate [$targetType] AcHtml dir [$m_sDirLoc].");
1726
    }
1730
    }
1727
 
1731
 
1728
    # know everything exists so lets do the biz.
1732
    # know everything exists so lets do the biz.
1729
    #
1733
    #
1730
    # now we need to copy all the files.
1734
    # now we need to copy all the files.
1731
    #
1735
    #
1732
    local *DIR;
1736
    local *DIR;
1733
    opendir(DIR, $m_sDirLoc) or 
1737
    opendir(DIR, $m_sDirLoc) or 
1734
        LogError("can't opendir $m_sDirLoc: $!");
1738
        Error("Can't opendir $m_sDirLoc: $!");
1735
 
1739
 
1736
    my ($m_fLoc) = "";
1740
    my ($m_fLoc) = "";
1737
    my ($file) = "";
1741
    my ($file) = "";
1738
    while (defined($file = readdir(DIR)))
1742
    while (defined($file = readdir(DIR)))
1739
    {
1743
    {
Line 1741... Line 1745...
1741
             $file !~ /^..$/ )
1745
             $file !~ /^..$/ )
1742
        {
1746
        {
1743
            $m_fLoc = "$m_sDirLoc/$file";
1747
            $m_fLoc = "$m_sDirLoc/$file";
1744
            if(File::Copy::copy("$m_fLoc", "$targetValue"))
1748
            if(File::Copy::copy("$m_fLoc", "$targetValue"))
1745
            {
1749
            {
1746
                LogNorm("Copied AcHtml [$targetType] item [$file] to [$targetValue] ...");
1750
                Verbose("Copied AcHtml [$targetType] item [$file] to [$targetValue] ...");
1747
            }
1751
            }
1748
            else
1752
            else
1749
            {
1753
            {
1750
                LogError("Failed to copy AcHtml [$targetType] item [$m_fLoc]: $!");
1754
                Error("Failed to copy AcHtml [$targetType] item [$m_fLoc]: $!");
1751
            }
1755
            }
1752
        }
1756
        }
1753
    }
1757
    }
1754
 
1758
 
1755
    closedir(DIR);
1759
    closedir(DIR);
Line 1771... Line 1775...
1771
#------------------------------------------------------------------------------
1775
#------------------------------------------------------------------------------
1772
{
1776
{
1773
    # correct number of parameters?
1777
    # correct number of parameters?
1774
    if ( ($#_+1) != 1 )
1778
    if ( ($#_+1) != 1 )
1775
    {
1779
    {
1776
        LogError("Incorrect number of params passed to " .
1780
        Error("Incorrect number of params passed to " .
1777
                  "installAllDpkgArchiveInfoFilesFiles() function. " .
1781
              "installAllDpkgArchiveInfoFilesFiles() function. ",
1778
                  "Check deploy config.");
1782
              "Check deploy config.");
1779
    }
1783
    }
1780
 
1784
 
1781
    my ($targetTag) = @_;
1785
    my ($targetTag) = @_;
1782
    
1786
    
1783
    # lets check to see if the target tag exists
1787
    # lets check to see if the target tag exists
Line 1810... Line 1814...
1810
#------------------------------------------------------------------------------
1814
#------------------------------------------------------------------------------
1811
{
1815
{
1812
    # correct number of parameters?
1816
    # correct number of parameters?
1813
    if ( ($#_+1) != 1 )
1817
    if ( ($#_+1) != 1 )
1814
    {
1818
    {
1815
        LogError("Incorrect number of params passed to " .
1819
        Error("Incorrect number of params passed to " .
1816
                  "installAllDpkgArchiveSqlFiles() function. " .
1820
              "installAllDpkgArchiveSqlFiles() function. ",
1817
                  "Check deploy config.");
1821
              "Check deploy config.");
1818
    }
1822
    }
1819
 
1823
 
1820
    my ($targetTag) = @_;
1824
    my ($targetTag) = @_;
1821
    
1825
    
1822
    # lets check to see if the target tag exists
1826
    # lets check to see if the target tag exists
Line 1848... Line 1852...
1848
#------------------------------------------------------------------------------
1852
#------------------------------------------------------------------------------
1849
{
1853
{
1850
    # correct number of parameters?
1854
    # correct number of parameters?
1851
    if ( ($#_+1) != 1 )
1855
    if ( ($#_+1) != 1 )
1852
    {
1856
    {
1853
        LogError("Incorrect number of params passed to " .
1857
        Error("Incorrect number of params passed to " .
1854
                  "installAllDpkgArchiveWarFiles() function. " .
1858
              "installAllDpkgArchiveWarFiles() function. " ,
1855
                  "Check deploy config.");
1859
              "Check deploy config.");
1856
    }
1860
    }
1857
 
1861
 
1858
    my ($targetTag) = @_;
1862
    my ($targetTag) = @_;
1859
    
1863
    
1860
    # lets check to see if the target tag exists
1864
    # lets check to see if the target tag exists
Line 1886... Line 1890...
1886
#------------------------------------------------------------------------------
1890
#------------------------------------------------------------------------------
1887
{
1891
{
1888
    # correct number of parameters?
1892
    # correct number of parameters?
1889
    if ( ($#_+1) != 1 )
1893
    if ( ($#_+1) != 1 )
1890
    {
1894
    {
1891
        LogError("Incorrect number of params passed to " .
1895
        Error("Incorrect number of params passed to " .
1892
                  "installAllDpkgArchiveJarFiles() function. " .
1896
              "installAllDpkgArchiveJarFiles() function. " ,
1893
                  "Check deploy config.");
1897
              "Check deploy config.");
1894
    }
1898
    }
1895
 
1899
 
1896
    my ($targetTag) = @_;
1900
    my ($targetTag) = @_;
1897
    
1901
    
1898
    # lets check to see if the target tag exists
1902
    # lets check to see if the target tag exists
Line 1924... Line 1928...
1924
#------------------------------------------------------------------------------
1928
#------------------------------------------------------------------------------
1925
{
1929
{
1926
    # correct number of parameters?
1930
    # correct number of parameters?
1927
    if ( ($#_+1) != 1 )
1931
    if ( ($#_+1) != 1 )
1928
    {
1932
    {
1929
        LogError("Incorrect number of params passed to " .
1933
        Error("Incorrect number of params passed to " .
1930
                  "installAllDpkgArchiveEtcFiles() function. " .
1934
              "installAllDpkgArchiveEtcFiles() function. " ,
1931
                  "Check deploy config.");
1935
              "Check deploy config.");
1932
    }
1936
    }
1933
 
1937
 
1934
    my ($targetTag) = @_;
1938
    my ($targetTag) = @_;
1935
    
1939
    
1936
    # lets check to see if the target tag exists
1940
    # lets check to see if the target tag exists
Line 1962... Line 1966...
1962
#------------------------------------------------------------------------------
1966
#------------------------------------------------------------------------------
1963
{
1967
{
1964
    # correct number of parameters?
1968
    # correct number of parameters?
1965
    if ( ($#_+1) != 1 )
1969
    if ( ($#_+1) != 1 )
1966
    {
1970
    {
1967
        LogError("Incorrect number of params passed to " .
1971
        Error("Incorrect number of params passed to " .
1968
                  "installAllDpkgArchiveScriptsFiles() function. " .
1972
              "installAllDpkgArchiveScriptsFiles() function. " ,
1969
                  "Check deploy config.");
1973
              "Check deploy config.");
1970
    }
1974
    }
1971
 
1975
 
1972
    my ($targetTag) = @_;
1976
    my ($targetTag) = @_;
1973
    
1977
    
1974
    # lets check to see if the target tag exists
1978
    # lets check to see if the target tag exists
Line 2000... Line 2004...
2000
#------------------------------------------------------------------------------
2004
#------------------------------------------------------------------------------
2001
{
2005
{
2002
    # correct number of parameters?
2006
    # correct number of parameters?
2003
    if ( ($#_+1) != 1 )
2007
    if ( ($#_+1) != 1 )
2004
    {
2008
    {
2005
        LogError("Incorrect number of params passed to " .
2009
        Error("Incorrect number of params passed to " .
2006
                  "installAllDpkgArchiveIncludeFiles() function. " .
2010
              "installAllDpkgArchiveIncludeFiles() function. " ,
2007
                  "Check deploy config.");
2011
              "Check deploy config.");
2008
    }
2012
    }
2009
 
2013
 
2010
    my ($targetTag) = @_;
2014
    my ($targetTag) = @_;
2011
    
2015
    
2012
    # lets check to see if the target tag exists
2016
    # lets check to see if the target tag exists
Line 2038... Line 2042...
2038
#------------------------------------------------------------------------------
2042
#------------------------------------------------------------------------------
2039
{
2043
{
2040
    # correct number of parameters?
2044
    # correct number of parameters?
2041
    if ( ($#_+1) != 1 )
2045
    if ( ($#_+1) != 1 )
2042
    {
2046
    {
2043
        LogError("Incorrect number of params passed to " .
2047
        Error("Incorrect number of params passed to " .
2044
                  "installAllDpkgArchiveIncludeFiles() function. " .
2048
              "installAllDpkgArchiveIncludeFiles() function. " ,
2045
                  "Check deploy config.");
2049
              "Check deploy config.");
2046
    }
2050
    }
2047
 
2051
 
2048
    my ($targetTag) = @_;
2052
    my ($targetTag) = @_;
2049
    
2053
    
2050
    # lets check to see if the target tag exists
2054
    # lets check to see if the target tag exists
Line 2078... Line 2082...
2078
#------------------------------------------------------------------------------
2082
#------------------------------------------------------------------------------
2079
{
2083
{
2080
    # correct number of parameters?
2084
    # correct number of parameters?
2081
    if ( ($#_+1) != 0 )
2085
    if ( ($#_+1) != 0 )
2082
    {
2086
    {
2083
        LogError("Incorrect number of params passed to " .
2087
        Error("Incorrect number of params passed to " .
2084
                  "installAllDpkgArchiveJspFiles() function. " .
2088
              "installAllDpkgArchiveJspFiles() function. " ,
2085
                  "Check deploy config.");
2089
              "Check deploy config.");
2086
    }
2090
    }
2087
 
2091
 
2088
    return installAllDpkgArchiveFiles ('jsp', '--NoTag');
2092
    return installAllDpkgArchiveFiles ('jsp', '--NoTag');
2089
}
2093
}
2090
 
2094
 
Line 2111... Line 2115...
2111
#------------------------------------------------------------------------------
2115
#------------------------------------------------------------------------------
2112
{
2116
{
2113
    # correct number of parameters?
2117
    # correct number of parameters?
2114
    if ( ($#_+1) != 3 )
2118
    if ( ($#_+1) != 3 )
2115
    {
2119
    {
2116
        LogError("Incorrect number of params passed to " .
2120
        Error("Incorrect number of params passed to " .
2117
                  "installDpkgArchiveFile() function. " .
2121
              "installDpkgArchiveFile() function. " ,
2118
                  "Check deploy config.");
2122
              "Check deploy config.");
2119
    }
2123
    }
2120
 
2124
 
2121
    my ($targetType, $sfile, $targetTag) = @_;
2125
    my ($targetType, $sfile, $targetTag) = @_;
2122
 
2126
 
2123
    # lets check to see if the target tag exists
2127
    # lets check to see if the target tag exists
Line 2144... Line 2148...
2144
    elsif ( "$targetType" eq "thx" )        { $m_srcFileLocation = "$DpkgThxDir/$sfile";  }
2148
    elsif ( "$targetType" eq "thx" )        { $m_srcFileLocation = "$DpkgThxDir/$sfile";  }
2145
    elsif ( "$targetType" eq "mug" )        { $m_srcFileLocation = "$DpkgMugDir/$sfile";  }
2149
    elsif ( "$targetType" eq "mug" )        { $m_srcFileLocation = "$DpkgMugDir/$sfile";  }
2146
    elsif ( "$targetType" eq "rpt" )        { $m_srcFileLocation = "$DpkgRptDir/$sfile";  }
2150
    elsif ( "$targetType" eq "rpt" )        { $m_srcFileLocation = "$DpkgRptDir/$sfile";  }
2147
    elsif ( "$targetType" eq "doc" )        { $m_srcFileLocation = "$DpkgDocDir/$sfile";  }
2151
    elsif ( "$targetType" eq "doc" )        { $m_srcFileLocation = "$DpkgDocDir/$sfile";  }
2148
    else  {
2152
    else  {
2149
        LogError("installDpkgArchiveFile() passed unknown target type [$targetType].");
2153
        Error("installDpkgArchiveFile() passed unknown target type [$targetType].");
2150
    }
2154
    }
2151
    
2155
    
2152
    
2156
    
2153
    # we will check to see if the file exists.
2157
    # we will check to see if the file exists.
2154
    #
2158
    #
2155
    if ( -f "$m_srcFileLocation" )
2159
    if ( -f "$m_srcFileLocation" )
2156
    {
2160
    {
2157
        # now we need to copy the file. 
2161
        # now we need to copy the file. 
2158
        if(File::Copy::copy("$m_srcFileLocation", "$m_dstFileLocation"))
2162
        if(File::Copy::copy("$m_srcFileLocation", "$m_dstFileLocation"))
2159
        {
2163
        {
2160
            LogNorm("Copied [$targetType] item [$sfile] to [$m_dstFileLocation] ...");
2164
            Verbose("Copied [$targetType] item [$sfile] to [$m_dstFileLocation] ...");
2161
        }
2165
        }
2162
        else
2166
        else
2163
        {
2167
        {
2164
            LogError("Failed to copy [$targetType] item [$sfile]: $!"); 
2168
            Error("Failed to copy [$targetType] item [$sfile]: $!"); 
2165
        }
2169
        }
2166
    }
2170
    }
2167
    else
2171
    else
2168
    {
2172
    {
2169
        LogError("Dpkg_archive [$targetType] item [$sfile] does not exist.");
2173
        Error("Dpkg_archive [$targetType] item [$sfile] does not exist.");
2170
    }
2174
    }
2171
 
2175
 
2172
    return 1;
2176
    return 1;
2173
}
2177
}
2174
 
2178
 
Line 2194... Line 2198...
2194
#------------------------------------------------------------------------------
2198
#------------------------------------------------------------------------------
2195
{
2199
{
2196
    # correct number of parameters?
2200
    # correct number of parameters?
2197
    if ( ($#_+1) != 3 )
2201
    if ( ($#_+1) != 3 )
2198
    {
2202
    {
2199
        LogError("Incorrect number of params passed to " .
2203
        Error("Incorrect number of params passed to " .
2200
                  "installDpkgArchiveAcHtmlFile() function. " .
2204
              "installDpkgArchiveAcHtmlFile() function. " ,
2201
                  "Check deploy config.");
2205
              "Check deploy config.");
2202
    }
2206
    }
2203
    my ($targetType, $sfile, $targetTag) = @_;
2207
    my ($targetType, $sfile, $targetTag) = @_;
2204
 
2208
 
2205
    # lets check to see if the source type and file actually exist
2209
    # lets check to see if the source type and file actually exist
2206
    #
2210
    #
2207
    my($m_sDirLoc)  = "$DpkgAcHtmlDir/$targetType";
2211
    my($m_sDirLoc)  = "$DpkgAcHtmlDir/$targetType";
2208
    if( ! -d "$m_sDirLoc" )
2212
    if( ! -d "$m_sDirLoc" )
2209
    {
2213
    {
2210
        LogError("Failed to locate [$targetType] AcHtml dir [$m_sDirLoc].");
2214
        Error("Failed to locate [$targetType] AcHtml dir [$m_sDirLoc].");
2211
    }
2215
    }
2212
 
2216
 
2213
    # lets check to see if the file exists
2217
    # lets check to see if the file exists
2214
    #
2218
    #
2215
    my($m_sFileLoc) = "$DpkgAcHtmlDir/$targetType/$sfile";
2219
    my($m_sFileLoc) = "$DpkgAcHtmlDir/$targetType/$sfile";
2216
    if( ! -f "$m_sFileLoc" )
2220
    if( ! -f "$m_sFileLoc" )
2217
    {
2221
    {
2218
        LogError("Failed to locate [$targetType] AcHtml file [$m_sFileLoc].");
2222
        Error("Failed to locate [$targetType] AcHtml file [$m_sFileLoc].");
2219
    }
2223
    }
2220
 
2224
 
2221
    # lets check to see if the target tag exists
2225
    # lets check to see if the target tag exists
2222
    # if does not the process with log an error.
2226
    # if does not the process with log an error.
2223
    #
2227
    #
Line 2226... Line 2230...
2226
    # know everything exists so lets do the biz.
2230
    # know everything exists so lets do the biz.
2227
    #
2231
    #
2228
    # now we need to copy the file.
2232
    # now we need to copy the file.
2229
    if(File::Copy::copy("$m_sFileLoc", "$targetValue"))
2233
    if(File::Copy::copy("$m_sFileLoc", "$targetValue"))
2230
    {
2234
    {
2231
        LogNorm("Copied [$targetType] AcHtml item [$sfile] to [$targetValue] ...");
2235
        Verbose("Copied [$targetType] AcHtml item [$sfile] to [$targetValue] ...");
2232
    }
2236
    }
2233
    else
2237
    else
2234
    {
2238
    {
2235
        LogError("Failed to copy [$targetType] AcHtml item [$sfile]: $!");
2239
        Error("Failed to copy [$targetType] AcHtml item [$sfile]: $!");
2236
    }
2240
    }
2237
    
2241
    
2238
    return 1;
2242
    return 1;
2239
}
2243
}
2240
 
2244
 
Line 2254... Line 2258...
2254
#------------------------------------------------------------------------------
2258
#------------------------------------------------------------------------------
2255
{
2259
{
2256
    # correct number of parameters?
2260
    # correct number of parameters?
2257
    if ( ($#_+1) != 2 )
2261
    if ( ($#_+1) != 2 )
2258
    {
2262
    {
2259
        LogError("Incorrect number of params passed to " .
2263
        Error("Incorrect number of params passed to " .
2260
                  "installDpkgArchiveRptFile() function. " .
2264
              "installDpkgArchiveRptFile() function. " ,
2261
                  "Check deploy config.");
2265
              "Check deploy config.");
2262
    }
2266
    }
2263
 
2267
 
2264
    my ($sfile, $targetTag) = @_;
2268
    my ($sfile, $targetTag) = @_;
2265
 
2269
 
2266
    # lets check to see if the target tag exists
2270
    # lets check to see if the target tag exists
Line 2293... Line 2297...
2293
#------------------------------------------------------------------------------
2297
#------------------------------------------------------------------------------
2294
{
2298
{
2295
    # correct number of parameters?
2299
    # correct number of parameters?
2296
    if ( ($#_+1) != 2 )
2300
    if ( ($#_+1) != 2 )
2297
    {
2301
    {
2298
        LogError("Incorrect number of params passed to " .
2302
        Error("Incorrect number of params passed to " .
2299
                  "installDpkgArchiveRoxFile() function. " .
2303
              "installDpkgArchiveRoxFile() function. " ,
2300
                  "Check deploy config.");
2304
              "Check deploy config.");
2301
    }
2305
    }
2302
 
2306
 
2303
    my ($sfile, $targetTag) = @_;
2307
    my ($sfile, $targetTag) = @_;
2304
 
2308
 
2305
    # lets check to see if the target tag exists
2309
    # lets check to see if the target tag exists
Line 2332... Line 2336...
2332
#------------------------------------------------------------------------------
2336
#------------------------------------------------------------------------------
2333
{
2337
{
2334
    # correct number of parameters?
2338
    # correct number of parameters?
2335
    if ( ($#_+1) != 2 )
2339
    if ( ($#_+1) != 2 )
2336
    {
2340
    {
2337
        LogError("Incorrect number of params passed to " .
2341
        Error("Incorrect number of params passed to " .
2338
                  "installDpkgArchiveDatFile() function. " .
2342
              "installDpkgArchiveDatFile() function. " ,
2339
                  "Check deploy config.");
2343
              "Check deploy config.");
2340
    }
2344
    }
2341
 
2345
 
2342
    my ($sfile, $targetTag) = @_;
2346
    my ($sfile, $targetTag) = @_;
2343
 
2347
 
2344
    # lets check to see if the target tag exists
2348
    # lets check to see if the target tag exists
Line 2371... Line 2375...
2371
#------------------------------------------------------------------------------
2375
#------------------------------------------------------------------------------
2372
{
2376
{
2373
    # correct number of parameters?
2377
    # correct number of parameters?
2374
    if ( ($#_+1) != 2 )
2378
    if ( ($#_+1) != 2 )
2375
    {
2379
    {
2376
        LogError("Incorrect number of params passed to " .
2380
        Error("Incorrect number of params passed to " .
2377
                  "installDpkgArchiveThxFile() function. " .
2381
              "installDpkgArchiveThxFile() function. " ,
2378
                  "Check deploy config.");
2382
              "Check deploy config.");
2379
    }
2383
    }
2380
 
2384
 
2381
    my ($sfile, $targetTag) = @_;
2385
    my ($sfile, $targetTag) = @_;
2382
 
2386
 
2383
    # lets check to see if the target tag exists
2387
    # lets check to see if the target tag exists
Line 2410... Line 2414...
2410
#------------------------------------------------------------------------------
2414
#------------------------------------------------------------------------------
2411
{
2415
{
2412
    # correct number of parameters?
2416
    # correct number of parameters?
2413
    if ( ($#_+1) != 2 )
2417
    if ( ($#_+1) != 2 )
2414
    {
2418
    {
2415
        LogError("Incorrect number of params passed to " .
2419
        Error("Incorrect number of params passed to " .
2416
                  "installDpkgArchiveMugFile() function. " .
2420
              "installDpkgArchiveMugFile() function. " ,
2417
                  "Check deploy config.");
2421
              "Check deploy config.");
2418
    }
2422
    }
2419
 
2423
 
2420
    my ($sfile, $targetTag) = @_;
2424
    my ($sfile, $targetTag) = @_;
2421
 
2425
 
2422
    # lets check to see if the target tag exists
2426
    # lets check to see if the target tag exists
Line 2449... Line 2453...
2449
#------------------------------------------------------------------------------
2453
#------------------------------------------------------------------------------
2450
{
2454
{
2451
    # correct number of parameters?
2455
    # correct number of parameters?
2452
    if ( ($#_+1) != 2 )
2456
    if ( ($#_+1) != 2 )
2453
    {
2457
    {
2454
        LogError("Incorrect number of params passed to " .
2458
        Error("Incorrect number of params passed to " .
2455
                  "installDpkgArchiveInfoFilesFile() function. " .
2459
              "installDpkgArchiveInfoFilesFile() function. " ,
2456
                  "Check deploy config.");
2460
              "Check deploy config.");
2457
    }
2461
    }
2458
 
2462
 
2459
    my ($sfile, $targetTag) = @_;
2463
    my ($sfile, $targetTag) = @_;
2460
 
2464
 
2461
    # lets check to see if the target tag exists
2465
    # lets check to see if the target tag exists
Line 2488... Line 2492...
2488
#------------------------------------------------------------------------------
2492
#------------------------------------------------------------------------------
2489
{
2493
{
2490
    # correct number of parameters?
2494
    # correct number of parameters?
2491
    if ( ($#_+1) != 2 )
2495
    if ( ($#_+1) != 2 )
2492
    {
2496
    {
2493
        LogError("Incorrect number of params passed to " .
2497
        Error("Incorrect number of params passed to " .
2494
                  "installDpkgArchiveSqlFile() function. " .
2498
              "installDpkgArchiveSqlFile() function. " ,
2495
                  "Check deploy config.");
2499
              "Check deploy config.");
2496
    }
2500
    }
2497
 
2501
 
2498
    my ($sfile, $targetTag) = @_;
2502
    my ($sfile, $targetTag) = @_;
2499
 
2503
 
2500
    # lets check to see if the target tag exists
2504
    # lets check to see if the target tag exists
Line 2527... Line 2531...
2527
#------------------------------------------------------------------------------
2531
#------------------------------------------------------------------------------
2528
{
2532
{
2529
    # correct number of parameters?
2533
    # correct number of parameters?
2530
    if ( ($#_+1) != 2 )
2534
    if ( ($#_+1) != 2 )
2531
    {
2535
    {
2532
        LogError("Incorrect number of params passed to " .
2536
        Error("Incorrect number of params passed to " .
2533
                  "installDpkgArchiveWarFile() function. " .
2537
              "installDpkgArchiveWarFile() function. " ,
2534
                  "Check deploy config.");
2538
              "Check deploy config.");
2535
    }
2539
    }
2536
 
2540
 
2537
    my ($sfile, $targetTag) = @_;
2541
    my ($sfile, $targetTag) = @_;
2538
 
2542
 
2539
    # lets check to see if the target tag exists
2543
    # lets check to see if the target tag exists
Line 2567... Line 2571...
2567
#------------------------------------------------------------------------------
2571
#------------------------------------------------------------------------------
2568
{
2572
{
2569
    # correct number of parameters?
2573
    # correct number of parameters?
2570
    if ( ($#_+1) != 2 )
2574
    if ( ($#_+1) != 2 )
2571
    {
2575
    {
2572
        LogError("Incorrect number of params passed to " .
2576
        Error("Incorrect number of params passed to " .
2573
                  "installDpkgArchiveJarFile() function. " .
2577
              "installDpkgArchiveJarFile() function. " ,
2574
                  "Check deploy config.");
2578
              "Check deploy config.");
2575
    }
2579
    }
2576
 
2580
 
2577
    my ($sfile, $targetTag) = @_;
2581
    my ($sfile, $targetTag) = @_;
2578
 
2582
 
2579
    # lets check to see if the target tag exists
2583
    # lets check to see if the target tag exists
Line 2607... Line 2611...
2607
#------------------------------------------------------------------------------
2611
#------------------------------------------------------------------------------
2608
{
2612
{
2609
    # correct number of parameters?
2613
    # correct number of parameters?
2610
    if ( ($#_+1) != 2 )
2614
    if ( ($#_+1) != 2 )
2611
    {
2615
    {
2612
        LogError("Incorrect number of params passed to " .
2616
        Error("Incorrect number of params passed to " .
2613
                  "installDpkgArchiveSarFile() function. " .
2617
              "installDpkgArchiveSarFile() function. " ,
2614
                  "Check deploy config.");
2618
              "Check deploy config.");
2615
    }
2619
    }
2616
 
2620
 
2617
    my ($sfile, $targetTag) = @_;
2621
    my ($sfile, $targetTag) = @_;
2618
 
2622
 
2619
    # lets check to see if the target tag exists
2623
    # lets check to see if the target tag exists
Line 2649... Line 2653...
2649
#------------------------------------------------------------------------------
2653
#------------------------------------------------------------------------------
2650
{
2654
{
2651
    # correct number of parameters?
2655
    # correct number of parameters?
2652
    if ( ($#_+1) != 2 )
2656
    if ( ($#_+1) != 2 )
2653
    {
2657
    {
2654
        LogError("Incorrect number of params passed to " .
2658
        Error("Incorrect number of params passed to " .
2655
                  "installDpkgArchiveEtcFile() function. " .
2659
              "installDpkgArchiveEtcFile() function. " ,
2656
                  "Check deploy config.");
2660
              "Check deploy config.");
2657
    }
2661
    }
2658
 
2662
 
2659
    my ($sfile, $targetTag) = @_;
2663
    my ($sfile, $targetTag) = @_;
2660
 
2664
 
2661
    # lets check to see if the target tag exists
2665
    # lets check to see if the target tag exists
Line 2688... Line 2692...
2688
#------------------------------------------------------------------------------
2692
#------------------------------------------------------------------------------
2689
{
2693
{
2690
    # correct number of parameters?
2694
    # correct number of parameters?
2691
    if ( ($#_+1) != 2 )
2695
    if ( ($#_+1) != 2 )
2692
    {
2696
    {
2693
        LogError("Incorrect number of params passed to " .
2697
        Error("Incorrect number of params passed to " .
2694
                  "installDpkgArchiveScriptsFile() function. " .
2698
              "installDpkgArchiveScriptsFile() function. " ,
2695
                  "Check deploy config.");
2699
              "Check deploy config.");
2696
    }
2700
    }
2697
 
2701
 
2698
   my ($sfile, $targetTag) = @_;
2702
   my ($sfile, $targetTag) = @_;
2699
 
2703
 
2700
    # lets check to see if the target tag exists
2704
    # lets check to see if the target tag exists
Line 2728... Line 2732...
2728
#------------------------------------------------------------------------------
2732
#------------------------------------------------------------------------------
2729
{
2733
{
2730
    # correct number of parameters?
2734
    # correct number of parameters?
2731
    if ( ($#_+1) != 2 )
2735
    if ( ($#_+1) != 2 )
2732
    {
2736
    {
2733
        LogError("Incorrect number of params passed to " .
2737
        Error("Incorrect number of params passed to " .
2734
                  "installDpkgArchiveIncludeFile() function. " .
2738
              "installDpkgArchiveIncludeFile() function. " ,
2735
                  "Check deploy config.");
2739
              "Check deploy config.");
2736
    }
2740
    }
2737
 
2741
 
2738
   my ($sfile, $targetTag) = @_;
2742
   my ($sfile, $targetTag) = @_;
2739
 
2743
 
2740
    # lets check to see if the target tag exists
2744
    # lets check to see if the target tag exists
Line 2768... Line 2772...
2768
#------------------------------------------------------------------------------
2772
#------------------------------------------------------------------------------
2769
{
2773
{
2770
    # correct number of parameters?
2774
    # correct number of parameters?
2771
    if ( ($#_+1) != 2 )
2775
    if ( ($#_+1) != 2 )
2772
    {
2776
    {
2773
        LogError("Incorrect number of params passed to " .
2777
        Error("Incorrect number of params passed to " .
2774
                  "installDpkgArchiveDocFile() function. " .
2778
              "installDpkgArchiveDocFile() function. " ,
2775
                  "Check deploy config.");
2779
              "Check deploy config.");
2776
    }
2780
    }
2777
 
2781
 
2778
   my ($sfile, $targetTag) = @_;
2782
   my ($sfile, $targetTag) = @_;
2779
 
2783
 
2780
    # lets check to see if the target tag exists
2784
    # lets check to see if the target tag exists
Line 2829... Line 2833...
2829
    #
2833
    #
2830
    foreach  ( @_ )
2834
    foreach  ( @_ )
2831
    {
2835
    {
2832
        if ( m/^--SelectFrom=(.*)/ ) {
2836
        if ( m/^--SelectFrom=(.*)/ ) {
2833
            $select = $1;
2837
            $select = $1;
2834
            LogError("installDpkgArchiveBinFile: Selector not known: $_")
2838
            Error("installDpkgArchiveBinFile: Selector not known: $_")
2835
                unless ( defined $DpkgLibDirList{$select} );
2839
                unless ( defined $DpkgLibDirList{$select} );
2836
 
2840
 
2837
        } elsif ( m/^--/ ) {
2841
        } elsif ( m/^--/ ) {
2838
            LogError('-x', "installDpkgArchiveBinFile: Unknown option ignored: $_")
2842
            Warning ("installDpkgArchiveBinFile: Unknown option ignored: $_")
2839
 
2843
 
2840
        } else {
2844
        } else {
2841
            push @args, $_;
2845
            push @args, $_;
2842
        }
2846
        }
2843
    }
2847
    }
Line 2845... Line 2849...
2845
 
2849
 
2846
    # correct number of parameters?
2850
    # correct number of parameters?
2847
    my ($fref, $targetTag) = @_;
2851
    my ($fref, $targetTag) = @_;
2848
    if ( $#args != 1 )
2852
    if ( $#args != 1 )
2849
    {
2853
    {
2850
        LogError("Incorrect number of params passed to " .
2854
        Error("Incorrect number of params passed to " .
2851
                  "installDpkgArchiveBinFile() function. " .
2855
              "installDpkgArchiveBinFile() function. " ,
2852
                  "Check deploy config.");
2856
              "Check deploy config.");
2853
    }
2857
    }
2854
 
2858
 
2855
    # lets check to see if the target tag exists
2859
    # lets check to see if the target tag exists
2856
    # if does not the process with log an error.
2860
    # if does not the process with log an error.
2857
    #
2861
    #
Line 2895... Line 2899...
2895
        foreach $i (@{$DpkgBinDirList{$select}})
2899
        foreach $i (@{$DpkgBinDirList{$select}})
2896
        {
2900
        {
2897
            $m_DpkgBinDir = "$DpkgBinDir" . "/$i";
2901
            $m_DpkgBinDir = "$DpkgBinDir" . "/$i";
2898
            if ( ! -d "$m_DpkgBinDir" )
2902
            if ( ! -d "$m_DpkgBinDir" )
2899
            {
2903
            {
2900
                LogDebug("Directory [$m_DpkgBinDir] not found.");
2904
                Debug("Directory [$m_DpkgBinDir] not found.");
2901
                next;
2905
                next;
2902
            }
2906
            }
2903
 
2907
 
2904
            # lets define the absolute location of the file
2908
            # lets define the absolute location of the file
2905
            $m_srcFileLocation = "$m_DpkgBinDir/$sfile";
2909
            $m_srcFileLocation = "$m_DpkgBinDir/$sfile";
Line 2910... Line 2914...
2910
            if ( -f "$m_srcFileLocation" )
2914
            if ( -f "$m_srcFileLocation" )
2911
            {
2915
            {
2912
                # now we need to copy the file.
2916
                # now we need to copy the file.
2913
                if(File::Copy::copy("$m_srcFileLocation", "$m_dstFileLocation"))
2917
                if(File::Copy::copy("$m_srcFileLocation", "$m_dstFileLocation"))
2914
                {
2918
                {
2915
                    LogNorm("Copied Bin [$sfile] to [$m_dstFileLocation] ...");
2919
                    Verbose("Copied Bin [$sfile] to [$m_dstFileLocation] ...");
2916
                    $foundFileFlag = "true";
2920
                    $foundFileFlag = "true";
2917
                 
2921
                 
2918
                    # no need to go further, we have found the file.
2922
                    # no need to go further, we have found the file.
2919
                    #
2923
                    #
2920
                    last;
2924
                    last;
2921
                }
2925
                }
2922
                else
2926
                else
2923
                {
2927
                {
2924
                    LogError("Failed to copy binary [$sfile]: $!");
2928
                    Error("Failed to copy binary [$sfile]: $!");
2925
                }
2929
                }
2926
            }
2930
            }
2927
            # else we have not found the file yet!
2931
            # else we have not found the file yet!
2928
        }
2932
        }
2929
 
2933
 
2930
        # if we do not find the file at all we need to inform
2934
        # if we do not find the file at all we need to inform
2931
        # the user.
2935
        # the user.
2932
        #
2936
        #
2933
        if ( "$foundFileFlag" eq "false" )
2937
        if ( "$foundFileFlag" eq "false" )
2934
        {
2938
        {
2935
            LogError("Dpkg_archive bin file [$sfile] does not exist or is not in correct directory structure.");
2939
            Error("Dpkg_archive bin file [$sfile] does not exist or is not in correct directory structure.");
2936
        }
2940
        }
2937
    }
2941
    }
2938
    
2942
    
2939
    return 1;
2943
    return 1;
2940
}
2944
}
Line 2953... Line 2957...
2953
#       processing.
2957
#       processing.
2954
#
2958
#
2955
#       Added optional 3rd parameter & if set to NoLinks then no generic named
2959
#       Added optional 3rd parameter & if set to NoLinks then no generic named
2956
#       libs will be created
2960
#       libs will be created
2957
#
2961
#
2958
# Inputs          :     $sfile              - Name of source file
2962
# Inputs          :     $sfile              - Name of source file OR
-
 
2963
#                                             A --Filter specification ( below)
2959
#                                             or a reference to a list of files
2964
#                                             A reference to a list of files OR
2960
#                       $targetTag          - Symbolic name of target
2965
#                       $targetTag          - Symbolic name of target
2961
#                       $links              - Optional. 'nolinks' will supress generic named libs
2966
#                       $links              - Optional. 'nolinks' will supress generic named libs
2962
#                       Options             - Optional options
2967
#                       Options             - Optional options
2963
#
2968
#
2964
# Options:
2969
# Options:
2965
#                   --NoLink                - same as 3rd arg == noloiks
2970
#                   --NoLink                - same as 3rd arg == nolinks
2966
#                   --Link                  - Default
2971
#                   --Link                  - Default
2967
#                   --SelectFrom=xxxx       - Limits foile source selection
2972
#                   --SelectFrom=xxxx       - Limits foile source selection
2968
#                                             By default all LIB sources are searched.
2973
#                                             By default all LIB sources are searched.
2969
#                                             The selector should be a Platform, Product
2974
#                                             The selector should be a Platform, Product
2970
#                                             ,Target or MachineType
2975
#                                             ,Target or MachineType
2971
#
2976
#
-
 
2977
# SourceFile options:
-
 
2978
#                   Source files may be a filter rule which will expand to
-
 
2979
#                   one or more files.
-
 
2980
#                       --FilterIn=xx
-
 
2981
#                       --FilterInRE=xx
-
 
2982
#                       --FilterOut=xx
-
 
2983
#                       --FilterOutRE=xx
-
 
2984
#
-
 
2985
#                     Notes:    --FilterIn=xxxx, --FilterOut=xxx
-
 
2986
#                               xxx is a simple Shell style filter where:
-
 
2987
#                                   * means one or more charters        '*.EXE'
-
 
2988
#                                   ? means a single character          '*.?'
-
 
2989
#                                   [abc] means either a or b or c      'file.[ch]'
-
 
2990
#
-
 
2991
#                               --FilterInRE=xxx, --FilterOutRE=xxx
-
 
2992
#                               xxx is a Regular Expression. There are harder to use but very
-
 
2993
#                               powerful. ie '.*\.EXE$'
-
 
2994
#
-
 
2995
#                               The 'In' filters are applied before the 'Out' filters.
-
 
2996
#
-
 
2997
#                               Multiple options may be joined with a comma.
2972
#
2998
#
2973
# Returns         :     Nothing of use
2999
# Returns         :     Nothing of use
2974
#                       Will not return if the file is not found
3000
#                       Will not return if the file is not found
2975
#
3001
#
2976
#------------------------------------------------------------------------------
3002
#------------------------------------------------------------------------------
Line 2990... Line 3016...
2990
        } elsif ( m/^--Link/ ) {
3016
        } elsif ( m/^--Link/ ) {
2991
            $links = 1;
3017
            $links = 1;
2992
 
3018
 
2993
        } elsif ( m/^--SelectFrom=(.*)/ ) {
3019
        } elsif ( m/^--SelectFrom=(.*)/ ) {
2994
            $select = $1;
3020
            $select = $1;
2995
            LogError("installDpkgArchiveLibFile: Selector not known: $_")
3021
            Error("installDpkgArchiveLibFile: Selector not known: $_")
2996
                unless ( defined $DpkgLibDirList{$select} );
3022
                unless ( defined $DpkgLibDirList{$select} );
2997
 
3023
 
-
 
3024
        } elsif ( m/^--Filter.*=/ ) {
-
 
3025
            push @args, $_;
-
 
3026
 
2998
        } elsif ( m/^--/ ) {
3027
        } elsif ( m/^--/ ) {
2999
            LogError('-x', "installDpkgArchiveLibFile: Unknown option ignored: $_")
3028
            Warning ("installDpkgArchiveLibFile: Unknown option ignored: $_")
3000
 
3029
 
3001
        } else {
3030
        } else {
3002
            push @args, $_;
3031
            push @args, $_;
3003
        }
3032
        }
3004
    }
3033
    }
Line 3014... Line 3043...
3014
 
3043
 
3015
    # correct number of parameters?
3044
    # correct number of parameters?
3016
    my ($fref, $targetTag) = @_;
3045
    my ($fref, $targetTag) = @_;
3017
    if ( $#args != 1 )
3046
    if ( $#args != 1 )
3018
    {
3047
    {
3019
        LogError("Incorrect number of params passed to " .
3048
        Error("Incorrect number of params passed to " .
3020
                  "installDpkgArchiveLibFile() function. " .
3049
              "installDpkgArchiveLibFile() function. " ,
3021
                  "Check deploy config.");
3050
              "Check deploy config.");
3022
    }
3051
    }
3023
 
3052
 
3024
    #
3053
    #
3025
    # Check to see if the target tag exists
3054
    # Check to see if the target tag exists
3026
    # If does not the process with log an error.
3055
    # If does not the process with log an error.
Line 3039... Line 3068...
3039
    {
3068
    {
3040
        push @one_file, $fref;
3069
        push @one_file, $fref;
3041
        $fref = \@one_file;
3070
        $fref = \@one_file;
3042
    }
3071
    }
3043
 
3072
 
-
 
3073
    #
-
 
3074
    #   If the source file contains a pattern, then expand the pattern
-
 
3075
    #   This may result in multiple files.
-
 
3076
    #   Note: Allow for a single entry of the form
-
 
3077
    #           --Filterin=xxx,---FilterOut=yyy
-
 
3078
    #
-
 
3079
    my @flist;
-
 
3080
    my @dir_tree_exclude;
-
 
3081
    my @dir_tree_include;
3044
    foreach my $sfile ( @$fref )
3082
    foreach my $element ( @$fref )
3045
    {
3083
    {
-
 
3084
        foreach  ( split /,/ , $element )
-
 
3085
        {
-
 
3086
            if ( /^--FilterOut=(.*)/ ) {
-
 
3087
                push @dir_tree_exclude, glob2pat($1);
-
 
3088
 
-
 
3089
            } elsif ( /^--FilterOutRE=(.*)/ ) {
-
 
3090
                push @dir_tree_exclude, $1;
-
 
3091
 
-
 
3092
            } elsif ( /^--FilterIn=(.*)/ ) {
-
 
3093
                push @dir_tree_include, glob2pat($1);
3046
 
3094
 
-
 
3095
            } elsif ( /^--FilterInRE=(.*)/ ) {
-
 
3096
                push @dir_tree_include, $1;
-
 
3097
 
-
 
3098
            } elsif ( m/^--/ ) {
-
 
3099
                Warning( "installDpkgArchiveLibFile: Unknown Filter option ignored: $_");
-
 
3100
 
-
 
3101
            } else {
-
 
3102
                push @flist, $_;
-
 
3103
            }
-
 
3104
        }
-
 
3105
    }
-
 
3106
 
-
 
3107
    #
-
 
3108
    #   If any patterns have been found, then expand them
-
 
3109
    #
-
 
3110
    if ( @dir_tree_exclude || @dir_tree_include )
-
 
3111
    {
-
 
3112
        foreach my $i (@{$DpkgLibDirList{$select}})
-
 
3113
        {
-
 
3114
            my @elements = ExpandDirTree( "$DpkgLibDir/$i", \@dir_tree_exclude, \@dir_tree_include, 0 );
-
 
3115
 
-
 
3116
            #
-
 
3117
            #   Clean off any leading / from each filename then add to a list
-
 
3118
            #   Remove any duplicates that were found
-
 
3119
            #
-
 
3120
            map { $_ =~ s~^/~~ } @elements;
-
 
3121
            UniquePush \@flist, @elements;
-
 
3122
        }
-
 
3123
    }
-
 
3124
 
-
 
3125
 
-
 
3126
    #
-
 
3127
    #   Process each file
-
 
3128
    #
-
 
3129
    foreach my $sfile ( @flist )
-
 
3130
    {
3047
 
3131
 
3048
        # we exclude .dll files if this is a sparc build
3132
        # we exclude .dll files if this is a sparc build
3049
        #
3133
        #
3050
        if ( "$MachType" eq "sparc"  &&
3134
        if ( "$MachType" eq "sparc"  &&
3051
             $sfile =~ m/\.dll/
3135
             $sfile =~ m/\.dll/
3052
           )
3136
           )
3053
        {
3137
        {
3054
            LogInfo("Excluding item [$sfile] from build, as we do not deliver dlls for this machine type [$MachType].");
3138
            Verbose("Excluding item [$sfile] from build, as we do not deliver dlls for this machine type [$MachType].");
3055
            return 1;
3139
            return 1;
3056
        }
3140
        }
3057
 
3141
 
3058
        # we exclude .so files if this is a win32 build
3142
        # we exclude .so files if this is a win32 build
3059
        #
3143
        #
3060
        if ( "$MachType" eq "win32"  &&
3144
        if ( "$MachType" eq "win32"  &&
3061
             $sfile =~ m/\.so/
3145
             $sfile =~ m/\.so/
3062
           )
3146
           )
3063
        {
3147
        {
3064
            LogInfo("Excluding item [$sfile] from build, as we do not deliver sosss for this machine type [$MachType].");
3148
            Verbose("Excluding item [$sfile] from build, as we do not deliver sosss for this machine type [$MachType].");
3065
            return 1;
3149
            return 1;
3066
        }
3150
        }
3067
 
3151
 
3068
        my ($libName) = $sfile;
3152
        my ($libName) = $sfile;
3069
        if ( "$MachType" eq "sparc" )
3153
        if ( "$MachType" eq "sparc" )
Line 3089... Line 3173...
3089
        {
3173
        {
3090
 
3174
 
3091
            $m_DpkgLibDir = "$DpkgLibDir" . "/$i";
3175
            $m_DpkgLibDir = "$DpkgLibDir" . "/$i";
3092
            if ( ! -d "$m_DpkgLibDir" )
3176
            if ( ! -d "$m_DpkgLibDir" )
3093
            {
3177
            {
3094
                LogDebug("Directory [$m_DpkgLibDir] not found.");
3178
                Debug("Directory [$m_DpkgLibDir] not found.");
3095
                next;
3179
                next;
3096
            }
3180
            }
3097
 
3181
 
-
 
3182
 
3098
            $m_srcFileLocation = "$m_DpkgLibDir/$sfile";
3183
            $m_srcFileLocation = "$m_DpkgLibDir/$sfile";
3099
            $m_dstFileLocation = "$targetValue/$sfile";
3184
            $m_dstFileLocation = "$targetValue/$sfile";
3100
 
3185
 
3101
 
3186
 
3102
            # we only want debug items in a debug build
3187
            # we only want debug items in a debug build
3103
            #
3188
            #
3104
            if(excludeItemFromBuild($sfile))
3189
            if(excludeItemFromBuild($sfile))
3105
            {
3190
            {
3106
                LogInfo("Excluding item [$sfile] from build as not compatible with build type [$BuildType].");
3191
                Verbose("Excluding item [$sfile] from build as not compatible with build type [$BuildType].");
3107
                $ExcludedFlag = "true";
3192
                $ExcludedFlag = "true";
3108
            }
3193
            }
3109
            else
3194
            else
3110
            {
3195
            {
3111
                # we need to ensure that only a single version/entry of the lib exists in the lib list
3196
                # we need to ensure that only a single version/entry of the lib exists in the lib list
Line 3118... Line 3203...
3118
                        $count++;
3203
                        $count++;
3119
                    }
3204
                    }
3120
        
3205
        
3121
                    if ( $count > 1 )
3206
                    if ( $count > 1 )
3122
                    {
3207
                    {
3123
                        LogError("Detected multiple references of lib [$libName] in lib list, check item [$sfile].");
3208
                        Error("Detected multiple references of lib [$libName] in lib list, check item [$sfile].");
3124
                    }
3209
                    }
3125
                }
3210
                }
3126
 
3211
 
3127
                # we will check to see if the file exists.
3212
                # we will check to see if the file exists.
3128
                #
3213
                #
3129
                if ( -f "$m_srcFileLocation" )
3214
                if ( -f "$m_srcFileLocation" )
3130
                {
3215
                {
3131
                    # now we need to copy the file.
3216
                    # now we need to copy the file.
3132
 
3217
 
3133
                    # we also want to create a generically named copy
3218
                    # we also want to create a generically named copy
3134
                    # of the library
3219
                    # of the library. ie:
-
 
3220
                    #       libraryP.nn.nn.nn.dll -> library.dll, libraryP.dll
-
 
3221
                    #       libraryP.so.nn.nn.nn  -> library.so, libraryP.so
3135
                    #
3222
                    #
3136
                    my ($gName)    = $sfile;
3223
                    my ($gName)    = $sfile;
3137
                    my ($nVerName) = $sfile;
3224
                    my ($nVerName) = $sfile;
3138
                    $gName = removeBuildTypeFromItemName($sfile);
3225
                    $gName = removeBuildTypeFromItemName($sfile);
3139
                    $gName = removeVersionNumberFromItemName($gName);
3226
                    $gName = removeVersionNumberFromItemName($gName);
3140
                    $nVerName = removeVersionNumberFromItemName($sfile);
3227
                    $nVerName = removeVersionNumberFromItemName($sfile);
3141
 
3228
 
3142
                    if(File::Copy::copy("$m_srcFileLocation", "$m_dstFileLocation"))
3229
                    if(File::Copy::copy("$m_srcFileLocation", "$m_dstFileLocation"))
3143
                    {
3230
                    {
3144
                        LogNorm("Copied Lib [$sfile] to [$m_dstFileLocation] ...");
3231
                        Verbose("Copied Lib [$sfile] to [$m_dstFileLocation] ...");
3145
                        $foundFileFlag = "true";
3232
                        $foundFileFlag = "true";
3146
 
3233
 
3147
                        if ( $links && ( "x$PkgPatchID" eq "x" || "$MachType" eq "win32") )
3234
                        if ( $links && ( "x$PkgPatchID" eq "x" || "$MachType" eq "win32") )
3148
                        {
3235
                        {
3149
                            # normal build or if we are building win32 we want generic names
3236
                            # normal build or if we are building win32 we want generic names
Line 3171... Line 3258...
3171
                    }
3258
                    }
3172
                    else
3259
                    else
3173
                    {
3260
                    {
3174
                        # here found the file but we had some trouble
3261
                        # here found the file but we had some trouble
3175
                        #
3262
                        #
3176
                        LogError("Failed to copy lib [$m_srcFileLocation]: $!");
3263
                        Error("Failed to copy lib [$m_srcFileLocation]: $!");
3177
                    }
3264
                    }
3178
 
3265
 
3179
                }
3266
                }
3180
                # else have not found the file yet!
3267
                # else have not found the file yet!
3181
            }
3268
            }
Line 3184... Line 3271...
3184
        # if we do not find the file at all we need to inform
3271
        # if we do not find the file at all we need to inform
3185
        # the user.
3272
        # the user.
3186
        #
3273
        #
3187
        if ( "$foundFileFlag" eq "false" && $ExcludedFlag eq "false" )
3274
        if ( "$foundFileFlag" eq "false" && $ExcludedFlag eq "false" )
3188
        {
3275
        {
3189
            LogError("Dpkg_archive lib file [$sfile] does not exist or is not in correct directory structure.");
3276
            Error("Dpkg_archive lib file [$sfile] does not exist or is not in correct directory structure.");
3190
        }
3277
        }
3191
    }
3278
    }
3192
 
3279
 
3193
    return 1;
3280
    return 1;
3194
}
3281
}
Line 3210... Line 3297...
3210
#------------------------------------------------------------------------------
3297
#------------------------------------------------------------------------------
3211
{
3298
{
3212
    # correct number of parameters?
3299
    # correct number of parameters?
3213
    if ( ($#_+1) != 3 )
3300
    if ( ($#_+1) != 3 )
3214
    {
3301
    {
3215
        LogError("Incorrect number of params passed to " .
3302
        Error("Incorrect number of params passed to " .
3216
                  "installPkgAddConfigFile() function. " .
3303
              "installPkgAddConfigFile() function. " ,
3217
                  "Check deploy config.");
3304
              "Check deploy config.");
3218
    }
3305
    }
3219
 
3306
 
3220
    # lets just check to see if we can execute this function on
3307
    # lets just check to see if we can execute this function on
3221
    # this machine.
3308
    # this machine.
3222
    #
3309
    #
3223
    if ( "$MachType" ne "sparc" )
3310
    if ( "$MachType" ne "sparc" )
3224
    {
3311
    {
3225
        LogInfo("installPkgAddConfigFile() not supported on this machine type.");
3312
        Verbose("installPkgAddConfigFile() not supported on this machine type.");
3226
        return 1;
3313
        return 1;
3227
    }
3314
    }
3228
 
3315
 
3229
 
3316
 
3230
    my ($sDirTag, $sfile, $tfile) = @_;
3317
    my ($sDirTag, $sfile, $tfile) = @_;
Line 3232... Line 3319...
3232
 
3319
 
3233
    # we must have a filename.
3320
    # we must have a filename.
3234
    #
3321
    #
3235
    if ( "x$sfile" eq "x" )
3322
    if ( "x$sfile" eq "x" )
3236
    {
3323
    {
3237
        LogError("Source filename not supplied. Check deploy config.");
3324
        Error("Source filename not supplied. Check deploy config.");
3238
    }
3325
    }
3239
 
3326
 
3240
 
3327
 
3241
    # lets check to see if the local src dir tag exists
3328
    # lets check to see if the local src dir tag exists
3242
    # if does not the process with log an error.
3329
    # if does not the process with log an error.
Line 3246... Line 3333...
3246
 
3333
 
3247
    # lets check to see if the source file exists
3334
    # lets check to see if the source file exists
3248
    #
3335
    #
3249
    if ( ! -f "$sDirValue/$sfile" )
3336
    if ( ! -f "$sDirValue/$sfile" )
3250
    {
3337
    {
3251
        LogError("Failed to find local source file [$sDirValue/$sfile].");
3338
        Error("Failed to find local source file [$sDirValue/$sfile].");
3252
    }
3339
    }
3253
 
3340
 
3254
    if ( ! -f "$ProtoTypeFile" )
3341
    if ( ! -f "$ProtoTypeFile" )
3255
    {
3342
    {
3256
        LogError("Prototype file [$ProtoTypeFile] does not exist. " .
3343
        Error("Prototype file [$ProtoTypeFile] does not exist.",
3257
                 "Ensure createPrototypeFile() function has been called before executing installPkgAddConfigFile() function. " .
3344
              "Ensure createPrototypeFile() function has been called before executing installPkgAddConfigFile() function.",
3258
                 "Check deploy config.");
3345
              "Check deploy config.");
3259
    }
3346
    }
3260
 
3347
 
3261
    
3348
    
3262
    # lets determine which prototype file we are going to
3349
    # lets determine which prototype file we are going to
3263
    # use
3350
    # use
Line 3266... Line 3353...
3266
 
3353
 
3267
    # lets copy the file
3354
    # lets copy the file
3268
    #
3355
    #
3269
    if(File::Copy::copy("$sDirValue/$sfile", "$dFileName"))
3356
    if(File::Copy::copy("$sDirValue/$sfile", "$dFileName"))
3270
    {
3357
    {
3271
        LogNorm("Copied [$sfile] to [$dFileName] ...");
3358
        Verbose("Copied [$sfile] to [$dFileName] ...");
3272
    }
3359
    }
3273
    else
3360
    else
3274
    {
3361
    {
3275
        LogError("Failed to copy local source file [$sDirValue/$sfile]: $!"); 
3362
        Error("Failed to copy local source file [$sDirValue/$sfile]: $!"); 
3276
    }
3363
    }
3277
 
3364
 
3278
   
3365
   
3279
    # now we need to update the prototype file
3366
    # now we need to update the prototype file
3280
    #
3367
    #
3281
    local *FILE;
3368
    local *FILE;
3282
    open ( FILE, ">> $ProtoTypeFile") or
3369
    open ( FILE, ">> $ProtoTypeFile") or
3283
        LogError("Failed to open file [$ProtoTypeFile].");
3370
        Error("Failed to open file [$ProtoTypeFile].");
3284
    printf FILE ("i $tfile=$sfile\n");
3371
    printf FILE ("i $tfile=$sfile\n");
3285
    close (FILE);
3372
    close (FILE);
3286
 
3373
 
3287
 
3374
 
3288
    return 1;
3375
    return 1;
Line 3305... Line 3392...
3305
#------------------------------------------------------------------------------
3392
#------------------------------------------------------------------------------
3306
{
3393
{
3307
    # correct number of parameters?
3394
    # correct number of parameters?
3308
    if ( ($#_+1) != 4 )
3395
    if ( ($#_+1) != 4 )
3309
    {
3396
    {
3310
        LogError("Incorrect number of params passed to " .
3397
        Error("Incorrect number of params passed to " .
3311
                  "installPkgAddConfigFile() function. " .
3398
              "installPkgAddConfigFile() function. " ,
3312
                  "Check deploy config.");
3399
              "Check deploy config.");
3313
    }
3400
    }
3314
 
3401
 
3315
    # lets just check to see if we can execute this function on
3402
    # lets just check to see if we can execute this function on
3316
    # this machine.
3403
    # this machine.
3317
    #
3404
    #
3318
    if ( "$MachType" ne "sparc" )
3405
    if ( "$MachType" ne "sparc" )
3319
    {
3406
    {
3320
        LogInfo("installPkgAddConfigFile() not supported on this machine type.");
3407
        Verbose("installPkgAddConfigFile() not supported on this machine type.");
3321
        return 1;
3408
        return 1;
3322
    }
3409
    }
3323
 
3410
 
3324
 
3411
 
3325
    my ($sDirTag, $sfile, $tfile, $class) = @_;
3412
    my ($sDirTag, $sfile, $tfile, $class) = @_;
3326
 
3413
 
3327
    if ( $class ne "sed" && $class ne "build" && $class ne "awk" && $class ne "preserve" )
3414
    if ( $class ne "sed" && $class ne "build" && $class ne "awk" && $class ne "preserve" )
3328
    {
3415
    {
3329
        LogError("Class Name for System Class File can only be one of sed, build, awk or preserve");
3416
        Error("Class Name for System Class File can only be one of sed, build, awk or preserve");
3330
    }
3417
    }
3331
 
3418
 
3332
    # we must have a filename.
3419
    # we must have a filename.
3333
    #
3420
    #
3334
    if ( "x$sfile" eq "x" )
3421
    if ( "x$sfile" eq "x" )
3335
    {
3422
    {
3336
        LogError("Source filename not supplied. Check deploy config.");
3423
        Error("Source filename not supplied. Check deploy config.");
3337
    }
3424
    }
3338
 
3425
 
3339
 
3426
 
3340
    # lets check to see if the local src dir tag exists
3427
    # lets check to see if the local src dir tag exists
3341
    # if does not the process with log an error.
3428
    # if does not the process with log an error.
Line 3345... Line 3432...
3345
 
3432
 
3346
    # lets check to see if the source file exists
3433
    # lets check to see if the source file exists
3347
    #
3434
    #
3348
    if ( ! -f "$sDirValue/$sfile" )
3435
    if ( ! -f "$sDirValue/$sfile" )
3349
    {
3436
    {
3350
        LogError("Failed to find local source file [$sDirValue/$sfile].");
3437
        Error("Failed to find local source file [$sDirValue/$sfile].");
3351
    }
3438
    }
3352
 
3439
 
3353
    if ( ! -f "$ProtoTypeFile" )
3440
    if ( ! -f "$ProtoTypeFile" )
3354
    {
3441
    {
3355
        LogError("Prototype file [$ProtoTypeFile] does not exist. " .
3442
        Error("Prototype file [$ProtoTypeFile] does not exist.",
3356
                 "Ensure createPrototypeFile() function has been called before executing installPkgAddConfigFile() function. " .
3443
              "Ensure createPrototypeFile() function has been called before executing installPkgAddConfigFile() function.",
3357
                 "Check deploy config.");
3444
              "Check deploy config.");
3358
    }
3445
    }
3359
 
3446
 
3360
    
3447
    
3361
    # lets determine which prototype file we are going to
3448
    # lets determine which prototype file we are going to
3362
    # use
3449
    # use
Line 3365... Line 3452...
3365
 
3452
 
3366
    # lets copy the file
3453
    # lets copy the file
3367
    #
3454
    #
3368
    if(File::Copy::copy("$sDirValue/$sfile", "$dFileName"))
3455
    if(File::Copy::copy("$sDirValue/$sfile", "$dFileName"))
3369
    {
3456
    {
3370
        LogNorm("Copied [$sfile] to [$dFileName] ...");
3457
        Verbose("Copied [$sfile] to [$dFileName] ...");
3371
    }
3458
    }
3372
    else
3459
    else
3373
    {
3460
    {
3374
        LogError("Failed to copy local source file [$sDirValue/$sfile]: $!"); 
3461
        Error("Failed to copy local source file [$sDirValue/$sfile]: $!"); 
3375
    }
3462
    }
3376
 
3463
 
3377
   
3464
   
3378
    # now we need to update the prototype file
3465
    # now we need to update the prototype file
3379
    #
3466
    #
3380
    local *FILE;
3467
    local *FILE;
3381
    open ( FILE, ">> $ProtoTypeFile") or
3468
    open ( FILE, ">> $ProtoTypeFile") or
3382
        LogError("Failed to open file [$ProtoTypeFile].");
3469
        Error("Failed to open file [$ProtoTypeFile].");
3383
    printf FILE ("e $class $tfile=$sfile ? ? ?\n");
3470
    printf FILE ("e $class $tfile=$sfile ? ? ?\n");
3384
    close (FILE);
3471
    close (FILE);
3385
 
3472
 
3386
 
3473
 
3387
    return 1;
3474
    return 1;
Line 3407... Line 3494...
3407
#------------------------------------------------------------------------------
3494
#------------------------------------------------------------------------------
3408
{
3495
{
3409
    # correct number of parameters?
3496
    # correct number of parameters?
3410
    if ( ($#_+1) != 6 )
3497
    if ( ($#_+1) != 6 )
3411
    {
3498
    {
3412
        LogError("Incorrect number of params passed to " .
3499
        Error("Incorrect number of params passed to " .
3413
                  "updatePrototypeFileAddItem() function. " .
3500
              "updatePrototypeFileAddItem() function. " ,
3414
                  "Check deploy config.");
3501
              "Check deploy config.");
3415
    }
3502
    }
3416
 
3503
 
3417
 
3504
 
3418
    # lets just check to see if we can execute this function on
3505
    # lets just check to see if we can execute this function on
3419
    # this machine.
3506
    # this machine.
3420
    #
3507
    #
3421
    if ( "$MachType" ne "sparc" )
3508
    if ( "$MachType" ne "sparc" )
3422
    {
3509
    {
3423
        LogInfo("updatePrototypeFileAddItem() not supported on this machine type.");
3510
        Verbose("updatePrototypeFileAddItem() not supported on this machine type.");
3424
        return 1;
3511
        return 1;
3425
    }
3512
    }
3426
 
3513
 
3427
    my ($sTag, $dTag, $perms, $uid, $gid, $type) = @_;
3514
    my ($sTag, $dTag, $perms, $uid, $gid, $type) = @_;
3428
 
3515
 
Line 3434... Line 3521...
3434
 
3521
 
3435
    # lets check the valid types
3522
    # lets check the valid types
3436
    $type = uc($type);
3523
    $type = uc($type);
3437
    if ( "$type" !~ /S/ )
3524
    if ( "$type" !~ /S/ )
3438
    {
3525
    {
3439
        LogError("Invalid type field supplied in updatePrototypeFileAddItem(). Check deploy config.");
3526
        Error("Invalid type field supplied in updatePrototypeFileAddItem(). Check deploy config.");
3440
    }
3527
    }
3441
 
3528
 
3442
    # now we need to update the prototype file
3529
    # now we need to update the prototype file
3443
    #
3530
    #
3444
    local *FILE;
3531
    local *FILE;
3445
    open ( FILE, ">> $protoTypeFile") or
3532
    open ( FILE, ">> $protoTypeFile") or
3446
        LogError("Failed to open file [$protoTypeFile].");
3533
        Error("Failed to open file [$protoTypeFile].");
3447
  
3534
  
3448
    my($m_Str)=""; 
3535
    my($m_Str)=""; 
3449
    if ( "$type" eq "S" )
3536
    if ( "$type" eq "S" )
3450
    {
3537
    {
3451
        $m_Str = "s none $sTag=$ERGAFC_BASEDIR/$dTag $perms $uid $gid";
3538
        $m_Str = "s none $sTag=$ERGAFC_BASEDIR/$dTag $perms $uid $gid";
3452
        LogNorm("Updated prototype file with entry [$m_Str]");
3539
        Verbose("Updated prototype file with entry [$m_Str]");
3453
    }
3540
    }
3454
    else
3541
    else
3455
    {
3542
    {
3456
        $m_Str = "f none $sTag=$ERGAFC_BASEDIR/$dTag $perms $uid $gid";
3543
        $m_Str = "f none $sTag=$ERGAFC_BASEDIR/$dTag $perms $uid $gid";
3457
        LogNorm("Updated prototype file with entry [$m_Str]");
3544
        Verbose("Updated prototype file with entry [$m_Str]");
3458
    }
3545
    }
3459
    printf FILE ("$m_Str\n");
3546
    printf FILE ("$m_Str\n");
3460
    close (FILE);
3547
    close (FILE);
3461
 
3548
 
3462
    return 1;
3549
    return 1;
Line 3481... Line 3568...
3481
#------------------------------------------------------------------------------
3568
#------------------------------------------------------------------------------
3482
{
3569
{
3483
    # correct number of parameters?
3570
    # correct number of parameters?
3484
    if ( ($#_+1) != 6 && ($#_+1) != 7 )
3571
    if ( ($#_+1) != 6 && ($#_+1) != 7 )
3485
    {
3572
    {
3486
        LogError("Incorrect number of params passed to " .
3573
        Error("Incorrect number of params passed to " .
3487
                  "updatePrototypeFileAddItem2() function. " .
3574
              "updatePrototypeFileAddItem2() function. " ,
3488
                  "Check deploy config.");
3575
              "Check deploy config.");
3489
    }
3576
    }
3490
 
3577
 
3491
 
3578
 
3492
    # lets just check to see if we can execute this function on
3579
    # lets just check to see if we can execute this function on
3493
    # this machine.
3580
    # this machine.
3494
    #
3581
    #
3495
    if ( "$MachType" ne "sparc" )
3582
    if ( "$MachType" ne "sparc" )
3496
    {
3583
    {
3497
        LogInfo("updatePrototypeFileAddItem2() not supported on this machine type.");
3584
        Verbose("updatePrototypeFileAddItem2() not supported on this machine type.");
3498
        return 1;
3585
        return 1;
3499
    }
3586
    }
3500
 
3587
 
3501
    # class must be last as it is optional
3588
    # class must be last as it is optional
3502
    my ($sTag, $dTag, $perms, $uid, $gid, $type, $class) = @_;
3589
    my ($sTag, $dTag, $perms, $uid, $gid, $type, $class) = @_;
Line 3510... Line 3597...
3510
 
3597
 
3511
    # lets check the valid types
3598
    # lets check the valid types
3512
    $type = uc($type);
3599
    $type = uc($type);
3513
    if ( "$type" !~ /S/ && "$type" !~ /I/ && "$type" !~ /E/ )
3600
    if ( "$type" !~ /S/ && "$type" !~ /I/ && "$type" !~ /E/ )
3514
    {
3601
    {
3515
        LogError("Invalid type field supplied in updatePrototypeFileAddItem2(). Check deploy config.");
3602
        Error("Invalid type field supplied in updatePrototypeFileAddItem2(). Check deploy config.");
3516
    }
3603
    }
3517
 
3604
 
3518
    # now we need to update the prototype file
3605
    # now we need to update the prototype file
3519
    #
3606
    #
3520
    local *FILE;
3607
    local *FILE;
3521
    open ( FILE, ">> $protoTypeFile") or
3608
    open ( FILE, ">> $protoTypeFile") or
3522
        LogError("Failed to open file [$protoTypeFile].");
3609
        Error("Failed to open file [$protoTypeFile].");
3523
  
3610
  
3524
    my($m_Str)="";
3611
    my($m_Str)="";
3525
    if ( "$type" eq "S" )
3612
    if ( "$type" eq "S" )
3526
    {
3613
    {
3527
        $m_Str = "s $class $sTag=$dTag $perms $uid $gid";
3614
        $m_Str = "s $class $sTag=$dTag $perms $uid $gid";
3528
        LogNorm("Updated prototype file with entry [$m_Str]");
3615
        Verbose("Updated prototype file with entry [$m_Str]");
3529
    }
3616
    }
3530
    elsif ( "$type" eq "E" )
3617
    elsif ( "$type" eq "E" )
3531
    {
3618
    {
3532
        $m_Str = "e $class $sTag=$dTag $perms $uid $gid";
3619
        $m_Str = "e $class $sTag=$dTag $perms $uid $gid";
3533
        LogNorm("Updated prototype file with entry [$m_Str]");
3620
        Verbose("Updated prototype file with entry [$m_Str]");
3534
    }
3621
    }
3535
    else
3622
    else
3536
    {
3623
    {
3537
        $m_Str = "i $sTag=$dTag";
3624
        $m_Str = "i $sTag=$dTag";
3538
        LogNorm("Updated prototype file with entry [$m_Str]");
3625
        Verbose("Updated prototype file with entry [$m_Str]");
3539
    }
3626
    }
3540
    printf FILE ("$m_Str\n");
3627
    printf FILE ("$m_Str\n");
3541
    close (FILE);
3628
    close (FILE);
3542
 
3629
 
3543
    return 1;
3630
    return 1;
Line 3556... Line 3643...
3556
    # lets just check to see if we can execute this function on
3643
    # lets just check to see if we can execute this function on
3557
    # this machine.
3644
    # this machine.
3558
    #
3645
    #
3559
    if ( "$MachType" ne "sparc" )
3646
    if ( "$MachType" ne "sparc" )
3560
    {
3647
    {
3561
        LogInfo("addPath2Prototype() not supported on this machine type.");
3648
        Verbose("addPath2Prototype() not supported on this machine type.");
3562
        return 1;
3649
        return 1;
3563
    }
3650
    }
3564
 
3651
 
3565
    # class must be last as it is optional
3652
    # class must be last as it is optional
3566
    my ($path, $perms, $uid, $gid, $class) = @_;
3653
    my ($path, $perms, $uid, $gid, $class) = @_;
Line 3569... Line 3656...
3569
    $perms  = "?"       if ( ($#_+1) < 2 );
3656
    $perms  = "?"       if ( ($#_+1) < 2 );
3570
    $uid    = "?"       if ( ($#_+1) < 3 );
3657
    $uid    = "?"       if ( ($#_+1) < 3 );
3571
    $gid    = "?"       if ( ($#_+1) < 4 );
3658
    $gid    = "?"       if ( ($#_+1) < 4 );
3572
    $class  = "none"    if ( ($#_+1) < 5 );
3659
    $class  = "none"    if ( ($#_+1) < 5 );
3573
 
3660
 
3574
    LogNorm("addPathToPrototype adding path [$path $perms $uid $gid $class]");
3661
    Information("addPathToPrototype adding path [$path $perms $uid $gid $class]");
3575
 
3662
 
3576
    # lets determine which prototype file we are going to
3663
    # lets determine which prototype file we are going to
3577
    # use
3664
    # use
3578
    my ($protoTypeFile);
3665
    my ($protoTypeFile);
3579
    $protoTypeFile = "$ProtoTypeFile";
3666
    $protoTypeFile = "$ProtoTypeFile";
3580
 
3667
 
3581
    # now we need to update the prototype file
3668
    # now we need to update the prototype file
3582
    #
3669
    #
3583
    local *FILE;
3670
    local *FILE;
3584
    open ( FILE, "+<$protoTypeFile") or LogError("Failed to open file [$protoTypeFile].");
3671
    open ( FILE, "+<$protoTypeFile") or Error("Failed to open file [$protoTypeFile].");
3585
 
3672
 
3586
    # set up has of all paths to be added
3673
    # set up has of all paths to be added
3587
    my ( %pathDirs );
3674
    my ( %pathDirs );
3588
    my ( $workPath );
3675
    my ( $workPath );
3589
    my ( $i );
3676
    my ( $i );
Line 3603... Line 3690...
3603
        if ( /^d ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)/ )
3690
        if ( /^d ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)/ )
3604
        {
3691
        {
3605
            # if this dir entry is defined in our paths to add we need to remove the entry
3692
            # if this dir entry is defined in our paths to add we need to remove the entry
3606
            if ( defined($pathDirs{$2}) )
3693
            if ( defined($pathDirs{$2}) )
3607
            {
3694
            {
3608
                LogWarn("addPath2Prototype: Path [$2] already exists in prototype file");
3695
                Warning("addPath2Prototype: Path [$2] already exists in prototype file");
3609
                delete($pathDirs{$2});
3696
                delete($pathDirs{$2});
3610
            }
3697
            }
3611
        }
3698
        }
3612
    }
3699
    }
3613
 
3700
 
3614
    my $protoLine;
3701
    my $protoLine;
3615
    # now we write the remaining dirs in the hash 
3702
    # now we write the remaining dirs in the hash 
3616
    foreach $i ( sort keys(%pathDirs) )
3703
    foreach $i ( sort keys(%pathDirs) )
3617
    {
3704
    {
3618
        $protoLine = sprintf("d %s %s %s %s %s", $class, $i, $perms, $uid, $gid);
3705
        $protoLine = sprintf("d %s %s %s %s %s", $class, $i, $perms, $uid, $gid);
3619
        LogInfo("addPath2Prototype: Adding Dir entry [$protoLine]");
3706
        Verbose("addPath2Prototype: Adding Dir entry [$protoLine]");
3620
        printf FILE "$protoLine\n"; 
3707
        printf FILE "$protoLine\n"; 
3621
    }
3708
    }
3622
 
3709
 
3623
    close FILE;
3710
    close FILE;
3624
    return 1;
3711
    return 1;
Line 3640... Line 3727...
3640
#------------------------------------------------------------------------------
3727
#------------------------------------------------------------------------------
3641
{
3728
{
3642
    # correct number of parameters?
3729
    # correct number of parameters?
3643
    if ( ($#_+1) != 3 )
3730
    if ( ($#_+1) != 3 )
3644
    {
3731
    {
3645
        LogError("Incorrect number of params passed to " .
3732
        Error("Incorrect number of params passed to " .
3646
                  "createAfcRcScriptLink() function. " .
3733
              "createAfcRcScriptLink() function. " ,
3647
                  "Check deploy config.");
3734
              "Check deploy config.");
3648
    }
3735
    }
3649
 
3736
 
3650
 
3737
 
3651
    # lets just check to see if we can execute this function on
3738
    # lets just check to see if we can execute this function on
3652
    # this machine.
3739
    # this machine.
3653
    #
3740
    #
3654
    if ( "$MachType" ne "sparc" )
3741
    if ( "$MachType" ne "sparc" )
3655
    {
3742
    {
3656
        LogInfo("createAfcRcScriptLink() not supported on this machine type.");
3743
        Verbose("createAfcRcScriptLink() not supported on this machine type.");
3657
        return 1;
3744
        return 1;
3658
    }
3745
    }
3659
 
3746
 
3660
    my ($startPrefix, $stopPrefix, $scriptPath) = @_;
3747
    my ($startPrefix, $stopPrefix, $scriptPath) = @_;
3661
 
3748
 
Line 3689... Line 3776...
3689
#------------------------------------------------------------------------------
3776
#------------------------------------------------------------------------------
3690
{
3777
{
3691
    # correct number of parameters?
3778
    # correct number of parameters?
3692
    if ( ($#_+1) != 4 )
3779
    if ( ($#_+1) != 4 )
3693
    {
3780
    {
3694
        LogError("Incorrect number of params passed to " .
3781
        Error("Incorrect number of params passed to " .
3695
                  "createAfcRcScriptLink() function. " .
3782
              "createAfcRcScriptLink() function. " ,
3696
                  "Check deploy config.");
3783
              "Check deploy config.");
3697
    }
3784
    }
3698
 
3785
 
3699
 
3786
 
3700
    # lets just check to see if we can execute this function on
3787
    # lets just check to see if we can execute this function on
3701
    # this machine.
3788
    # this machine.
3702
    #
3789
    #
3703
    if ( "$MachType" ne "sparc" )
3790
    if ( "$MachType" ne "sparc" )
3704
    {
3791
    {
3705
        LogInfo("createAfcRcScriptLink() not supported on this machine type.");
3792
        Verbose("createAfcRcScriptLink() not supported on this machine type.");
3706
        return 1;
3793
        return 1;
3707
    }
3794
    }
3708
 
3795
 
3709
    my ($startPrefix, $stopPrefix, $targetTag, $scriptPath) = @_;
3796
    my ($startPrefix, $stopPrefix, $targetTag, $scriptPath) = @_;
3710
 
3797
 
Line 3756... Line 3843...
3756
        {
3843
        {
3757
            $cmd = "cd $tDir; ln -s $sName $gName";
3844
            $cmd = "cd $tDir; ln -s $sName $gName";
3758
            $retVal = system("$cmd");
3845
            $retVal = system("$cmd");
3759
            if ( $retVal != 0 )
3846
            if ( $retVal != 0 )
3760
            {
3847
            {
3761
                LogError("Failed to create generic link [$gName] to [$tDir/$sName]: $retVal");
3848
                Error("Failed to create generic link [$gName] to [$tDir/$sName]: $retVal");
3762
            }
3849
            }
3763
            else
3850
            else
3764
            {
3851
            {
3765
                LogNorm("Created generic link [$gName] to [$tDir/$sName] ...");
3852
                Verbose("Created generic link [$gName] to [$tDir/$sName] ...");
3766
            }
3853
            }
3767
        }
3854
        }
3768
    }
3855
    }
3769
    else
3856
    else
3770
    {
3857
    {
Line 3794... Line 3881...
3794
 
3881
 
3795
        # we have a match, lets create the copy.
3882
        # we have a match, lets create the copy.
3796
        #
3883
        #
3797
        if(File::Copy::copy("$sLoc", "$tDir/$gName"))
3884
        if(File::Copy::copy("$sLoc", "$tDir/$gName"))
3798
        {
3885
        {
3799
            LogNorm("Created generic lib copy [$tDir/$gName]...");
3886
            Verbose("Created generic lib copy [$tDir/$gName]...");
3800
        }
3887
        }
3801
        else
3888
        else
3802
        {
3889
        {
3803
            LogError("Failed to create generic lib copy [$gName] from [$sLoc]: $!");
3890
            Error("Failed to create generic lib copy [$gName] from [$sLoc]: $!");
3804
        }
3891
        }
3805
    }
3892
    }
3806
 
3893
 
3807
    return 1;
3894
    return 1;
3808
}
3895
}
Line 3942... Line 4029...
3942
#------------------------------------------------------------------------------
4029
#------------------------------------------------------------------------------
3943
{
4030
{
3944
    # correct number of parameters?
4031
    # correct number of parameters?
3945
    if ( ($#_+1) != 1 )
4032
    if ( ($#_+1) != 1 )
3946
    {
4033
    {
3947
        LogError("Incorrect number of params passed to " .
4034
        Error("Incorrect number of params passed to " .
3948
                  "installAllDpkgArchiveBinFiles() function. " .
4035
              "installAllDpkgArchiveBinFiles() function. " ,
3949
                  "Check deploy config.");
4036
              "Check deploy config.");
3950
    }
4037
    }
3951
 
4038
 
3952
    my ($targetTag) = @_;
4039
    my ($targetTag) = @_;
3953
 
4040
 
3954
    # lets check to see if the target tag exists
4041
    # lets check to see if the target tag exists
Line 3962... Line 4049...
3962
    #
4049
    #
3963
    my ($i);
4050
    my ($i);
3964
    my ($m_DpkgBinDir);
4051
    my ($m_DpkgBinDir);
3965
    foreach $i (@{$DpkgBinDirList{'_ALL_'}})
4052
    foreach $i (@{$DpkgBinDirList{'_ALL_'}})
3966
    {
4053
    {
3967
        $m_DpkgBinDir = "$DpkgBinDir" . "/$i";
4054
        $m_DpkgBinDir = "$DpkgBinDir/$i";
3968
        if ( ! -d "$m_DpkgBinDir" )
4055
        if ( ! -d $m_DpkgBinDir )
3969
        {
4056
        {
3970
            LogInfo("Directory [$m_DpkgBinDir] not found.");
4057
            Verbose("Directory [$m_DpkgBinDir] not found.");
3971
            next;
4058
            next;
3972
        }
4059
        }
3973
 
4060
 
3974
        local *DIR;
4061
        local *DIR;
3975
        opendir(DIR, $m_DpkgBinDir) or 
4062
        opendir(DIR, $m_DpkgBinDir) or 
3976
            LogError("can't opendir $m_DpkgBinDir : $!");
4063
            Error("can't opendir $m_DpkgBinDir : $!");
3977
 
4064
 
3978
        my ($file);
4065
        my ($file);
3979
        while (defined($file = readdir(DIR))) 
4066
        while (defined($file = readdir(DIR))) 
3980
        {
4067
        {
3981
            if ( $file !~ /^\.$/  &&     # we do not want the . and .. entries.
4068
            if ( $file !~ /^\.$/  &&     # we do not want the . and .. entries.
Line 3983... Line 4070...
3983
                 $file !~ /\.pdb$/ )
4070
                 $file !~ /\.pdb$/ )
3984
            {
4071
            {
3985
                my ($m_fLoc) = "$m_DpkgBinDir/$file"; 
4072
                my ($m_fLoc) = "$m_DpkgBinDir/$file"; 
3986
                if(File::Copy::copy("$m_fLoc", "$targetValue"))
4073
                if(File::Copy::copy("$m_fLoc", "$targetValue"))
3987
                {
4074
                {
3988
                    LogNorm("Copied [$file] to [$targetValue] ...");
4075
                    Verbose("Copied [$file] to [$targetValue] ...");
3989
                }
4076
                }
3990
                else
4077
                else
3991
                {
4078
                {
3992
                    LogError("Failed to copy bin [$m_fLoc]: $!"); 
4079
                    Error("Failed to copy bin [$m_fLoc]: $!"); 
3993
                }
4080
                }
3994
            }
4081
            }
3995
        }
4082
        }
3996
        closedir(DIR);
4083
        closedir(DIR);
3997
    }
4084
    }
Line 4012... Line 4099...
4012
#------------------------------------------------------------------------------
4099
#------------------------------------------------------------------------------
4013
{
4100
{
4014
    # correct number of parameters?
4101
    # correct number of parameters?
4015
    if ( ($#_+1) != 1  )
4102
    if ( ($#_+1) != 1  )
4016
    {
4103
    {
4017
        LogError("Incorrect number of params passed to rmDirectory() function.");
4104
        Error("Incorrect number of params passed to rmDirectory() function.");
4018
    }
4105
    }
4019
 
4106
 
4020
    my ($startingPoint) = @_;
4107
    my ($startingPoint) = @_;
4021
    
4108
    
4022
    LogInfo("Recursively removing Directory tree [$startingPoint]");
4109
    Verbose("Recursively removing Directory tree [$startingPoint]");
4023
 
4110
 
4024
    foreach my $item ( glob("$startingPoint/*"), glob("$startingPoint/.*") ) 
4111
    foreach my $item ( glob("$startingPoint/*"), glob("$startingPoint/.*") ) 
4025
    {
4112
    {
4026
        if ( $item !~ /^$startingPoint\/\.$/  && $item !~ /^$startingPoint\/\.\.$/ ) 
4113
        if ( $item !~ /^$startingPoint\/\.$/  && $item !~ /^$startingPoint\/\.\.$/ ) 
4027
        {
4114
        {
Line 4030... Line 4117...
4030
                rmDirectory("$item");
4117
                rmDirectory("$item");
4031
            }
4118
            }
4032
            else
4119
            else
4033
            {
4120
            {
4034
                unlink("$item");
4121
                unlink("$item");
4035
                LogDebug("Removed file [$item].");
4122
                Debug("Removed file [$item].");
4036
            }
4123
            }
4037
        }
4124
        }
4038
    }
4125
    }
4039
 
4126
 
4040
    # lets clean the starting point.
4127
    # lets clean the starting point.
Line 4043... Line 4130...
4043
    if ( "$base" ne "." && "$base" ne ".." )
4130
    if ( "$base" ne "." && "$base" ne ".." )
4044
    {
4131
    {
4045
        my $retVal = rmdir("$startingPoint");
4132
        my $retVal = rmdir("$startingPoint");
4046
        if( $retVal )
4133
        if( $retVal )
4047
        {
4134
        {
4048
            LogDebug("Removed dir [$startingPoint].");
4135
            Debug("Removed dir [$startingPoint].");
4049
        }
4136
        }
4050
        else
4137
        else
4051
        {
4138
        {
4052
            LogError("Failed to remove dir [$startingPoint] : $!");
4139
            Error("Failed to remove dir [$startingPoint] : $!");
4053
        }
4140
        }
4054
    }
4141
    }
4055
    return 1;
4142
    return 1;
4056
}
4143
}
4057
 
4144
 
4058
 
-
 
4059
 
-
 
4060
#------------------------------------------------------------------------------
-
 
4061
sub CreateDirectory
-
 
4062
#
-
 
4063
# Description
-
 
4064
#       Create a directory tree based on the path specified.  It creates the tree
-
 
4065
#       rooted at the root path specified.  This path must exist
-
 
4066
#
-
 
4067
#       The first parameter is the root path to root the tree at (optional).
-
 
4068
#       The second parameter is the tree to create.
-
 
4069
#       The third parameter is the umask to create the path with
-
 
4070
#------------------------------------------------------------------------------
-
 
4071
{
-
 
4072
    if ( ($#_+1) != 3  )
-
 
4073
    {
-
 
4074
        LogError("Incorrect number of params passed to CreateDirectory() function.");
-
 
4075
    }
-
 
4076
 
-
 
4077
    my ( $rootPath, $dirPath, $umask ) = @_;
-
 
4078
 
-
 
4079
    # remove trailing slash from rootPath
-
 
4080
    $rootPath =~ s|/$||;
-
 
4081
    # remove leading slash from dirPath
-
 
4082
    $dirPath =~ s|^/||;
-
 
4083
 
-
 
4084
    if ( ! -d $rootPath )
-
 
4085
    {
-
 
4086
        LogError("CreateDirectory: RootPath [$rootPath] does not exist");
-
 
4087
    }
-
 
4088
 
-
 
4089
    LogNorm("CreateDirectory: Creating path [$dirPath] in [$rootPath]");
-
 
4090
      
-
 
4091
    my @dirs = split("/", $dirPath);
-
 
4092
 
-
 
4093
    foreach my $i ( @dirs )
-
 
4094
    {
-
 
4095
        $rootPath .= "/$i";
-
 
4096
        if ( ! -d $rootPath )
-
 
4097
        {
-
 
4098
            LogDebug("CreateDirectory: Creating [$rootPath]");
-
 
4099
            mkdir($rootPath, $umask);
-
 
4100
        }
-
 
4101
    }
-
 
4102
}   # CreateDirectory
-
 
4103
 
-
 
4104
 
-
 
4105
#------------------------------------------------------------------------------
4145
#------------------------------------------------------------------------------
4106
sub CreateTargetDirStructure
4146
sub CreateTargetDirStructure
4107
#
4147
#
4108
# Description:
4148
# Description:
4109
#       This sub-routine create the target stucture based on what the user has
4149
#       This sub-routine create the target stucture based on what the user has
Line 4114... Line 4154...
4114
#       In this function we also check to see if all the LocalSrcDirStructure
4154
#       In this function we also check to see if all the LocalSrcDirStructure
4115
#       directories exist. We warn if they do not.
4155
#       directories exist. We warn if they do not.
4116
#
4156
#
4117
#------------------------------------------------------------------------------
4157
#------------------------------------------------------------------------------
4118
{
4158
{
4119
    LogNorm("Cleaning any previous target file items...");
4159
    Information("Cleaning any previous target file items...");
4120
 
4160
 
4121
    my ($i);
4161
    my ($i);
4122
    my ($m_dirD);
4162
    my ($m_dirD);
4123
 
4163
 
4124
    # lets clean.
4164
    # lets clean.
Line 4155... Line 4195...
4155
        rmDirectory("$m_dirD");
4195
        rmDirectory("$m_dirD");
4156
    }
4196
    }
4157
 
4197
 
4158
    # lets create.
4198
    # lets create.
4159
    #
4199
    #
4160
    LogNorm ("Creating target directory structure...");
4200
    Information ("Creating target directory structure...");
4161
 
-
 
4162
    $m_dirD = "$PkgBaseDir";
-
 
4163
    if ( ! -d "$m_dirD" )
-
 
4164
    {
-
 
4165
        mkpath ( "$m_dirD", 0, 0777);
-
 
4166
        LogInfo("Creating target dir [$m_dirD].");
-
 
4167
    }
-
 
4168
 
-
 
4169
    CreateDirectory($PkgBaseDir, $TargetBaseDir, 0777);
-
 
4170
 
4201
 
-
 
4202
    make_directory( "$PkgBaseDir/$TargetBaseDir", 0777, "Create target dir");
4171
    foreach $i ( sort {$a cmp $b} values %TargetDstDirStructure )
4203
    foreach $i ( sort {$a cmp $b} values %TargetDstDirStructure )
4172
    {
4204
    {
4173
        CreateDirectory("$PkgBaseDir/$TargetBaseDir", $i, 0777);
4205
        make_directory("$PkgBaseDir/$TargetBaseDir/$i", 0777);
4174
    }
4206
    }
4175
 
4207
 
4176
 
4208
 
4177
    # lets determine if we have a InstallShield config dir
4209
    # lets determine if we have a InstallShield config dir
4178
    #
4210
    #
Line 4208... Line 4240...
4208
        #
4240
        #
4209
        if ( -f "$m_ishieldProjFile" )
4241
        if ( -f "$m_ishieldProjFile" )
4210
        {
4242
        {
4211
            if ( ! -d "$m_ishieldDir" )
4243
            if ( ! -d "$m_ishieldDir" )
4212
            {
4244
            {
4213
                LogError ("Local InstallShield config dir [$m_ishieldDir] does not exist. " .
4245
                Error ("Local InstallShield config dir [$m_ishieldDir] does not exist.",
4214
                          "Please create before continuing.");
4246
                       "Please create before continuing.");
4215
            }
4247
            }
4216
            else
4248
            else
4217
            {
4249
            {
4218
                # we populate the ishield config dir with the ishieldlib files
4250
                # we populate the ishield config dir with the ishieldlib files
4219
                #
4251
                #
4220
                my ($i);
4252
                my ($i);
4221
                LogNorm("Installing Standard ishieldlib files from [$PKG_UTIL_DIR] to [$m_ishieldDir]");
4253
                Verbose("Installing Standard ishieldlib files from [$PKG_UTIL_DIR] to [$m_ishieldDir]");
4222
                foreach $i ( @PKG_ISHIELD_FILES )
4254
                foreach $i ( @PKG_ISHIELD_FILES )
4223
                {
4255
                {
4224
                    # first we remove the file (as previously it install read-only).
4256
                    # first we remove the file (as previously it install read-only).
4225
                    unlink("$m_ishieldDir/$i");
4257
                    unlink("$m_ishieldDir/$i");
4226
                    if( File::Copy::copy("$PKG_UTIL_DIR/$i", "$m_ishieldDir") )
4258
                    if( File::Copy::copy("$PKG_UTIL_DIR/$i", "$m_ishieldDir") )
4227
                    {
4259
                    {
4228
                        LogInfo("Copied [$PKG_UTIL_DIR/$i] to [$m_ishieldDir] ...");
4260
                        Verbose("Copied [$PKG_UTIL_DIR/$i] to [$m_ishieldDir] ...");
4229
                    }
4261
                    }
4230
                    else
4262
                    else
4231
                    {
4263
                    {
4232
                        LogError("Failed to copy info file [$PKG_UTIL_DIR/$i] to [$m_ishieldDir] : $!");
4264
                        Error("Failed to copy info file [$PKG_UTIL_DIR/$i] to [$m_ishieldDir] : $!");
4233
                    }
4265
                    }
4234
                }
4266
                }
4235
 
4267
 
4236
 
4268
 
4237
                # we also want to deliver the patch rule files
4269
                # we also want to deliver the patch rule files
4238
                # if this build is a patch build.
4270
                # if this build is a patch build.
4239
                #
4271
                #
4240
                if ( "x$PkgPatchNum" ne "x" )
4272
                if ( "x$PkgPatchNum" ne "x" )
4241
                {
4273
                {
4242
                    LogNorm("Installing Patch ishieldlib files from [$PKG_UTIL_DIR] to [$m_ishieldDir]");
4274
                    Verbose("Installing Patch ishieldlib files from [$PKG_UTIL_DIR] to [$m_ishieldDir]");
4243
                    foreach $i ( @PATCH_ISHIELD_FILES )
4275
                    foreach $i ( @PATCH_ISHIELD_FILES )
4244
                    {
4276
                    {
4245
                        # first we remove the file (as previously it install read-only).
4277
                        # first we remove the file (as previously it install read-only).
4246
                        unlink("$m_ishieldDir/$i");
4278
                        unlink("$m_ishieldDir/$i");
4247
                        if( File::Copy::copy("$PKG_UTIL_DIR/$i", "$m_ishieldDir") )
4279
                        if( File::Copy::copy("$PKG_UTIL_DIR/$i", "$m_ishieldDir") )
4248
                        {
4280
                        {
4249
                            LogInfo("Copied [$PKG_UTIL_DIR/$i] to [$m_ishieldDir] ...");
4281
                            Verbose("Copied [$PKG_UTIL_DIR/$i] to [$m_ishieldDir] ...");
4250
                        }
4282
                        }
4251
                        else
4283
                        else
4252
                        {
4284
                        {
4253
                            LogError("Failed to copy info file [$PKG_UTIL_DIR/$i] to [$m_ishieldDir] : $!");
4285
                            Error("Failed to copy info file [$PKG_UTIL_DIR/$i] to [$m_ishieldDir] : $!");
4254
                        }
4286
                        }
4255
                    }
4287
                    }
4256
                }
4288
                }
4257
 
4289
 
4258
 
4290
 
Line 4262... Line 4294...
4262
                #
4294
                #
4263
                # we assume our source dir is the interface/etc dir and our
4295
                # we assume our source dir is the interface/etc dir and our
4264
                # dst dir is the PkgBaseDir
4296
                # dst dir is the PkgBaseDir
4265
                #
4297
                #
4266
                my ($m_islibImgFile) = "";
4298
                my ($m_islibImgFile) = "";
4267
                LogNorm("Installing ishield image files from [$DpkgEtcDir] to [$m_ishieldDir]");
4299
                Verbose("Installing ishield image files from [$DpkgEtcDir] to [$m_ishieldDir]");
4268
                foreach $i ( @PKG_ISHIELD_IMG_FILES )
4300
                foreach $i ( @PKG_ISHIELD_IMG_FILES )
4269
                {
4301
                {
4270
                    $m_islibImgFile = "$DpkgEtcDir/$ProjectAcronym" . "_" . $i;
4302
                    $m_islibImgFile = "$DpkgEtcDir/$ProjectAcronym" . "_" . $i;
4271
                    if ( -f "$m_islibImgFile" )
4303
                    if ( -f "$m_islibImgFile" )
4272
                    {
4304
                    {
4273
                        if( File::Copy::copy("$m_islibImgFile", "$PkgBaseDir") )
4305
                        if( File::Copy::copy("$m_islibImgFile", "$PkgBaseDir") )
4274
                        {
4306
                        {
4275
                            LogInfo("Copied [$m_islibImgFile] to [$PkgBaseDir] ...");
4307
                            Verbose("Copied [$m_islibImgFile] to [$PkgBaseDir] ...");
4276
                        }
4308
                        }
4277
                        else
4309
                        else
4278
                        {
4310
                        {
4279
                            LogError("Failed to copy info file [$m_islibImgFile] to " .
4311
                            Error("Failed to copy info file [$m_islibImgFile] to " .
4280
                                     "[$PkgBaseDir] : $!");
4312
                                     "[$PkgBaseDir] : $!");
4281
                        }
4313
                        }
4282
                    }
4314
                    }
4283
                    else
4315
                    else
4284
                    {
4316
                    {
Line 4288... Line 4320...
4288
                        $m_islibImgFile = "$DpkgEtcDir/mas" . "_" . $i;
4320
                        $m_islibImgFile = "$DpkgEtcDir/mas" . "_" . $i;
4289
                        if ( -f "$m_islibImgFile" )
4321
                        if ( -f "$m_islibImgFile" )
4290
                        {
4322
                        {
4291
                            if( File::Copy::copy("$m_islibImgFile", "$PkgBaseDir") )
4323
                            if( File::Copy::copy("$m_islibImgFile", "$PkgBaseDir") )
4292
                            {
4324
                            {
4293
                                LogInfo("Copied [$m_islibImgFile] to [$PkgBaseDir] ...");
4325
                                Verbose("Copied [$m_islibImgFile] to [$PkgBaseDir] ...");
4294
                            }
4326
                            }
4295
                            else
4327
                            else
4296
                            {
4328
                            {
4297
                                LogError("Failed to copy info file [$m_islibImgFile] to " .
4329
                                Error("Failed to copy info file [$m_islibImgFile] to " .
4298
                                         "[$PkgBaseDir] : $!");
4330
                                         "[$PkgBaseDir] : $!");
4299
                            } 
4331
                            } 
4300
                        } 
4332
                        } 
4301
                        else
4333
                        else
4302
                        {
4334
                        {
4303
                            LogWarn("Failed to locate ishieldlib image [xxx_$i], no image copied, " .
4335
                            Warning("Failed to locate ishieldlib image [xxx_$i], no image copied, " .
4304
                                    "check depolylib config.");
4336
                                    "check depolylib config.");
4305
                        }
4337
                        }
4306
                    }
4338
                    }
4307
                }
4339
                }
4308
 
4340
 
4309
            }
4341
            }
4310
        }
4342
        }
4311
        else
4343
        else
4312
        {
4344
        {
4313
            LogWarn("Did not detect InstallShield project file [$m_ishieldProjFile]");
4345
            Warning("Did not detect InstallShield project file [$m_ishieldProjFile]");
4314
            LogWarn("Not installing InstallShield library files.");
4346
            Warning("Not installing InstallShield library files.");
4315
        }
4347
        }
4316
    }
4348
    }
4317
 
4349
 
4318
    # done.
4350
    # done.
4319
    return 1;
4351
    return 1;
Line 4340... Line 4372...
4340
 
4372
 
4341
    # lets open the file.
4373
    # lets open the file.
4342
    #
4374
    #
4343
    local *FILE;
4375
    local *FILE;
4344
    open ( FILE, "> $outFile") or
4376
    open ( FILE, "> $outFile") or
4345
        LogError("Failed to open file [$outFile].");
4377
        Error("Failed to open file [$outFile].");
4346
 
4378
 
4347
    # lets populate the pkgdef file.
4379
    # lets populate the pkgdef file.
4348
 
4380
 
4349
    printf FILE ("// This is an automatically generated include file.\n");
4381
    printf FILE ("// This is an automatically generated include file.\n");
4350
    printf FILE ("// Please do not modify, and please do not check into ClearCase.\n");
4382
    printf FILE ("// Please do not modify, and please do not check into ClearCase.\n");
Line 4395... Line 4427...
4395
    foreach $i ( values %LocalSrcDirStructure )
4427
    foreach $i ( values %LocalSrcDirStructure )
4396
    {
4428
    {
4397
        my ($m_Dir) = "$SrcDir/$i";
4429
        my ($m_Dir) = "$SrcDir/$i";
4398
        if ( ! -d "$m_Dir" )
4430
        if ( ! -d "$m_Dir" )
4399
        {
4431
        {
4400
            LogWarn ("Local src dir [$m_Dir] does not exist.");
4432
            Warning ("Local src dir [$m_Dir] does not exist.");
4401
        }
4433
        }
4402
    }
4434
    }
4403
 
4435
 
4404
    return 1;
4436
    return 1;
4405
}
4437
}
Line 4419... Line 4451...
4419
#------------------------------------------------------------------------------
4451
#------------------------------------------------------------------------------
4420
{
4452
{
4421
    # correct number of parameters?
4453
    # correct number of parameters?
4422
    if ( ($#_+1) != 2 ) 
4454
    if ( ($#_+1) != 2 ) 
4423
    {
4455
    {
4424
        LogError("Incorrect number of params passed to " .
4456
        Error("Incorrect number of params passed to " .
4425
                  "getLocalDirValue() function.");
4457
                  "getLocalDirValue() function.");
4426
    }
4458
    }
4427
 
4459
 
4428
    my ($m_key, $m_type) = @_;
4460
    my ($m_key, $m_type) = @_;
4429
    if (exists  $LocalSrcDirStructure{$m_key} )    
4461
    if (exists  $LocalSrcDirStructure{$m_key} )    
Line 4438... Line 4470...
4438
            return "$LocalSrcDirStructure{$m_key}";
4470
            return "$LocalSrcDirStructure{$m_key}";
4439
        }
4471
        }
4440
    }
4472
    }
4441
    else
4473
    else
4442
    {
4474
    {
4443
        LogError("Local src tag [$m_key] does not exist in " .
4475
        Error("Local src tag [$m_key] does not exist in " .
4444
                 "LocalSrcDirStructure. " .
4476
             "LocalSrcDirStructure. " ,
4445
                 "Check deploy configuration.");
4477
             "Check deploy configuration.");
4446
    }
4478
    }
4447
 
4479
 
4448
    return 1;
4480
    return 1;
4449
}
4481
}
4450
 
4482
 
Line 4467... Line 4499...
4467
#------------------------------------------------------------------------------
4499
#------------------------------------------------------------------------------
4468
{
4500
{
4469
    # correct number of parameters?
4501
    # correct number of parameters?
4470
    if ( ($#_+1) != 2 ) 
4502
    if ( ($#_+1) != 2 ) 
4471
    {
4503
    {
4472
        LogError("Incorrect number of params passed to " .
4504
        Error("Incorrect number of params passed to " .
4473
                  "getTargetDstDirValue() function.");
4505
                  "getTargetDstDirValue() function.");
4474
    }
4506
    }
4475
 
4507
 
4476
    my ($m_key, $m_type) = @_;
4508
    my ($m_key, $m_type) = @_;
4477
    my $tdir;
4509
    my $tdir;
Line 4483... Line 4515...
4483
    {
4515
    {
4484
        $tdir = $TargetBaseDir . '/' . $TargetDstDirStructure{$m_key};
4516
        $tdir = $TargetBaseDir . '/' . $TargetDstDirStructure{$m_key};
4485
    }
4517
    }
4486
    else
4518
    else
4487
    {
4519
    {
4488
        LogError("Target destination dir tag [$m_key] does not exist in " .
4520
        Error("Target destination dir tag [$m_key] does not exist in " .
4489
                 "TargetDstDirStructure. " .
4521
             "TargetDstDirStructure. " ,
4490
                 "Check deploy configuration.");
4522
             "Check deploy configuration.");
4491
    }
4523
    }
4492
 
4524
 
4493
 
4525
 
4494
    #
4526
    #
4495
    #   If an absolute path is required than add the PkgBaseDir
4527
    #   If an absolute path is required than add the PkgBaseDir
Line 4497... Line 4529...
4497
    #
4529
    #
4498
    if ( "$m_type" eq "A" ) {
4530
    if ( "$m_type" eq "A" ) {
4499
        $tdir = "$PkgBaseDir/$tdir";
4531
        $tdir = "$PkgBaseDir/$tdir";
4500
    } elsif ( "$m_type" eq "R" )  {
4532
    } elsif ( "$m_type" eq "R" )  {
4501
    } else {
4533
    } else {
4502
        LogError("getTargetDstDirValue: Bad call. Unknown type: $m_type");
4534
        Error("getTargetDstDirValue: Bad call. Unknown type: $m_type");
4503
    }
4535
    }
4504
 
4536
 
4505
    return $tdir;
4537
    return $tdir;
4506
}
4538
}
4507
 
4539
 
Line 4515... Line 4547...
4515
#------------------------------------------------------------------------------
4547
#------------------------------------------------------------------------------
4516
{
4548
{
4517
    # correct number of parameters?
4549
    # correct number of parameters?
4518
    if ( ($#_+1) != 0 )
4550
    if ( ($#_+1) != 0 )
4519
    {
4551
    {
4520
        LogError("Incorrect number of params passed to " .
4552
        Error("Incorrect number of params passed to " .
4521
                  "createPatch() function. Check deploy config.");
4553
              "createPatch() function.",
-
 
4554
              "Check deploy config.");
4522
    }
4555
    }
4523
 
4556
 
4524
    # lets just check to see if we can execute this function on
4557
    # lets just check to see if we can execute this function on
4525
    # this machine.
4558
    # this machine.
4526
    #
4559
    #
4527
    if ( "$MachType" ne "sparc" )
4560
    if ( "$MachType" ne "sparc" )
4528
    {
4561
    {
4529
        LogInfo("createPatch() not supported on this machine type.");
4562
        Verbose("createPatch() not supported on this machine type.");
4530
        return 1;
4563
        return 1;
4531
    }
4564
    }
4532
 
4565
 
4533
    # lets just check to see if we can execute this function on
4566
    # lets just check to see if we can execute this function on
4534
    # for  this build.
4567
    # for  this build.
4535
    #
4568
    #
4536
    if ( "x$PkgPatchNum" eq "x" )
4569
    if ( "x$PkgPatchNum" eq "x" )
4537
    {
4570
    {
4538
        LogWarn("createPatch() can only be called during a PATCH build.");
4571
        Warning("createPatch() can only be called during a PATCH build.");
4539
        return 1;
4572
        return 1;
4540
    }
4573
    }
4541
 
4574
 
4542
    # we need to create the patch directory that contains
4575
    # we need to create the patch directory that contains
4543
    #
4576
    #
4544
    LogNorm("Creating patch ...");
4577
    Information("Creating patch ...");
4545
 
4578
 
4546
    my ( $m_pkgmkCmd );
4579
    my ( $m_pkgmkCmd );
4547
    my ( $m_pkgtransCmd );
4580
    my ( $m_pkgtransCmd );
4548
    $m_pkgmkCmd = "pkgmk -o " .
4581
    $m_pkgmkCmd = "pkgmk -o " .
4549
                  "-f $PkgBaseDir/prototype " .
4582
                  "-f $PkgBaseDir/prototype " .
Line 4552... Line 4585...
4552
    # lets execute the package commands.
4585
    # lets execute the package commands.
4553
    my ($retVal);
4586
    my ($retVal);
4554
    $retVal = system("$m_pkgmkCmd");
4587
    $retVal = system("$m_pkgmkCmd");
4555
    if ( $retVal != 0 )
4588
    if ( $retVal != 0 )
4556
    {
4589
    {
4557
        LogError("Failed to complete command [$m_pkgmkCmd].");
4590
        Error("Failed to complete command [$m_pkgmkCmd].");
4558
    }
4591
    }
4559
 
4592
 
4560
    # we need to generate a README file to help during installation
4593
    # we need to generate a README file to help during installation
4561
    #
4594
    #
4562
    generatePatchREADME();
4595
    generatePatchREADME();
4563
 
4596
 
4564
 
4597
 
4565
    my ($m_Cmd)    = ""; 
4598
    my ($m_Cmd)    = ""; 
4566
    my ($m_tmpDir) = "$PkgPatchTmpDir/$PkgPatchID";
4599
    my ($m_tmpDir) = "$PkgPatchTmpDir/$PkgPatchID";
4567
 
4600
 
4568
    LogNorm("Creating staging area of patch...");
4601
    Information("Creating staging area of patch...");
4569
    $m_Cmd = "cd $PkgBaseDir && mkdir -p $m_tmpDir;";
4602
    $m_Cmd = "cd $PkgBaseDir && mkdir -p $m_tmpDir;";
4570
    system($m_Cmd);
4603
    system($m_Cmd);
4571
 
4604
 
4572
    LogNorm("Copying patch contents to staging area of patch...");
4605
    Information("Copying patch contents to staging area of patch...");
4573
    $m_Cmd = "cd $PkgBaseDir && cp -r $PkgName $m_tmpDir;";
4606
    $m_Cmd = "cd $PkgBaseDir && cp -r $PkgName $m_tmpDir;";
4574
    system($m_Cmd);
4607
    system($m_Cmd);
4575
 
4608
 
4576
    # we need to copy the patch install utility files from
4609
    # we need to copy the patch install utility files from
4577
    # their resting place.
4610
    # their resting place.
Line 4579... Line 4612...
4579
    my ($i);
4612
    my ($i);
4580
    foreach $i ( @PATCH_UTIL_FILES )
4613
    foreach $i ( @PATCH_UTIL_FILES )
4581
    {
4614
    {
4582
        if( File::Copy::copy("$PATCH_UTIL_DIR/$i", "$PkgPatchTmpDir") )
4615
        if( File::Copy::copy("$PATCH_UTIL_DIR/$i", "$PkgPatchTmpDir") )
4583
        {
4616
        {
4584
            LogNorm("Copied [$PATCH_UTIL_DIR/$i] to [$PkgPatchTmpDir] ...");
4617
            Verbose("Copied [$PATCH_UTIL_DIR/$i] to [$PkgPatchTmpDir] ...");
4585
            system("chmod 0755 $PkgPatchTmpDir/$i");
4618
            system("chmod 0755 $PkgPatchTmpDir/$i");
4586
        }
4619
        }
4587
        else
4620
        else
4588
        {
4621
        {
4589
            LogError("Failed to copy info file [$PATCH_UTIL_DIR/$i] to [$PkgPatchTmpDir] : $!");
4622
            Error("Failed to copy info file [$PATCH_UTIL_DIR/$i] to [$PkgPatchTmpDir] : $!");
4590
        }
4623
        }
4591
    }
4624
    }
4592
 
4625
 
4593
    # Lets put the readme in place
4626
    # Lets put the readme in place
4594
    #
4627
    #
4595
    if( File::Copy::copy("$PkgPatchReadme", "$PkgPatchTmpDir") )
4628
    if( File::Copy::copy("$PkgPatchReadme", "$PkgPatchTmpDir") )
4596
    {
4629
    {
4597
        LogNorm("Copied [$PkgPatchReadme] to [$PkgPatchTmpDir] ...");
4630
        Verbose("Copied [$PkgPatchReadme] to [$PkgPatchTmpDir] ...");
4598
    }
4631
    }
4599
    else
4632
    else
4600
    {
4633
    {
4601
        LogError("Failed to copy info file [$PkgPatchReadme] to [$PkgPatchTmpDir] : $!");
4634
        Error("Failed to copy info file [$PkgPatchReadme] to [$PkgPatchTmpDir] : $!");
4602
    }
4635
    }
4603
 
4636
 
4604
    LogNorm("Copying patch contents to staging area of patch...");
4637
    Information("Copying patch contents to staging area of patch...");
4605
    $m_Cmd = "cd $PkgBaseDir && cp -r $PkgName $m_tmpDir;";
4638
    $m_Cmd = "cd $PkgBaseDir && cp -r $PkgName $m_tmpDir;";
4606
    system($m_Cmd);
4639
    system($m_Cmd);
4607
 
4640
 
4608
    my ($m_oFile) = "$PkgPatchID-$ProjectAcronym\.tgz";
4641
    my ($m_oFile) = "$PkgPatchID-$ProjectAcronym\.tgz";
4609
    LogNorm("Creating a gzip'd compressed tar (.tgz) output file [$m_oFile]...");
4642
    Information("Creating a gzip'd compressed tar (.tgz) output file [$m_oFile]...");
4610
    my ($base) = File::Basename::basename($PkgPatchTmpDir);
4643
    my ($base) = File::Basename::basename($PkgPatchTmpDir);
4611
    $m_Cmd = "cd $PkgBaseDir && tar cvf - $base | gzip > $m_oFile";
4644
    $m_Cmd = "cd $PkgBaseDir && tar cvf - $base | gzip > $m_oFile";
4612
    system($m_Cmd);
4645
    system($m_Cmd);
4613
 
4646
 
4614
    return 1;
4647
    return 1;
Line 4624... Line 4657...
4624
#
4657
#
4625
#------------------------------------------------------------------------------
4658
#------------------------------------------------------------------------------
4626
{
4659
{
4627
    local *FILE;
4660
    local *FILE;
4628
    open ( FILE, "> $PkgPatchReadme") or
4661
    open ( FILE, "> $PkgPatchReadme") or
4629
        LogError("Failed to open file [$PkgPatchReadme].");
4662
        Error("Failed to open file [$PkgPatchReadme].");
4630
 
4663
 
4631
    printf FILE ("This is a patch for $PkgName $PkgVersion\n");
4664
    printf FILE ("This is a patch for $PkgName $PkgVersion\n");
4632
    printf FILE ("---------------------------------------------------------------\n");
4665
    printf FILE ("---------------------------------------------------------------\n");
4633
    printf FILE ("\n");
4666
    printf FILE ("\n");
4634
    printf FILE ("Installing patch (as the 'root' user) :\n");
4667
    printf FILE ("Installing patch (as the 'root' user) :\n");
Line 4669... Line 4702...
4669
 
4702
 
4670
    my ($m_sfile) = $file;
4703
    my ($m_sfile) = $file;
4671
    $file =~ s/$PkgBaseDir//;
4704
    $file =~ s/$PkgBaseDir//;
4672
 
4705
 
4673
    open ( FILE, ">> $PkgPatchReadme") or
4706
    open ( FILE, ">> $PkgPatchReadme") or
4674
         LogError("Failed to open file [$deplylib::PkgPatchReadme].");
4707
         Error("Failed to open file [$deplylib::PkgPatchReadme].");
4675
 
4708
 
4676
    # lets populate the prototype file.
4709
    # lets populate the prototype file.
4677
    printf FILE ("* $file\n");
4710
    printf FILE ("* $file\n");
4678
 
4711
 
4679
    close (FILE);
4712
    close (FILE);
Line 4688... Line 4721...
4688
#       The type of package is machine specific. The subroutine will invoke a
4721
#       The type of package is machine specific. The subroutine will invoke a
4689
#       machine specfic function to do the real work.
4722
#       machine specfic function to do the real work.
4690
#
4723
#
4691
#------------------------------------------------------------------------------
4724
#------------------------------------------------------------------------------
4692
{
4725
{
4693
    LogInfo("createPackage");
4726
    Information("createPackage");
4694
    # correct number of parameters?
4727
    # correct number of parameters?
4695
    if ( ($#_+1) != 0 )
4728
    if ( ($#_+1) != 0 )
4696
    {
4729
    {
4697
        LogError("Incorrect number of params passed to " .
4730
        Error("Incorrect number of params passed to " .
4698
                  "createPackage() function. Check deploy config.");
4731
              "createPackage() function. ",
-
 
4732
              "Check deploy config.");
4699
    }
4733
    }
4700
 
4734
 
4701
    # lets just check to see if we can execute this function on
4735
    # lets just check to see if we can execute this function on
4702
    # this machine.
4736
    # this machine.
4703
    #
4737
    #
Line 4707... Line 4741...
4707
        # lets just check to see if we can execute this function on
4741
        # lets just check to see if we can execute this function on
4708
        # for  this build.
4742
        # for  this build.
4709
        #
4743
        #
4710
        if ( $PkgPatchNum )
4744
        if ( $PkgPatchNum )
4711
        {
4745
        {
4712
            LogWarn("createPackage() can only be called during a RELEASE build.");
4746
            Warning("createPackage() can only be called during a RELEASE build.");
4713
            return 1;
4747
            return 1;
4714
        }
4748
        }
4715
 
4749
 
4716
        #
4750
        #
4717
        #   Ensure the Release directory is present
4751
        #   Ensure the Release directory is present
4718
        #
4752
        #
4719
        if ( ! -d $ReleaseDir )
4753
        make_directory( $ReleaseDir, 0777 );
4720
        {
-
 
4721
 
4754
 
4722
            mkpath ( $ReleaseDir, 0, 0777);
-
 
4723
            LogInfo("created [$ReleaseDir] dir...");
-
 
4724
        }
-
 
4725
    
-
 
4726
        # Ensure that the package descriptor is transferred
4755
        # Ensure that the package descriptor is transferred
4727
        #
4756
        #
4728
        my ($m_copydesc) = "cp $SrcDir/descpkg $ReleaseDir";
4757
        my ($m_copydesc) = "cp $SrcDir/descpkg $ReleaseDir";
4729
        system($m_copydesc);
4758
        system($m_copydesc);
4730
 
4759
 
4731
        # Invoke the machine specific package builder by name
4760
        # Invoke the machine specific package builder by name
4732
        # Need to relax strictness. Yes we do know what we are doing here
4761
        # Need to relax strictness. Yes we do know what we are doing here
4733
        #
4762
        #
4734
        no strict "refs";
4763
        no strict "refs";
4735
        &$createRoutine( @_ ) || LogError("Unspecified error building package");
4764
        &$createRoutine( @_ ) || Error("Unspecified error building package");
4736
        use strict "refs";
4765
        use strict "refs";
4737
    }
4766
    }
4738
    else
4767
    else
4739
    {
4768
    {
4740
        LogInfo("createPackage() not supported on this machine type: $MachType.");
4769
        Verbose("createPackage() not supported on this machine type: $MachType.");
4741
    }
4770
    }
4742
    return 1;
4771
    return 1;
4743
}
4772
}
4744
 
4773
 
4745
 
4774
 
Line 4751... Line 4780...
4751
#       The type of package is machine specific. The subroutine will invoke a
4780
#       The type of package is machine specific. The subroutine will invoke a
4752
#       machine specfic function to do the real work.
4781
#       machine specfic function to do the real work.
4753
#
4782
#
4754
#------------------------------------------------------------------------------
4783
#------------------------------------------------------------------------------
4755
{
4784
{
4756
    LogInfo("createPackage_sparc");
4785
    Verbose("createPackage_sparc");
4757
 
4786
 
4758
    # we need to copy the package utility files from
4787
    # we need to copy the package utility files from
4759
    # their resting place.
4788
    # their resting place.
4760
    #
4789
    #
4761
    foreach my $i ( @PKG_UTIL_FILES )
4790
    foreach my $i ( @PKG_UTIL_FILES )
4762
    {
4791
    {
4763
        if( File::Copy::copy("$PKG_UTIL_DIR/$i", "$PkgBaseDir") )
4792
        if( File::Copy::copy("$PKG_UTIL_DIR/$i", "$PkgBaseDir") )
4764
        {
4793
        {
4765
            LogNorm("Copied [$PKG_UTIL_DIR/$i] to [$PkgBaseDir] ...");
4794
            Verbose("Copied [$PKG_UTIL_DIR/$i] to [$PkgBaseDir] ...");
4766
            updatePrototypeFileAddItem2("$i", "$i", "", "", "", "I");
4795
            updatePrototypeFileAddItem2("$i", "$i", "", "", "", "I");
4767
            system("chmod 0755 $PkgBaseDir/$i");
4796
            system("chmod 0755 $PkgBaseDir/$i");
4768
        }
4797
        }
4769
        else
4798
        else
4770
        {
4799
        {
4771
            LogError("Failed to copy info file [$PKG_UTIL_DIR/$i] to [$PkgBaseDir] : $!");
4800
            Error("Failed to copy info file [$PKG_UTIL_DIR/$i] to [$PkgBaseDir] : $!");
4772
        }
4801
        }
4773
    }
4802
    }
4774
 
4803
 
4775
 
4804
 
4776
    my ( $m_pkgmkCmd );
4805
    my ( $m_pkgmkCmd );
Line 4788... Line 4817...
4788
    # lets execute the package commands.
4817
    # lets execute the package commands.
4789
    my ($retVal);
4818
    my ($retVal);
4790
    $retVal = system("$m_pkgmkCmd");
4819
    $retVal = system("$m_pkgmkCmd");
4791
    if ( $retVal != 0 )
4820
    if ( $retVal != 0 )
4792
    {
4821
    {
4793
        LogError("Failed to complete command [$m_pkgmkCmd].");
4822
        Error("Failed to complete command [$m_pkgmkCmd].");
4794
    }
4823
    }
4795
 
4824
 
4796
    $retVal = system("$m_pkgtransCmd");
4825
    $retVal = system("$m_pkgtransCmd");
4797
    system("$m_pkgtransCmd");
4826
    system("$m_pkgtransCmd");
4798
    if ( $retVal != 0 )
4827
    if ( $retVal != 0 )
4799
    {
4828
    {
4800
        LogError("Failed to complete command [$m_pkgtransCmd].");
4829
        Error("Failed to complete command [$m_pkgtransCmd].");
4801
    }
4830
    }
4802
 
4831
 
4803
    # lets compress the output to save some space.
4832
    # lets compress the output to save some space.
4804
    #
4833
    #
4805
    LogNorm("Compressing $PkgOutputFile");
4834
    Information("Compressing $PkgOutputFile");
4806
    my ($m_compressCmd) = "cd $PkgBaseDir; gzip $PkgOutputFile; mv ${PkgOutputFile}.gz $ReleaseDir";
4835
    my ($m_compressCmd) = "cd $PkgBaseDir; gzip $PkgOutputFile; mv ${PkgOutputFile}.gz $ReleaseDir";
4807
    system($m_compressCmd);
4836
    system($m_compressCmd);
4808
 
4837
 
4809
    return 1;
4838
    return 1;
4810
}
4839
}
Line 4819... Line 4848...
4819
#
4848
#
4820
#       Do have the option of creating a WinCE specific packager
4849
#       Do have the option of creating a WinCE specific packager
4821
#
4850
#
4822
#------------------------------------------------------------------------------
4851
#------------------------------------------------------------------------------
4823
{
4852
{
4824
    LogInfo("createPackage_WinCE");
4853
    Verbose("createPackage_WinCE");
4825
    createPackage_win32(@_);
4854
    createPackage_win32(@_);
4826
}
4855
}
4827
 
4856
 
4828
#------------------------------------------------------------------------------
4857
#------------------------------------------------------------------------------
4829
sub createPackage_win32
4858
sub createPackage_win32
Line 4832... Line 4861...
4832
#       This sub-routine is used to create a package.
4861
#       This sub-routine is used to create a package.
4833
#       Invoke the isbuild.pl utility to build the install shield project
4862
#       Invoke the isbuild.pl utility to build the install shield project
4834
#
4863
#
4835
#------------------------------------------------------------------------------
4864
#------------------------------------------------------------------------------
4836
{
4865
{
4837
    LogInfo("createPackage_win32");
4866
    Verbose("createPackage_win32");
4838
    #
4867
    #
4839
    #   Locate MergeModules in external packages
4868
    #   Locate MergeModules in external packages
4840
    #   These will be used by the InstallShield compiler
4869
    #   These will be used by the InstallShield compiler
4841
    #
4870
    #
4842
    my @mm_dirs;
4871
    my @mm_dirs;
Line 4848... Line 4877...
4848
    #   This must be a flat directory structure. ie: all files in the
4877
    #   This must be a flat directory structure. ie: all files in the
4849
    #   subdirectory called MergeModule.
4878
    #   subdirectory called MergeModule.
4850
    #
4879
    #
4851
    $tdir = "$RootDir/MergeModules";
4880
    $tdir = "$RootDir/MergeModules";
4852
    push @mm_dirs, $tdir if ( -d $tdir );
4881
    push @mm_dirs, $tdir if ( -d $tdir );
4853
    LogInfo ("Discovered MergeModules in: $tdir") if ( -d $tdir );
4882
    Verbose ("Discovered MergeModules in: $tdir") if ( -d $tdir );
4854
 
4883
 
4855
    #
4884
    #
4856
    #   Check for Merge Modules in the Interface directory
4885
    #   Check for Merge Modules in the Interface directory
4857
    #   This will be pulled in via a BuildPkgArchive
4886
    #   This will be pulled in via a BuildPkgArchive
4858
    #
4887
    #
4859
    $tdir = "$InterfaceDir/MergeModules";
4888
    $tdir = "$InterfaceDir/MergeModules";
4860
    push @mm_tld, $tdir if ( -d $tdir );
4889
    push @mm_tld, $tdir if ( -d $tdir );
4861
    LogInfo ("Discovered MergeModules in: $tdir") if ( -d $tdir );
4890
    Verbose ("Discovered MergeModules in: $tdir") if ( -d $tdir );
4862
 
4891
 
4863
    #
4892
    #
4864
    #   Check in LinkPkgArchive locations too
4893
    #   Check in LinkPkgArchive locations too
4865
    for my $entry ( $BuildFileInfo->getBuildPkgRules() )
4894
    for my $entry ( $BuildFileInfo->getBuildPkgRules() )
4866
    {
4895
    {
4867
        next unless ( $entry->{'TYPE'} eq 'link' );
4896
        next unless ( $entry->{'TYPE'} eq 'link' );
4868
        $tdir = $entry->{'ROOT'} . '/MergeModules';
4897
        $tdir = $entry->{'ROOT'} . '/MergeModules';
4869
        push @mm_tld, $tdir if ( -d $tdir );
4898
        push @mm_tld, $tdir if ( -d $tdir );
4870
        LogInfo ("Discovered MergeModules in: $tdir") if ( -d $tdir );
4899
        Verbose ("Discovered MergeModules in: $tdir") if ( -d $tdir );
4871
    }
4900
    }
4872
 
4901
 
4873
    #
4902
    #
4874
    #   Expand the merge module subdirectory tree into
4903
    #   Expand the merge module subdirectory tree into
4875
    #   suitable paths:
4904
    #   suitable paths:
Line 4911... Line 4940...
4911
        next unless ( -f $prog );
4940
        next unless ( -f $prog );
4912
        $prog_found = 1;
4941
        $prog_found = 1;
4913
        last;
4942
        last;
4914
    }
4943
    }
4915
 
4944
 
4916
    LogError("isbuild.pl not found") unless $prog_found;
4945
    Error("isbuild.pl not found") unless $prog_found;
4917
    LogNorm("isbuild: $prog");
4946
    Verbose("isbuild: $prog");
4918
    my $rv = system ( $ENV{GBE_PERL}, $prog,
4947
    my $rv = system ( $ENV{GBE_PERL}, $prog,
4919
                            "-project=../$PkgName.ism",
4948
                            "-project=../$PkgName.ism",
4920
                            "-version=$PkgVersionUser",
4949
                            "-version=$PkgVersionUser",
4921
                            "-out=$ReleaseDir",
4950
                            "-out=$ReleaseDir",
4922
                            "-workdir=$InterfaceDir",
4951
                            "-workdir=$InterfaceDir",
4923
                            map { "-mergemodule=$_" } @mm_dirs
4952
                            map { "-mergemodule=$_" } @mm_dirs
4924
                             );
4953
                             );
4925
    LogError ("InstallShield Builder Error" ) if ( $rv );
4954
    Error ("InstallShield Builder Error" ) if ( $rv );
4926
    return 1;
4955
    return 1;
4927
}
4956
}
4928
 
4957
 
4929
#------------------------------------------------------------------------------
4958
#------------------------------------------------------------------------------
4930
sub createPrototypeFile
4959
sub createPrototypeFile
Line 4936... Line 4965...
4936
#------------------------------------------------------------------------------
4965
#------------------------------------------------------------------------------
4937
{
4966
{
4938
    # correct number of parameters?
4967
    # correct number of parameters?
4939
    if ( ($#_+1) != 2 )
4968
    if ( ($#_+1) != 2 )
4940
    {
4969
    {
4941
        LogError("Incorrect number of params passed to " .
4970
        Error("Incorrect number of params passed to " .
4942
                  "createPrototypeFile() function. Check deploy config.");
4971
              "createPrototypeFile() function",
-
 
4972
              "Check deploy config.");
4943
    }
4973
    }
4944
 
4974
 
4945
    # lets just check to see if we can execute this function on
4975
    # lets just check to see if we can execute this function on
4946
    # this machine.
4976
    # this machine.
4947
    #
4977
    #
4948
    if ( "$MachType" ne "sparc" )
4978
    if ( "$MachType" ne "sparc" )
4949
    {
4979
    {
4950
        LogInfo("createPrototypeFile() not supported on this machine type.");
4980
        Verbose("createPrototypeFile() not supported on this machine type.");
4951
        return 1;
4981
        return 1;
4952
    }
4982
    }
4953
 
4983
 
4954
    # lets take the passed in args.
4984
    # lets take the passed in args.
4955
    my ($uid, $gid) = @_;
4985
    my ($uid, $gid) = @_;
Line 4966... Line 4996...
4966
 
4996
 
4967
    # we need to locate the prototype file
4997
    # we need to locate the prototype file
4968
    if ( -f "$protoTypeFile" )
4998
    if ( -f "$protoTypeFile" )
4969
    {
4999
    {
4970
        unlink("$protoTypeFile");
5000
        unlink("$protoTypeFile");
4971
        LogInfo("Removing prototype file [$protoTypeFile].");
5001
        Verbose("Removing prototype file [$protoTypeFile].");
4972
    }
5002
    }
4973
 
5003
 
4974
    # lets open the prototype file.
5004
    # lets open the prototype file.
4975
    #    
5005
    #    
4976
    local *FILE;
5006
    local *FILE;
4977
    open ( FILE, "> $protoTypeFile") or
5007
    open ( FILE, "> $protoTypeFile") or
4978
        LogError("Failed to open file [$protoTypeFile].");
5008
        Error("Failed to open file [$protoTypeFile].");
4979
 
5009
 
4980
    # lets populate the prototype file.
5010
    # lets populate the prototype file.
4981
    printf FILE ("i pkginfo\n");
5011
    printf FILE ("i pkginfo\n");
4982
 
5012
 
4983
    if ( "x$TargetBaseDir" ne "x." )
5013
    if ( "x$TargetBaseDir" ne "x." )
Line 4993... Line 5023...
4993
    # be installing 
5023
    # be installing 
4994
    File::Find::find(\&prototypeFind, "$targetBaseDir");
5024
    File::Find::find(\&prototypeFind, "$targetBaseDir");
4995
 
5025
 
4996
    # lets populate the prototype file with a newline.
5026
    # lets populate the prototype file with a newline.
4997
    open ( FILE, ">> $protoTypeFile") or
5027
    open ( FILE, ">> $protoTypeFile") or
4998
        LogError("Failed to open file [$protoTypeFile].");
5028
        Error("Failed to open file [$protoTypeFile].");
4999
    printf FILE ("\n");
5029
    printf FILE ("\n");
5000
    close (FILE);
5030
    close (FILE);
5001
 
5031
 
5002
 
5032
 
5003
    # lets put the pre-deinfed generic entries into the 
5033
    # lets put the pre-deinfed generic entries into the 
Line 5020... Line 5050...
5020
                  " >> $protoTypeFile";
5050
                  " >> $protoTypeFile";
5021
 
5051
 
5022
    my ($retVal) = system("cd $pkgBaseDir; $m_cmd");
5052
    my ($retVal) = system("cd $pkgBaseDir; $m_cmd");
5023
    if ( $retVal != 0 )
5053
    if ( $retVal != 0 )
5024
    {
5054
    {
5025
        LogError("Failed to create prototype file [$protoTypeFile].");
5055
        Error("Failed to create prototype file [$protoTypeFile].");
5026
    }
5056
    }
5027
 
5057
 
5028
    LogNorm("Created prototype file [$protoTypeFile].");
5058
    Information("Created prototype file [$protoTypeFile].");
5029
 
5059
 
5030
    return 1;
5060
    return 1;
5031
}
5061
}
5032
 
5062
 
5033
#------------------------------------------------------------------------------
5063
#------------------------------------------------------------------------------
Line 5066... Line 5096...
5066
            {
5096
            {
5067
                $file =~ s/$tDir/$TargetBaseDir/;
5097
                $file =~ s/$tDir/$TargetBaseDir/;
5068
            }
5098
            }
5069
 
5099
 
5070
            open ( FILE, ">> $pfile") or
5100
            open ( FILE, ">> $pfile") or
5071
                 LogError("Failed to open file [$pfile].");
5101
                 Error("Failed to open file [$pfile].");
5072
 
5102
 
5073
            # lets populate the prototype file.
5103
            # lets populate the prototype file.
5074
            printf FILE (" $file");
5104
            printf FILE (" $file");
5075
            close (FILE);
5105
            close (FILE);
5076
        }
5106
        }
Line 5085... Line 5115...
5085
#       This sub-routine is used to add additonal genericinformation
5115
#       This sub-routine is used to add additonal genericinformation
5086
#       used by the patch.
5116
#       used by the patch.
5087
#
5117
#
5088
#------------------------------------------------------------------------------
5118
#------------------------------------------------------------------------------
5089
{
5119
{
5090
    LogNorm("Adding patch information files to patch build...");
5120
    Information("Adding patch information files to patch build...");
5091
 
5121
 
5092
    # we need to determine whiich file we are dealing with
5122
    # we need to determine whiich file we are dealing with
5093
    my ($protoTypeFile);
5123
    my ($protoTypeFile);
5094
    $protoTypeFile = "$ProtoTypeFile";
5124
    $protoTypeFile = "$ProtoTypeFile";
5095
 
5125
 
5096
    # lets open the prototype file.
5126
    # lets open the prototype file.
5097
    #
5127
    #
5098
    local *FILE;
5128
    local *FILE;
5099
    open ( FILE, ">> $protoTypeFile") or
5129
    open ( FILE, ">> $protoTypeFile") or
5100
        LogError("Failed to open file [$protoTypeFile].");
5130
        Error("Failed to open file [$protoTypeFile].");
5101
 
5131
 
5102
 
5132
 
5103
    # we need to copy the install informational files from
5133
    # we need to copy the install informational files from
5104
    # their resting place.
5134
    # their resting place.
5105
    my ($i);
5135
    my ($i);
5106
    foreach $i ( @PATCH_INFO_FILES )
5136
    foreach $i ( @PATCH_INFO_FILES )
5107
    {
5137
    {
5108
        if( File::Copy::copy("$PATCH_UTIL_DIR/$i", "$PkgBaseDir") )
5138
        if( File::Copy::copy("$PATCH_UTIL_DIR/$i", "$PkgBaseDir") )
5109
        {
5139
        {
5110
            LogNorm("Copied [$PATCH_UTIL_DIR/$i] to [$PkgBaseDir] ...");
5140
            Verbose("Copied [$PATCH_UTIL_DIR/$i] to [$PkgBaseDir] ...");
5111
            printf FILE ("i $i\n"); 
5141
            printf FILE ("i $i\n"); 
5112
        }
5142
        }
5113
        else
5143
        else
5114
        {
5144
        {
5115
            LogError("Failed to copy info file [$PATCH_UTIL_DIR/$i]: $!");
5145
            Error("Failed to copy info file [$PATCH_UTIL_DIR/$i]: $!");
5116
        }
5146
        }
5117
    }
5147
    }
5118
    close FILE;
5148
    close FILE;
5119
    
5149
    
5120
    return 1;
5150
    return 1;
Line 5129... Line 5159...
5129
#       include the i.replace file in the PKG_INFO_FILES List
5159
#       include the i.replace file in the PKG_INFO_FILES List
5130
#
5160
#
5131
#------------------------------------------------------------------------------
5161
#------------------------------------------------------------------------------
5132
{
5162
{
5133
 
5163
 
5134
    LogNorm("useReplaceClass: Adding replace class to installer");
5164
    Information("useReplaceClass: Adding replace class to installer");
5135
 
5165
 
5136
    $PkgInfoClasses = $PkgInfoClasses . " " . "replace";
5166
    $PkgInfoClasses = $PkgInfoClasses . " " . "replace";
5137
    push(@PKG_UTIL_FILES, "i.replace");
5167
    push(@PKG_UTIL_FILES, "i.replace");
5138
}
5168
}
5139
 
5169
 
Line 5147... Line 5177...
5147
#------------------------------------------------------------------------------
5177
#------------------------------------------------------------------------------
5148
{
5178
{
5149
    # correct number of parameters?
5179
    # correct number of parameters?
5150
    if ( ($#_+1) == 0 )
5180
    if ( ($#_+1) == 0 )
5151
    {
5181
    {
5152
        LogError("Incorrect number of params passed to " .
5182
        Error("Incorrect number of params passed to " .
5153
                  "createPkginfoFile() function. Check deploy config.");
5183
              "createPkginfoFile() function",
-
 
5184
              "Check deploy config.");
5154
    }
5185
    }
5155
 
5186
 
5156
    LogNorm("addPkgInfoClasses() Adding classes \"" . join(" ", @_) . "\" to CLASSES List");
5187
    Information("addPkgInfoClasses() Adding classes \"" . join(" ", @_) . "\" to CLASSES List");
5157
 
5188
 
5158
    $PkgInfoClasses = $PkgInfoClasses . " " . join(" ", @_);
5189
    $PkgInfoClasses = $PkgInfoClasses . " " . join(" ", @_);
5159
}
5190
}
5160
 
5191
 
5161
 
5192
 
Line 5168... Line 5199...
5168
#------------------------------------------------------------------------------
5199
#------------------------------------------------------------------------------
5169
{
5200
{
5170
    # lets just check to see if we can execute this function on this machine.
5201
    # lets just check to see if we can execute this function on this machine.
5171
    if ( "$MachType" ne "sparc" )
5202
    if ( "$MachType" ne "sparc" )
5172
    {
5203
    {
5173
        LogInfo("addPkgInfoField() not supported on this machine type.");
5204
        Verbose("addPkgInfoField() not supported on this machine type.");
5174
        return 1;
5205
        return 1;
5175
    }
5206
    }
5176
    # lets open the pkginfo file.   
5207
    # lets open the pkginfo file.   
5177
    local *FILE;
5208
    local *FILE;
5178
    open ( FILE, ">> $PkgInfoFile") or LogError("Failed to open file [$PkgInfoFile].");
5209
    open ( FILE, ">> $PkgInfoFile") or Error("Failed to open file [$PkgInfoFile].");
5179
 
5210
 
5180
    foreach my $i ( @_ )
5211
    foreach my $i ( @_ )
5181
    {
5212
    {
5182
        print FILE "$i\n";
5213
        print FILE "$i\n";
5183
    }
5214
    }
Line 5194... Line 5225...
5194
#------------------------------------------------------------------------------
5225
#------------------------------------------------------------------------------
5195
{
5226
{
5196
    # correct number of parameters?
5227
    # correct number of parameters?
5197
    if ( ($#_+1) != 2 )
5228
    if ( ($#_+1) != 2 )
5198
    {
5229
    {
5199
        LogError("Incorrect number of params passed to " .
5230
        Error("Incorrect number of params passed to " .
5200
                  "updatePrototypeFileItemClass() function. Check deploy config.");
5231
                  "updatePrototypeFileItemClass() function. Check deploy config.");
5201
    }
5232
    }
5202
 
5233
 
5203
 
5234
 
5204
    # lets just check to see if we can execute this function on
5235
    # lets just check to see if we can execute this function on
5205
    # this machine.
5236
    # this machine.
5206
    #
5237
    #
5207
    if ( "$MachType" ne "sparc" )
5238
    if ( "$MachType" ne "sparc" )
5208
    {
5239
    {
5209
        LogInfo("updatePrototypeFileItemClass() not supported on this machine type.");
5240
        Verbose("updatePrototypeFileItemClass() not supported on this machine type.");
5210
        return 1;
5241
        return 1;
5211
    }
5242
    }
5212
 
5243
 
5213
 
5244
 
5214
    # lets setup the passed values.
5245
    # lets setup the passed values.
Line 5217... Line 5248...
5217
    my ($tmpProtoTypeFile) = "/tmp/xx_prototypefile.$$";
5248
    my ($tmpProtoTypeFile) = "/tmp/xx_prototypefile.$$";
5218
 
5249
 
5219
    # lets open the prototype file if it exists
5250
    # lets open the prototype file if it exists
5220
    #
5251
    #
5221
    open (PFILE, "< $ProtoTypeFile") or
5252
    open (PFILE, "< $ProtoTypeFile") or
5222
        LogError("Failed to open prototype file [$ProtoTypeFile].");
5253
        Error("Failed to open prototype file [$ProtoTypeFile].");
5223
 
5254
 
5224
    open (PFILETMP, "> $tmpProtoTypeFile") or
5255
    open (PFILETMP, "> $tmpProtoTypeFile") or
5225
        LogError("Failed to open tmp prototype file [$tmpProtoTypeFile].");
5256
        Error("Failed to open tmp prototype file [$tmpProtoTypeFile].");
5226
 
5257
 
5227
    while ( <PFILE> )
5258
    while ( <PFILE> )
5228
    {
5259
    {
5229
        chomp;
5260
        chomp;
5230
        # The path section will normally contain "path [mode]" or path=path
5261
        # The path section will normally contain "path [mode]" or path=path
Line 5240... Line 5271...
5240
    close PFILETMP;
5271
    close PFILETMP;
5241
 
5272
 
5242
    # now we need to copy the file.
5273
    # now we need to copy the file.
5243
    if(File::Copy::copy("$tmpProtoTypeFile", "$ProtoTypeFile"))
5274
    if(File::Copy::copy("$tmpProtoTypeFile", "$ProtoTypeFile"))
5244
    {
5275
    {
5245
        LogNorm("Updated file $m_item to class $class");
5276
        Verbose("Updated file $m_item to class $class");
5246
        unlink($tmpProtoTypeFile);
5277
        unlink($tmpProtoTypeFile);
5247
    }
5278
    }
5248
    else
5279
    else
5249
    {
5280
    {
5250
        LogError("Failed to copy lib [$tmpProtoTypeFile]: $!");
5281
        Error("Failed to copy lib [$tmpProtoTypeFile]: $!");
5251
    }
5282
    }
5252
 
5283
 
5253
    return 1;
5284
    return 1;
5254
 
5285
 
5255
}
5286
}
Line 5267... Line 5298...
5267
    # lets just check to see if we can execute this function on
5298
    # lets just check to see if we can execute this function on
5268
    # this machine.
5299
    # this machine.
5269
    #
5300
    #
5270
    if ( "$MachType" ne "sparc" )
5301
    if ( "$MachType" ne "sparc" )
5271
    {
5302
    {
5272
        LogInfo("updatePrototypeFileItemClass() not supported on this machine type.");
5303
        Verbose("updatePrototypeFileItemClass() not supported on this machine type.");
5273
        return 1;
5304
        return 1;
5274
    }
5305
    }
5275
 
5306
 
5276
    LogError("Must call useReplaceClass() before calling setReplaceClassFiles()") if ( $PkgInfoClasses !~ /replace/ );
5307
    Error("Must call useReplaceClass() before calling setReplaceClassFiles()") if ( $PkgInfoClasses !~ /replace/ );
5277
 
5308
 
5278
    my ($tmpProtoTypeFile) = "/tmp/xx_prototypefile.$$";
5309
    my ($tmpProtoTypeFile) = "/tmp/xx_prototypefile.$$";
5279
 
5310
 
5280
    # lets open the prototype file if it exists
5311
    # lets open the prototype file if it exists
5281
    #
5312
    #
5282
    open (PFILE, "< $ProtoTypeFile") or
5313
    open (PFILE, "< $ProtoTypeFile") or
5283
        LogError("Failed to open prototype file [$ProtoTypeFile].");
5314
        Error("Failed to open prototype file [$ProtoTypeFile].");
5284
 
5315
 
5285
    open (PFILETMP, "> $tmpProtoTypeFile") or
5316
    open (PFILETMP, "> $tmpProtoTypeFile") or
5286
        LogError("Failed to open tmp prototype file [$tmpProtoTypeFile].");
5317
        Error("Failed to open tmp prototype file [$tmpProtoTypeFile].");
5287
 
5318
 
5288
    my $line;
5319
    my $line;
5289
    while ( $line = <PFILE> )
5320
    while ( $line = <PFILE> )
5290
    {
5321
    {
5291
        chomp $line;
5322
        chomp $line;
Line 5302... Line 5333...
5302
    close PFILETMP;
5333
    close PFILETMP;
5303
 
5334
 
5304
    # now we need to copy the file.
5335
    # now we need to copy the file.
5305
    if(File::Copy::copy("$tmpProtoTypeFile", "$ProtoTypeFile"))
5336
    if(File::Copy::copy("$tmpProtoTypeFile", "$ProtoTypeFile"))
5306
    {
5337
    {
5307
        LogNorm("Updated prototype file entries to class replace");
5338
        Verbose("Updated prototype file entries to class replace");
5308
        unlink($tmpProtoTypeFile);
5339
        unlink($tmpProtoTypeFile);
5309
    }
5340
    }
5310
    else
5341
    else
5311
    {
5342
    {
5312
        LogError("Failed to copy lib [$tmpProtoTypeFile]: $!");
5343
        Error("Failed to copy lib [$tmpProtoTypeFile]: $!");
5313
    }
5344
    }
5314
 
5345
 
5315
    return 1;
5346
    return 1;
5316
 
5347
 
5317
}
5348
}
Line 5327... Line 5358...
5327
#------------------------------------------------------------------------------
5358
#------------------------------------------------------------------------------
5328
{
5359
{
5329
    # lets check to see if our description has been set
5360
    # lets check to see if our description has been set
5330
    if ( $PkgDesc eq "" )
5361
    if ( $PkgDesc eq "" )
5331
    {
5362
    {
5332
        LogError("Package description not set. " .
5363
        Error("Package description not set. " .
5333
                 "Use setPkgDescription('my package description') function.");
5364
                 "Use setPkgDescription('my package description') function.");
5334
    }
5365
    }
5335
 
5366
 
5336
    # lets check to see if our long name has been set
5367
    # lets check to see if our long name has been set
5337
    if ( $PkgNameLong eq "" )
5368
    if ( $PkgNameLong eq "" )
5338
    {
5369
    {
5339
        LogError("Package name not set. Use setPkgName('my package long name') function.");
5370
        Error("Package name not set. Use setPkgName('my package long name') function.");
5340
    }
5371
    }
5341
 
5372
 
5342
 
5373
 
5343
    # lets just check to see if we can execute this function on
5374
    # lets just check to see if we can execute this function on
5344
    # this machine.
5375
    # this machine.
Line 5354... Line 5385...
5354
 
5385
 
5355
    # we need to locate the pkginfo file
5386
    # we need to locate the pkginfo file
5356
    if ( -f "$pkginfoFile" )
5387
    if ( -f "$pkginfoFile" )
5357
    {
5388
    {
5358
        unlink("$pkginfoFile");
5389
        unlink("$pkginfoFile");
5359
        LogInfo("Removing pkginfo file [$pkginfoFile].");
5390
        Verbose("Removing pkginfo file [$pkginfoFile].");
5360
    }
5391
    }
5361
 
5392
 
5362
    # lets open the pkginfo file.
5393
    # lets open the pkginfo file.
5363
    #    
5394
    #    
5364
    local *FILE;
5395
    local *FILE;
5365
    open ( FILE, "> $pkginfoFile") or
5396
    open ( FILE, "> $pkginfoFile") or
5366
        LogError("Failed to open file [$pkginfoFile].");
5397
        Error("Failed to open file [$pkginfoFile].");
5367
 
5398
 
5368
    # lets populate the pkginfo file.
5399
    # lets populate the pkginfo file.
5369
    printf FILE ("PKG=$PkgName\n");
5400
    printf FILE ("PKG=$PkgName\n");
5370
 
5401
 
5371
 
5402
 
Line 5452... Line 5483...
5452
    close FILE;
5483
    close FILE;
5453
 
5484
 
5454
 
5485
 
5455
    # lets close the pkginfo file.
5486
    # lets close the pkginfo file.
5456
    close (FILE);
5487
    close (FILE);
5457
    LogNorm("Created pkginfo file [$pkginfoFile].");
5488
    Information("Created pkginfo file [$pkginfoFile].");
5458
 
5489
 
5459
    return 1;
5490
    return 1;
5460
}
5491
}
5461
 
5492
 
5462
 
5493
 
Line 5470... Line 5501...
5470
#------------------------------------------------------------------------------
5501
#------------------------------------------------------------------------------
5471
{
5502
{
5472
    # correct number of parameters?
5503
    # correct number of parameters?
5473
    if ( ($#_+1) != 4 )
5504
    if ( ($#_+1) != 4 )
5474
    {
5505
    {
5475
        LogError("Incorrect number of params passed to " .
5506
        Error("Incorrect number of params passed to " .
5476
                  "updatePrototypeFileItemOwner() function. Check deploy config.");
5507
                  "updatePrototypeFileItemOwner() function. Check deploy config.");
5477
    }
5508
    }
5478
 
5509
 
5479
 
5510
 
5480
    # lets just check to see if we can execute this function on
5511
    # lets just check to see if we can execute this function on
5481
    # this machine.
5512
    # this machine.
5482
    #
5513
    #
5483
    if ( "$MachType" ne "sparc" )
5514
    if ( "$MachType" ne "sparc" )
5484
    {
5515
    {
5485
        LogInfo("chmod() not supported on this machine type.");
5516
        Verbose("chmod() not supported on this machine type.");
5486
        return 1;
5517
        return 1;
5487
    }
5518
    }
5488
 
5519
 
5489
 
5520
 
5490
    # lets setup the passed values.
5521
    # lets setup the passed values.
Line 5495... Line 5526...
5495
 
5526
 
5496
 
5527
 
5497
    # lets open the prototype file if it exists
5528
    # lets open the prototype file if it exists
5498
    #
5529
    #
5499
    open (PFILE, "< $ProtoTypeFile") or
5530
    open (PFILE, "< $ProtoTypeFile") or
5500
        LogError("Failed to open prototype file [$ProtoTypeFile].");
5531
        Error("Failed to open prototype file [$ProtoTypeFile].");
5501
 
5532
 
5502
    open (PFILETMP, "> $tmpProtoTypeFile") or
5533
    open (PFILETMP, "> $tmpProtoTypeFile") or
5503
        LogError("Failed to open tmp prototype file [$tmpProtoTypeFile].");
5534
        Error("Failed to open tmp prototype file [$tmpProtoTypeFile].");
5504
 
5535
 
5505
    my ($inLine);
5536
    my ($inLine);
5506
    while ( <PFILE> )
5537
    while ( <PFILE> )
5507
    {
5538
    {
5508
        $inLine = $_;
5539
        $inLine = $_;
Line 5521... Line 5552...
5521
    close PFILETMP;
5552
    close PFILETMP;
5522
 
5553
 
5523
    # now we need to copy the file.
5554
    # now we need to copy the file.
5524
    if(File::Copy::copy("$tmpProtoTypeFile", "$ProtoTypeFile"))
5555
    if(File::Copy::copy("$tmpProtoTypeFile", "$ProtoTypeFile"))
5525
    {
5556
    {
5526
        LogNorm("Copied [$tmpProtoTypeFile] to [$ProtoTypeFile] ...");
5557
        Verbose("Copied [$tmpProtoTypeFile] to [$ProtoTypeFile] ...");
5527
        unlink($tmpProtoTypeFile);
5558
        unlink($tmpProtoTypeFile);
5528
    }
5559
    }
5529
    else
5560
    else
5530
    {
5561
    {
5531
        LogError("Failed to copy lib [$tmpProtoTypeFile]: $!");
5562
        Error("Failed to copy lib [$tmpProtoTypeFile]: $!");
5532
    }
5563
    }
5533
 
5564
 
5534
    return 1;
5565
    return 1;
5535
 
5566
 
5536
}
5567
}
Line 5546... Line 5577...
5546
#------------------------------------------------------------------------------
5577
#------------------------------------------------------------------------------
5547
{
5578
{
5548
    # correct number of parameters?
5579
    # correct number of parameters?
5549
    if ( ($#_+1) != 3 )
5580
    if ( ($#_+1) != 3 )
5550
    {
5581
    {
5551
        LogError("Incorrect number of params passed to " .
5582
        Error("Incorrect number of params passed to " .
5552
                  "chmod() function. Check deploy config.");
5583
                  "chmod() function. Check deploy config.");
5553
    }
5584
    }
5554
 
5585
 
5555
 
5586
 
5556
    # lets setup the passed values.
5587
    # lets setup the passed values.
Line 5559... Line 5590...
5559
 
5590
 
5560
    # lets just check to see if the perms are in correct format.
5591
    # lets just check to see if the perms are in correct format.
5561
    #
5592
    #
5562
    if ( "$m_ownPerms" !~ m/^[0-9][0-9][0-9][0-9]$/ )
5593
    if ( "$m_ownPerms" !~ m/^[0-9][0-9][0-9][0-9]$/ )
5563
    {
5594
    {
5564
        LogError("chmod() does not support [$m_ownPerms] permission, use format 0755 etc.");
5595
        Error("chmod() does not support [$m_ownPerms] permission, use format 0755 etc.");
5565
        return 1;
5596
        return 1;
5566
    }
5597
    }
5567
 
5598
 
5568
    # lets get the absolute src dir value
5599
    # lets get the absolute src dir value
5569
    my ($m_sDirAbsoluteValue) = getTargetDstDirValue($m_sDirTag, "A");
5600
    my ($m_sDirAbsoluteValue) = getTargetDstDirValue($m_sDirTag, "A");
Line 5581... Line 5612...
5581
    # check to see if item exists
5612
    # check to see if item exists
5582
    #
5613
    #
5583
    if ( ! -f "$item" && 
5614
    if ( ! -f "$item" && 
5584
         ! -d "$item" )
5615
         ! -d "$item" )
5585
    {
5616
    {
5586
        LogError("Failed to find item [$item]. Check deploy config."); 
5617
        Error("Failed to find item [$item]. Check deploy config."); 
5587
    }
5618
    }
5588
    LogNorm("chmod: Changing permisions of file [$m_sfile] in dirtag [$m_sDirTag] to [$m_ownPerms]");
5619
    Verbose("chmod: Changing permisions of file [$m_sfile] in dirtag [$m_sDirTag] to [$m_ownPerms]");
5589
    chmodFile("$item", $m_ownPerms);
5620
    chmodFile("$item", $m_ownPerms);
5590
 
5621
 
5591
    return 1;
5622
    return 1;
5592
}
5623
}
5593
 
5624
 
Line 5602... Line 5633...
5602
#------------------------------------------------------------------------------
5633
#------------------------------------------------------------------------------
5603
{
5634
{
5604
    # correct number of parameters?
5635
    # correct number of parameters?
5605
    if ( ($#_+1) != 2 )
5636
    if ( ($#_+1) != 2 )
5606
    {
5637
    {
5607
        LogError("Incorrect number of params passed to " .
5638
        Error("Incorrect number of params passed to " .
5608
                  "chmodRecursive() function. Check deploy config.");
5639
                  "chmodRecursive() function. Check deploy config.");
5609
    }
5640
    }
5610
 
5641
 
5611
    # lets setup the passed values.
5642
    # lets setup the passed values.
5612
    my ($m_sDirTag, $m_ownPerms) = @_;
5643
    my ($m_sDirTag, $m_ownPerms) = @_;
5613
 
5644
 
5614
    # lets just check to see if the perms are in correct format.
5645
    # lets just check to see if the perms are in correct format.
5615
    #
5646
    #
5616
    if ( "$m_ownPerms" !~ m/^[0-9][0-9][0-9][0-9]$/ )
5647
    if ( "$m_ownPerms" !~ m/^[0-9][0-9][0-9][0-9]$/ )
5617
    {
5648
    {
5618
        LogError("chmod() does not support [$m_ownPerms] permission, use format 0755 etc.");
5649
        Error("chmod() does not support [$m_ownPerms] permission, use format 0755 etc.");
5619
        return 1;
5650
        return 1;
5620
    }
5651
    }
5621
 
5652
 
5622
 
5653
 
5623
    # lets get the absolute src dir value
5654
    # lets get the absolute src dir value
Line 5627... Line 5658...
5627
    # check to see if item exists
5658
    # check to see if item exists
5628
    #
5659
    #
5629
    if ( ! -f "$m_sDirAbsoluteValue" &&
5660
    if ( ! -f "$m_sDirAbsoluteValue" &&
5630
         ! -d "$m_sDirAbsoluteValue" )
5661
         ! -d "$m_sDirAbsoluteValue" )
5631
    {
5662
    {
5632
        LogError("Failed to find item [$m_sDirAbsoluteValue]. " .
5663
        Error("Failed to find item [$m_sDirAbsoluteValue]. " .
5633
                  "Check deploy config."); 
5664
                  "Check deploy config."); 
5634
    }
5665
    }
5635
 
5666
 
5636
 
5667
 
5637
    # if its a not a dir
5668
    # if its a not a dir
5638
    #
5669
    #
5639
    if ( ! -d "$m_sDirAbsoluteValue" && -f "$m_sDirAbsoluteValue" )
5670
    if ( ! -d "$m_sDirAbsoluteValue" && -f "$m_sDirAbsoluteValue" )
5640
    {
5671
    {
5641
        LogWarn("chmodRecursive: This should not happen as dirtag [$m_sDirTag] is a file, changings perms to [$m_ownPerms] anyway");
5672
        Warning("chmodRecursive: This should not happen as dirtag [$m_sDirTag] is a file, changings perms to [$m_ownPerms] anyway");
5642
        chmodFile("$m_sDirAbsoluteValue", $m_ownPerms);
5673
        chmodFile("$m_sDirAbsoluteValue", $m_ownPerms);
5643
    }
5674
    }
5644
    else
5675
    else
5645
    {
5676
    {
5646
        # it must be a dir
5677
        # it must be a dir
5647
        LogNorm("chmodRecursive: Recursively setting perms on dirtag [$m_sDirTag] to [$m_ownPerms]");
5678
        Verbose("chmodRecursive: Recursively setting perms on dirtag [$m_sDirTag] to [$m_ownPerms]");
5648
        chmodDir("$m_sDirAbsoluteValue", $m_ownPerms);
5679
        chmodDir("$m_sDirAbsoluteValue", $m_ownPerms);
5649
    }
5680
    }
5650
 
5681
 
5651
    return 1;
5682
    return 1;
5652
}
5683
}
Line 5666... Line 5697...
5666
#------------------------------------------------------------------------------
5697
#------------------------------------------------------------------------------
5667
{
5698
{
5668
    # correct number of parameters?
5699
    # correct number of parameters?
5669
    if ( ($#_+1) != 2 )
5700
    if ( ($#_+1) != 2 )
5670
    {
5701
    {
5671
        LogError("Incorrect number of params passed to " .
5702
        Error("Incorrect number of params passed to " .
5672
                  "chmodDir() function.");
5703
                  "chmodDir() function.");
5673
    }
5704
    }
5674
 
5705
 
5675
    my ($startingPoint, $perms) = @_;
5706
    my ($startingPoint, $perms) = @_;
5676
 
5707
 
5677
    LogInfo("chmodDir: Recursively setting permsision of [$startingPoint] to [$perms]");
5708
    Verbose("chmodDir: Recursively setting permsision of [$startingPoint] to [$perms]");
5678
 
5709
 
5679
    local *DIR;
5710
    local *DIR;
5680
    opendir(DIR, $startingPoint) or
5711
    opendir(DIR, $startingPoint) or
5681
        LogError("can't opendir $startingPoint: $!");
5712
        Error("can't opendir $startingPoint: $!");
5682
 
5713
 
5683
    my ($item);
5714
    my ($item);
5684
    while (defined($item = readdir(DIR)))
5715
    while (defined($item = readdir(DIR)))
5685
    {
5716
    {
5686
        if ( "$item" !~ /^\.$/  &&
5717
        if ( "$item" !~ /^\.$/  &&
Line 5720... Line 5751...
5720
 
5751
 
5721
    my ($cmd) = "CORE::chmod $perms, $item";
5752
    my ($cmd) = "CORE::chmod $perms, $item";
5722
    my ($noItems) = CORE::chmod oct($perms), $item;
5753
    my ($noItems) = CORE::chmod oct($perms), $item;
5723
    if ( $noItems == 0 )
5754
    if ( $noItems == 0 )
5724
    {
5755
    {
5725
        LogError("Failed to complete command [$cmd], retVal=[$noItems]");
5756
        Error("Failed to complete command [$cmd], retVal=[$noItems]");
5726
    }
5757
    }
5727
    else
5758
    else
5728
    {
5759
    {
5729
        LogDebug("Executed command: [$cmd]");
5760
        Debug("Executed command: [$cmd]");
5730
    }
5761
    }
5731
 
5762
 
5732
    return 1;
5763
    return 1;
5733
}
5764
}
5734
 
5765
 
Line 5745... Line 5776...
5745
#------------------------------------------------------------------------------
5776
#------------------------------------------------------------------------------
5746
{
5777
{
5747
    # correct number of parameters?
5778
    # correct number of parameters?
5748
    if ( ($#_+1) != 3 )
5779
    if ( ($#_+1) != 3 )
5749
    {
5780
    {
5750
        LogError("Incorrect number of params passed to " .
5781
        Error("Incorrect number of params passed to " .
5751
                  "createSymbolicLink() function. Check deploy config.");
5782
                  "createSymbolicLink() function. Check deploy config.");
5752
    }
5783
    }
5753
 
5784
 
5754
 
5785
 
5755
    # lets just check to see if we can execute this function on
5786
    # lets just check to see if we can execute this function on
5756
    # this machine.
5787
    # this machine.
5757
    #
5788
    #
5758
    if ( "$MachType" ne "sparc" )
5789
    if ( "$MachType" ne "sparc" )
5759
    {
5790
    {
5760
        LogInfo("createSymbolicLink() not supported on this machine type.");
5791
        Verbose("createSymbolicLink() not supported on this machine type.");
5761
        return 1;
5792
        return 1;
5762
    }
5793
    }
5763
 
5794
 
5764
 
5795
 
5765
    # lets setup the passed values.
5796
    # lets setup the passed values.
Line 5771... Line 5802...
5771
 
5802
 
5772
    # lets see if the source item exists
5803
    # lets see if the source item exists
5773
    #
5804
    #
5774
    if ( ! -f "$m_sDirAbsoluteValue/$m_srcStr" )
5805
    if ( ! -f "$m_sDirAbsoluteValue/$m_srcStr" )
5775
    {
5806
    {
5776
        LogError("Failed to locate item [$m_sDirAbsoluteValue/$m_srcStr], link not created.");
5807
        Error("Failed to locate item [$m_sDirAbsoluteValue/$m_srcStr], link not created.");
5777
    }
5808
    }
5778
 
5809
 
5779
 
5810
 
5780
 
5811
 
5781
    my ($cmd) = "cd $m_sDirAbsoluteValue; ln -s $m_srcStr $m_linkStr";
5812
    my ($cmd) = "cd $m_sDirAbsoluteValue; ln -s $m_srcStr $m_linkStr";
5782
    system("$cmd");
5813
    system("$cmd");
5783
    if ( $? != 0 )
5814
    if ( $? != 0 )
5784
    {
5815
    {
5785
        LogError("Failed to complete command: [$cmd]");
5816
        Error("Failed to complete command: [$cmd]");
5786
    }
5817
    }
5787
    else
5818
    else
5788
    {
5819
    {
5789
        LogNorm("Executed command: [$cmd]");
5820
        Verbose("Executed command: [$cmd]");
5790
    }
5821
    }
5791
 
5822
 
5792
    return 1;
5823
    return 1;
5793
}
5824
}
5794
 
5825
 
Line 5803... Line 5834...
5803
#------------------------------------------------------------------------------
5834
#------------------------------------------------------------------------------
5804
{
5835
{
5805
    # correct number of parameters?
5836
    # correct number of parameters?
5806
    if ( ($#_+1) != 3 )
5837
    if ( ($#_+1) != 3 )
5807
    {
5838
    {
5808
        LogError("Incorrect number of params passed to " .
5839
        Error("Incorrect number of params passed to " .
5809
                  "createPrototypeFile2() function. Check deploy config.");
5840
                  "createPrototypeFile2() function. Check deploy config.");
5810
    }
5841
    }
5811
 
5842
 
5812
    # lets just check to see if we can execute this function on
5843
    # lets just check to see if we can execute this function on
5813
    # this machine.
5844
    # this machine.
5814
    #
5845
    #
5815
    if ( "$MachType" ne "sparc" )
5846
    if ( "$MachType" ne "sparc" )
5816
    {
5847
    {
5817
        LogInfo("createPrototypeFile2() not supported on this machine type.");
5848
        Verbose("createPrototypeFile2() not supported on this machine type.");
5818
        return 1;
5849
        return 1;
5819
    }
5850
    }
5820
 
5851
 
5821
    # lets take the passed in args.
5852
    # lets take the passed in args.
5822
    my ($uid, $gid, $mask) = @_;
5853
    my ($uid, $gid, $mask) = @_;
Line 5833... Line 5864...
5833
 
5864
 
5834
    # we need to locate the prototype file
5865
    # we need to locate the prototype file
5835
    if ( -f "$protoTypeFile" )
5866
    if ( -f "$protoTypeFile" )
5836
    {
5867
    {
5837
        unlink("$protoTypeFile");
5868
        unlink("$protoTypeFile");
5838
        LogInfo("Removing prototype file [$protoTypeFile].");
5869
        Verbose("Removing prototype file [$protoTypeFile].");
5839
    }
5870
    }
5840
 
5871
 
5841
    # lets open the prototype file.
5872
    # lets open the prototype file.
5842
    #    
5873
    #    
5843
    local *FILE;
5874
    local *FILE;
5844
    open ( FILE, "> $protoTypeFile") or
5875
    open ( FILE, "> $protoTypeFile") or
5845
        LogError("Failed to open file [$protoTypeFile].");
5876
        Error("Failed to open file [$protoTypeFile].");
5846
    # lets populate the prototype file.
5877
    # lets populate the prototype file.
5847
    printf FILE ("!default $mask $uid $gid\n");
5878
    printf FILE ("!default $mask $uid $gid\n");
5848
    printf FILE ("i pkginfo\n");
5879
    printf FILE ("i pkginfo\n");
5849
    close (FILE);
5880
    close (FILE);
5850
 
5881
 
Line 5871... Line 5902...
5871
    File::Find::find(\&prototype2Find, "$targetBaseDir");
5902
    File::Find::find(\&prototype2Find, "$targetBaseDir");
5872
 
5903
 
5873
 
5904
 
5874
    # lets populate the prototype file with a newline.
5905
    # lets populate the prototype file with a newline.
5875
    open ( FILE, ">> $protoTypeFile") or
5906
    open ( FILE, ">> $protoTypeFile") or
5876
        LogError("Failed to open file [$protoTypeFile].");
5907
        Error("Failed to open file [$protoTypeFile].");
5877
    printf FILE ("\n");
5908
    printf FILE ("\n");
5878
    close (FILE);
5909
    close (FILE);
5879
 
5910
 
5880
 
5911
 
5881
    LogNorm("Created prototype file [$protoTypeFile].");
5912
    Information("Created prototype file [$protoTypeFile].");
5882
 
5913
 
5883
    return 1;
5914
    return 1;
5884
}
5915
}
5885
 
5916
 
-
 
5917
#-------------------------------------------------------------------------------
-
 
5918
# Function        : createZip
-
 
5919
#
-
 
5920
# Description     : Create a ZIp file of a given directory
-
 
5921
#
-
 
5922
# Inputs          : --Recurse               - Recurse subdirs
-
 
5923
#                   --NoRecurse             - Done recurse subdirs
-
 
5924
#                   --Dirnames              - Record Dir names
-
 
5925
#                   --NoDirnames            - Don't record dirnames
-
 
5926
#                   --NoQuiet               - Display the operatios
-
 
5927
#                   --Dir=xxxx              - Symbolic Directory to zip
-
 
5928
#                   --ZipDir=ttt            - Symbolic target directory
-
 
5929
#                   --ZipFile=yyyy          - Zipfile to create
-
 
5930
#
-
 
5931
# Returns         : Will not return on error
-
 
5932
#                   Requires 'zip' to be provided by a 'package' such as InfoZip
-
 
5933
#
-
 
5934
sub createZip
-
 
5935
{
-
 
5936
    my $recurse = 1;
-
 
5937
    my $dirnames = 0;
-
 
5938
    my $quiet = 1;
-
 
5939
    my $sdir;
-
 
5940
    my $tdir;
-
 
5941
    my $tfile;
-
 
5942
 
-
 
5943
    #
-
 
5944
    #   Only on Windows at the moment.
-
 
5945
    #   Perhaps Unix should create a .gz file
-
 
5946
    #
-
 
5947
    Warning ("createZip not supported on $MachType. Operation skipped")
-
 
5948
        unless ( "$MachType" eq "win32" );
-
 
5949
 
-
 
5950
    #
-
 
5951
    #   Process user arguments
-
 
5952
    #
-
 
5953
    foreach ( @_ )
-
 
5954
    {
-
 
5955
        if ( m/^--Recurse/ ) {
-
 
5956
            $recurse = 1;
-
 
5957
 
-
 
5958
        } elsif ( m/^--NoRecurse/) {
-
 
5959
            $recurse = 0;
-
 
5960
 
-
 
5961
        } elsif ( m/^--Dirnames/ ) {
-
 
5962
            $dirnames = 1;
-
 
5963
 
-
 
5964
        } elsif ( m/^--NoDirnames/ ) {
-
 
5965
            $dirnames = 0;
-
 
5966
 
-
 
5967
        } elsif ( m/^--NoQuiets/ ) {
-
 
5968
            $quiet = 0;
-
 
5969
 
-
 
5970
        } elsif ( m/^--Dir=(.*)/ ) {
-
 
5971
            $sdir = $1;
-
 
5972
 
-
 
5973
        } elsif ( m/^--ZipDir=(.*)/ ) {
-
 
5974
            $tdir = $1;
-
 
5975
            
-
 
5976
        } elsif ( m/^--ZipFile=(.*)/ ) {
-
 
5977
            $tfile = $1;
-
 
5978
            
-
 
5979
        } else {
-
 
5980
            Warning("createZip: Unknown argument ignored: $_");
-
 
5981
 
-
 
5982
        }
-
 
5983
    }
-
 
5984
 
-
 
5985
    #
-
 
5986
    #   Convert the source directory TAG into a real directory
-
 
5987
    #
-
 
5988
    Error ("createZip: Source directory not specified") unless ( $sdir );
-
 
5989
    my $sdir_a = getTargetDstDirValue($sdir, "A");
-
 
5990
 
-
 
5991
    #
-
 
5992
    #   Convert the destination directory tag into a real directory
-
 
5993
    #
-
 
5994
    Error ("createZip: Target directory not specified") unless ( $tdir );
-
 
5995
    Error ("createZip: Target filename not specified") unless ( $tfile );
-
 
5996
    my $tdir_a = getTargetDstDirValue($tdir, "A");
-
 
5997
 
-
 
5998
    #
-
 
5999
    #   Locate the 'zip' uitilty
-
 
6000
    #
-
 
6001
    my $prog = LocateProgInPath( 'zip' );
-
 
6002
    Error ("createZip: Cannot locate ZIP executable",
-
 
6003
            "May need to use the 'infozip' package") unless ( $prog );
-
 
6004
 
-
 
6005
    #
-
 
6006
    #   Generate command file
-
 
6007
    #
-
 
6008
    my $args = '-9';
-
 
6009
    $args .= 'q' unless ( (! $quiet) || IsVerbose(1));
-
 
6010
    $args .= 'r' if ( $recurse );
-
 
6011
    $args .= 'j' unless ( $dirnames );
-
 
6012
 
-
 
6013
    #
-
 
6014
    #   Zip up the files
-
 
6015
    #
-
 
6016
    Information ("Create Zip File: [$tdir] $tfile");
-
 
6017
    chdir ( $sdir_a ) || Error ("Cannot cd to $sdir_a");
-
 
6018
    my $rv = System ($prog, $args, "$tdir_a/$tfile", "." );
-
 
6019
    chdir($CurrentDir) || Error ("Cannot cd to $CurrentDir");
-
 
6020
 
-
 
6021
    Error ("createZip: Zip file not created") if ( $rv );
-
 
6022
}
-
 
6023
 
5886
 
6024
 
5887
#------------------------------------------------------------------------------
6025
#------------------------------------------------------------------------------
5888
sub prototype2Find
6026
sub prototype2Find
5889
#
6027
#
5890
#    Description:
6028
#    Description:
Line 5923... Line 6061...
5923
        # files so we need to exclude them
6061
        # files so we need to exclude them
5924
        if ( "$file" ne "$ProtoTypeFileName" &&
6062
        if ( "$file" ne "$ProtoTypeFileName" &&
5925
             "$file" ne "$PkgInfoFileName")
6063
             "$file" ne "$PkgInfoFileName")
5926
        {
6064
        {
5927
            open ( FILE, ">> $pfile") or
6065
            open ( FILE, ">> $pfile") or
5928
                LogError("Failed to open file [$pfile].");
6066
                Error("Failed to open file [$pfile].");
5929
 
6067
 
5930
            if ( -f "$m_sfile" )
6068
            if ( -f "$m_sfile" )
5931
            {
6069
            {
5932
                printf FILE ("f none $file=$file $m_MASK $m_UID $m_GID\n");
6070
                printf FILE ("f none $file=$file $m_MASK $m_UID $m_GID\n");
5933
            }
6071
            }
Line 5960... Line 6098...
5960
#------------------------------------------------------------------------------
6098
#------------------------------------------------------------------------------
5961
{
6099
{
5962
   # correct number of parameters?
6100
   # correct number of parameters?
5963
    if ( ($#_+1) != 2 )
6101
    if ( ($#_+1) != 2 )
5964
    {
6102
    {
5965
        LogError("Incorrect number of params passed to " .
6103
        Error("Incorrect number of params passed to " .
5966
                  "convertFile() function. Check deploy config.");
6104
                  "convertFile() function. Check deploy config.");
5967
    }
6105
    }
5968
    my ($m_targetDirTag, $m_nfile) = @_;
6106
    my ($m_targetDirTag, $m_nfile) = @_;
5969
 
6107
 
5970
 
6108
 
Line 5982... Line 6120...
5982
    local *IFILE;
6120
    local *IFILE;
5983
    local *TFILE;
6121
    local *TFILE;
5984
    if ( -f "$m_ifileLoc" )
6122
    if ( -f "$m_ifileLoc" )
5985
    {
6123
    {
5986
        open (IFILE, "< $m_ifileLoc" ) or
6124
        open (IFILE, "< $m_ifileLoc" ) or
5987
            LogError("Failed to open file [$m_ifileLoc] : $!");
6125
            Error("Failed to open file [$m_ifileLoc] : $!");
5988
 
6126
 
5989
        open (TFILE, "> $m_tfileLoc" ) or
6127
        open (TFILE, "> $m_tfileLoc" ) or
5990
            LogError("Failed to open file [$m_tfileLoc] : $!");
6128
            Error("Failed to open file [$m_tfileLoc] : $!");
5991
 
6129
 
5992
        while ( <IFILE> ) 
6130
        while ( <IFILE> ) 
5993
        {
6131
        {
5994
            chomp;
6132
            chomp;
5995
            print TFILE "$_\n";
6133
            print TFILE "$_\n";
5996
        }
6134
        }
5997
    }
6135
    }
5998
    else
6136
    else
5999
    {
6137
    {
6000
        LogError("Deploy file [$m_ifileLoc] does not exist.");
6138
        Error("Deploy file [$m_ifileLoc] does not exist.");
6001
    }
6139
    }
6002
 
6140
 
6003
    close IFILE;
6141
    close IFILE;
6004
    close TFILE;
6142
    close TFILE;
6005
 
6143
 
6006
 
6144
 
6007
    # lets replace our original file with the new one
6145
    # lets replace our original file with the new one
6008
    #
6146
    #
6009
    if(File::Copy::move("$m_tfileLoc", "$m_ifileLoc"))
6147
    if(File::Copy::move("$m_tfileLoc", "$m_ifileLoc"))
6010
    {
6148
    {
6011
        LogNorm("Renamed [$m_tfileLoc] to [$m_ifileLoc] ...");
6149
        Information("Renamed [$m_tfileLoc] to [$m_ifileLoc] ...");
6012
    }
6150
    }
6013
    else
6151
    else
6014
    {
6152
    {
6015
        LogError("Failed to crename file [$m_tfileLoc] to [$m_ifileLoc]: $!");
6153
        Error("Failed to crename file [$m_tfileLoc] to [$m_ifileLoc]: $!");
6016
    }
6154
    }
6017
 
6155
 
6018
    return 1;
6156
    return 1;
6019
}
6157
}
6020
 
6158
 
6021
 
-
 
6022
#------------------------------------------------------------------------------
6159
#-------------------------------------------------------------------------------
6023
sub installDeployFile
6160
# Function        : installDeployFile
6024
#
6161
#
6025
# Description:
-
 
6026
#       This sub-routine is used to copy a local deployment file into
6162
# Description     : This sub-routine is used to copy a local deployment file into
6027
#       the target destination dir. 
6163
#                   the target destination dir.
6028
#
6164
#
-
 
6165
# Inputs          : m_srcDirTag             - Tag for Source Dir name
-
 
6166
#                                             Tag defined in %LocalSrcDirStructure
-
 
6167
#                   m_sfile                 - Name of the source file
-
 
6168
#                   m_targetDirTag          - Tag for the target directory
-
 
6169
#                                             Tag defined in %TargetDstDirStructure
-
 
6170
#                   m_nfile                 - Target filename
-
 
6171
#                                             Must be specified. If set to "", then
-
 
6172
#                                             the source filename will be used.
-
 
6173
#
-
 
6174
# Returns         : True
6029
#
6175
#
6030
#------------------------------------------------------------------------------
6176
#------------------------------------------------------------------------------
-
 
6177
 
-
 
6178
sub installDeployFile
6031
{
6179
{
6032
    # correct number of parameters?
6180
    # correct number of parameters?
6033
    if ( ($#_+1) != 4 )
6181
    if ( ($#_+1) != 4 )
6034
    {
6182
    {
6035
        LogError("Incorrect number of params passed to " .
6183
        Error("Incorrect number of params passed to " .
6036
                  "installDeployFile() function. Check deploy config.");
6184
                  "installDeployFile() function. Check deploy config.");
6037
    }
6185
    }
6038
 
6186
 
6039
    my ($m_srcDirTag, $m_sfile, $m_targetDirTag, $m_nfile) = @_;
6187
    my ($m_srcDirTag, $m_sfile, $m_targetDirTag, $m_nfile) = @_;
6040
 
6188
 
Line 6067... Line 6215...
6067
    if ( -f "$m_sfileLoc" )
6215
    if ( -f "$m_sfileLoc" )
6068
    {
6216
    {
6069
        # now we need to copy the file. 
6217
        # now we need to copy the file. 
6070
        if(File::Copy::copy("$m_sfileLoc", "$m_nfileLoc"))
6218
        if(File::Copy::copy("$m_sfileLoc", "$m_nfileLoc"))
6071
        {
6219
        {
6072
            LogNorm("Copied [$m_sfile] to [$m_nfileLoc] ...");
6220
            Verbose("Copied [$m_sfile] to [$m_nfileLoc] ...");
6073
 
6221
 
6074
            # now we need to ensure the item is writable as it
6222
            # now we need to ensure the item is writable as it
6075
            # has come from our VOB that is by definition read-only
6223
            # has come from our VOB that is by definition read-only
6076
            #
6224
            #
6077
            CORE::chmod oct("0755"), $m_nfileLoc;
6225
            CORE::chmod oct("0755"), $m_nfileLoc;
6078
 
6226
 
6079
        }
6227
        }
6080
        else
6228
        else
6081
        {
6229
        {
6082
            LogError("Failed to copy lib [$m_sfileLoc]: $!"); 
6230
            Error("Failed to copy lib [$m_sfileLoc]: $!"); 
6083
        }
6231
        }
6084
    }
6232
    }
6085
    else
6233
    else
6086
    {
6234
    {
6087
        LogError("Deploy file [$m_sfileLoc] does not exist.");
6235
        Error("Deploy file [$m_sfileLoc] does not exist.");
6088
    }
6236
    }
6089
 
6237
 
6090
    return 1;
6238
    return 1;
6091
}
6239
}
6092
 
6240
 
Line 6104... Line 6252...
6104
#------------------------------------------------------------------------------
6252
#------------------------------------------------------------------------------
6105
{
6253
{
6106
   # correct number of parameters?
6254
   # correct number of parameters?
6107
    if ( ($#_+1) != 1 )
6255
    if ( ($#_+1) != 1 )
6108
    {
6256
    {
6109
        LogError("Incorrect number of params passed to " .
6257
        Error("Incorrect number of params passed to " .
6110
                  "getGenericNameForLib() function. Check deploy config.");
6258
                  "getGenericNameForLib() function. Check deploy config.");
6111
    }
6259
    }
6112
 
6260
 
6113
    # lets just check to see if we can execute this function on
6261
    # lets just check to see if we can execute this function on
6114
    # this machine.
6262
    # this machine.
6115
    #
6263
    #
6116
    if ( "$MachType" ne "sparc" )
6264
    if ( "$MachType" ne "sparc" )
6117
    {
6265
    {
6118
        LogInfo("getGenericNameForLib() not supported on this machine type.");
6266
        Verbose("getGenericNameForLib() not supported on this machine type.");
6119
        return "";
6267
        return "";
6120
    }
6268
    }
6121
 
6269
 
6122
 
6270
 
6123
    my($itemName) = @_;
6271
    my($itemName) = @_;
Line 6125... Line 6273...
6125
    # first we need to check to see if it belongs in this build
6273
    # first we need to check to see if it belongs in this build
6126
    #
6274
    #
6127
    my ($gName) = "";
6275
    my ($gName) = "";
6128
    if(excludeItemFromBuild($itemName))
6276
    if(excludeItemFromBuild($itemName))
6129
    {
6277
    {
6130
        LogInfo("Excluding item [$itemName] from build as not compatible with build type " .
6278
        Verbose("Excluding item [$itemName] from build as not compatible with build type " .
6131
                "[$BuildType].");
6279
                "[$BuildType].");
6132
        return "";  # file should be excluded.
6280
        return "";  # file should be excluded.
6133
    }
6281
    }
6134
    else
6282
    else
6135
    {
6283
    {
Line 6156... Line 6304...
6156
#------------------------------------------------------------------------------
6304
#------------------------------------------------------------------------------
6157
{
6305
{
6158
   # correct number of parameters?
6306
   # correct number of parameters?
6159
    if ( ($#_+1) != 1 )
6307
    if ( ($#_+1) != 1 )
6160
    {
6308
    {
6161
        LogError("Incorrect number of params passed to " .
6309
        Error("Incorrect number of params passed to " .
6162
                  "getGenericNameNoVersionForLib() function. Check deploy config.");
6310
                  "getGenericNameNoVersionForLib() function. Check deploy config.");
6163
    }
6311
    }
6164
 
6312
 
6165
    # lets just check to see if we can execute this function on
6313
    # lets just check to see if we can execute this function on
6166
    # this machine.
6314
    # this machine.
6167
    #
6315
    #
6168
    if ( "$MachType" ne "sparc" )
6316
    if ( "$MachType" ne "sparc" )
6169
    {
6317
    {
6170
        LogInfo("getGenericNameNoVersionForLib() not supported on this machine type.");
6318
        Verbose("getGenericNameNoVersionForLib() not supported on this machine type.");
6171
        return "";
6319
        return "";
6172
    }
6320
    }
6173
 
6321
 
6174
 
6322
 
6175
    my($itemName) = @_;
6323
    my($itemName) = @_;
Line 6177... Line 6325...
6177
    # first we need to check to see if it belongs in this build
6325
    # first we need to check to see if it belongs in this build
6178
    #
6326
    #
6179
    my ($gName) = "";
6327
    my ($gName) = "";
6180
    if(excludeItemFromBuild($itemName))
6328
    if(excludeItemFromBuild($itemName))
6181
    {
6329
    {
6182
        LogInfo("Excluding item [$itemName] from build as not compatible with build type " .
6330
        Verbose("Excluding item [$itemName] from build as not compatible with build type " .
6183
                "[$BuildType].");
6331
                "[$BuildType].");
6184
        return "";  # file should be excluded.
6332
        return "";  # file should be excluded.
6185
    }
6333
    }
6186
    else
6334
    else
6187
    {
6335
    {
Line 6203... Line 6351...
6203
#------------------------------------------------------------------------------
6351
#------------------------------------------------------------------------------
6204
{
6352
{
6205
   # correct number of parameters?
6353
   # correct number of parameters?
6206
    if ( ($#_+1) != 1 )
6354
    if ( ($#_+1) != 1 )
6207
    {
6355
    {
6208
        LogError("Incorrect number of params passed to " .
6356
        Error("Incorrect number of params passed to " .
6209
                  "getGenericNameNoVersionForXML() function. Check deploy config.");
6357
                  "getGenericNameNoVersionForXML() function. Check deploy config.");
6210
    }
6358
    }
6211
 
6359
 
6212
    my($itemName) = @_;
6360
    my($itemName) = @_;
6213
    my ($gName) = "";
6361
    my ($gName) = "";
Line 6241... Line 6389...
6241
        # if we match lets deal with it.
6389
        # if we match lets deal with it.
6242
        $nfile =~ s/_[0-9]+_[0-9]+_[0-9]+\.xml$/\.xml/;
6390
        $nfile =~ s/_[0-9]+_[0-9]+_[0-9]+\.xml$/\.xml/;
6243
    }
6391
    }
6244
    else
6392
    else
6245
    {
6393
    {
6246
        LogWarn("Filename [$nfile] does not contain required format [myfile_N_N_N.xml].");
6394
        Warning("Filename [$nfile] does not contain required format [myfile_N_N_N.xml].");
6247
    }
6395
    }
6248
    return "$nfile";
6396
    return "$nfile";
6249
}
6397
}
6250
 
6398
 
6251
 
6399
 
Line 6259... Line 6407...
6259
#------------------------------------------------------------------------------
6407
#------------------------------------------------------------------------------
6260
{
6408
{
6261
    # correct number of parameters?
6409
    # correct number of parameters?
6262
    if ( ($#_+1) != 1 )
6410
    if ( ($#_+1) != 1 )
6263
    {
6411
    {
6264
        LogError("Incorrect number of params passed to " .
6412
        Error("Incorrect number of params passed to " .
6265
                  "createDpkgArchive() function. Check deploy config.");
6413
                  "createDpkgArchive() function. Check deploy config.");
6266
    }
6414
    }
6267
 
6415
 
6268
    my ($desc) = @_;
6416
    my ($desc) = @_;
6269
 
6417
 
6270
    # lets just check to see if we can execute this function on
6418
    # lets just check to see if we can execute this function on
6271
    # for  this build.
6419
    # for  this build.
6272
    #
6420
    #
6273
    if ( "x$PkgPatchNum" ne "x" )
6421
    if ( "x$PkgPatchNum" ne "x" )
6274
    {
6422
    {
6275
        LogInfo("createDpkgArchive() can only be called during a RELEASE build.");
6423
        Verbose("createDpkgArchive() can only be called during a RELEASE build.");
6276
        return 1;
6424
        return 1;
6277
    }
6425
    }
6278
 
6426
 
6279
 
6427
 
6280
    # 1. we create a dpkg_archive top level dir within the output directory
6428
    # 1. we create a dpkg_archive top level dir within the output directory
6281
    #
6429
    #
6282
    my ($m_tmpDir) = "$PkgBaseDir/dpkg_archive";
6430
    my ($m_tmpDir) = "$PkgBaseDir/dpkg_archive";
6283
    if ( ! -d $m_tmpDir )
-
 
6284
    {
-
 
6285
        mkdir("$m_tmpDir", 0777);
6431
    make_directory( $m_tmpDir, 0777 );
6286
        LogInfo("created [$m_tmpDir] dir...");
-
 
6287
    }
-
 
6288
    
6432
 
6289
    # 2. we create a sub-directory with the package name
6433
    # 2. we create a sub-directory with the package name
6290
    #
6434
    #
6291
    $m_tmpDir = "$PkgBaseDir/dpkg_archive/$TargetBaseDir";
6435
    $m_tmpDir = "$PkgBaseDir/dpkg_archive/$TargetBaseDir";
6292
    if ( ! -d $m_tmpDir )
-
 
6293
    {
-
 
6294
        mkdir("$m_tmpDir", 0777);
6436
    make_directory( $m_tmpDir, 0777 );
6295
        LogInfo("created [$m_tmpDir] dir...");
-
 
6296
    }
-
 
6297
 
6437
 
6298
    # 3. we create a sub-directory with the package version number
6438
    # 3. we create a sub-directory with the package version number
6299
    #
6439
    #
6300
    my ($m_tmpDir2) = "$PkgBaseDir/dpkg_archive/$TargetBaseDir/" .
6440
    my ($m_tmpDir2) = "$PkgBaseDir/dpkg_archive/$TargetBaseDir/" .
6301
                      "$PkgVersion" .  "." . "$ProjectAcronym";
6441
                      "$PkgVersion" .  "." . "$ProjectAcronym";
6302
    if ( ! -d $m_tmpDir2 )
-
 
6303
    {
-
 
6304
        mkdir("$m_tmpDir2", 0777);
6442
    make_directory( $m_tmpDir2, 0777 );
6305
        LogInfo("created [$m_tmpDir2] dir...");
-
 
6306
    }
-
 
6307
 
6443
 
6308
 
6444
 
6309
    # 4. we replacate the contents of the original outputdir/package name
6445
    # 4. we replacate the contents of the original outputdir/package name
6310
    #    to do this we shall execute a find starting within the original package target dir
6446
    #    to do this we shall execute a find starting within the original package target dir
6311
    #    any copy all items we find to the new location under the dpkg_archive/package/version dir.
6447
    #    any copy all items we find to the new location under the dpkg_archive/package/version dir.
Line 6319... Line 6455...
6319
 
6455
 
6320
    # now we need to update the prototype file
6456
    # now we need to update the prototype file
6321
    #
6457
    #
6322
    local *FILE;
6458
    local *FILE;
6323
    open ( FILE, ">> $m_DescPkgFile") or
6459
    open ( FILE, ">> $m_DescPkgFile") or
6324
        LogError("Failed to open file [$m_DescPkgFile].");
6460
        Error("Failed to open file [$m_DescPkgFile].");
6325
    printf FILE ("$PkgName, $PkgVersion.$ProjectAcronym - $desc\n");
6461
    printf FILE ("$PkgName, $PkgVersion.$ProjectAcronym - $desc\n");
6326
    close (FILE);
6462
    close (FILE);
6327
   
6463
   
6328
 
6464
 
6329
    # done.
6465
    # done.
6330
    LogNorm("createDpkgArchive() completed.");
6466
    Information("createDpkgArchive() completed.");
6331
 
6467
 
6332
    return 1;
6468
    return 1;
6333
}
6469
}
6334
 
6470
 
6335
 
6471
 
Line 6356... Line 6492...
6356
        my ($m_sfile) = $item;
6492
        my ($m_sfile) = $item;
6357
        $item =~ s/$PkgBaseDir\/$TargetBaseDir/$PkgBaseDir\/dpkg_archive\/$TargetBaseDir\/$PkgVersion\.$ProjectAcronym/;
6493
        $item =~ s/$PkgBaseDir\/$TargetBaseDir/$PkgBaseDir\/dpkg_archive\/$TargetBaseDir\/$PkgVersion\.$ProjectAcronym/;
6358
 
6494
 
6359
        if(File::Copy::copy("$m_sfile", "$item"))
6495
        if(File::Copy::copy("$m_sfile", "$item"))
6360
        {
6496
        {
6361
            LogNorm("Copied [$base] to [$item] ...");
6497
            Verbose("Copied [$base] to [$item] ...");
6362
        }
6498
        }
6363
        else
6499
        else
6364
        {
6500
        {
6365
            LogError("Failed to copy pkg file [$m_sfile] to [$item]: $!");
6501
            Error("Failed to copy pkg file [$m_sfile] to [$item]: $!");
6366
        }
6502
        }
6367
    }
6503
    }
6368
    else
6504
    else
6369
    {
6505
    {
6370
        # we have found a dir
6506
        # we have found a dir
6371
        my ($m_sDir) = $item;
6507
        my ($m_sDir) = $item;
6372
        $item =~ s/$PkgBaseDir\/$TargetBaseDir/$PkgBaseDir\/dpkg_archive\/$TargetBaseDir\/$PkgVersion\.$ProjectAcronym/;
6508
        $item =~ s~$PkgBaseDir/$TargetBaseDir~$PkgBaseDir/dpkg_archive/$TargetBaseDir/$PkgVersion\.$ProjectAcronym~;
6373
 
-
 
6374
        # if the dir does not exist lets create it
-
 
6375
        # 
-
 
6376
        if ( ! -d $item)
-
 
6377
        {
-
 
6378
            mkdir ( $item, 0777 );
6509
        make_directory( $item, 0777 );
6379
        }
-
 
6380
 
-
 
6381
    }
6510
    }
6382
}
6511
}
6383
 
6512
 
6384
 
6513
 
6385
 
6514
 
Line 6389... Line 6518...
6389
#
6518
#
6390
#    Description:
6519
#    Description:
6391
#        This is called to update the RM class objects with details from RM database
6520
#        This is called to update the RM class objects with details from RM database
6392
#------------------------------------------------------------------------------
6521
#------------------------------------------------------------------------------
6393
{
6522
{
-
 
6523
    #
-
 
6524
    #   If this script is invoked by the AutoBuildTool, then we may not be able
-
 
6525
    #   to create a Release Note as the RM entry may not be available. More over
-
 
6526
    #   the ABT will create a release note as the package is made official
-
 
6527
    #
-
 
6528
    if ( $autobuild )
-
 
6529
    {
-
 
6530
        Debug('getRmDetails: AutoBuild Environment supresses function');
-
 
6531
        return;
-
 
6532
    }
-
 
6533
 
-
 
6534
 
6394
    if ( ! defined($RmPkgDetails) )
6535
    if ( ! defined($RmPkgDetails) )
6395
    {
6536
    {
6396
        # Set defaults for elements in RM if not found
6537
        # Set defaults for elements in RM if not found
6397
        DeployUtils::RmPkgInfo->DefaultDescription($PkgDesc);
6538
        DeployUtils::RmPkgInfo->DefaultDescription($PkgDesc);
6398
        DeployUtils::RmPkgInfo->DefaultLabel($PkgLabel);
6539
        DeployUtils::RmPkgInfo->DefaultLabel($PkgLabel);
Line 6406... Line 6547...
6406
        {
6547
        {
6407
            $RmPvPkgDetails = DeployUtils::RmPkgInfo->new( { PKG_NAME => $PkgName, 
6548
            $RmPvPkgDetails = DeployUtils::RmPkgInfo->new( { PKG_NAME => $PkgName, 
6408
                                                             PKG_VERSION => $PkgPreviousVersionStr } );
6549
                                                             PKG_VERSION => $PkgPreviousVersionStr } );
6409
            if ( $RmPvPkgDetails->foundDetails() )
6550
            if ( $RmPvPkgDetails->foundDetails() )
6410
            {
6551
            {
-
 
6552
                sub MultiLineVerb
-
 
6553
                {
-
 
6554
                    my ($prefix, $text ) = @_;
-
 
6555
                    my $zap = 0;
-
 
6556
 
-
 
6557
                    foreach my $line ( split /[\r\n]+/, $text  )
-
 
6558
                    {
-
 
6559
                        Verbose($prefix . "[" . $line . "]");
-
 
6560
                        unless ( $zap )
-
 
6561
                        {
-
 
6562
                            $prefix = ' ' x length($prefix);
-
 
6563
                            $zap = 1;
-
 
6564
                        }
-
 
6565
                    }
-
 
6566
                }
-
 
6567
 
6411
                LogNorm("Retrieved Package Details from Release Manager");
6568
                Information("Retrieved Package Details from Release Manager");
-
 
6569
                if ( IsVerbose(1) )
-
 
6570
                {
6412
                LogInfo("RM pkg_name       = [" . $RmPkgDetails->pkg_name()       . "]");
6571
                    MultiLineVerb("RM pkg_name       = ",  $RmPkgDetails->pkg_name()       );
6413
                LogInfo("RM pkg_id         = [" . $RmPkgDetails->pkg_id()         . "]");
6572
                    MultiLineVerb("RM pkg_id         = ",  $RmPkgDetails->pkg_id()         );
6414
                LogInfo("RM pv_id          = [" . $RmPkgDetails->pv_id()          . "]");
6573
                    MultiLineVerb("RM pv_id          = ",  $RmPkgDetails->pv_id()          );
6415
                LogInfo("RM pv_description = [" . $RmPkgDetails->pv_description() . "]");
6574
                    MultiLineVerb("RM pv_description = ",  $RmPkgDetails->pv_description() );
6416
                LogInfo("RM pv_overview    = [" . $RmPkgDetails->pv_overview()    . "]");
6575
                    MultiLineVerb("RM pv_overview    = ",  $RmPkgDetails->pv_overview()    );
6417
                LogInfo("RM pv_reason      = [" . $RmPkgDetails->pv_reason()      . "]");
6576
                    MultiLineVerb("RM pv_reason      = ",  $RmPkgDetails->pv_reason()      );
6418
                LogInfo("RM pv_label       = [" . $RmPkgDetails->pv_label()       . "]");
6577
                    MultiLineVerb("RM pv_label       = ",  $RmPkgDetails->pv_label()       );
6419
                LogInfo("RM previousPv_id  = [" . $RmPvPkgDetails->pv_id()        . "]");
6578
                    MultiLineVerb("RM previousPv_id  = ",  $RmPvPkgDetails->pv_id()        );
6420
                LogInfo("RM pv_dlocked     = [" . $RmPvPkgDetails->pv_dlocked()   . "]");
6579
                    MultiLineVerb("RM pv_dlocked     = ",  $RmPvPkgDetails->pv_dlocked()   );
-
 
6580
                }
6421
            }
6581
            }
6422
            else
6582
            else
6423
            {
6583
            {
6424
                # our package does not exist in release manager
6584
                # our package does not exist in release manager
6425
                LogWarn("Could not retrieve package $PkgName $PkgVersionUser previous version " .
6585
                Warning("Could not retrieve package $PkgName $PkgVersionUser previous version " .
6426
                        "details from Release Manager.")
6586
                        "details from Release Manager.")
6427
            }
6587
            }
6428
        }
6588
        }
6429
        else
6589
        else
6430
        {
6590
        {
6431
            # our package does not exist in release manager 
6591
            # our package does not exist in release manager 
6432
            LogWarn("Package $PkgName $PkgVersionUser does not exist in the Release Manager. Please check configuration.") 
6592
            Warning("Package $PkgName $PkgVersionUser does not exist in the Release Manager",
-
 
6593
                    "Please check configuration.")
6433
        }
6594
        }
6434
    }
6595
    }
6435
}  
6596
}  
6436
 
6597
 
6437
 
6598
 
6438
 
6599
 
6439
# This is now depricated
6600
# This is now depricated
6440
sub generateReleaseNote
6601
sub generateReleaseNote
6441
{
6602
{
6442
    LogError("generateReleaseNote is depricated please use generateHtmlReleaseNote");
6603
    Error("generateReleaseNote is depricated please use generateHtmlReleaseNote");
6443
    return 1;
6604
    return 1;
6444
}
6605
}
6445
 
6606
 
6446
 
6607
 
6447
 
6608
 
Line 6458... Line 6619...
6458
    #   to create a Release Note as the RM entry may not be available. More over
6619
    #   to create a Release Note as the RM entry may not be available. More over
6459
    #   the ABT will create a release note as the package is made official
6620
    #   the ABT will create a release note as the package is made official
6460
    #
6621
    #
6461
    if ( $autobuild )
6622
    if ( $autobuild )
6462
    {
6623
    {
6463
        LogWarn('AutoBuild Environment. Release notes generated later');
6624
        Warning('AutoBuild Environment. Release notes generated later');
6464
        return;
6625
        return;
6465
    }
6626
    }
6466
 
6627
 
6467
    #
6628
    #
6468
    #   Ensure the Release directory is present
6629
    #   Ensure the Release directory is present
6469
    #
6630
    #
6470
    if ( ! -d $ReleaseDir )
-
 
6471
    {
-
 
6472
        mkpath ( $ReleaseDir, 0, 0777);
6631
    make_directory( $ReleaseDir, 0777 );
6473
        LogInfo("created [$ReleaseDir] dir...");
-
 
6474
    }
-
 
6475
 
6632
 
6476
    if ( ! getRmReleaseNote() )
6633
    if ( ! getRmReleaseNote() )
6477
    {
6634
    {
6478
        LogError("No Release Manager details, release note not generated.");
6635
        Error("No Release Manager details, release note not generated.");
6479
    }
6636
    }
6480
}
6637
}
6481
 
6638
 
6482
 
6639
 
6483
 
6640
 
Line 6500... Line 6657...
6500
    # let's update the release contents now
6657
    # let's update the release contents now
6501
    #
6658
    #
6502
    generateProductContents();
6659
    generateProductContents();
6503
 
6660
 
6504
 
6661
 
6505
    LogNorm("Retrieving Release Notes From Release Manager...Please wait...");
6662
    Information("Retrieving Release Notes From Release Manager...Please wait...");
6506
 
6663
 
6507
    my $user_agent = LWP::UserAgent->new( timeout => 30 );
6664
    my $user_agent = LWP::UserAgent->new( timeout => 30 );
6508
    my $response = $user_agent->get('http://erg:8002/ManagerSuite/Release_Manager/_adhoc_release_notes.asp?pv_id='. $RmPkgDetails->pv_id(), 
6665
    my $response = $user_agent->get('http://erg:8002/ManagerSuite/Release_Manager/_adhoc_release_notes.asp?pv_id='. $RmPkgDetails->pv_id(), 
6509
                                    ':content_file' => "$PkgReleaseNote\.html");
6666
                                    ':content_file' => "$PkgReleaseNote\.html");
6510
    if ( $response->is_success )
6667
    if ( $response->is_success )
6511
    {
6668
    {
6512
        LogNorm("Retrieved Release Manager HTML Release note [$PkgReleaseNote\.html]");
6669
        Verbose("Retrieved Release Manager HTML Release note [$PkgReleaseNote\.html]");
6513
        return 1;
6670
        return 1;
6514
    }
6671
    }
6515
    else
6672
    else
6516
    {
6673
    {
6517
        LogWarn("Unable to retrieve Release Manager Release Notes");
6674
        Warning("Unable to retrieve Release Manager Release Notes");
6518
        return 0;
6675
        return 0;
6519
    }
6676
    }
6520
}
6677
}
6521
 
6678
 
6522
#------------------------------------------------------------------------------
6679
#------------------------------------------------------------------------------
Line 6540... Line 6697...
6540
 
6697
 
6541
        if ( defined ( $depObj ) )
6698
        if ( defined ( $depObj ) )
6542
        {
6699
        {
6543
            if ( $depObj->pkg_version() ne "$versionStr" )
6700
            if ( $depObj->pkg_version() ne "$versionStr" )
6544
            {
6701
            {
6545
                LogWarn("Dependency difference, [$i] Local version $versionStr, RM version " . $depObj->pkg_version());
6702
                Warning("Dependency difference, [$i] Local version $versionStr, RM version " . $depObj->pkg_version());
6546
                $retValue = 1;
6703
                $retValue = 1;
6547
            }
6704
            }
6548
        }  
6705
        }  
6549
        else
6706
        else
6550
        {
6707
        {
6551
            LogWarn("Dependency difference, [$i] Cannot locate archive in Release Manager database.");
6708
            Warning("Dependency difference, [$i] Cannot locate archive in Release Manager database.");
6552
            $retValue = 1;
6709
            $retValue = 1;
6553
        }
6710
        }
6554
    }
6711
    }
6555
 
6712
 
6556
    # lets check to see if we detected a difference 
6713
    # lets check to see if we detected a difference 
6557
    if ( $retValue != 0 )
6714
    if ( $retValue != 0 )
6558
    { 
6715
    { 
6559
        LogError("Difference detected between the local build.pl and Release Manager config. " .
6716
        Error("Difference detected between the local build.pl and Release Manager config.",
6560
                 "Please check Release Manager configuration.");
6717
              "Please check Release Manager configuration.");
6561
    }
6718
    }
6562
 
6719
 
6563
 
6720
 
6564
 
6721
 
6565
    # now we check release manager details against our local ones
6722
    # now we check release manager details against our local ones
Line 6582... Line 6739...
6582
            $versionStr .= "\.$moduleInfo->{proj}" if ( $moduleInfo->{proj} ne "" );
6739
            $versionStr .= "\.$moduleInfo->{proj}" if ( $moduleInfo->{proj} ne "" );
6583
            my $depObj = $RmPkgDetails->getDependencyObject($i);
6740
            my $depObj = $RmPkgDetails->getDependencyObject($i);
6584
 
6741
 
6585
            if ( $depObj->pkg_version() ne "$versionStr" )
6742
            if ( $depObj->pkg_version() ne "$versionStr" )
6586
            {
6743
            {
6587
                LogWarn("Dependency difference, [$i] local version $versionStr, RM version " . $depObj->pkg_version());
6744
                Warning("Dependency difference, [$i] local version $versionStr, RM version " . $depObj->pkg_version());
6588
                $retValue = 1;
6745
                $retValue = 1;
6589
            }
6746
            }
6590
        }  
6747
        }  
6591
        else
6748
        else
6592
        {
6749
        {
6593
            LogWarn("Dependency difference, cannot locate archive [$i] in local build.pl.");
6750
            Warning("Dependency difference, cannot locate archive [$i] in local build.pl.");
6594
            $retValue = 1;
6751
            $retValue = 1;
6595
        }
6752
        }
6596
    }
6753
    }
6597
 
6754
 
6598
    # lets check to see if we detected a difference 
6755
    # lets check to see if we detected a difference 
6599
    if ( $retValue != 0 )
6756
    if ( $retValue != 0 )
6600
    { 
6757
    { 
6601
        LogError("Difference detected between Release Manager config and the local build.pl. " .
6758
        Error("Difference detected between Release Manager config and the local build.pl. ",
6602
                 "Please check the local configuration.");
6759
               "Please check the local configuration.");
6603
    }
6760
    }
6604
 
6761
 
6605
    return 1;
6762
    return 1;
6606
}
6763
}
6607
 
6764
 
Line 6622... Line 6779...
6622
    # lets just check to see if we can execute this function on
6779
    # lets just check to see if we can execute this function on
6623
    # this machine.
6780
    # this machine.
6624
    #
6781
    #
6625
    if ( "$MachType" ne "win32" )
6782
    if ( "$MachType" ne "win32" )
6626
    {
6783
    {
6627
        LogNorm("createPerlSvcWin32() not supported on this machine type.");
6784
        Information("createPerlSvcWin32() not supported on this machine type.");
6628
        return 1;
6785
        return 1;
6629
    }
6786
    }
6630
 
6787
 
6631
 
6788
 
6632
    my ($m_srcDirTag, $m_sfile, $m_targetDirTag, $m_ofile, @m_libDirTags) = @_;
6789
    my ($m_srcDirTag, $m_sfile, $m_targetDirTag, $m_ofile, @m_libDirTags) = @_;
Line 6647... Line 6804...
6647
    }
6804
    }
6648
    if ( -d $DpkgScriptsDir )
6805
    if ( -d $DpkgScriptsDir )
6649
    {
6806
    {
6650
        $_libStr = $_libStr . "$DpkgScriptsDir";
6807
        $_libStr = $_libStr . "$DpkgScriptsDir";
6651
    }
6808
    }
6652
    LogNorm("additional places to look for perl modules, [$_libStr]");
6809
    Verbose("additional places to look for perl modules, [$_libStr]");
6653
 
6810
 
6654
 
6811
 
6655
    # lets get the target dir value
6812
    # lets get the target dir value
6656
    my ($m_srcDirValue) = getLocalDirValue($m_srcDirTag, "A");
6813
    my ($m_srcDirValue) = getLocalDirValue($m_srcDirTag, "A");
6657
 
6814
 
Line 6666... Line 6823...
6666
    # lets execute the package commands.
6823
    # lets execute the package commands.
6667
    my ($retVal);
6824
    my ($retVal);
6668
    $retVal = system("$_cmdStr");
6825
    $retVal = system("$_cmdStr");
6669
    if ( $retVal != 0 )
6826
    if ( $retVal != 0 )
6670
    {
6827
    {
6671
        LogError("Failed to complete command [$_cmdStr].");
6828
        Error("Failed to complete command [$_cmdStr].");
6672
    }
6829
    }
6673
 
6830
 
6674
    # done.
6831
    # done.
6675
    return 1;
6832
    return 1;
6676
}
6833
}
Line 6691... Line 6848...
6691
    # lets just check to see if we can execute this function on
6848
    # lets just check to see if we can execute this function on
6692
    # this machine.
6849
    # this machine.
6693
    #
6850
    #
6694
    if ( "$MachType" ne "win32" )
6851
    if ( "$MachType" ne "win32" )
6695
    {
6852
    {
6696
        LogNorm("createPerlAppWin32() not supported on this machine type.");
6853
        Information("createPerlAppWin32() not supported on this machine type.");
6697
        return 1;
6854
        return 1;
6698
    }
6855
    }
6699
 
6856
 
6700
 
6857
 
6701
    my ($m_srcDirTag, $m_sfile, $m_targetDirTag, $m_ofile, @m_libDirTags) = @_;
6858
    my ($m_srcDirTag, $m_sfile, $m_targetDirTag, $m_ofile, @m_libDirTags) = @_;
Line 6716... Line 6873...
6716
    }
6873
    }
6717
    if ( -d $DpkgScriptsDir )
6874
    if ( -d $DpkgScriptsDir )
6718
    {
6875
    {
6719
        $_libStr = $_libStr . "$DpkgScriptsDir";
6876
        $_libStr = $_libStr . "$DpkgScriptsDir";
6720
    }
6877
    }
6721
    LogNorm("additional places to look for perl modules, [$_libStr]");
6878
    Verbose("additional places to look for perl modules, [$_libStr]");
6722
 
6879
 
6723
 
6880
 
6724
    # lets get the target dir value
6881
    # lets get the target dir value
6725
    my ($m_srcDirValue) = getLocalDirValue($m_srcDirTag, "A");
6882
    my ($m_srcDirValue) = getLocalDirValue($m_srcDirTag, "A");
6726
 
6883
 
Line 6735... Line 6892...
6735
    # lets execute the package commands.
6892
    # lets execute the package commands.
6736
    my ($retVal);
6893
    my ($retVal);
6737
    $retVal = system("$_cmdStr");
6894
    $retVal = system("$_cmdStr");
6738
    if ( $retVal != 0 )
6895
    if ( $retVal != 0 )
6739
    {
6896
    {
6740
        LogError("Failed to complete command [$_cmdStr].");
6897
        Error("Failed to complete command [$_cmdStr].");
6741
    }
6898
    }
6742
 
6899
 
6743
    # done.
6900
    # done.
6744
    return 1;
6901
    return 1;
6745
}
6902
}
Line 6769... Line 6926...
6769
    {
6926
    {
6770
        # lets zap the product contents
6927
        # lets zap the product contents
6771
        # only if the release manager entry is not locked.
6928
        # only if the release manager entry is not locked.
6772
        if ( $RmPkgDetails->pv_dlocked() ne "Y" )
6929
        if ( $RmPkgDetails->pv_dlocked() ne "Y" )
6773
        {
6930
        {
6774
           LogError("Failed to zap product contents.")
6931
           Error("Failed to zap product contents.")
6775
                if ( ! $RmPkgDetails->zapProductContents( $Platform ) );
6932
                if ( ! $RmPkgDetails->zapProductContents( $Platform ) );
6776
        }
6933
        }
6777
 
6934
 
6778
 
6935
 
6779
        # lets get a listing of the products contents
6936
        # lets get a listing of the products contents
6780
        #
6937
        #
6781
        File::Find::find( \&ProductContentsFind, "$PkgBaseDir/$TargetBaseDir");
6938
        File::Find::find( \&ProductContentsFind, "$PkgBaseDir/$TargetBaseDir");
6782
    }
6939
    }
6783
    else
6940
    else
6784
    {
6941
    {
6785
        LogWarn("Unable to load product contents because we do not have a connection to Release Manager.");
6942
        Warning("Unable to load product contents because we do not have a connection to Release Manager.");
6786
    }
6943
    }
6787
 
6944
 
6788
 
6945
 
6789
    # done
6946
    # done
6790
    return 1;
6947
    return 1;
Line 6830... Line 6987...
6830
        {
6987
        {
6831
            $cksumStr  = `cksum "$item"`;
6988
            $cksumStr  = `cksum "$item"`;
6832
            $retVal    = $? / 256;
6989
            $retVal    = $? / 256;
6833
            if ( $retVal != 0 )
6990
            if ( $retVal != 0 )
6834
            {
6991
            {
6835
                LogError("Failed to determine cksum for product content item [$item].") 
6992
                Error("Failed to determine cksum for product content item [$item].") 
6836
            }
6993
            }
6837
            else
6994
            else
6838
            {
6995
            {
6839
                chomp($cksumStr);
6996
                chomp($cksumStr);
6840
                $cksumStr =~ s/^\s+|\s+$//g;
6997
                $cksumStr =~ s/^\s+|\s+$//g;
Line 6865... Line 7022...
6865
 
7022
 
6866
            # we only mess with the product contents
7023
            # we only mess with the product contents
6867
            # if the package is not released.
7024
            # if the package is not released.
6868
            if ( $RmPkgDetails->pv_dlocked() ne "Y" )
7025
            if ( $RmPkgDetails->pv_dlocked() ne "Y" )
6869
            {
7026
            {
6870
                LogError("Failed to insert product content item.")
7027
                Error("Failed to insert product content item.")
6871
                     if ( ! $RmPkgDetails->insertProductContentItem( $Target, $cksumPath, $cksumName, '', $cksumSize, $cksumValue) );
7028
                     if ( ! $RmPkgDetails->insertProductContentItem( $Target, $cksumPath, $cksumName, '', $cksumSize, $cksumValue) );
6872
            }
7029
            }
6873
            else
7030
            else
6874
            {
7031
            {
6875
                LogInfo("product item - $Target, $cksumPath, $cksumName, '', $cksumSize, $cksumValue");
7032
                Verbose("product item - $Target, $cksumPath, $cksumName, '', $cksumSize, $cksumValue");
6876
            }
7033
            }
6877
        }
7034
        }
6878
        else
7035
        else
6879
        {
7036
        {
6880
            $cksumPath =~ s/$/\//;
7037
            $cksumPath =~ s/$/\//;
6881
            if ( $RmPkgDetails->pv_dlocked() ne "Y" )
7038
            if ( $RmPkgDetails->pv_dlocked() ne "Y" )
6882
            {
7039
            {
6883
               LogError("Failed to insert product content item.")
7040
               Error("Failed to insert product content item.")
6884
                     if ( ! $RmPkgDetails->insertProductContentItem( $Target, $cksumPath, '', '', 0, '') );
7041
                     if ( ! $RmPkgDetails->insertProductContentItem( $Target, $cksumPath, '', '', 0, '') );
6885
            }
7042
            }
6886
            else
7043
            else
6887
            {
7044
            {
6888
                LogInfo("product dir - $Target, $cksumPath, '', '', 0, ''");
7045
                Verbose("product dir - $Target, $cksumPath, '', '', 0, ''");
6889
            }
7046
            }
6890
        }
7047
        }
6891
    }
7048
    }
6892
}
7049
}
6893
 
7050
 
-
 
7051
#-------------------------------------------------------------------------------
-
 
7052
# Function        : make_directory
-
 
7053
#
-
 
7054
# Description     : Create a directory if it does not already exist
-
 
7055
#                   Simple function to provide user messages on the way
-
 
7056
#                   Will create a complete path. There is no need to
-
 
7057
#                   break it into bits.
-
 
7058
#
-
 
7059
# Inputs          : name        - path to the directory
-
 
7060
#                   umask       - umask
-
 
7061
#                   text        - User text (optional)
-
 
7062
#
-
 
7063
# Returns         :
-
 
7064
#
-
 
7065
 
-
 
7066
sub make_directory
-
 
7067
{
-
 
7068
    my ($name, $umask, $text ) = @_;
-
 
7069
 
-
 
7070
    Error ("make_directory needs a umask") unless ( $umask );
-
 
7071
    Error ("make_directory needs a path") unless ( $name );
-
 
7072
    $text = "Create directory"  unless ( $text );
-
 
7073
 
-
 
7074
    my $umask_text = sprintf( "0%o", $umask );
-
 
7075
 
-
 
7076
    unless ( -d $name )
-
 
7077
    {
-
 
7078
        Verbose ( "$text: $name [$umask_text]");
-
 
7079
        mkpath ( $name, 0, $umask);
-
 
7080
    }
-
 
7081
    else
-
 
7082
    {
-
 
7083
        Verbose2 ( "$text: $name [$umask_text] - already exists");
-
 
7084
    }
-
 
7085
}
-
 
7086
 
6894
#------------------------------------------------------------------------------
7087
#------------------------------------------------------------------------------
6895
1;
7088
1;