Subversion Repositories DevTools

Rev

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

Rev 2931 Rev 3967
Line 31... Line 31...
31
use JatsProperties;
31
use JatsProperties;
32
use JatsEnv;
32
use JatsEnv;
33
use ConfigurationFile;
33
use ConfigurationFile;
34
use JatsSvn qw(:All);
34
use JatsSvn qw(:All);
35
use JatsLocateFiles;
35
use JatsLocateFiles;
-
 
36
use JatsBuildFiles;
36
use Encode;
37
use Encode;
37
 
38
 
38
 
39
 
39
#use Data::Dumper;
40
#use Data::Dumper;
40
use Fcntl ':flock'; # import LOCK_* constants
41
use Fcntl ':flock'; # import LOCK_* constants
Line 69... Line 70...
69
my $opt_workDir = '/work';
70
my $opt_workDir = '/work';
70
my $opt_vobMap;
71
my $opt_vobMap;
71
my $opt_preserveProjectBase;
72
my $opt_preserveProjectBase;
72
my $opt_ignoreProjectBaseErrors;
73
my $opt_ignoreProjectBaseErrors;
73
my $opt_ignoreMakeProjectErrors;
74
my $opt_ignoreMakeProjectErrors;
-
 
75
my $opt_ignoreBuildFileClashes;
74
my $opt_forceProjectBase;
76
my $opt_forceProjectBase;
75
my @opt_limitProjectBase;
77
my @opt_limitProjectBase;
-
 
78
my @opt_selectProjectBase;
76
my @opt_mergePaths;
79
my @opt_mergePaths;
77
my $opt_ignoreBadPaths;
80
my $opt_ignoreBadPaths;
78
my $opt_delete;
81
my $opt_delete;
79
my $opt_recentAge = 14;             # Days
82
my $opt_recentAge = 14;             # Days
80
my $opt_relabel = 0;
83
my $opt_relabel = 0;
Line 85... Line 88...
85
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
88
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
86
my $opt_resume;
89
my $opt_resume;
87
my $opt_processRipples = 1;
90
my $opt_processRipples = 1;
88
my $opt_mergePackages;
91
my $opt_mergePackages;
89
my @opt_deleteFiles;
92
my @opt_deleteFiles;
90
my $opt_PatchIsaRipple;
93
my $opt_useTestRepo;
-
 
94
my $opt_saveCompressed;
-
 
95
my $opt_skipBuildNameCheck;
-
 
96
my $opt_deleteLinks;
-
 
97
my $count_BadPaths = 0;
-
 
98
my $opt_IgnoreBadSourcePath;
-
 
99
my $opt_forceSuck;
91
 
100
 
92
################################################################################
101
################################################################################
93
#   List of Projects Suffixes and Branch Names to be used within SVN
102
#   List of Projects Suffixes and Branch Names to be used within SVN
94
#
103
#
95
#       Name        - Name of branch for the project
104
#       Name        - Name of branch for the project
Line 121... Line 130...
121
    '.pmb'      => { Name => 'Pietermaritzburg' },
130
    '.pmb'      => { Name => 'Pietermaritzburg' },
122
    '.vps'      => { Name => 'VixPayments' },
131
    '.vps'      => { Name => 'VixPayments' },
123
    '.ncc'      => { Name => 'NSWClubCard' },
132
    '.ncc'      => { Name => 'NSWClubCard' },
124
    '.rm'       => { Name => 'Rome' },
133
    '.rm'       => { Name => 'Rome' },
125
    '.vss'      => { Name => 'SmartSite' },
134
    '.vss'      => { Name => 'SmartSite' },
-
 
135
    '.ssts'     => { Name => 'SydneySchoolbus' },
126
    'unknown'   => { Name => 'UnknownProject' },
136
    'unknown'   => { Name => 'UnknownProject' },
127
 
137
 
128
    '.ebr'      => { Name => 'eBrio' , Trunk => 1 },
138
    '.ebr'      => { Name => 'eBrio' , Trunk => 1 },
129
    '.mas'      => { Name => 'Mass'  , Trunk => 1 },
139
    '.mas'      => { Name => 'Mass'  , Trunk => 1 },
130
    '.cr'       => { Name => 'Core'  , Trunk => 1 },
140
    '.cr'       => { Name => 'Core'  , Trunk => 1 },
Line 265... Line 275...
265
    'daf_br_th'                     => 'IgnoreBadPath,all,IgnoreMakeProject', # MakeProject Tested. Bad Paths not used
275
    'daf_br_th'                     => 'IgnoreBadPath,all,IgnoreMakeProject', # MakeProject Tested. Bad Paths not used
266
    'linux_kernel_bcp4600'          => 'ForceProjectBase=/LMOS/linux/kernel',
276
    'linux_kernel_bcp4600'          => 'ForceProjectBase=/LMOS/linux/kernel',
267
    'linux_kernel_viper'            => 'ForceProjectBase=/LMOS/linux/kernel',
277
    'linux_kernel_viper'            => 'ForceProjectBase=/LMOS/linux/kernel',
268
    'linux_kernel_cobra'            => 'ForceProjectBase=/LMOS/linux/kernel',
278
    'linux_kernel_cobra'            => 'ForceProjectBase=/LMOS/linux/kernel',
269
 
279
 
270
    'LinuxDrivers'                  => 'flatTime,processRipples,No-PatchIsaRipple,LimitProjectBase=/LMOS/linux/drivers'.
280
    'LinuxDrivers'                  => 'flatTime,processRipples,LimitProjectBase=/LMOS/linux/drivers'.
271
                                       ',mergePaths=modules:bcp4600:cobra:eb5600:etx86:tp5600:viper',
281
                                       ',mergePaths=modules:bcp4600:cobra:eb5600:etx86:tp5600:viper',
272
 
282
 
273
    'flashCopier'                   => 'flatTime,LimitProjectBase=/LMOS/tools/flashCopier'.
283
    'flashCopier'                   => 'flatTime,LimitProjectBase=/LMOS/tools/flashCopier'.
274
                                       ',mergePaths=+:src:pcp5700:eb5600:tp5600',
284
                                       ',mergePaths=+:src:pcp5700:eb5600:tp5600',
275
 
285
 
Line 283... Line 293...
283
    'linux_day0fs_gen1'            => 'flatTime,LimitProjectBase=/LMOS/linux/filesystems/day0-fs'.
293
    'linux_day0fs_gen1'            => 'flatTime,LimitProjectBase=/LMOS/linux/filesystems/day0-fs'.
284
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:etx86:common'.
294
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:etx86:common'.
285
                                       ',processRipples',
295
                                       ',processRipples',
286
 
296
 
287
    'linux_kernel_gen1'               => 'flatTime,mergePaths=,processRipples,LimitProjectBase=/LMOS/linux/kernel',
297
    'linux_kernel_gen1'               => 'flatTime,mergePaths=,processRipples,LimitProjectBase=/LMOS/linux/kernel',
-
 
298
 
-
 
299
    'serpent'                         => 'flatTime,processRipples,LimitProjectBase=/LMOS/linux/kernel'.
-
 
300
                                         ',mergePaths=serpent-common:common:cobra:viper',
-
 
301
 
288
    'rt3070'                          => 'flatVersion',
302
    'rt3070'                          => 'flatVersion',
289
 
303
 
290
    'TRACS'                           => 'IgnoreMakeProject,DeleteFiles=*.plg',   # not tested
304
    'TRACS'                           => 'IgnoreMakeProject,DeleteFiles=*.plg',   # not tested
291
 
305
 
-
 
306
    'qtobeapp'                        => 'Trunk=.uk',
-
 
307
 
-
 
308
    'br_applets'                      => 'flatTime,LimitProjectBase=/ProjectCD/seattle'.
-
 
309
                                       ',mergePaths=++:build/**:Sales/**:FarePayment/**:KCM/**:unit_test/**:VP/**:WSF/**'.
-
 
310
                                       ',processRipples',
-
 
311
 
-
 
312
    'CDAdministration'      => 'RetainCompressed,IgnoreMakeProject,SelectProjectBase=MASS_Dev_Infra/DeviceCDManagement/cpp/CDAdministrator:MASS_Dev_Infra/CDAdministrator:MASS_Dev_Infra/CDAdministrator_vt:MASS_Dev_Infra/Cda/java:MASS_Dev_Infra/CDA:MASS_Dev_Infra',
-
 
313
    
-
 
314
    'obme'                  => ',IgnoreMakeProject,',
-
 
315
 
-
 
316
    'apportionment'         => 'SkipBuildFileCheck',
-
 
317
    'almgr'                 => 'SkipBuildFileCheck,SelectProjectBase=MASS_Dev_Bus/CBP/al/almgr/cpp:MASS_Dev_Bus/CBP/al/almgr:MASS_Dev_Bus/CBP/al:MASS_Dev_Bus/CBP',
-
 
318
    'cvm'                   => 'SelectProjectBase=MASS_Dev_Bus/CBP/cvm/cpp:MASS_Dev_Bus/CBP/cvm',
-
 
319
    'esvrapi'               => 'SelectProjectBase=MASS_Dev_Bus/CBP/enquiry/esvrapi/cpp:MASS_Dev_Bus/CBP/enquiry/esvrapi',
-
 
320
    'Validation'            => 'SelectProjectBase=MASS_Dev_Bus/CBP/validation/validation/cpp:MASS_Dev_Bus/CBP/validation/validation',
-
 
321
    'txnfilter'             => 'DeleteLinks,SelectProjectBase=MASS_Dev_Bus/CBP/txnfilter/txnfilter:MASS_Dev_Bus/CBP/txnfilter/cpp:MASS_Dev_Bus/CBP/txnfilter',
-
 
322
 
-
 
323
    'card'                  => 'SelectProjectBase=MASS_Dev_Bus/Card/cpp:MASS_Dev_Bus/Card',
-
 
324
    'cbps'                  => 'SelectProjectBase=MASS_Dev_Bus/CBP/cbps/cpp:MASS_Dev_Bus/CBP/cbps:MASS_Dev_Bus/CBP',
-
 
325
    'issuercommon'          => 'SelectProjectBase=MASS_Dev_Bus/Issuer/issuerCommon/cpp:MASS_Dev_Bus/Issuer/issuerCommon',
-
 
326
    'ivp'                   => 'SelectProjectBase=MASS_Dev_Bus/CBP/ivp/ivp/cpp:MASS_Dev_Bus/CBP/ivp/ivp:MASS_Dev_Bus/CBP/ivp:MASS_Dev_Bus/CBP',
-
 
327
 
-
 
328
    'daf_transap_mag'       => 'SelectProjectBase=DPG_SWBase/transap/proxy/mag:DPG_SWBase/transap/proxy',
-
 
329
    'daf_transap_proxyman'  => 'SelectProjectBase=DPG_SWBase/transap/proxymanager',
-
 
330
    'daf_transap_rkf'       => 'SkipBuildFileCheck',
-
 
331
 
-
 
332
    'daf_cd_common'         => 'IgnoreProjectBase',
-
 
333
 
-
 
334
    'altp'                  => 'SelectProjectBase=MASS_Dev_Bus/CBP/al/altp/cpp:MASS_Dev_Bus/CBP/al/altp',
-
 
335
    'cfm'                   => 'SelectProjectBase=MASS_Dev_Bus/CBP/cfm/cpp:MASS_Dev_Bus/CBP/cfm',
-
 
336
    'enqdef'                => 'SelectProjectBase=MASS_Dev_Bus/CBP/enquiry/enqdef',
-
 
337
    'expstat'               => 'SelectProjectBase=MASS_Dev_Bus/CBP/expstat/cpp:MASS_Dev_Bus/CBP/expstat',
-
 
338
    'olsenqxdr'             => 'SelectProjectBase=MASS_Dev_Bus/CBP/enquiry/olsenqxdr/cpp:MASS_Dev_Bus/CBP/enquiry/olsenqxdr',
-
 
339
    'olseod'                => 'SelectProjectBase=MASS_Dev_Bus/CBP/olseod/olseod/cpp:MASS_Dev_Bus/CBP/olseod/olseod:MASS_Dev_Bus/CBP/olseod',
-
 
340
    'streamer'              => 'SelectProjectBase=MASS_Dev_Bus/CBP/streamer/cpp:MASS_Dev_Bus/CBP/streamer',
-
 
341
    'tgen'                  => 'SelectProjectBase=MASS_Dev_Bus/CBP/tgen/cpp:MASS_Dev_Bus/CBP/tgen',
-
 
342
 
-
 
343
    'daf_transap_ultralight'=> 'flatTime,processRipples,mergePaths=++',
-
 
344
#    'daf_cardshark'        => 'flatTime,processRipples,mergePaths=++',
-
 
345
 
-
 
346
    'emv_raw_cs'            => 'flatTime,processRipples,SelectProjectBase=DPG_SWBase/emv_cs/emv_raw_cs/cpf:DPG_SWBase/emv_cs/emv_raw_cs'.
-
 
347
                                    ',mergePaths=++:linux/**:win32/**',
-
 
348
    'OpManCronJob'          => 'SkipBuildFileCheck',
-
 
349
    'issuertest'            => 'SelectProjectBase=MASS_Dev_Bus/Issuer/test/IssuerTest:MASS_Dev_Bus/Issuer/test/cpp:MASS_Dev_Bus/Card/test/cpp:MASS_Dev_Bus/Card/test/cpp',
-
 
350
    'obits_simulator'       => 'IgnoreMakeProject',
-
 
351
    'application'           => 'IgnoreMakeProject,SelectProjectBase=MASS_Dev_Bus/Application',
-
 
352
    'FinCommon'             => 'SkipBuildFileCheck,SelectProjectBase=MASS_Dev_Bus/Financial',
-
 
353
    'FinRun'                => 'SkipBuildFileCheck,SelectProjectBase=MASS_Dev_Bus/Financial',
-
 
354
    'olstxnstream'          => 'SelectProjectBase=MASS_Dev_Infra/core_olstxnstream',
-
 
355
 
-
 
356
    'product'               => 'SkipBuildFileCheck,SelectProjectBase=MASS_Dev_Bus/Product',
-
 
357
    'oracen-bei-patch'      => 'RetainCompressed',
-
 
358
    'oracen-patch'          => 'RetainCompressed',
-
 
359
    'pcv'                   => 'IgnoreMakeProject',
-
 
360
    'summarisation'         => 'SkipBuildFileCheck',
-
 
361
    'AVMApplicationEngine'  => 'IgnoreMakeProject',
-
 
362
    'ESL'                   => 'IgnoreMakeProject',
-
 
363
    'daf_br_oar'            => 'IgnoreProjectBase',         # Look OK
-
 
364
    'daf_br'                => 'RetainCompressed,IgnoreProjectBase,IgnoreMakeProject,SelectProjectBase=DPG_SWBase/daf_br:DPG_SWBase/br',    # Look OK
-
 
365
    'daf_dti'               => 'IgnoreProjectBase,SelectProjectBase=DPG_SWBase/dti;DPG_SWBase',
-
 
366
    'OcpGui'                => 'IgnoreMakeProject',
-
 
367
    'ssu5000'               => 'ForceProjectBase=/DPG_SWCode',
-
 
368
    'obftp'                 => 'IgnoreMakeProject,IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
369
    'saftp'                 => 'IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
370
    'PFTPp'                 => 'IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',        # Need to test
-
 
371
    'ocp5000'               => 'ForceProjectBase=/DPG_SWCode,RetainCompressed,IgnoreMakeProject', # Need to test
-
 
372
    'SPOS'                  => 'ForceProjectBase=/DPG_SWCode',
-
 
373
 
-
 
374
    'gak6000'               => 'ForceProjectBase=/DPG_SWCode,IgnoreProjectBase',
-
 
375
    'gak5000'               => 'ForceProjectBase=/DPG_SWCode,IgnoreProjectBase,IgnoreBadPath',
-
 
376
    'hcp5000'               => 'IgnoreMakeProject,ForceProjectBase=/DPG_SWCode,RetainCompressed,IgnoreBadSourcePath',
-
 
377
    'agents_unit'           => 'IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
378
 
-
 
379
    'tp5000'                => 'IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
380
    'vcp5000'               => 'IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
381
 
-
 
382
    'MetrixOra'             => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples',
-
 
383
    'oracs'                 => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples',
-
 
384
    'oradacw'               => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/oradacw:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
-
 
385
    'orabocw'               => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/orabocw:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
-
 
386
 
292
 
387
 
293
    'icl'                   => 'IgnoreProjectBase,',
388
    'icl'                   => 'IgnoreProjectBase,',
294
    'itso'                  => 'IgnoreProjectBase,',
389
    'itso'                  => 'IgnoreProjectBase,',
295
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
390
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
296
    'daf_utils_mos'         => 'IgnoreProjectBase,',
391
    'daf_utils_mos'         => 'IgnoreProjectBase,',
Line 307... Line 402...
307
    'linux_kernel_gen1' => {
402
    'linux_kernel_gen1' => {
308
            'linux_kernel_eb5600_2.6.21.1.0.cots' => '+:TP5600:EB5600:ETX86:common:packager.sflash:www.kernel.org:packager.grub',
403
            'linux_kernel_eb5600_2.6.21.1.0.cots' => '+:TP5600:EB5600:ETX86:common:packager.sflash:www.kernel.org:packager.grub',
309
            'linux_kernel_tp5600_2.6.21.1.0.cots' => '+:tp5600:eb5600:etx86:bcp4600:common:packager.sflash:www.kernel.org:packager.grub',
404
            'linux_kernel_tp5600_2.6.21.1.0.cots' => '+:tp5600:eb5600:etx86:bcp4600:common:packager.sflash:www.kernel.org:packager.grub',
310
            },
405
            },
311
 
406
 
-
 
407
    'serpent'   => {
-
 
408
        'linux_kernel_viper_2.6.24.6.0000.cots' => 'common:viper',
-
 
409
        'linux_kernel_viper_2.6.24.6.1000.cots' => 'serpent-common:cobra:viper',
-
 
410
 
-
 
411
    },
-
 
412
 
312
);
413
);
313
 
414
 
314
my %packageRippleControl = (
415
my %packageRippleControl = (
315
    'linux_drivers_etx86' => 'major',
416
    'linux_drivers_etx86' => 'major',
316
    'linux_drivers_eb5600' => 'major',
417
    'linux_drivers_eb5600' => 'major',
Line 327... Line 428...
327
    '14503'     => { name => 'Hops3' },
428
    '14503'     => { name => 'Hops3' },
328
    '21864'     => { name => 'Hops3.6' },
429
    '21864'     => { name => 'Hops3.6' },
329
    '22303'     => { name => 'Hops3.7' },
430
    '22303'     => { name => 'Hops3.7' },
330
    '17223'     => { name => 'Hops4' },
431
    '17223'     => { name => 'Hops4' },
331
 
432
 
332
    '19743' => {name => 'ITSO.2.1.4-MainlineOBE_Validator'},
433
#    '19743' => {name => 'ITSO.2.1.4-MainlineOBE_Validator'},
333
    '11743' => {name => 'ITSO.2.1.3-MainlineOBE_Validator'},
434
#    '11743' => {name => 'ITSO.2.1.3-MainlineOBE_Validator'},
334
    '21384' => {name => 'OBE2.1.3-GoAheadRelease-R4'},
435
#    '21384' => {name => 'OBE2.1.3-GoAheadRelease-R4'},
335
    '23243' => {name => 'OBE2.1.3-GoAheadRelease-R4.5'},
436
#    '23243' => {name => 'OBE2.1.3-GoAheadRelease-R4.5'},
336
    '23843' => {name => 'Validator.2.1.3-UKlive'},
437
#    '23843' => {name => 'Validator.2.1.3-UKlive'},
337
    '15663' => {name => 'Validator.2.1.3-LegacyVersion_SSW_LMR'},
438
#    '15663' => {name => 'Validator.2.1.3-LegacyVersion_SSW_LMR'},
338
    '25183' => {name => 'ITSO.2.1.4-Validator-cmnITSO.V2src'},
439
#    '25183' => {name => 'ITSO.2.1.4-Validator-cmnITSO.V2src'},
339
    '24303' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.4'},
440
#    '24303' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.4'},
340
    '13143' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.2'},
441
#    '13143' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.2'},
341
    '24443' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.2-hot-fix'},
442
#    '24443' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.2-hot-fix'},
342
    '16023' => {name => 'OBME_PSION-TransportScotlandDLL'},
443
#    '16023' => {name => 'OBME_PSION-TransportScotlandDLL'},
343
 
444
 
344
);
445
);
345
 
446
 
346
# The following packages will have the version in the specified release forced to be on the trunk
447
# The following packages will have the version in the specified release forced to be on the trunk
347
# A trunk will be forced and the version will be on it.
448
# A trunk will be forced and the version will be on it.
Line 440... Line 541...
440
                'postimage!'        => \$opt_postimage,
541
                'postimage!'        => \$opt_postimage,
441
                'workdir:s'         => \$opt_workDir,
542
                'workdir:s'         => \$opt_workDir,
442
                'relabel!'          => \$opt_relabel,
543
                'relabel!'          => \$opt_relabel,
443
                'svn!'              => \$opt_useSvn,
544
                'svn!'              => \$opt_useSvn,
444
                'testRmDatabase'    => \$opt_testRmDatabase,
545
                'testRmDatabase'    => \$opt_testRmDatabase,
445
                'fromSvn!'          => \$opt_extractFromSvn,
-
 
446
                'resume'            => \$opt_resume,
546
                'resume'            => \$opt_resume,
447
                'mergePackages:s'   => \$opt_mergePackages,
547
                'mergePackages:s'   => \$opt_mergePackages,
448
                'subdir:s'          => \$opt_repoSubdir,    # Subdir within repo
548
                'subdir:s'          => \$opt_repoSubdir,    # Subdir within repo
449
                
-
 
450
                'svn!'          => \$opt_useSvn,
-
 
451
                'testRmDatabase'    => \$opt_testRmDatabase,
-
 
452
                'fromSvn!'          => \$opt_extractFromSvn,
549
                'fromSvn!'          => \$opt_extractFromSvn,
-
 
550
                'testRepo!'         => \$opt_useTestRepo,
453
                );
551
                );
454
 
552
 
455
#
553
#
456
#   Process help and manual options
554
#   Process help and manual options
457
#
555
#
Line 545... Line 643...
545
                    linux_kernel_tp5600
643
                    linux_kernel_tp5600
546
                    linux_kernel_eb5600
644
                    linux_kernel_eb5600
547
                    linux_kernel_bcp4600
645
                    linux_kernel_bcp4600
548
                );
646
                );
549
 
647
 
-
 
648
    } elsif ( $opt_mergePackages eq 'serpent' ) {
-
 
649
        $opt_name = $opt_mergePackages;
-
 
650
        @ARGV = qw (
-
 
651
                    linux_kernel_viper
-
 
652
                    linux_kernel_cobra
-
 
653
                );
-
 
654
 
-
 
655
    } elsif ( $opt_mergePackages eq 'emv_raw_cs_merge' ) {
-
 
656
        $opt_name = 'emv_raw_cs';
-
 
657
        @ARGV = qw (
-
 
658
                    emv_raw_cs
-
 
659
                    emv_raw_cs-w32
-
 
660
                );
-
 
661
                
-
 
662
 
-
 
663
    } elsif ( $opt_mergePackages eq 'seattleBr' ) {
-
 
664
        $opt_name = 'br_applets';
-
 
665
        @ARGV = qw (
-
 
666
                    br_applet_cst
-
 
667
                    br_applet_gak_wsf
-
 
668
                    br_applet_gak_wsf_pos
-
 
669
                    br_applet_obftp_ct
-
 
670
                    br_applet_obftp_et
-
 
671
                    br_applet_obftp_kcm
-
 
672
                    br_applet_obftp_kt
-
 
673
                    br_applet_obftp_pt
-
 
674
                    br_applet_obftp_st
-
 
675
                    br_applet_pftp_ct_brt
-
 
676
                    br_applet_pftp_ct_vanpool
-
 
677
                    br_applet_pftp_kcm_dart
-
 
678
                    br_applet_pftp_kcm_rr
-
 
679
                    br_applet_pftp_kcm_vanpool
-
 
680
                    br_applet_pftp_kt
-
 
681
                    br_applet_pftp_pt_vanpool
-
 
682
                    br_applet_pftp_st
-
 
683
                    br_applet_pftp_st_llr
-
 
684
                    br_applet_pftp_wsf
-
 
685
                    br_applet_saftp_ct_brt
-
 
686
                    br_applet_saftp_kcm_rr
-
 
687
                    br_applet_saftp_st
-
 
688
                    br_applet_saftp_st_llr
-
 
689
                    br_applet_tru
-
 
690
                    br_applet_tvm
-
 
691
                    unit_test_br_cst
-
 
692
                    unit_test_br_gak
-
 
693
                    unit_test_br_kcm_ct_saftp
-
 
694
                    unit_test_br_obftp
-
 
695
                    unit_test_br_st_saftp
-
 
696
                    unit_test_br_vanpool
-
 
697
                    SalesConfiguration
-
 
698
                );
550
    } else
699
    } else
551
    {
700
    {
552
        Error ("Unknown Merge Package Name: $opt_mergePackages");
701
        Error ("Unknown Merge Package Name: $opt_mergePackages");
553
    }
702
    }
554
}
703
}
Line 663... Line 812...
663
    $versions{$tip}{Tip} = 1 if $tip;
812
    $versions{$tip}{Tip} = 1 if $tip;
664
}
813
}
665
 
814
 
666
#
815
#
667
#   Generate dumps and images
816
#   Generate dumps and images
-
 
817
#       Always create image first - we are doing it after every transfer
668
#
818
#
669
if ( $opt_images )
819
if ( $opt_images || 1 )
670
{
820
{
671
    createImages();
821
    createImages();
672
}
822
}
673
 
823
 
674
if ( $opt_dump )
824
if ( $opt_dump )
Line 925... Line 1075...
925
 
1075
 
926
        if ( index( $data, ',processRipples,' ) >= 0) {
1076
        if ( index( $data, ',processRipples,' ) >= 0) {
927
            $opt_processRipples = 1;
1077
            $opt_processRipples = 1;
928
        }
1078
        }
929
 
1079
 
-
 
1080
        if ( index( $data, ',NoProcessRipples,' ) >= 0) {
-
 
1081
            $opt_processRipples = 0;
-
 
1082
            Message ("Disable Processing of ripples");
-
 
1083
        }
-
 
1084
        
930
        if ( index( $data, ',SetProjectBase,' ) >= 0) {
1085
        if ( index( $data, ',SetProjectBase,' ) >= 0) {
931
            $opt_preserveProjectBase = 1;
1086
            $opt_preserveProjectBase = 1;
932
            $opt_ignoreProjectBaseErrors = 1;
1087
            $opt_ignoreProjectBaseErrors = 1;
933
            Message ("Preserving ProjectBase");
1088
            Message ("Preserving ProjectBase");
934
        }
1089
        }
Line 936... Line 1091...
936
        if ( index( $data, ',AllowMultiPath,' ) >= 0) {
1091
        if ( index( $data, ',AllowMultiPath,' ) >= 0) {
937
            $opt_AllowMuliplePaths = 1;
1092
            $opt_AllowMuliplePaths = 1;
938
            Message ("Allowing Multiple Paths");
1093
            Message ("Allowing Multiple Paths");
939
        }
1094
        }
940
 
1095
 
941
        if ( index( $data, ',PatchIsaRipple,' ) >= 0) {
1096
        if ( index( $data, ',IgnoreBadSourcePath,' ) >= 0) {
942
            $opt_PatchIsaRipple = 1;
1097
            $opt_IgnoreBadSourcePath = 1;
943
            Message ("Treating Patch as a ripple");
1098
            Message ("Ignore Source Paths tagged as Bad");
944
        }
1099
        }
945
        
1100
        
946
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
1101
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
947
            $opt_forceProjectBase = $1;
1102
            $opt_forceProjectBase = $1;
948
            $opt_AllowMuliplePaths = 1;
1103
            $opt_AllowMuliplePaths = 1;
949
            Message ("Force Project Base: $opt_forceProjectBase");
1104
            Message ("Force Project Base: $opt_forceProjectBase");
950
        }
1105
        }
951
 
1106
 
-
 
1107
 
952
        if ( $data =~ m~,LimitProjectBase=(.*?),~ ) {
1108
        if ( $data =~ m~,LimitProjectBase=(.*?),~ ) {
953
            $opt_AllowMuliplePaths = 1;
1109
            $opt_AllowMuliplePaths = 1;
954
            @opt_limitProjectBase = split(':', $1);
1110
            @opt_limitProjectBase = split(':', $1);
955
            Message ("Limit Project Base: @opt_limitProjectBase");
1111
            Message ("Limit Project Base: @opt_limitProjectBase");
956
        }
1112
        }
957
 
1113
 
-
 
1114
        if ( $data =~ m~,SelectProjectBase=(.*?),~ ) {
-
 
1115
            $opt_AllowMuliplePaths = 1;
-
 
1116
            @opt_selectProjectBase = split(':', $1);
-
 
1117
            Message ("Select Project Base from: @opt_selectProjectBase");
-
 
1118
        }
-
 
1119
        
958
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
1120
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
959
            @opt_mergePaths = split(':', $1);
1121
            @opt_mergePaths = split(':', $1);
960
            Message ("Merge Paths: @opt_mergePaths");
1122
            Message ("Merge Paths: @opt_mergePaths");
961
        }
1123
        }
962
 
1124
 
963
        if ( $data =~ m~,DeleteFiles=(.*?),~ ) {
1125
        if ( $data =~ m~,DeleteFiles=(.*?),~ ) {
964
            @opt_deleteFiles = split(':', $1);
1126
            @opt_deleteFiles = split(':', $1);
965
            Message ("Delete Files: @opt_deleteFiles");
1127
            Message ("Delete Files: @opt_deleteFiles");
966
        }
1128
        }
-
 
1129
 
-
 
1130
        if ( $data =~ m~,DeleteLinks,~ ) {
-
 
1131
            $opt_deleteLinks = 1;
-
 
1132
            Message ("Delete soft links");
967
        
1133
        }
-
 
1134
 
-
 
1135
        if ( index( $data, ',ForceSuck,' ) >= 0) {
-
 
1136
            $opt_forceSuck = 1;
-
 
1137
            Message ("Force sucking empty directories");
-
 
1138
        }
-
 
1139
 
968
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
1140
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
969
            $opt_ignoreProjectBaseErrors = 1;
1141
            $opt_ignoreProjectBaseErrors = 1;
970
            Message ("Ignore ProjectBase Errors");
1142
            Message ("Ignore ProjectBase Errors");
971
        }
1143
        }
972
 
1144
 
973
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
1145
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
974
            $opt_ignoreMakeProjectErrors = 1;
1146
            $opt_ignoreMakeProjectErrors = 1;
975
            Message ("Ignore MakeProject Usage");
1147
            Message ("Ignore MakeProject Usage");
976
        }
1148
        }
977
 
1149
 
-
 
1150
        if ( index( $data, ',NoBuildFileCheck,' ) >= 0) {
-
 
1151
            $opt_ignoreBuildFileClashes = 1;
-
 
1152
            Message ("Ignoring Build File Clashes");
-
 
1153
        }
-
 
1154
 
-
 
1155
        if ( index( $data, ',SkipBuildFileCheck,' ) >= 0) {
-
 
1156
            $opt_skipBuildNameCheck = 1;
-
 
1157
            Message ("Skip Build File Clashes Testing");
-
 
1158
        }
-
 
1159
        
978
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
1160
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
979
            $opt_ignoreBadPaths = 1;
1161
            $opt_ignoreBadPaths = 1;
980
            Message ("Ignore Bad Paths in makefile Usage");
1162
            Message ("Ignore Bad Paths in makefile Usage");
981
        }
1163
        }
982
        
1164
        
983
        if ( index( $data, ',utf8,' ) >= 0) {
1165
        if ( index( $data, ',utf8,' ) >= 0) {
984
            $mustConvertFileNames = 1;
1166
            $mustConvertFileNames = 1;
985
            Message ("Convert filenames to UTF8");
1167
            Message ("Convert filenames to UTF8");
986
        }
1168
        }
-
 
1169
 
-
 
1170
        if ( index( $data, ',NoRetain,' ) >= 0) {
-
 
1171
            $opt_reuse = 2;
-
 
1172
            Message ("Package Versions not Retained");
-
 
1173
        }
-
 
1174
 
-
 
1175
        if ( index( $data, ',RetainCompressed,' ) >= 0) {
-
 
1176
            $opt_saveCompressed = 1;
-
 
1177
            Message ("Package Versions will be retained as compressed images");
-
 
1178
        }
-
 
1179
        
-
 
1180
 
-
 
1181
        if ( $data =~ m~,Trunk=(.*?),~ ) {
-
 
1182
            my $tt = $1;
-
 
1183
            $Projects{$tt}{Trunk} = 1;
-
 
1184
            Message ("Force project to trunk: $tt");
-
 
1185
        }
987
    }
1186
    }
988
 
1187
 
989
    Message("Package Type: $packageType, $pruneModeString");
1188
    Message("Package Type: $packageType, $pruneModeString");
990
}
1189
}
991
 
1190
 
Line 1078... Line 1277...
1078
            {
1277
            {
1079
                my $ep = $versions{$entry};
1278
                my $ep = $versions{$entry};
1080
                unless ( $ep->{last} || $ep->{next}[0] )
1279
                unless ( $ep->{last} || $ep->{next}[0] )
1081
                {
1280
                {
1082
#                    if (  $ep->{isaWip}  )
1281
#                    if (  $ep->{isaWip}  )
1083
                    if ( (exists $ep->{badVcsTag} && $ep->{badVcsTag}) || $ep->{isaWip}  )
1282
                    if ( (!$opt_IgnoreBadSourcePath  && (exists $ep->{badVcsTag}  && $ep->{badVcsTag})) || $ep->{isaWip} )
1084
                    {
1283
                    {
1085
                        $ep->{badSingleton} = 1;
1284
                        $ep->{badSingleton} = 1;
1086
                        $reprocess = 1;
1285
                        $reprocess = 1;
1087
                        $badSingletonCount++;
1286
                        $badSingletonCount++;
1088
 
1287
 
Line 1098... Line 1297...
1098
            calcLinks()
1297
            calcLinks()
1099
                if ( $reprocess );
1298
                if ( $reprocess );
1100
        }
1299
        }
1101
 
1300
 
1102
        #
1301
        #
-
 
1302
        #   True Patches show up as singletons - they have no parent
-
 
1303
        #   Need to create strands of patches to be glued onto the base
-
 
1304
        #
-
 
1305
        {
-
 
1306
            my %patchTree;
-
 
1307
            my $patchSeen;
-
 
1308
            Message ("Creating patch threads");
-
 
1309
            foreach my $entry ( sort {$versions{$a}{version} cmp $versions{$b}{version}} @startPoints )
-
 
1310
            {
-
 
1311
                my $ep = $versions{$entry};
-
 
1312
                next unless ( defined $ep->{buildVersion} );
-
 
1313
 
-
 
1314
                my $suffix = $ep->{name} . $ep->{suffix};
-
 
1315
 
-
 
1316
                my ($major, $minor, $patch, $build) = @{$ep->{buildVersion}};
-
 
1317
 
-
 
1318
                my $patchBase = sprintf ("%3.3d.%3.3d.%3.3d.$suffix", $major, $minor, $patch);
-
 
1319
                
-
 
1320
                if ( defined $ep->{buildVersion} )
-
 
1321
                {
-
 
1322
                    if ( $ep->{isaPatch} )
-
 
1323
                    {
-
 
1324
                        push @{$patchTree{$patchBase}}, $entry;
-
 
1325
                        $ep->{patchRoot} = $patchBase;
-
 
1326
                        $patchSeen++;
-
 
1327
                    }
-
 
1328
                }
-
 
1329
            }
-
 
1330
 
-
 
1331
            my %patchRoot;
-
 
1332
            if ($patchSeen)
-
 
1333
            {
-
 
1334
                foreach my $entry ( sort {$versions{$a}{version} cmp $versions{$b}{version}} keys %versions )
-
 
1335
                {
-
 
1336
                    my $ep = $versions{$entry};
-
 
1337
                    next if ( $ep->{isaPatch} );
-
 
1338
                    next unless ( defined $ep->{buildVersion} );
-
 
1339
 
-
 
1340
                    my $suffix = $ep->{name} . $ep->{suffix};
-
 
1341
                    my ($major, $minor, $patch, $build) = @{$ep->{buildVersion}};
-
 
1342
                    my $patchBase = sprintf ("%3.3d.%3.3d.%3.3d.$suffix", $major, $minor, $patch);
-
 
1343
 
-
 
1344
                    if ( defined $patchRoot{$patchBase})
-
 
1345
                    {
-
 
1346
                        Warning ("Multiple Patch Roots identified", $versions{$patchRoot{$patchBase}}{vname},$ep->{vname}, "Both hash to: " . $patchBase );
-
 
1347
                    }
-
 
1348
                    else
-
 
1349
                    {
-
 
1350
                        $patchRoot{$patchBase} = $entry;
-
 
1351
                    }
-
 
1352
                }
-
 
1353
 
-
 
1354
#DebugDumpData('%patchRoot', \%patchRoot );
-
 
1355
                foreach  ( keys %patchTree )
-
 
1356
                {
-
 
1357
                    my $last;
-
 
1358
                    foreach my $entry ( sort {$versions{$a}{version} cmp $versions{$b}{version}} @{$patchTree{$_}} )
-
 
1359
                    {
-
 
1360
                        if ( $last )
-
 
1361
                        {
-
 
1362
                            $versions{$last}{MakeTree} = 1;
-
 
1363
                            push @{$versions{$last}{next}}, $entry;
-
 
1364
                            $reprocess = 1;
-
 
1365
                        }
-
 
1366
                        else
-
 
1367
                        {
-
 
1368
                            # First entry in thread.
-
 
1369
 
-
 
1370
# print "--- Patch Branch $versions{$entry}{vname}\n";
-
 
1371
                            $versions{$entry}{branchPoint} = 2;
-
 
1372
                            
-
 
1373
 
-
 
1374
                            my $patchBase = $versions{$entry}{patchRoot};
-
 
1375
                            my $patchBaseEntry = $patchRoot{$patchBase};
-
 
1376
                            if ( $patchBase )
-
 
1377
                            {
-
 
1378
 
-
 
1379
                                if ( defined($patchBaseEntry) && exists ($versions{$patchBaseEntry}) )
-
 
1380
                                {
-
 
1381
                                    push @{$versions{$patchBaseEntry}{next}}, $entry;
-
 
1382
#    Message( "Attaching ",$versions{$entry}{version}," to $patchBase");
-
 
1383
                                }
-
 
1384
                                else
-
 
1385
                                {
-
 
1386
    Message( "Cannot Attach ",$versions{$entry}{version}," to $patchBase" );
-
 
1387
                                    Warning ("Cannot attach thread. No base version");
-
 
1388
                                }
-
 
1389
                            }
-
 
1390
                        }
-
 
1391
                        $last = $entry;
-
 
1392
                    }
-
 
1393
                }
-
 
1394
            }
-
 
1395
            calcLinks()
-
 
1396
                if ( $reprocess );
-
 
1397
        }
-
 
1398
#DebugDumpData('$verions', \%versions );
-
 
1399
 
-
 
1400
        #
1103
        #   Create simple trees out of the chains
1401
        #   Create simple trees out of the chains
1104
        #   Tree is based on suffix (project) and version
1402
        #   Tree is based on suffix (project) and version
1105
        #
1403
        #
1106
        {
1404
        {
1107
            my %trees;
1405
            my %trees;
Line 1113... Line 1411...
1113
            }
1411
            }
1114
 
1412
 
1115
            foreach  ( keys %trees )
1413
            foreach  ( keys %trees )
1116
            {
1414
            {
1117
                my $last;
1415
                my $last;
1118
                foreach my $entry ( sort { $versions{$a}{version} cmp $versions{$b}{version}  } @{$trees{$_}} )
1416
                foreach my $entry ( sort {$versions{$a}{version} cmp $versions{$b}{version}} @{$trees{$_}} )
1119
                {
1417
                {
1120
                    if ( $last )
1418
                    if ( $last )
1121
                    {
1419
                    {
1122
                        $versions{$last}{MakeTree} = 1;
1420
                        $versions{$last}{MakeTree} = 1;
1123
                        push @{$versions{$last}{next}}, $entry;
1421
                        push @{$versions{$last}{next}}, $entry;
Line 1660... Line 1958...
1660
    #   Display warnings about Bad Essential Packages
1958
    #   Display warnings about Bad Essential Packages
1661
    #
1959
    #
1662
    $allSvn = 1;
1960
    $allSvn = 1;
1663
    foreach my $entry ( keys(%versions) )
1961
    foreach my $entry ( keys(%versions) )
1664
    {
1962
    {
-
 
1963
        markDpkgArchive($entry);
1665
        $rippleCount++ if ( exists($versions{$entry}{isaRipple}) && $versions{$entry}{isaRipple} );
1964
        $rippleCount++ if ( exists($versions{$entry}{isaRipple}) && $versions{$entry}{isaRipple} );
1666
        $allSvn = 0 unless ( $versions{$entry}{isSvn} );
1965
        $allSvn = 0 unless ( $versions{$entry}{isSvn} );
1667
        next unless ( exists $versions{$entry}{Essential}  );
1966
        next unless ( exists $versions{$entry}{Essential}  );
1668
        next unless ( $versions{$entry}{badVcsTag}  );
1967
        next unless ( $versions{$entry}{badVcsTag}  );
1669
        push @badEssentials, $entry;
1968
        push @badEssentials, $entry;
1670
        Warning ("BadVCS Essential: " . GetVname($entry))
1969
        Warning ("BadVCS Essential: " . GetVname($entry));
1671
    }
1970
    }
1672
 
1971
 
1673
    #
1972
    #
1674
    #   All done
1973
    #   All done
1675
    #
1974
    #
Line 1930... Line 2229...
1930
    Message ("------------------------------------------------------------------" );
2229
    Message ("------------------------------------------------------------------" );
1931
    Message ("Package $processCount of $processTotal");
2230
    Message ("Package $processCount of $processTotal");
1932
 
2231
 
1933
    Message ("New package-version: " . GetVname($entry) . " Tag: " . $versions{$entry}{vcsTag} );
2232
    Message ("New package-version: " . GetVname($entry) . " Tag: " . $versions{$entry}{vcsTag} );
1934
 
2233
 
1935
#    if ( $versions{$entry}{rippleList} )
-
 
1936
#    {
-
 
1937
#        Message ("Version has ripples");
-
 
1938
#        foreach my $rentry ( @{$versions{$entry}{rippleList}} )
-
 
1939
#        {
-
 
1940
#            Message ("  -- ". GetVname($rentry));
-
 
1941
#        }
-
 
1942
#    }
-
 
1943
    
-
 
1944
 
-
 
1945
    #
2234
    #
1946
    #   Detect user abort
2235
    #   Detect user abort
1947
    #
2236
    #
1948
    if ( -f $cwd . '/stopfile' )
2237
    if ( -f $cwd . '/stopfile' )
1949
    {
2238
    {
Line 1961... Line 2250...
1961
    }
2250
    }
1962
    else
2251
    else
1963
    {
2252
    {
1964
        #
2253
        #
1965
        #   Call worker function
2254
        #   Call worker function
1966
        #   It will exist on any error so that it can be logged
2255
        #   It will exit on any error so that it can be logged
1967
        #
2256
        #
1968
        $rv = newPackageVersionBody( \%data, @_ );
2257
        $rv = newPackageVersionBody( \%data, @_ );
1969
        $globalError = 1 if ( $rv >= 10 );
2258
        $globalError = 1 if ( $rv >= 10 );
1970
    }
2259
    }
1971
 
2260
 
Line 2022... Line 2311...
2022
    #   Delete the created view
2311
    #   Delete the created view
2023
    #   Its just a directory, so delete it
2312
    #   Its just a directory, so delete it
2024
    #
2313
    #
2025
    if ( $data{ViewRoot} && -d $data{ViewRoot})
2314
    if ( $data{ViewRoot} && -d $data{ViewRoot})
2026
    {
2315
    {
-
 
2316
        my $cfile = saneLabel($entry) . '.tgz';
2027
        if ( $opt_reuse == 0 || $opt_reuse == 2 || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
2317
        if ( $opt_reuse == 0 || $opt_reuse == 2 || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
2028
        {
2318
        {
2029
            Message ("Delete View: $data{ViewRoot}");
2319
            Message ("Delete View: $data{ViewRoot}");
2030
            RmDirTree ($data{ViewRoot} );
2320
            RmDirTree ($data{ViewRoot} );
-
 
2321
            unlink $cfile;
2031
        }
2322
        }
2032
        else
2323
        else
2033
        {
2324
        {
2034
            Message ("Retaining View: $data{ViewRoot}");
2325
            Message ("Retaining View: $data{ViewRoot}");
-
 
2326
            if ( $opt_saveCompressed )
-
 
2327
            {
-
 
2328
                Message ("Compressing the retained directory");
-
 
2329
                unless ( -f $cfile )
-
 
2330
                {
-
 
2331
                    my $rv = System ('tar', '-czf', $cfile, $data{ViewRoot} );
-
 
2332
                    if ( $rv )
-
 
2333
                    {
-
 
2334
                        Warning("Failed to compress directory");
-
 
2335
                    }
-
 
2336
                }
-
 
2337
                else
-
 
2338
                {
-
 
2339
                    Message ("Reusing compressed file");
-
 
2340
                }
-
 
2341
                RmDirTree ($data{ViewRoot} );
-
 
2342
            }
2035
        }
2343
        }
2036
 
2344
 
2037
    }
2345
    }
2038
    else
2346
    else
2039
    {
2347
    {
Line 2105... Line 2413...
2105
    my $rv;
2413
    my $rv;
2106
    my $vcs_type;
2414
    my $vcs_type;
2107
    my $cc_label;
2415
    my $cc_label;
2108
    my $cc_path;
2416
    my $cc_path;
2109
    my $cc_path_original;
2417
    my $cc_path_original;
-
 
2418
    my $selectDir;
2110
 
2419
 
2111
    #
2420
    #
2112
    #   Init Data
2421
    #   Init Data
2113
    #
2422
    #
2114
    $data->{rmRef} = 'ERROR';
2423
    $data->{rmRef} = 'ERROR';
Line 2177... Line 2486...
2177
#        $data->{errStr} = 'Package is DeadWood';
2486
#        $data->{errStr} = 'Package is DeadWood';
2178
#        return 3;
2487
#        return 3;
2179
#    }
2488
#    }
2180
 
2489
 
2181
    #
2490
    #
-
 
2491
    #   Check for a handcrafted substitute package
2182
    #   Determine version information
2492
    #       May have been created with gen_cots
2183
    #
2493
    #
2184
    $data->{tag} = $versions{$entry}{vcsTag} || '';
2494
    testDpkgArchive($entry);
2185
    if ( $versions{$entry}{badVcsTag} )
2495
    if (extractFilesFromStore($data, $entry) )
2186
    {
2496
    {
2187
        Warning ("Error: Bad VcsTag for: " . GetVname($entry),
-
 
2188
                 "Tag: $data->{tag}" );
2497
        Message ("Using package from store");
2189
        $data->{errStr} = 'VCS Tag Marked as Bad';
-
 
2190
        return 1;
-
 
2191
 
-
 
2192
    }
2498
    }
-
 
2499
    else
-
 
2500
    {
-
 
2501
        #
-
 
2502
        #   Determine version information
-
 
2503
        #
-
 
2504
        if ($opt_IgnoreBadSourcePath)
-
 
2505
        {
-
 
2506
            # Ignore versions tagged with a bad source path
-
 
2507
            #   Will expect that the Vob will be forced
-
 
2508
            #   Hope that we have a label
-
 
2509
            delete $versions{$entry}{badVcsTag};
-
 
2510
        }
2193
 
2511
 
2194
 
-
 
2195
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
-
 
2196
    $vcs_type = $1;
-
 
2197
    $cc_label = $4;
-
 
2198
    $cc_path = $2;
-
 
2199
    $cc_path = '/' . $cc_path;
-
 
2200
    $cc_path =~ tr~\\/~/~s;
-
 
2201
    $cc_path_original = $cc_path;
-
 
2202
 
-
 
2203
    #
-
 
2204
    #   Correct well known path mistakes in CC paths
-
 
2205
    #
-
 
2206
    if ( $vcs_type eq 'CC' )
-
 
2207
    {
-
 
2208
        $cc_path =~ s~/build.pl$~~i;
-
 
2209
        $cc_path =~ s~/src$~~i;
-
 
2210
        $cc_path =~ s~/cpp$~~i;
-
 
2211
        $cc_path =~ s~/MASS_Dev/Infra/~/MASS_Dev_Infra/~i;
-
 
2212
        $cc_path =~ s~/MASS_Dev/Tools/~/MASS_Dev_Tools/~i;
-
 
2213
        $cc_path =~ s~/MASS_Dev/Bus/~/MASS_Dev_Bus/~i;
-
 
2214
        $cc_path =~ s~/MASS_Dev_Bus/Cbp/~/MASS_Dev_Bus/CBP/~i;
-
 
2215
        $cc_path =~ s~/MREF_Package/ergpostmongui$~/MREF_Package/ergpostmongui~i;
-
 
2216
        $cc_path =~ s~/MREF_../MREF_Package/~/MREF_Package/~i;
-
 
2217
        $cc_path =~ s~/MREF_Package/mass_ergocdp/~/MREF_Package/ergocdp/~i;
-
 
2218
        $cc_path =~ s~/MASS_Dev_Bus/CBP/systemCD.ejb~/MASS_Dev_Bus/CBP/systemCD/ejb~i;
-
 
2219
        $cc_path =~ s~/MASS_Dev_Bus/Financial/cpp/paymentmanager~/MASS_Dev_Bus/Financial/cpp/paymentmanager~i;
-
 
2220
        $cc_path =~ s~/MASS_Dev_Bus/WebServices~/MASS_Dev_Bus/WebServices~i;
-
 
2221
        $cc_path =~ s~/MASS_Dev_Bus/CBP/nullAdapter~//MASS_Dev_Bus/CBP/nullAdaptor~i;
-
 
2222
 
-
 
2223
        $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
2224
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
-
 
2225
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
-
 
2226
        $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
-
 
2227
        $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
-
 
2228
 
-
 
2229
        if (   $versions{$entry}{name} =~ m/^ERGagency$/i
-
 
2230
            || $versions{$entry}{name} =~ m/^ERGavm$/i
-
 
2231
            || $versions{$entry}{name} =~ m/^ERGboi$/i
-
 
2232
            || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
-
 
2233
            || $versions{$entry}{name} =~ m/^ERGcardholder$/i
-
 
2234
            || $versions{$entry}{name} =~ m/^ERGcdaimports$/i
-
 
2235
            || $versions{$entry}{name} =~ m/^ERGcda$/i
-
 
2236
            || $versions{$entry}{name} =~ m/^ERGcscedit$/i
-
 
2237
            || $versions{$entry}{name} =~ m/^ERGcs$/i
2512
        $data->{tag} = $versions{$entry}{vcsTag} || '';
2238
            || $versions{$entry}{name} =~ m/^ERGofs$/i
-
 
2239
            || $versions{$entry}{name} =~ m/^ERGols$/i
-
 
2240
            || $versions{$entry}{name} =~ m/^ERGtpf$/i
-
 
2241
            || $versions{$entry}{name} =~ m/^ERGorasys$/i
-
 
2242
            || $versions{$entry}{name} =~ m/^ERGoracs$/i
-
 
2243
            || $versions{$entry}{name} =~ m/^ERGpxyif$/i
-
 
2244
            || $versions{$entry}{name} =~ m/^ERGtp5upg$/i
-
 
2245
            || $versions{$entry}{name} =~ m/^ERGinstitutional$/i
-
 
2246
            || $versions{$entry}{name} =~ m/^ERGinfra$/i
-
 
2247
            || $versions{$entry}{name} =~ m/^ERGcrrpts$/i
-
 
2248
            || $versions{$entry}{name} =~ m/^ERGmiddle$/i
-
 
2249
            || $versions{$entry}{name} =~ m/^ERGmiddleapi$/i
-
 
2250
            || $versions{$entry}{name} =~ m/^ERGwebapi$/i
-
 
2251
            || $versions{$entry}{name} =~ m/^ERGwebtestui$/i
-
 
2252
            || $versions{$entry}{name} =~ m/^ERGwebesbui$/i
-
 
2253
            || $versions{$entry}{name} =~ m/^ERGwspiv$/i
-
 
2254
            || $versions{$entry}{name} =~ m/^ERGwscst$/i
-
 
2255
            || $versions{$entry}{name} =~ m/^sposMUG$/i
-
 
2256
            || $versions{$entry}{name} =~ m/^ERGfinman$/i
-
 
2257
            || $versions{$entry}{name} =~ m/^ERGkm$/i
2513
        if ( $versions{$entry}{badVcsTag} )
2258
            || $versions{$entry}{name} =~ m/^ERGxml$/i
-
 
2259
            || $versions{$entry}{name} =~ m/^ERGoradacw$/i
-
 
2260
            || $versions{$entry}{name} =~ m/^ERGtru$/i
-
 
2261
            )
-
 
2262
        {
2514
        {
-
 
2515
            Warning ("Error: Bad VcsTag for: " . GetVname($entry),
2263
            $cc_path = '/MREF_Package';
2516
                     "Tag: $data->{tag}" );
-
 
2517
            $data->{errStr} = 'VCS Tag Marked as Bad';
-
 
2518
            return 1;
-
 
2519
 
2264
        }
2520
        }
2265
 
2521
 
-
 
2522
 
-
 
2523
        $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
-
 
2524
        $vcs_type = $1;
-
 
2525
        $cc_label = $4;
-
 
2526
        $cc_path = $2;
-
 
2527
        $cc_path = '/' . $cc_path;
-
 
2528
        $cc_path =~ tr~\\/~/~s;
-
 
2529
        $cc_path_original = $cc_path;
-
 
2530
 
-
 
2531
        #
-
 
2532
        #   Process IgnoreBadSourcePath
-
 
2533
        #
2266
        if (   $versions{$entry}{name} =~ m/^tp5000_MUG$/i )
2534
        if ($opt_IgnoreBadSourcePath)
2267
        {
2535
        {
-
 
2536
            if (($vcs_type eq 'UC') || (length($cc_label) < 1))
-
 
2537
            {
-
 
2538
                $versions{$entry}{badVcsTag} = 98;
-
 
2539
                Warning ("Error: Bad VcsTag for: " . GetVname($entry),
-
 
2540
                         "Tag: $data->{tag}" );
-
 
2541
                $data->{errStr} = 'VCS Tag Marked as Bad - and has no label';
-
 
2542
                return 1;
-
 
2543
            }
-
 
2544
        }
-
 
2545
 
-
 
2546
        #
-
 
2547
        #   Correct well known path mistakes in CC paths
-
 
2548
        #
-
 
2549
        if ( $vcs_type eq 'CC' )
-
 
2550
        {
-
 
2551
            $cc_path =~ s~/build.pl$~~i;
-
 
2552
            $cc_path =~ s~/src$~~i;
-
 
2553
            $cc_path =~ s~/cpp$~~i;
-
 
2554
            $cc_path =~ s~/MASS_Dev/Infra/~/MASS_Dev_Infra/~i;
-
 
2555
            $cc_path =~ s~/MASS_Dev/Tools/~/MASS_Dev_Tools/~i;
-
 
2556
            $cc_path =~ s~/MASS_Dev/Bus/~/MASS_Dev_Bus/~i;
-
 
2557
            $cc_path =~ s~/MASS_Dev_Bus/Cbp/~/MASS_Dev_Bus/CBP/~i;
-
 
2558
            $cc_path =~ s~/MREF_Package/ergpostmongui$~/MREF_Package/ergpostmongui~i;
-
 
2559
            $cc_path =~ s~/MREF_../MREF_Package/~/MREF_Package/~i;
-
 
2560
            $cc_path =~ s~/MREF_Package/mass_ergocdp/~/MREF_Package/ergocdp/~i;
-
 
2561
            $cc_path =~ s~/MASS_Dev_Bus/CBP/systemCD.ejb~/MASS_Dev_Bus/CBP/systemCD/ejb~i;
-
 
2562
            $cc_path =~ s~/MASS_Dev_Bus/Financial/cpp/paymentmanager~/MASS_Dev_Bus/Financial/cpp/paymentmanager~i;
-
 
2563
            $cc_path =~ s~/MASS_Dev_Bus/WebServices~/MASS_Dev_Bus/WebServices~i;
-
 
2564
            $cc_path =~ s~/MASS_Dev_Bus/CBP/nullAdapter~//MASS_Dev_Bus/CBP/nullAdaptor~i;
-
 
2565
            $cc_path =~ s~/DPG_SWBase/Services~/DPG_SWBase/services~i;
-
 
2566
 
-
 
2567
 
-
 
2568
            $cc_path = '/MASS_Dev_Bus/Application' if ( $versions{$entry}{name} eq 'application');
-
 
2569
            $cc_path = '/MASS_Dev_Bus/Product'     if ( $versions{$entry}{name} eq 'product');
-
 
2570
            $cc_path = '/MASS_Dev_Bus/Financial'   if ( $versions{$entry}{name} eq 'FinRun');
-
 
2571
 
-
 
2572
            $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
2573
            $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
2574
            $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
-
 
2575
            $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
-
 
2576
            $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
-
 
2577
            $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
-
 
2578
 
-
 
2579
            if (   $versions{$entry}{name} =~ m/^ERGagency$/i
-
 
2580
                || $versions{$entry}{name} =~ m/^ERGavm$/i
-
 
2581
                || $versions{$entry}{name} =~ m/^ERGboi$/i
-
 
2582
                || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
-
 
2583
                || $versions{$entry}{name} =~ m/^ERGcardholder$/i
-
 
2584
                || $versions{$entry}{name} =~ m/^ERGcdaimports$/i
-
 
2585
                || $versions{$entry}{name} =~ m/^ERGcda$/i
-
 
2586
                || $versions{$entry}{name} =~ m/^ERGcscedit$/i
-
 
2587
                || $versions{$entry}{name} =~ m/^ERGcs$/i
-
 
2588
                || $versions{$entry}{name} =~ m/^ERGofs$/i
-
 
2589
                || $versions{$entry}{name} =~ m/^ERGols$/i
-
 
2590
                || $versions{$entry}{name} =~ m/^ERGtpf$/i
-
 
2591
                || $versions{$entry}{name} =~ m/^ERGorasys$/i
-
 
2592
                || $versions{$entry}{name} =~ m/^ERGoracs$/i
-
 
2593
                || $versions{$entry}{name} =~ m/^ERGpxyif$/i
-
 
2594
                || $versions{$entry}{name} =~ m/^ERGtp5upg$/i
-
 
2595
                || $versions{$entry}{name} =~ m/^ERGinstitutional$/i
-
 
2596
                || $versions{$entry}{name} =~ m/^ERGinfra$/i
-
 
2597
                || $versions{$entry}{name} =~ m/^ERGcrrpts$/i
-
 
2598
                || $versions{$entry}{name} =~ m/^ERGmiddle$/i
-
 
2599
                || $versions{$entry}{name} =~ m/^ERGmiddleapi$/i
-
 
2600
                || $versions{$entry}{name} =~ m/^ERGwebapi$/i
-
 
2601
                || $versions{$entry}{name} =~ m/^ERGwebtestui$/i
-
 
2602
                || $versions{$entry}{name} =~ m/^ERGwebesbui$/i
-
 
2603
                || $versions{$entry}{name} =~ m/^ERGwspiv$/i
-
 
2604
                || $versions{$entry}{name} =~ m/^ERGwscst$/i
-
 
2605
                || $versions{$entry}{name} =~ m/^sposMUG$/i
-
 
2606
                || $versions{$entry}{name} =~ m/^ERGfinman$/i
2268
            if ( $versions{$entry}{version} =~ m~vtk$~ )
2607
                || $versions{$entry}{name} =~ m/^ERGkm$/i
-
 
2608
                || $versions{$entry}{name} =~ m/^ERGxml$/i
-
 
2609
                || $versions{$entry}{name} =~ m/^ERGoradacw$/i
-
 
2610
                || $versions{$entry}{name} =~ m/^ERGtru$/i
-
 
2611
                )
2269
            {
2612
            {
2270
                $cc_path = '/MREF_Package';
2613
                $cc_path = '/MREF_Package';
2271
            }
2614
            }
2272
        }
-
 
2273
 
2615
 
-
 
2616
            if (   $versions{$entry}{name} =~ m/^tp5000_MUG$/i )
-
 
2617
            {
-
 
2618
                if ( $versions{$entry}{version} =~ m~vtk$~ )
-
 
2619
                {
-
 
2620
                    $cc_path = '/MREF_Package';
-
 
2621
                }
-
 
2622
            }
-
 
2623
 
2274
        $cc_path = $opt_forceProjectBase
2624
            $cc_path = $opt_forceProjectBase
2275
            if ( $opt_forceProjectBase );
2625
                if ( $opt_forceProjectBase );
2276
 
2626
 
2277
        foreach ( @opt_limitProjectBase )
2627
            foreach ( @opt_limitProjectBase )
2278
        {
-
 
2279
            if ( $cc_path =~ m~$_~ )
-
 
2280
            {
2628
            {
-
 
2629
                if ( $cc_path =~ m~$_~ )
-
 
2630
                {
2281
                $cc_path = $_;
2631
                    $cc_path = $_;
2282
                last;
2632
                    last;
-
 
2633
                }
-
 
2634
            }
-
 
2635
 
-
 
2636
            if ( $cc_path_original ne $cc_path )
-
 
2637
            {
-
 
2638
                    Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
2283
            }
2639
            }
2284
        }
2640
        }
2285
        
2641
    
-
 
2642
    #print "--- Path: $cc_path, Label: $cc_label\n";
-
 
2643
 
2286
        if ( $cc_path_original ne $cc_path )
2644
        if ( $vcs_type eq 'SVN' )
2287
        {
2645
        {
2288
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
2646
            $rv = extractFilesFromSubversion( $data, $entry );
-
 
2647
            return $rv if ( $rv );
2289
        }
2648
        }
2290
    }
2649
        else
2291
    
2650
        {
-
 
2651
            #
-
 
2652
            #   Create CC view
2292
#print "--- Path: $cc_path, Label: $cc_label\n";
2653
            #   Import into Subversion View
-
 
2654
            #
-
 
2655
            $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label, $entry );
-
 
2656
            return $rv if ( $rv );
2293
 
2657
 
-
 
2658
            #
-
 
2659
            #   May need to limit the extracted source tree
-
 
2660
            #   Use the first selected directory that we have
-
 
2661
            #
2294
    if ( $vcs_type eq 'SVN' )
2662
            if ( @opt_selectProjectBase )
2295
    {
2663
            {
-
 
2664
                foreach ( @opt_selectProjectBase )
-
 
2665
                {
2296
        $rv = extractFilesFromSubversion( $data, $entry );
2666
                    my $testDir = join('/', $data->{ViewRoot}, $_);
-
 
2667
                    if ( -d $testDir )
-
 
2668
                    {
-
 
2669
                        $selectDir = $_;
-
 
2670
                        $data->{ViewPath} = $testDir;
2297
        return $rv if ( $rv );
2671
                        last;
2298
    }
2672
                    }
2299
    else
2673
                }
2300
    {
2674
 
-
 
2675
                unless ( $selectDir )
2301
        #
2676
                {
-
 
2677
                    Warning ("No directory selected from list");
2302
        #   Create CC view
2678
                }
2303
        #   Import into Subversion View
2679
                else
2304
        #
2680
                {
2305
        $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label );
2681
                    Message ("Selecting Dir: /$selectDir");
2306
        return $rv if ( $rv );
2682
                }
-
 
2683
            }
-
 
2684
        }
2307
    }
2685
    }
2308
 
2686
 
2309
    #
2687
    #
2310
    #   Delete specified files from the source tree
2688
    #   Delete specified files from the source tree
2311
    #
2689
    #
Line 2325... Line 2703...
2325
            unlink ( join ('/', $data->{ViewRoot}, $rmFile) )|| Warning "Cannot delete: $rmFile";
2703
            unlink ( join ('/', $data->{ViewRoot}, $rmFile) )|| Warning "Cannot delete: $rmFile";
2326
        }
2704
        }
2327
    }
2705
    }
2328
 
2706
 
2329
    #
2707
    #
-
 
2708
    #   Some packages contain softlinks - that break the file scanner
-
 
2709
    #
-
 
2710
    if ( $opt_deleteLinks )
-
 
2711
    {
-
 
2712
        # Not doing anything yet - fixed the JATS find bit
-
 
2713
    }
-
 
2714
 
-
 
2715
    #
2330
    #   Developers have been slack
2716
    #   Developers have been slack
2331
    #       Sometime the mark the source path as 'GMTPE2005'
2717
    #       Sometime the mark the source path as 'GMTPE2005'
2332
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
2718
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
2333
    #
2719
    #
2334
    #   Attempt to suck up empty directories below the specified
2720
    #   Attempt to suck up empty directories below the specified
2335
    #   source path
2721
    #   source path
2336
    #
2722
    #
2337
    unless ( $opt_preserveProjectBase || $opt_forceProjectBase || @opt_limitProjectBase)
2723
    unless (($opt_preserveProjectBase || $opt_forceProjectBase || @opt_limitProjectBase || $selectDir) && ! $opt_forceSuck)
2338
    {
2724
    {
2339
        #
2725
        #
2340
        #   Look in ViewPath
2726
        #   Look in ViewPath
2341
        #   If it contains only ONE directory then we can suck it up
2727
        #   If it contains only ONE directory then we can suck it up
2342
        #
2728
        #
Line 2355... Line 2741...
2355
    #
2741
    #
2356
    #   Check for bad source paths
2742
    #   Check for bad source paths
2357
    #
2743
    #
2358
    if (detectBadMakePaths($data) )
2744
    if (detectBadMakePaths($data) )
2359
    {
2745
    {
-
 
2746
        $count_BadPaths++;
2360
        unless ( $opt_ignoreBadPaths )
2747
        unless ( $opt_ignoreBadPaths )
2361
        {
2748
        {
2362
            $data->{BadPath}++;
2749
            $data->{BadPath}++;
2363
            $data->{errStr} = 'Bad Paths in Makefile';
2750
            $data->{errStr} = 'Bad Paths in Makefile';
2364
            return 4;           # Lets see what the others look like too
2751
            return 4;           # Lets see what the others look like too
Line 2543... Line 2930...
2543
    {
2930
    {
2544
        $data->{errStr} = 'Failed to import to SVN';
2931
        $data->{errStr} = 'Failed to import to SVN';
2545
        return 12;
2932
        return 12;
2546
    }
2933
    }
2547
 
2934
 
-
 
2935
    #
-
 
2936
    #   Some packages generate multiple packages
-
 
2937
    #   Some of these are the result of merging several packages
-
 
2938
    #   so we can only do this detection After the import
-
 
2939
    #
-
 
2940
    #   Detect potential build problems where multiple buildfiles
-
 
2941
    #   exists and cannot be resolved by our build system
-
 
2942
    #
-
 
2943
    #   This is not a show stopper (yet)
-
 
2944
    #
-
 
2945
    unless ( $opt_skipBuildNameCheck )
-
 
2946
    {
-
 
2947
        if (detectBuildFileClashes($data, 'SvnImportDir'))
-
 
2948
        {
-
 
2949
            unless ( $opt_ignoreBuildFileClashes )
-
 
2950
            {
-
 
2951
                $data->{BuildFileClash}++;
-
 
2952
                Message ("Build File Clash detected");
-
 
2953
            }
-
 
2954
        }
-
 
2955
    }
-
 
2956
    else
-
 
2957
    {
-
 
2958
        Message ('Detect Build File Clashes - skipped');
-
 
2959
    }
-
 
2960
 
2548
    $versions{$entry}{TagCreated} = 1;
2961
    $versions{$entry}{TagCreated} = 1;
2549
    $firstVersionCreated = $entry unless ( $firstVersionCreated );
2962
    $firstVersionCreated = $entry unless ( $firstVersionCreated );
2550
 
2963
 
2551
    #
2964
    #
2552
    #   Read in the Rm Reference
2965
    #   Read in the Rm Reference
Line 2731... Line 3144...
2731
#                   Perform the calculation to determine the details of
3144
#                   Perform the calculation to determine the details of
2732
#                   the branch point. The work will only be done when its
3145
#                   the branch point. The work will only be done when its
2733
#                   needed. This will avoid the creation of branchpoints
3146
#                   needed. This will avoid the creation of branchpoints
2734
#                   that are not used.
3147
#                   that are not used.
2735
#
3148
#
2736
# Inputs          : $entry                  Entry being processed
3149
# Inputs          : $entry          - Entry being processed
2737
#                   $author         - Who done it
3150
#                   $author         - Who done it
2738
#                   $date           - When
3151
#                   $date           - When
2739
#
3152
#
2740
# Returns         : 
3153
# Returns         : 
2741
#
3154
#
Line 2796... Line 3209...
2796
 
3209
 
2797
    #
3210
    #
2798
    #   Create target name
3211
    #   Create target name
2799
    #
3212
    #
2800
    my $tgt_label;
3213
    my $tgt_label;
-
 
3214
    if ($versions{$entry}{isaPatch} )
-
 
3215
    {
-
 
3216
        my $parent = $versions{$entry}{last};
-
 
3217
        my $pver = $versions{$parent}{vname};
-
 
3218
        $tgt_label = 'Patching_' . $pver;
-
 
3219
    }
2801
    if ( $forceNewProject || $versions{$entry}{newSuffix} || $createSuffix || !defined $src_label )
3220
    elsif ( $forceNewProject || $versions{$entry}{newSuffix} || $createSuffix || !defined $src_label )
2802
    {
3221
    {
2803
        #
3222
        #
2804
        #   Create target name based on project
3223
        #   Create target name based on project
2805
        #
3224
        #
2806
        return if ( $singleProject );
3225
        return if ( $singleProject );
Line 2920... Line 3339...
2920
    my $inernalErrorCount = 0;
3339
    my $inernalErrorCount = 0;
2921
    my $notProcessedCount = 0;
3340
    my $notProcessedCount = 0;
2922
    my $badPathCount = 0;
3341
    my $badPathCount = 0;
2923
    my $badProjectBaseCount = 0;
3342
    my $badProjectBaseCount = 0;
2924
    my $badMakeProjectCount = 0;
3343
    my $badMakeProjectCount = 0;
-
 
3344
    my $buildFileClashes = 0;
2925
 
3345
 
2926
    #
3346
    #
2927
    #   Display versions that did get captured
3347
    #   Display versions that did get captured
2928
    #
3348
    #
2929
    foreach my $entry ( @processOrder )
3349
    foreach my $entry ( @processOrder )
Line 2944... Line 3364...
2944
        {
3364
        {
2945
            $processedCount++;
3365
            $processedCount++;
2946
            $badPathCount++ if ($versions{$entry}{data}{BadPath} );
3366
            $badPathCount++ if ($versions{$entry}{data}{BadPath} );
2947
            $badProjectBaseCount++ if ($versions{$entry}{data}{BadProjectBase} );
3367
            $badProjectBaseCount++ if ($versions{$entry}{data}{BadProjectBase} );
2948
            $badMakeProjectCount++ if ($versions{$entry}{data}{BadMakeProject} );
3368
            $badMakeProjectCount++ if ($versions{$entry}{data}{BadMakeProject} );
-
 
3369
            $buildFileClashes++ if ($versions{$entry}{data}{BuildFileClash} );
2949
            next;
3370
            next;
2950
        }
3371
        }
2951
 
3372
 
2952
        my $reason = $versions{$entry}{data}{errStr} || '';
3373
        my $reason = $versions{$entry}{data}{errStr} || '';
2953
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
3374
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
Line 2981... Line 3402...
2981
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
3402
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
2982
    Warning ("Internal Errors: $inernalErrorCount") if ( $inernalErrorCount );
3403
    Warning ("Internal Errors: $inernalErrorCount") if ( $inernalErrorCount );
2983
    Warning ("Multiple source paths", @multiplePaths ) if ( scalar @multiplePaths > 1 );
3404
    Warning ("Multiple source paths", @multiplePaths ) if ( scalar @multiplePaths > 1 );
2984
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
3405
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
2985
    Warning ("Packages with Bad Paths: $badPathCount") if ( $badPathCount );
3406
    Warning ("Packages with Bad Paths: $badPathCount") if ( $badPathCount );
-
 
3407
    Warning ("Packages with Ignored Bad Paths: $badPathCount") if ( $count_BadPaths );
-
 
3408
 
2986
    Warning ("Packages with Bad ProjectBase: $badProjectBaseCount") if ( $badProjectBaseCount );
3409
    Warning ("Packages with Bad ProjectBase: $badProjectBaseCount") if ( $badProjectBaseCount );
2987
    Warning ("Packages with MakeProjects: $badMakeProjectCount") if ( $badMakeProjectCount );
3410
    Warning ("Packages with MakeProjects: $badMakeProjectCount") if ( $badMakeProjectCount );
-
 
3411
    Warning ("Build File Clashes Found: $buildFileClashes") if ( $buildFileClashes );
2988
    Warning ("Global Error Detected") if ( $globalError );
3412
    Warning ("Global Error Detected") if ( $globalError );
2989
    Message ("---- All Done -----");
3413
    Message ("---- All Done -----");
2990
}
3414
}
2991
 
3415
 
2992
#-------------------------------------------------------------------------------
3416
#-------------------------------------------------------------------------------
Line 2996... Line 3420...
2996
#                   May take a while as we handle nasty errors
3420
#                   May take a while as we handle nasty errors
2997
#
3421
#
2998
# Inputs          : $data           - Hash of good stuff from newPackageVersionBody
3422
# Inputs          : $data           - Hash of good stuff from newPackageVersionBody
2999
#                   $cc_path
3423
#                   $cc_path
3000
#                   $cc_label
3424
#                   $cc_label
-
 
3425
#                   $entry          - original PV entry
3001
#
3426
#
3002
# Returns         : exit code
3427
# Returns         : exit code
3003
#                   Sets up
3428
#                   Sets up
3004
#                       $data->{errStr}
3429
#                       $data->{errStr}
3005
#                       $data->{errCode}
3430
#                       $data->{errCode}
3006
#                   As per newPackageVersionBody
3431
#                   As per newPackageVersionBody
3007
#
3432
#
3008
sub extractFilesFromClearCase
3433
sub extractFilesFromClearCase
3009
{
3434
{
3010
    my ($data, $cc_path, $cc_label) = @_;
3435
    my ($data, $cc_path, $cc_label, $entry) = @_;
3011
    my $tryCount = 0;
3436
    my $tryCount = 0;
3012
    my $rv = 99;
3437
    my $rv = 99;
3013
 
3438
 
3014
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : "$cc_label";
3439
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : "$cc_label";
3015
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
3440
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
Line 3022... Line 3447...
3022
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
3447
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
3023
        Message ("Preserving Project Base");
3448
        Message ("Preserving Project Base");
3024
    }
3449
    }
3025
    $data->{ViewPath} =~  tr~/~/~s;
3450
    $data->{ViewPath} =~  tr~/~/~s;
3026
 
3451
 
-
 
3452
    #
-
 
3453
    #   Some versions are bad and have been manually marked as bad
-
 
3454
    #   Use touch cc2svn_ignore - to create file
-
 
3455
    #
-
 
3456
    if ( $opt_reuse && -f "$data->{ViewRoot}/cc2svn_ignore" )
-
 
3457
    {
-
 
3458
        Message ("View specifically ignored");
-
 
3459
        $data->{errStr} = 'View specifically ignored';
-
 
3460
        $data->{errCode} = '0';
-
 
3461
        return 4;               # Will Retain view
-
 
3462
    }
-
 
3463
 
-
 
3464
    #
-
 
3465
    #   Attempt to reuse compressed file
-
 
3466
    #
-
 
3467
    if ( $opt_reuse )
-
 
3468
    {
-
 
3469
        my $cfile = saneLabel($entry) . '.tgz';
-
 
3470
        if ( -f $cfile )
-
 
3471
        {
-
 
3472
            Message ("Restoring compressed image");
-
 
3473
            my $rv = System ('tar', '-xzf', $cfile );
-
 
3474
            if ( $rv )
-
 
3475
            {
-
 
3476
                Warning("Failed to decompress directory");
-
 
3477
                $data->{errStr} = 'Failed to de-tar compressed image';
-
 
3478
                return 2;
-
 
3479
            }
-
 
3480
            else
-
 
3481
            {
-
 
3482
                my $cc_vob = $cc_path;
-
 
3483
                $cc_vob =~ s~^/~~;
-
 
3484
                $cc_vob =~ s~/.*~~;
-
 
3485
                my $detarPath =  $data->{ViewRoot} . '/' . $cc_vob;
-
 
3486
 
-
 
3487
                Error ("Logic error: Did not de-tar into expected location", $detarPath)
-
 
3488
                    unless ( -d $detarPath  );
-
 
3489
 
-
 
3490
                if ( -d $data->{ViewPath}  )
-
 
3491
                {
-
 
3492
                    # All is good
-
 
3493
                    return 0;
-
 
3494
                }
-
 
3495
 
-
 
3496
                # Recalc ViewPath to the root of the VOB
-
 
3497
                $cc_path =~ s~^/~~;
-
 
3498
                $cc_path =~ s~/.*~~;
-
 
3499
                $cc_path = '/' . $cc_path;
-
 
3500
                $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
-
 
3501
 
-
 
3502
                return 0;
-
 
3503
            }
-
 
3504
        }
-
 
3505
    }
-
 
3506
 
3027
    if ( $opt_reuse && -d $data->{ViewPath}  )
3507
    if ( $opt_reuse && -d $data->{ViewPath}  )
3028
    {
3508
    {
3029
        Message ("Reusing view: $cc_label");
3509
        Message ("Reusing view: $cc_label");
-
 
3510
 
-
 
3511
        #
-
 
3512
        #   Br applet kludge - can be removed later
-
 
3513
        #   Add some nice data to each view
-
 
3514
#        open (FH, '>' , $data->{ViewRoot} . '/cc2svn_tag' ) || Error ("Cannot open '$data->{ViewRoot}/cc2svn_tag'");
-
 
3515
#        print FH $versions{$entry}{name},' ',$versions{$entry}{vname},"\n";
-
 
3516
#        close FH;
3030
        return 0;
3517
        return 0;
3031
    }
3518
    }
3032
 
3519
 
3033
    while ( $rv == 99 ) {
3520
    while ( $rv == 99 ) {
3034
        my @args;
3521
        my @args;
Line 3123... Line 3610...
3123
 
3610
 
3124
    #
3611
    #
3125
    #   Create a nice name for the import
3612
    #   Create a nice name for the import
3126
    #
3613
    #
3127
    my $import_label = saneLabel($entry);
3614
    my $import_label = saneLabel($entry);
3128
    
-
 
3129
 
3615
 
3130
    $data->{ViewRoot} = $opt_name ? $opt_name : $import_label;
3616
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : $import_label;
3131
    $data->{ViewPath} =  $data->{ViewRoot};
3617
    $data->{ViewPath} =  $data->{ViewRoot};
3132
    $data->{ViewPath} =~  tr~/~/~s;
3618
    $data->{ViewPath} =~  tr~/~/~s;
3133
 
3619
    
3134
    if ( $opt_reuse && -d $data->{ViewPath}  )
3620
    if ( $opt_reuse && -d $data->{ViewPath}  )
3135
    {
3621
    {
-
 
3622
        #
-
 
3623
        #   Br applet kludge - can be removed later
-
 
3624
        #   Add some nice data to each view
-
 
3625
#        open (FH, '>' , $data->{ViewRoot} . '/cc2svn_tag' ) || Error ("Cannot open '$data->{ViewRoot}/cc2svn_tag'");
-
 
3626
#        print FH $versions{$entry}{name},' ',$versions{$entry}{vname},"\n";
-
 
3627
#        close FH;
-
 
3628
        
3136
        Message ("Reusing view: $import_label");
3629
        Message ("Reusing view: $import_label");
3137
        return 0;
3630
        return 0;
3138
    }
3631
    }
3139
 
3632
 
3140
    #
3633
    #
Line 3184... Line 3677...
3184
    #
3677
    #
3185
    return 0;
3678
    return 0;
3186
}
3679
}
3187
 
3680
 
3188
#-------------------------------------------------------------------------------
3681
#-------------------------------------------------------------------------------
-
 
3682
# Function        : extractFilesFromStore
-
 
3683
#
-
 
3684
# Description     : Extract files from Store
-
 
3685
#                   Locaal directory under dpkgExtract
-
 
3686
#
-
 
3687
# Inputs          : $data           - Hash of good stuff from newPackageVersionBody
-
 
3688
#                   $entry          - All the PV information
-
 
3689
#
-
 
3690
# Returns         : exit code
-
 
3691
#                       1 - Files found
-
 
3692
#                       0 - Not found
-
 
3693
#
-
 
3694
sub extractFilesFromStore
-
 
3695
{
-
 
3696
    my ($data, $entry ) = @_;
-
 
3697
    #
-
 
3698
    #   Create a nice name for the import
-
 
3699
    #
-
 
3700
    my $import_label = saneLabel($entry);
-
 
3701
 
-
 
3702
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : $import_label;
-
 
3703
    $data->{ViewPath} =  'dpkgExtract/' . $data->{ViewRoot};
-
 
3704
    $data->{ViewPath} =~  tr~/~/~s;
-
 
3705
    
-
 
3706
    if ( -d $data->{ViewPath}  )
-
 
3707
    {
-
 
3708
        $data->{fromStore} = 1;
-
 
3709
        Message ("Reusing Stored view: $import_label");
-
 
3710
        return 1;
-
 
3711
    }
-
 
3712
 
-
 
3713
    #
-
 
3714
    #   Not found in store
-
 
3715
    #
-
 
3716
    delete $data->{ViewRoot};
-
 
3717
    delete $data->{ViewPath};
-
 
3718
    return 0;
-
 
3719
}
-
 
3720
 
-
 
3721
#-------------------------------------------------------------------------------
-
 
3722
# Function        : testDpkgArchive
-
 
3723
#
-
 
3724
# Description     : Indicate if the package exists in dpkg_archive
-
 
3725
#
-
 
3726
# Inputs          : 
-
 
3727
#
-
 
3728
# Returns         : 
-
 
3729
#
-
 
3730
sub testDpkgArchive
-
 
3731
{
-
 
3732
    my ($entry) = @_;
-
 
3733
    my $vname = $versions{$entry}{vname};
-
 
3734
 
-
 
3735
    if ( -d join('/', $ENV{GBE_DPKG}, $packageNames, $vname )) {
-
 
3736
        Message ("Version found in dpkg_archive");
-
 
3737
    } else {
-
 
3738
        Message ("Version NOT found in dpkg_archive");
-
 
3739
    }
-
 
3740
}
-
 
3741
 
-
 
3742
#-------------------------------------------------------------------------------
-
 
3743
# Function        : markDpkgArchive
-
 
3744
#
-
 
3745
# Description     : Indicate if the package exists in dpkg_archive
-
 
3746
#
-
 
3747
# Inputs          : 
-
 
3748
#
-
 
3749
# Returns         : 
-
 
3750
#
-
 
3751
sub markDpkgArchive
-
 
3752
{
-
 
3753
    my ($entry) = @_;
-
 
3754
    my $vname = $versions{$entry}{vname};
-
 
3755
    my $path = join('/', $ENV{GBE_DPKG}, $packageNames, $vname );
-
 
3756
    delete $versions{$entry}{dpkgArchive};
-
 
3757
    if ( -d $path ) {
-
 
3758
        $versions{$entry}{dpkgArchive} = $path;
-
 
3759
    }
-
 
3760
}
-
 
3761
 
-
 
3762
#-------------------------------------------------------------------------------
3189
# Function        : detectMakeProjectUsage
3763
# Function        : detectMakeProjectUsage
3190
#
3764
#
3191
# Description     : etect and report usage of the MakeProject directive
3765
# Description     : etect and report usage of the MakeProject directive
3192
#
3766
#
3193
# Inputs          : $data               - Ref to a hash of bits
3767
# Inputs          : $data               - Ref to a hash of bits
Line 3590... Line 4164...
3590
#                        $retval = 1;
4164
#                        $retval = 1;
3591
                         $definitionError++;
4165
                         $definitionError++;
3592
                    }
4166
                    }
3593
                    else
4167
                    else
3594
                    {
4168
                    {
-
 
4169
                        Warning ("Build: $buildFile");
-
 
4170
                        #
-
 
4171
                        #   Whats the file for
-
 
4172
                        #
-
 
4173
                        if (open (BF, '<', $buildFile ))
-
 
4174
                        {
-
 
4175
                            while ( <BF> )
-
 
4176
                            {
-
 
4177
                                s~\s+$~~;
-
 
4178
                                if ( m~\s*BuildName~ )
-
 
4179
                                {
-
 
4180
                                    Warning ("BuildName: $_");
-
 
4181
                                    last;
-
 
4182
                                }
-
 
4183
                            }
-
 
4184
                            close BF;
-
 
4185
                        }
-
 
4186
 
-
 
4187
 
3595
                        #
4188
                        #
3596
                        #   Determine the depth of the view root
4189
                        #   Determine the depth of the view root
3597
                        #
4190
                        #
3598
                        Warning ("Build: $buildFile");
-
 
3599
                        my $countPath = ($data->{ViewPath} =~ tr~/~/~);
4191
                        my $countPath = ($data->{ViewPath} =~ tr~/~/~);
3600
                        my $countBuild = ($buildFile =~ tr~/~/~);
4192
                        my $countBuild = ($buildFile =~ tr~/~/~);
3601
                        my $max_up = $countBuild - $countPath -1;
4193
                        my $max_up = $countBuild - $countPath -1;
3602
 
4194
 
3603
                        m~--Up=(\d+)~i;
4195
                        m~--Up=(\d+)~i;
Line 3640... Line 4232...
3640
    #
4232
    #
3641
    #   Detect defined, but not used
4233
    #   Detect defined, but not used
3642
    #
4234
    #
3643
    if ( $usesProjectBase && ! $definesProjectBase )
4235
    if ( $usesProjectBase && ! $definesProjectBase )
3644
    {
4236
    {
3645
        Warning ("SetProjectBase - Uses ProjectBase without defining it");
4237
        Warning ("SetProjectBase - Uses Default ProjectBase");
3646
    }
4238
    }
3647
 
4239
 
3648
    if ( ! $usesProjectBase && $definesProjectBase )
4240
    if ( ! $usesProjectBase && $definesProjectBase )
3649
    {
4241
    {
3650
        Warning ("SetProjectBase - Defines ProjectBase without using it");
4242
        Warning ("SetProjectBase - Defines ProjectBase without using it");
Line 3657... Line 4249...
3657
    }
4249
    }
3658
    return $retval;
4250
    return $retval;
3659
}
4251
}
3660
 
4252
 
3661
#-------------------------------------------------------------------------------
4253
#-------------------------------------------------------------------------------
-
 
4254
# Function        : detectBuildFileClashes
-
 
4255
#
-
 
4256
# Description     : Scan a directory for multiple buildfiles and conflicts
-
 
4257
#                   Only works for Jats build.pl files - at the moment
-
 
4258
#
-
 
4259
# Inputs          : $data       - PackageVersion Data
-
 
4260
#                   $rootDir    - Directory to scan
-
 
4261
#
-
 
4262
# Returns         : 0                   - All is well
-
 
4263
#                   !0                  - Multiple build files found
-
 
4264
#
-
 
4265
sub detectBuildFileClashes
-
 
4266
{
-
 
4267
    my ($pvdata, $rootDir) = @_;
-
 
4268
    my %data;
-
 
4269
    my $rv = 0;
-
 
4270
Message ('Detect Build File Clashes');
-
 
4271
 
-
 
4272
    my $bscanner = BuildFileScanner ( $rootDir, 'build.pl' );
-
 
4273
    my $count = $bscanner->locate();
-
 
4274
 
-
 
4275
    #
-
 
4276
    #   None found - OK ( but not good )
-
 
4277
    #
-
 
4278
    return $rv unless ( $count );
-
 
4279
 
-
 
4280
    #
-
 
4281
    #   Process all the build files in the tree
-
 
4282
    #
-
 
4283
    $bscanner->scan();
-
 
4284
    my @buildfiles = $bscanner->getMatchList();
-
 
4285
#   DebugDumpData('$bscanner', $bscanner );
-
 
4286
#   DebugDumpData('@buildfiles', \@buildfiles );
-
 
4287
#   exit 99;
-
 
4288
 
-
 
4289
    foreach my $bf ( @buildfiles )
-
 
4290
    {
-
 
4291
        my $bdir = $bf->{dir};
-
 
4292
        my $bname = $bf->{name};
-
 
4293
        my $bversion = $bf->{version};
-
 
4294
        next unless ( defined($bname) );
-
 
4295
Information ("BuildFiles: $bname, $bversion : $bdir");
-
 
4296
 
-
 
4297
        if ( exists ($data{$bname}{count}) && ($data{$bname}{count} >= 1) )
-
 
4298
        {
-
 
4299
            Warning ("MultipleBuildFiles for $bname ($bversion)");
-
 
4300
            $rv = 1;
-
 
4301
        }
-
 
4302
        $data{$bname}{count}++;
-
 
4303
        push @{$data{$bname}{versions}}, $bversion;
-
 
4304
    }
-
 
4305
 
-
 
4306
    return $rv;
-
 
4307
}
-
 
4308
 
-
 
4309
#-------------------------------------------------------------------------------
3662
# Function        : findDirWithStuff
4310
# Function        : findDirWithStuff
3663
#
4311
#
3664
# Description     : Find a directory that contains more than just another subdir
4312
# Description     : Find a directory that contains more than just another subdir
3665
#                   Note: don't use 'glob' it doesn't work if the name has a space in it.
4313
#                   Note: don't use 'glob' it doesn't work if the name has a space in it.
3666
#
4314
#
Line 3741... Line 4389...
3741
 
4389
 
3742
#-------------------------------------------------------------------------------
4390
#-------------------------------------------------------------------------------
3743
# Function        : saneLabel
4391
# Function        : saneLabel
3744
#
4392
#
3745
# Description     : Generate a sane version label
4393
# Description     : Generate a sane version label
3746
#                   Handle suplicates (due to character squishing)
4394
#                   Handle duplicates (due to character squishing)
3747
#                   Cache results for repeatability
4395
#                   Cache results for repeatability
3748
#
4396
#
3749
# Inputs          : $entry          - Version info
4397
# Inputs          : $entry          - Version info
3750
#                   $pkgname        - Alternate pkgname (branching)
4398
#                   $pkgname        - Alternate pkgname (branching)
3751
#
4399
#
Line 3967... Line 4615...
3967
                    #
4615
                    #
3968
                    next if ( $pkg_ver eq '23.23.23.ssw' );
4616
                    next if ( $pkg_ver eq '23.23.23.ssw' );
3969
 
4617
 
3970
                    #
4618
                    #
3971
                    #   Add data to the hash
4619
                    #   Add data to the hash
3972
                    #       Remove entries that address themselves
-
 
3973
                    #
4620
                    #
3974
                    push (@{$versions{$last_pv_id}{next}}, $pv_id) unless ($pv_id == $last_pv_id || $last_pv_id == 0) ;
-
 
3975
                    $versions{$pv_id}{name} = $pkg_name;
4621
                    $versions{$pv_id}{name} = $pkg_name;
3976
                    $versions{$pv_id}{pvid} = $pv_id;
4622
                    $versions{$pv_id}{pvid} = $pv_id;
3977
                    $versions{$pv_id}{vname} = $pkg_ver;
4623
                    $versions{$pv_id}{vname} = $pkg_ver;
3978
                    $versions{$pv_id}{vcsTag} = $vcstag;
4624
                    $versions{$pv_id}{vcsTag} = $vcstag;
3979
                    $versions{$pv_id}{created} = $created;
4625
                    $versions{$pv_id}{created} = $created;
Line 3987... Line 4633...
3987
                    examineVcsTag($pv_id);
4633
                    examineVcsTag($pv_id);
3988
 
4634
 
3989
                    #
4635
                    #
3990
                    #   Process version number
4636
                    #   Process version number
3991
                    #
4637
                    #
3992
                    my ($suffix, $version, $isaR, $isaWip, $buildVersion ) = massageVersion($pkg_ver, $pkg_name);
4638
                    my ($suffix, $version, $isaR, $isaWip, $buildVersion, $isaPatch ) = massageVersion($pkg_ver, $pkg_name);
3993
 
4639
 
3994
                    $versions{$pv_id}{version} = $version;
4640
                    $versions{$pv_id}{version} = $version;
3995
                    $versions{$pv_id}{buildVersion} = $buildVersion;
4641
                    $versions{$pv_id}{buildVersion} = $buildVersion;
3996
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
4642
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
-
 
4643
                    $versions{$pv_id}{isaPatch} = 1 if ( $isaPatch );
-
 
4644
 
-
 
4645
                    # Remove entries that address themselves
-
 
4646
                    push (@{$versions{$last_pv_id}{next}}, $pv_id) unless ($pv_id == $last_pv_id || $last_pv_id == 0 || $isaPatch) ;
-
 
4647
                    
3997
 
4648
 
3998
                    #
4649
                    #
3999
                    #   New method for detecting a ripple
4650
                    #   New method for detecting a ripple
4000
                    #       Don't look at the version number
4651
                    #       Don't look at the version number
4001
                    #       Use RM data
4652
                    #       Use RM data
Line 4052... Line 4703...
4052
    my ($major, $minor, $patch, $build, $suffix);
4703
    my ($major, $minor, $patch, $build, $suffix);
4053
    my $result;
4704
    my $result;
4054
    my $buildVersion;
4705
    my $buildVersion;
4055
    my $isaRipple;
4706
    my $isaRipple;
4056
    my $isaWIP;
4707
    my $isaWIP;
-
 
4708
    my $isaPatch;
4057
    $build = 0;
4709
    $build = 0;
4058
 
4710
 
4059
#print "--- $name, $version\n";
4711
#print "--- $name, $version\n";
4060
    $version =~ s~^_~~;
4712
    $version =~ s~^_~~;
4061
    $version =~ s~^${name}_~~;
4713
    $version =~ s~^${name}_~~;
Line 4064... Line 4716...
4064
    #   xxxxxxxxx.nnnn.cots
4716
    #   xxxxxxxxx.nnnn.cots
4065
    #
4717
    #
4066
    if ( $version =~ m~(.*)\.cots$~ ) {
4718
    if ( $version =~ m~(.*)\.cots$~ ) {
4067
        my $cots_base = $1;
4719
        my $cots_base = $1;
4068
        $suffix = '.cots';
4720
        $suffix = '.cots';
4069
        if ( $version =~ m~(.*?)\.([0-9]{4})\.cots$~ )
4721
        if ( $version =~ m~(.*?)\.([0-9]{4,5})\.cots$~ )
4070
        {
4722
        {
4071
            $result = $1 . sprintf (".%4.4d", $2) . $suffix;
4723
            $result = $1 . sprintf (".%4.4d", $2) . $suffix;
4072
        }
4724
        }
4073
        else
4725
        else
4074
        {
4726
        {
4075
            $result = $cots_base . '.0000.cots';
4727
            $result = $cots_base . '.0000.cots';
4076
        }
4728
        }
-
 
4729
        if ( $result =~ m~(.*)\.(\d+)(\d\d\d)\.cots$~ )
-
 
4730
        {
-
 
4731
            $buildVersion = [$1, 0 , $2, $3 ];
-
 
4732
        }
4077
    }
4733
    }
4078
    #
4734
    #
4079
    #   Convert version into full form for comparisions
4735
    #   Convert version into full form for comparisions
4080
    #       nnn.nnn.nnn.[p]nnn.xxx
4736
    #       nnn.nnn.nnn.[p]nnn.xxx
4081
    #       nnn.nnn.nnn.[p]nnn-xxx
4737
    #       nnn.nnn.nnn.[p]nnn-xxx
Line 4089... Line 4745...
4089
        $minor = $2;
4745
        $minor = $2;
4090
        $patch = $3;
4746
        $patch = $3;
4091
        $build = $4;
4747
        $build = $4;
4092
        $suffix = defined $6 ? ".$6" : '';
4748
        $suffix = defined $6 ? ".$6" : '';
4093
        $isaRipple = 0;
4749
        $isaRipple = 0;
-
 
4750
        $isaPatch = 1;
4094
    }
4751
    }
4095
    #
4752
    #
4096
    #       nn.nnn.nnnnn.xxx
4753
    #       nn.nnn.nnnnn.xxx
4097
    #       nn.nnn.nnnnn-xxx
4754
    #       nn.nnn.nnnnn-xxx
4098
    #       nnn.nnn.nnnx.xxx
4755
    #       nnn.nnn.nnnx.xxx
Line 4153... Line 4810...
4153
        $major = $1;
4810
        $major = $1;
4154
        $minor = $2;
4811
        $minor = $2;
4155
        $patch = 0;
4812
        $patch = 0;
4156
        $suffix = $3;
4813
        $suffix = $3;
4157
    }
4814
    }
-
 
4815
 
-
 
4816
    #
-
 
4817
    #       nnn.nnn.c.xxx
-
 
4818
    #
-
 
4819
    elsif ( $version =~ m~^(\d+)\.(\d+)\.(\w)(\.\w+)$~ ) {
-
 
4820
        $major = $1;
-
 
4821
        $minor = $2;
-
 
4822
        $patch = ord($3);
-
 
4823
        $suffix = $4;
-
 
4824
    }
-
 
4825
    
4158
    
4826
    
4159
    #
4827
    #
4160
    #       nnn.nnn.nnnz
4828
    #       nnn.nnn.nnnz
4161
    #
4829
    #
4162
    elsif ( $version =~ m~^(\d+)\.(\d+)\.(\d+)([a-z])$~ ) {
4830
    elsif ( $version =~ m~^(\d+)\.(\d+)\.(\d+)([a-z])$~ ) {
Line 4170... Line 4838...
4170
    #
4838
    #
4171
    #       ???REV=???
4839
    #       ???REV=???
4172
    #
4840
    #
4173
    elsif ( $version =~ m~REV=~ ) {
4841
    elsif ( $version =~ m~REV=~ ) {
4174
        $suffix = '.cots';
4842
        $suffix = '.cots';
4175
        $result = $version . '.0000.cots';
4843
        $result = $version . '.000000.cots';
4176
    }
4844
    }
4177
 
4845
 
4178
    #
4846
    #
4179
    #   Wip Packages
4847
    #   Wip Packages
4180
    #   (nnnnnn).xxx
4848
    #   (nnnnnn).xxx
4181
    #   Should be essential, but want to sort very low
4849
    #   Should be essential, but want to sort very low
4182
    #
4850
    #
4183
    elsif ($version =~ m~\((.*)\)(\..*)?~) {
4851
    elsif ($version =~ m~\((.*)\)(\..*)?~) {
4184
        $suffix = $2 || '';
4852
        $suffix = $2 || '';
4185
        $result = "000.000.000.000$suffix";
4853
        $result = "000.000.000.00000$suffix";
4186
        $isaWIP = 1;
4854
        $isaWIP = 1;
4187
    }
4855
    }
4188
 
4856
 
4189
    #
4857
    #
4190
    #   !current
4858
    #   !current
4191
    #
4859
    #
4192
    elsif ($version eq '!current' || $version eq 'current_$USER' || $version eq 'current' || $version eq 'beta' || $version eq 'latest' || $version eq 'beta.cr' || $version eq 'CREATE') {
4860
    elsif ($version eq '!current' || $version eq 'current_$USER' || $version eq 'current' || $version eq 'beta' || $version eq 'latest' || $version eq 'beta.cr' || $version eq 'CREATE') {
4193
        $suffix = '';
4861
        $suffix = '';
4194
        $result = "000.000.000.000$suffix";
4862
        $result = "000.000.000.00000$suffix";
4195
        $isaWIP = 1;
4863
        $isaWIP = 1;
4196
    }
4864
    }
4197
    
4865
    
4198
    #
4866
    #
4199
    #   Also WIP: FINRUN.103649.BEI.WIP
4867
    #   Also WIP: FINRUN.103649.BEI.WIP
4200
    elsif ($version =~ m~(\.[a-zA-Z]+)\.WIP$~) {
4868
    elsif ($version =~ m~(\.[a-zA-Z]+)\.WIP$~) {
4201
        $suffix = lc($1);
4869
        $suffix = lc($1);
4202
        $result = "000.000.000.000$suffix";
4870
        $result = "000.000.000.00000$suffix";
4203
        $isaWIP = 1;
4871
        $isaWIP = 1;
4204
    }
4872
    }
4205
 
4873
 
4206
    #
4874
    #
4207
    #   Also ERGOFSSLS190100_015
4875
    #   Also ERGOFSSLS190100_015
Line 4236... Line 4904...
4236
            $major = 0;
4904
            $major = 0;
4237
            $minor = 0;
4905
            $minor = 0;
4238
            $patch = 0;
4906
            $patch = 0;
4239
        }
4907
        }
4240
        
4908
        
4241
        $result = sprintf("%3.3d.%3.3d.%3.3d.%3.3d%s", $major,$minor,$patch,$build,$suffix || '.0000');
4909
        $result = sprintf("%3.3d.%3.3d.%3.3d.%5.5d%s", $major,$minor,$patch,$build,$suffix || '.0000');
4242
        $buildVersion = [ $major, $minor, $patch, $build ];
4910
        $buildVersion = [ $major, $minor, $patch, $build ];
4243
    }
4911
    }
4244
 
4912
 
4245
    $suffix = lc( $suffix );
4913
    $suffix = lc( $suffix );
4246
    if ( exists $suffixFixup{$suffix} )
4914
    if ( exists $suffixFixup{$suffix} )
4247
    {
4915
    {
4248
        $suffix = $suffixFixup{$suffix} ;
4916
        $suffix = $suffixFixup{$suffix} ;
4249
    }
4917
    }
4250
 
4918
 
4251
    return ($suffix, $result, $isaRipple, $isaWIP, $buildVersion );
4919
    return ($suffix, $result, $isaRipple, $isaWIP, $buildVersion, $isaPatch );
4252
}
4920
}
4253
 
4921
 
4254
#-------------------------------------------------------------------------------
4922
#-------------------------------------------------------------------------------
4255
# Function        : vcsCleanup
4923
# Function        : vcsCleanup
4256
#
4924
#
Line 4450... Line 5118...
4450
        #
5118
        #
4451
        if ( scalar @multiplePaths > 1 )
5119
        if ( scalar @multiplePaths > 1 )
4452
        {
5120
        {
4453
            push @text, '|';
5121
            push @text, '|';
4454
            push @text, 'Multiple Paths';
5122
            push @text, 'Multiple Paths';
-
 
5123
            if ( $opt_AllowMuliplePaths )
-
 
5124
            {
-
 
5125
                push @text, 'Multiple Paths allowed:' . scalar @multiplePaths . ' found';
-
 
5126
            }
-
 
5127
            else
-
 
5128
            {
4455
            push @text, @multiplePaths;
5129
                push @text, @multiplePaths;
-
 
5130
            }
4456
        }
5131
        }
4457
 
5132
 
4458
        #
5133
        #
4459
        #   Bad essentials
5134
        #   Bad essentials
4460
        #
5135
        #
Line 4508... Line 5183...
4508
        push @text, '(Coded information)';
5183
        push @text, '(Coded information)';
4509
        push @text, '|{Code';
5184
        push @text, '|{Code';
4510
        push @text, '|{N: Not Locked';
5185
        push @text, '|{N: Not Locked';
4511
        push @text, 'b: Bad Singleton';
5186
        push @text, 'b: Bad Singleton';
4512
        push @text, 'B: Bad VCS Tag';
5187
        push @text, 'B: Bad VCS Tag';
-
 
5188
        push @text, 'd: Package in dpkg_archive';
4513
        push @text, 'D: DeadWood';
5189
        push @text, 'D: DeadWood';
4514
        push @text, 'E: Essential Release Version';
5190
        push @text, 'E: Essential Release Version';
4515
        push @text, 'F: Package directories labled';
5191
        push @text, 'F: Package directories labled';
4516
        push @text, 'G: Glued into Version Tree';
5192
        push @text, 'G: Glued into Version Tree';
4517
        push @text, 'L: Label not in VOB';
5193
        push @text, 'L: Label not in VOB';
-
 
5194
        push @text, 'p: Is a Patch';
4518
        push @text, 'r: Recent version';
5195
        push @text, 'r: Recent version';
4519
        push @text, 'R: Ripple';
5196
        push @text, 'R: Ripple';
4520
        push @text, 'S: Splitpoint';
5197
        push @text, 'S: Splitpoint';
4521
        push @text, 't: Glued into Project Tree';
5198
        push @text, 't: Glued into Project Tree';
4522
        push @text, 'T: Tip version';
5199
        push @text, 'T: Tip version';
Line 4588... Line 5265...
4588
        $stateText .= 'b' if (exists $versions{$entry}{badSingleton});
5265
        $stateText .= 'b' if (exists $versions{$entry}{badSingleton});
4589
        $stateText .= 'B' if (exists $versions{$entry}{badVcsTag});
5266
        $stateText .= 'B' if (exists $versions{$entry}{badVcsTag});
4590
        $stateText .= 'G' if (exists $versions{$entry}{GluedIn});
5267
        $stateText .= 'G' if (exists $versions{$entry}{GluedIn});
4591
        $stateText .= 't' if (exists $versions{$entry}{MakeTree});
5268
        $stateText .= 't' if (exists $versions{$entry}{MakeTree});
4592
        $stateText .= 'E' if (exists $versions{$entry}{Essential});
5269
        $stateText .= 'E' if (exists $versions{$entry}{Essential});
-
 
5270
        $stateText .= 'd' if (exists $versions{$entry}{dpkgArchive});
4593
        $stateText .= 'D' if (exists $versions{$entry}{DeadWood});
5271
        $stateText .= 'D' if (exists $versions{$entry}{DeadWood});
-
 
5272
        $stateText .= 'p' if ( $versions{$entry}{isaPatch} );
4594
        $stateText .= 'R' if ( $versions{$entry}{isaRipple} );
5273
        $stateText .= 'R' if ( $versions{$entry}{isaRipple} );
4595
        $stateText .= 'r' if (exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
5274
        $stateText .= 'r' if (exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
4596
        $stateText .= 'S' if (exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
5275
        $stateText .= 'S' if (exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
4597
        $stateText .= 'T' if (exists $versions{$entry}{Tip} );
5276
        $stateText .= 'T' if (exists $versions{$entry}{Tip} );
4598
        $stateText .= 'V' if (exists $versions{$entry}{isSvn} );
5277
        $stateText .= 'V' if (exists $versions{$entry}{isSvn} );
Line 4795... Line 5474...
4795
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
5474
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4796
        if (exists $ScmRepoMap{$packageNames});
5475
        if (exists $ScmRepoMap{$packageNames});
4797
 
5476
 
4798
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
5477
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
4799
        if (exists $ScmRepoMap{$packageNames}{protected});
5478
        if (exists $ScmRepoMap{$packageNames}{protected});
-
 
5479
 
-
 
5480
    $opt_vobMap = '' if ( $opt_repoSubdir );
-
 
5481
 
4800
    #
5482
    #
4801
    #   Free the memory
5483
    #   Free the memory
4802
    #
5484
    #
4803
    %ScmRepoMap = ();
5485
    %ScmRepoMap = ();
4804
 
5486
 
4805
    #
5487
    #
4806
    #   Calculate Target Repo
5488
    #   Calculate Target Repo
4807
    #
5489
    #
4808
    Warning ("No VOB Mapping found")
5490
    Warning ("No VOB Mapping found")
4809
        unless ($opt_vobMap);
5491
        unless ($opt_vobMap || ($opt_repoSubdir && $opt_repo));
4810
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
5492
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4811
        unless ( $opt_repo || $opt_vobMap );
5493
        unless ( $opt_repo || $opt_vobMap );
4812
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
5494
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
-
 
5495
    $r1 = 'Import_test/' . $r1 if ( $opt_useTestRepo );
4813
    $r1 =~ s~//~/~g;
5496
    $r1 =~ s~//~/~g;
4814
    $r1 =~ s~^/~~;
5497
    $r1 =~ s~^/~~;
-
 
5498
    $r1 =~ s~/\.$~~;
4815
    $r1 =~ s~/$~~;
5499
    $r1 =~ s~/$~~;
4816
    $svnRepo = $opt_repo_base . $r1;
5500
    $svnRepo = $opt_repo_base . $r1;
4817
 
5501
 
4818
    Message( "Repo URL: $svnRepo");
5502
    Message( "Repo URL: $svnRepo");
4819
}
5503
}
Line 5010... Line 5694...
5010
    #
5694
    #
5011
    #   Process data
5695
    #   Process data
5012
    foreach my $entry ( @svnDataItems )
5696
    foreach my $entry ( @svnDataItems )
5013
    {
5697
    {
5014
        my $name;
5698
        my $name;
5015
        my $isaBranch;
-
 
5016
        my $target = $entry->{target};
5699
        my $target = $entry->{'target'};
5017
        if ( $target =~ m~/tags/(.*)~ ) {
5700
        if ( $target =~ m~/tags/(.*)~ ) {
5018
            $name = $1;
5701
            $name = $1;
5019
            $svnData{tags}{$name} = 1;
5702
            $svnData{tags}{$name} = 1;
5020
        } elsif ( $target =~ m~/branches/(.*)~ )  {
5703
        } elsif ( $target =~ m~/branches/(.*)~ )  {
5021
            $name = $1;
5704
            $name = $1;
Line 5023... Line 5706...
5023
        } else {
5706
        } else {
5024
            $svnData{nonTag}{$target} = 1;
5707
            $svnData{nonTag}{$target} = 1;
5025
        }
5708
        }
5026
 
5709
 
5027
        my $fromBranch;
5710
        my $fromBranch;
5028
        if ( $entry->{fromPath} =~ m~/trunk$~  ) {
5711
        if ( $entry->{'copyfrom-path'} =~ m~/trunk$~  ) {
5029
            $fromBranch = 'trunk';
5712
            $fromBranch = 'trunk';
5030
        } elsif ( $entry->{fromPath} =~ m~/branches/(.*)~ ) {
5713
        } elsif ( $entry->{'copyfrom-path'} =~ m~/branches/(.*)~ ) {
5031
            $fromBranch = $1;
5714
            $fromBranch = $1;
5032
        }
5715
        }
5033
 
5716
 
5034
        # largest Rev number on branch
5717
        # largest Rev number on branch
5035
        if ( exists $svnData{max}{$fromBranch} )
5718
        if ( exists $svnData{max} && exists $svnData{max}{$fromBranch} )
5036
        {
5719
        {
5037
            if ( $svnData{max}{$fromBranch}{rev} <  $entry->{fromRev} )
5720
            if ( $svnData{max}{$fromBranch}{rev} <  $entry->{'copyfrom-rev'} )
5038
            {
5721
            {
5039
                $svnData{max}{$fromBranch}{rev} =  $entry->{fromRev};
5722
                $svnData{max}{$fromBranch}{rev} =  $entry->{'copyfrom-rev'};
5040
                $svnData{max}{$fromBranch}{name} = $name;
5723
                $svnData{max}{$fromBranch}{name} = $name;
5041
            }
5724
            }
5042
        }
5725
        }
5043
        else
5726
        else
5044
        {
5727
        {
5045
            $svnData{max}{$fromBranch}{rev} =  $entry->{fromRev};
5728
            $svnData{max}{$fromBranch}{rev} =  $entry->{'copyfrom-rev'};
5046
            $svnData{max}{$fromBranch}{name} = $name;
5729
            $svnData{max}{$fromBranch}{name} = $name;
5047
        }
5730
        }
5048
    }
5731
    }
5049
 
5732
 
5050
    foreach my $branch ( keys %{$svnData{max}} )
5733
    foreach my $branch ( keys %{$svnData{max}} )
Line 5101... Line 5784...
5101
# Inputs          : 
5784
# Inputs          : 
5102
#
5785
#
5103
# Returns         : 
5786
# Returns         : 
5104
#
5787
#
5105
my $entryData;
5788
my $entryData;
-
 
5789
my $entryActive;
5106
sub  ProcessSvnLog
5790
sub  ProcessSvnLog
5107
{
5791
{
5108
    my ($self, $line ) = @_;
5792
    my ($self, $line ) = @_;
-
 
5793
    $entryActive = '' unless ( defined $entryActive );
-
 
5794
    return unless ( $line );
5109
#print "----- $line\n";
5795
#print "----- ($entryActive) $line\n";
-
 
5796
 
5110
    if ( $line =~ m~^<logentry~ ) {
5797
    if ( $line =~ m~^<logentry~ ) {
5111
        $entryData = ();
5798
        $entryData = ();
-
 
5799
        $entryActive = 'A';
5112
 
5800
 
5113
    } elsif ( $line =~ m~^\s+revision="(\d+)"~ ) {
5801
    } elsif ( ($line =~ s~\s*(.+?)="(.*)">(.*)</path>$~~) && ($entryActive eq 'A') ) {
-
 
5802
        #
-
 
5803
        #   Last entry has two items
-
 
5804
        #       Attribute
5114
        $entryData->{Rev} = $1;
5805
        #       Data Item
5115
 
5806
        #
5116
    } elsif ( $line =~ m~^\s+copyfrom-path="(.*)"~ ) {
5807
        $entryData->{$1} = $2;
5117
        $entryData->{fromPath} = $1;
5808
        $entryData->{target} = $3;
5118
 
5809
 
5119
    } elsif ( $line =~ m~^\s+copyfrom-rev="(\d+)"~ ) {
5810
    } elsif ( ($line =~ m~\s*(.*?)="(.*)"~) && ($entryActive eq 'A') ) {
-
 
5811
        #
5120
        $entryData->{fromRev} = $1;
5812
        #   Attribute
5121
        
5813
        #
5122
    } elsif ( $line =~ m~\s+action=.*?>(.*)</path~ ) {
-
 
5123
        $entryData->{target} = $1;
5814
        $entryData->{$1} = $2;
5124
 
5815
 
5125
    } elsif ( $line =~ m~</logentry~ ) {
5816
    } elsif ( $line =~ m~</logentry~ ) {
-
 
5817
        $entryActive = '';
5126
        if ( exists $entryData->{fromPath} )
5818
        if ( exists $entryData->{'copyfrom-path'} )
5127
        {
5819
        {
5128
#            DebugDumpData("Data", $entryData);
5820
#            DebugDumpData("Data", $entryData);
5129
            push @svnDataItems, $entryData;
5821
            push @svnDataItems, $entryData;
5130
        }
5822
        }
5131
    }
5823
    }
Line 5250... Line 5942...
5250
    -workdir=path      - Use for temp storage (def:/work)
5942
    -workdir=path      - Use for temp storage (def:/work)
5251
    -delete            - Delete SVN package before test
5943
    -delete            - Delete SVN package before test
5252
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
5944
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
5253
    -testRmDatabase    - Use test database
5945
    -testRmDatabase    - Use test database
5254
    -[no]fromSvn       - Also extract packages from SVN
5946
    -[no]fromSvn       - Also extract packages from SVN
-
 
5947
    -[no]testRepo      - Force use of a test repository.
-
 
5948
    -resume            - Resume aborted import (dangerous)
5255
 
5949
 
5256
=head1 OPTIONS
5950
=head1 OPTIONS
5257
 
5951
 
5258
=over 8
5952
=over 8
5259
 
5953