Subversion Repositories DevTools

Rev

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

Rev 2764 Rev 4003
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 71... Line 72...
71
my $opt_fileList;
72
my $opt_fileList;
72
my $opt_ccbase;
73
my $opt_ccbase;
73
my $opt_preserveProjectBase;
74
my $opt_preserveProjectBase;
74
my $opt_ignoreProjectBaseErrors;
75
my $opt_ignoreProjectBaseErrors;
75
my $opt_ignoreMakeProjectErrors;
76
my $opt_ignoreMakeProjectErrors;
-
 
77
my $opt_ignoreBuildFileClashes;
76
my $opt_forceProjectBase;
78
my $opt_forceProjectBase;
77
my @opt_limitProjectBase;
79
my @opt_limitProjectBase;
-
 
80
my @opt_selectProjectBase;
78
my @opt_mergePaths;
81
my @opt_mergePaths;
79
my $opt_ignoreBadPaths;
82
my $opt_ignoreBadPaths;
80
my $opt_delete;
83
my $opt_delete;
81
my $opt_recentAge = 14;             # Days
84
my $opt_recentAge = 14;             # Days
82
my $opt_relabel = 0;
85
my $opt_relabel = 0;
Line 86... Line 89...
86
my $opt_extractFromSvn;
89
my $opt_extractFromSvn;
87
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
90
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
88
my $opt_resume;
91
my $opt_resume;
89
my $opt_processRipples = 1;
92
my $opt_processRipples = 1;
90
my $opt_mergePackages;
93
my $opt_mergePackages;
-
 
94
my @opt_deleteFiles;
-
 
95
my $opt_useTestRepo;
-
 
96
my $opt_saveCompressed;
-
 
97
my $opt_skipBuildNameCheck;
-
 
98
my $opt_deleteLinks;
-
 
99
my $count_BadPaths = 0;
-
 
100
my $opt_IgnoreBadSourcePath;
-
 
101
my $opt_forceSuck;
-
 
102
my $opt_noVCS;
91
 
103
 
92
################################################################################
104
################################################################################
93
#   List of Projects Suffixes and Branch Names to be used within SVN
105
#   List of Projects Suffixes and Branch Names to be used within SVN
94
#
106
#
95
#       Name        - Name of branch for the project
107
#       Name        - Name of branch for the project
Line 121... Line 133...
121
    '.pmb'      => { Name => 'Pietermaritzburg' },
133
    '.pmb'      => { Name => 'Pietermaritzburg' },
122
    '.vps'      => { Name => 'VixPayments' },
134
    '.vps'      => { Name => 'VixPayments' },
123
    '.ncc'      => { Name => 'NSWClubCard' },
135
    '.ncc'      => { Name => 'NSWClubCard' },
124
    '.rm'       => { Name => 'Rome' },
136
    '.rm'       => { Name => 'Rome' },
125
    '.vss'      => { Name => 'SmartSite' },
137
    '.vss'      => { Name => 'SmartSite' },
-
 
138
    '.ssts'     => { Name => 'SydneySchoolbus' },
126
    'unknown'   => { Name => 'UnknownProject' },
139
    'unknown'   => { Name => 'UnknownProject' },
127
 
140
 
128
    '.ebr'      => { Name => 'eBrio' , Trunk => 1 },
141
    '.ebr'      => { Name => 'eBrio' , Trunk => 1 },
129
    '.mas'      => { Name => 'Mass'  , Trunk => 1 },
142
    '.mas'      => { Name => 'Mass'  , Trunk => 1 },
130
    '.cr'       => { Name => 'Core'  , Trunk => 1 },
143
    '.cr'       => { Name => 'Core'  , Trunk => 1 },
Line 143... Line 156...
143
    '.pxxx.sea'     => '.sea',
156
    '.pxxx.sea'     => '.sea',
144
    '.pxxx.syd'     => '.syd',
157
    '.pxxx.syd'     => '.syd',
145
    '.pxxx.sydddd'  => '.syd',
158
    '.pxxx.sydddd'  => '.syd',
146
    '.oslo'         => '.oso',
159
    '.oslo'         => '.oso',
147
    '.osl'          => '.oso',
160
    '.osl'          => '.oso',
-
 
161
    '.0x3'          => '.cr',
-
 
162
    '.0x4'          => '.cr',
-
 
163
    '.0x5'          => '.cr',
-
 
164
    '.0x13'         => '.cr',
148
);
165
);
149
 
166
 
150
my %specialPackages = (
167
my %specialPackages = (
151
    'core_devl'           =>  ',all,protected,',
168
    'core_devl'           =>  ',all,protected,',
152
    'daf_utils_mos'       => ',flat,',
169
    'daf_utils_mos'       => ',flat,',
Line 161... Line 178...
161
    'Dataman'             => ',utf8,',
178
    'Dataman'             => ',utf8,',
162
    'CommandServer'       => ',IgnoreMakeProject,',
179
    'CommandServer'       => ',IgnoreMakeProject,',
163
    'TDSExporterControl'  => ',IgnoreMakeProject,',
180
    'TDSExporterControl'  => ',IgnoreMakeProject,',
164
    'cdagui'              => ',IgnoreMakeProject,',
181
    'cdagui'              => ',IgnoreMakeProject,',
165
 
182
 
-
 
183
    'daf_bvt'                 => ',IgnoreMakeProject,',  # Look OK
-
 
184
    'daf_dll'                 => ',IgnoreMakeProject,',  # MakeProject not in used makefile
-
 
185
    'PFTPi'                   => ',IgnoreMakeProject,',  # Looks OK
-
 
186
    'PFTPu'                   => ',IgnoreMakeProject,',  # Looks OK
-
 
187
    'WinCEBlocker'            => ',IgnoreMakeProject,',  # Looks OK
-
 
188
    'WinCEDeviceAutoInject'   => ',IgnoreMakeProject,',  # Looks OK
-
 
189
    'WinCEReboot'             => ',IgnoreMakeProject,',  # Looks OK
166
 
190
 
167
    'ftp'                   => ',SetProjectBase,',
191
    'ftp'                   => ',SetProjectBase,',
168
    'ddu_app_manager'       => ',SetProjectBase,IgnoreMakeProject,',
192
    'ddu_app_manager'       => ',SetProjectBase,IgnoreMakeProject,',
169
    'ddu_afc'               => ',SetProjectBase,IgnoreMakeProject,',
193
    'ddu_afc'               => ',SetProjectBase,IgnoreMakeProject,',
170
    'ddu_dog'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
194
    'ddu_dog'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
Line 250... Line 274...
250
    'pcv_final_wce'                 => 'IgnoreMakeProject', # MakeProject Tested on at least one
274
    'pcv_final_wce'                 => 'IgnoreMakeProject', # MakeProject Tested on at least one
251
    'pcv_wce'                       => 'IgnoreMakeProject', # MakeProject Tested on at least one
275
    'pcv_wce'                       => 'IgnoreMakeProject', # MakeProject Tested on at least one
252
    'WinCEDeviceUpgrade'            => 'IgnoreMakeProject', # MakeProject Tested on at least one
276
    'WinCEDeviceUpgrade'            => 'IgnoreMakeProject', # MakeProject Tested on at least one
253
    'scil'                          => 'LimitProjectBase=/DPG_SWCode/projects/seattle/tvm',
277
    'scil'                          => 'LimitProjectBase=/DPG_SWCode/projects/seattle/tvm',
254
    'daf_br_compiler_support'       => 'ForceProjectBase=/DPG_SWBase/daf_br_compiler/support',
278
    'daf_br_compiler_support'       => 'ForceProjectBase=/DPG_SWBase/daf_br_compiler/support',
-
 
279
    'daf_br_th'                     => 'IgnoreBadPath,all,IgnoreMakeProject', # MakeProject Tested. Bad Paths not used
-
 
280
    'linux_kernel_bcp4600'          => 'ForceProjectBase=/LMOS/linux/kernel',
-
 
281
    'linux_kernel_viper'            => 'ForceProjectBase=/LMOS/linux/kernel',
-
 
282
    'linux_kernel_cobra'            => 'ForceProjectBase=/LMOS/linux/kernel',
255
 
283
 
256
    'LinuxDrivers'                  => 'flatTime,LimitProjectBase=/LMOS/linux/drivers'.
284
    'LinuxDrivers'                  => 'flatTime,processRipples,LimitProjectBase=/LMOS/linux/drivers'.
257
                                       ',mergePaths=modules:bcp4600:cobra:eb5600:etx86:tp5600:viper',
285
                                       ',mergePaths=modules:bcp4600:cobra:eb5600:etx86:tp5600:viper',
258
 
286
 
259
    'flashCopier'              => 'flatTime,LimitProjectBase=/LMOS/tools/flashCopier'.
287
    'flashCopier'                   => 'flatTime,LimitProjectBase=/LMOS/tools/flashCopier'.
260
                                       ',mergePaths=+:src:pcp5700:eb5600:tp5600',
288
                                       ',mergePaths=+:src:pcp5700:eb5600:tp5600',
261
 
289
 
-
 
290
    'u-boot'                        => 'flatTime,LimitProjectBase=/LMOS/linux/bootstrap/u-boot'.
-
 
291
                                       ',mergePaths=+:src:u-boot:u-boot-hk',
262
 
292
 
-
 
293
    'dams_gen1'                      => 'flatTime,LimitProjectBase=/LMOS/apps/dams'.
-
 
294
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:core:doc'.
-
 
295
                                       ',processRipples',
-
 
296
 
-
 
297
    'linux_day0fs_gen1'            => 'flatTime,LimitProjectBase=/LMOS/linux/filesystems/day0-fs'.
-
 
298
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:etx86:common'.
-
 
299
                                       ',processRipples',
-
 
300
 
-
 
301
    'linux_kernel_gen1'               => 'flatTime,mergePaths=,processRipples,LimitProjectBase=/LMOS/linux/kernel',
-
 
302
 
-
 
303
    'serpent'                         => 'flatTime,processRipples,LimitProjectBase=/LMOS/linux/kernel'.
-
 
304
                                         ',mergePaths=serpent-common:common:cobra:viper',
-
 
305
 
-
 
306
    'rt3070'                          => 'flatVersion',
-
 
307
 
-
 
308
    'TRACS'                           => 'IgnoreMakeProject,DeleteFiles=*.plg',   # not tested
-
 
309
 
-
 
310
    'qtobeapp'                        => 'Trunk=.uk',
-
 
311
 
-
 
312
    'br_applets'                      => 'flatTime,LimitProjectBase=/ProjectCD/seattle'.
-
 
313
                                       ',mergePaths=++:build/**:Sales/**:FarePayment/**:KCM/**:unit_test/**:VP/**:WSF/**'.
-
 
314
                                       ',processRipples',
-
 
315
 
-
 
316
    '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',
-
 
317
    
-
 
318
    'obme'                  => ',IgnoreMakeProject,',
-
 
319
 
-
 
320
    'apportionment'         => 'SkipBuildFileCheck',
-
 
321
    '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',
-
 
322
    'cvm'                   => 'SelectProjectBase=MASS_Dev_Bus/CBP/cvm/cpp:MASS_Dev_Bus/CBP/cvm',
-
 
323
    'esvrapi'               => 'SelectProjectBase=MASS_Dev_Bus/CBP/enquiry/esvrapi/cpp:MASS_Dev_Bus/CBP/enquiry/esvrapi',
-
 
324
    'Validation'            => 'SelectProjectBase=MASS_Dev_Bus/CBP/validation/validation/cpp:MASS_Dev_Bus/CBP/validation/validation',
-
 
325
    'txnfilter'             => 'DeleteLinks,SelectProjectBase=MASS_Dev_Bus/CBP/txnfilter/txnfilter:MASS_Dev_Bus/CBP/txnfilter/cpp:MASS_Dev_Bus/CBP/txnfilter',
-
 
326
 
-
 
327
    'card'                  => 'SelectProjectBase=MASS_Dev_Bus/Card/cpp:MASS_Dev_Bus/Card',
-
 
328
    'cbps'                  => 'SelectProjectBase=MASS_Dev_Bus/CBP/cbps/cpp:MASS_Dev_Bus/CBP/cbps:MASS_Dev_Bus/CBP',
-
 
329
    'issuercommon'          => 'SelectProjectBase=MASS_Dev_Bus/Issuer/issuerCommon/cpp:MASS_Dev_Bus/Issuer/issuerCommon',
-
 
330
    'ivp'                   => 'SelectProjectBase=MASS_Dev_Bus/CBP/ivp/ivp/cpp:MASS_Dev_Bus/CBP/ivp/ivp:MASS_Dev_Bus/CBP/ivp:MASS_Dev_Bus/CBP',
-
 
331
 
-
 
332
    'daf_transap_mag'       => 'SelectProjectBase=DPG_SWBase/transap/proxy/mag:DPG_SWBase/transap/proxy',
-
 
333
    'daf_transap_proxyman'  => 'SelectProjectBase=DPG_SWBase/transap/proxymanager',
-
 
334
    'daf_transap_rkf'       => 'SkipBuildFileCheck',
-
 
335
 
-
 
336
    'daf_cd_common'         => 'IgnoreProjectBase',
-
 
337
 
-
 
338
    'altp'                  => 'SelectProjectBase=MASS_Dev_Bus/CBP/al/altp/cpp:MASS_Dev_Bus/CBP/al/altp',
-
 
339
    'cfm'                   => 'SelectProjectBase=MASS_Dev_Bus/CBP/cfm/cpp:MASS_Dev_Bus/CBP/cfm',
-
 
340
    'enqdef'                => 'SelectProjectBase=MASS_Dev_Bus/CBP/enquiry/enqdef',
-
 
341
    'expstat'               => 'SelectProjectBase=MASS_Dev_Bus/CBP/expstat/cpp:MASS_Dev_Bus/CBP/expstat',
-
 
342
    'olsenqxdr'             => 'SelectProjectBase=MASS_Dev_Bus/CBP/enquiry/olsenqxdr/cpp:MASS_Dev_Bus/CBP/enquiry/olsenqxdr',
-
 
343
    'olseod'                => 'SelectProjectBase=MASS_Dev_Bus/CBP/olseod/olseod/cpp:MASS_Dev_Bus/CBP/olseod/olseod:MASS_Dev_Bus/CBP/olseod',
-
 
344
    'streamer'              => 'SelectProjectBase=MASS_Dev_Bus/CBP/streamer/cpp:MASS_Dev_Bus/CBP/streamer',
-
 
345
    'tgen'                  => 'SelectProjectBase=MASS_Dev_Bus/CBP/tgen/cpp:MASS_Dev_Bus/CBP/tgen',
-
 
346
 
-
 
347
    'daf_transap_ultralight'=> 'flatTime,processRipples,mergePaths=++',
-
 
348
#    'daf_cardshark'        => 'flatTime,processRipples,mergePaths=++',
-
 
349
 
-
 
350
    'emv_raw_cs'            => 'flatTime,processRipples,SelectProjectBase=DPG_SWBase/emv_cs/emv_raw_cs/cpf:DPG_SWBase/emv_cs/emv_raw_cs'.
-
 
351
                                    ',mergePaths=++:linux/**:win32/**',
-
 
352
    'OpManCronJob'          => 'SkipBuildFileCheck',
-
 
353
    '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',
-
 
354
    'obits_simulator'       => 'IgnoreMakeProject',
-
 
355
    'application'           => 'IgnoreMakeProject,SelectProjectBase=MASS_Dev_Bus/Application',
-
 
356
    'FinCommon'             => 'SkipBuildFileCheck,SelectProjectBase=MASS_Dev_Bus/Financial',
-
 
357
    'FinRun'                => 'SkipBuildFileCheck,SelectProjectBase=MASS_Dev_Bus/Financial',
-
 
358
    'olstxnstream'          => 'SelectProjectBase=MASS_Dev_Infra/core_olstxnstream',
-
 
359
 
-
 
360
    'product'               => 'SkipBuildFileCheck,SelectProjectBase=MASS_Dev_Bus/Product',
-
 
361
    'oracen-bei-patch'      => 'RetainCompressed',
-
 
362
    'oracen-patch'          => 'RetainCompressed',
-
 
363
    'pcv'                   => 'IgnoreMakeProject',
-
 
364
    'summarisation'         => 'SkipBuildFileCheck',
-
 
365
    'AVMApplicationEngine'  => 'IgnoreMakeProject',
-
 
366
    'ESL'                   => 'IgnoreMakeProject',
-
 
367
    'daf_br_oar'            => 'IgnoreProjectBase',         # Look OK
-
 
368
    'daf_br'                => 'RetainCompressed,IgnoreProjectBase,IgnoreMakeProject,SelectProjectBase=DPG_SWBase/daf_br:DPG_SWBase/br',    # Look OK
-
 
369
    'daf_dti'               => 'IgnoreProjectBase,SelectProjectBase=DPG_SWBase/dti;DPG_SWBase',
-
 
370
    'OcpGui'                => 'IgnoreMakeProject',
-
 
371
    'ssu5000'               => 'ForceProjectBase=/DPG_SWCode',
-
 
372
    'obftp'                 => 'IgnoreMakeProject,IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
373
    'saftp'                 => 'IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
374
    'PFTPp'                 => 'IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',        # Need to test
-
 
375
    'ocp5000'               => 'ForceProjectBase=/DPG_SWCode,RetainCompressed,IgnoreMakeProject', # Need to test
-
 
376
    'SPOS'                  => 'ForceProjectBase=/DPG_SWCode',
-
 
377
 
-
 
378
    'gak6000'               => 'ForceProjectBase=/DPG_SWCode,IgnoreProjectBase',
-
 
379
    'gak5000'               => 'ForceProjectBase=/DPG_SWCode,IgnoreProjectBase,IgnoreBadPath',
-
 
380
    'hcp5000'               => 'IgnoreMakeProject,ForceProjectBase=/DPG_SWCode,RetainCompressed,IgnoreBadSourcePath',
-
 
381
    'agents_unit'           => 'IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
382
 
-
 
383
    'tp5000'                => 'noVCS,IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
384
    'vcp5000'               => 'IgnoreProjectBase,ForceProjectBase=/DPG_SWCode',
-
 
385
 
-
 
386
    'MetrixOra'             => 'Trunk=.sea,ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples',
-
 
387
    'oracs'                 => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/oracs:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
-
 
388
    'oradacw'               => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/oradacw:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
-
 
389
    'orabocw'               => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/orabocw:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
263
 
390
 
264
 
391
 
265
    'icl'                   => 'IgnoreProjectBase,',
392
    'icl'                   => 'IgnoreProjectBase,',
266
    'itso'                  => 'IgnoreProjectBase,',
393
    'itso'                  => 'IgnoreProjectBase,',
267
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
394
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
Line 269... Line 396...
269
    'itso_ud'               => 'IgnoreProjectBase,',
396
    'itso_ud'               => 'IgnoreProjectBase,',
270
#    'mos_api'               => 'IgnoreProjectBase,',
397
#    'mos_api'               => 'IgnoreProjectBase,',
271
#    'mos_fonts'             => 'IgnoreProjectBase,',
398
#    'mos_fonts'             => 'IgnoreProjectBase,',
272
#    'sntp'                  => 'IgnoreProjectBase,',
399
#    'sntp'                  => 'IgnoreProjectBase,',
273
#    'time_it'               => 'IgnoreProjectBase,',
400
#    'time_it'               => 'IgnoreProjectBase,',
-
 
401
 
-
 
402
    'MOS'      => 'RetainCompressed,IgnoreProjectBase,',
-
 
403
 
-
 
404
 
-
 
405
 
274
);
406
);
275
 
407
 
-
 
408
 
-
 
409
my %mergePathExtended = (
-
 
410
 
-
 
411
    'linux_kernel_gen1' => {
-
 
412
            'linux_kernel_eb5600_2.6.21.1.0.cots' => '+:TP5600:EB5600:ETX86:common:packager.sflash:www.kernel.org:packager.grub',
-
 
413
            'linux_kernel_tp5600_2.6.21.1.0.cots' => '+:tp5600:eb5600:etx86:bcp4600:common:packager.sflash:www.kernel.org:packager.grub',
-
 
414
            },
-
 
415
 
-
 
416
    'serpent'   => {
-
 
417
        'linux_kernel_viper_2.6.24.6.0000.cots' => 'common:viper',
-
 
418
        'linux_kernel_viper_2.6.24.6.1000.cots' => 'serpent-common:cobra:viper',
-
 
419
 
-
 
420
    },
-
 
421
 
-
 
422
);
-
 
423
 
-
 
424
my %packageRippleControl = (
-
 
425
    'linux_drivers_etx86' => 'major',
-
 
426
    'linux_drivers_eb5600' => 'major',
-
 
427
    'linux_drivers_tp5600' => 'major',
-
 
428
);
-
 
429
 
-
 
430
 
276
my %notCots = (
431
my %notCots = (
277
    'isl'       => 1,
432
    'isl'       => 1,
278
);
433
);
279
 
434
 
280
my $ukHopsMode = 0;
-
 
281
my %ukHopsReleases = (
435
my %ukHopsReleases = (
282
    '6222'      => { name => 'MainLine', 'trunk' => 1 },
436
    '6222'      => { name => 'MainLine', 'trunk' => 1 },
283
    '14503'     => { name => 'Hops3' },
437
    '14503'     => { name => 'Hops3' },
284
    '21864'     => { name => 'Hops3.6' },
438
    '21864'     => { name => 'Hops3.6' },
285
    '22303'     => { name => 'Hops3.7' },
439
    '22303'     => { name => 'Hops3.7' },
Line 326... Line 480...
326
my $globalError;
480
my $globalError;
327
my @unknownProjects;
481
my @unknownProjects;
328
my %knownProjects;
482
my %knownProjects;
329
my $badSingletonCount = 0;
483
my $badSingletonCount = 0;
330
my @flatOrder;
484
my @flatOrder;
331
my $flatMode;
485
my $flatMode = 0;
332
my $pruneMode;
486
my $pruneMode;
333
my $pruneModeString;
487
my $pruneModeString;
334
my $threadId = 0;
488
my $threadId = 0;
335
my $threadCount;
489
my $threadCount;
336
my %tipVersions;
490
my %tipVersions;
Line 360... Line 514...
360
 
514
 
361
our $GBE_RM_URL;
515
our $GBE_RM_URL;
362
my $UNIX = $ENV{'GBE_UNIX'};
516
my $UNIX = $ENV{'GBE_UNIX'};
363
 
517
 
364
my $result = GetOptions (
518
my $result = GetOptions (
365
                "help+"         => \$opt_help,          # flag, multiple use allowed
519
                'help+'             => \$opt_help,          # flag, multiple use allowed
366
                "manual:3"      => \$opt_help,
520
                'manual:3'          => \$opt_help,
367
                "verbose:+"     => \$opt_verbose,       # Versose
521
                'verbose:+'         => \$opt_verbose,       # Versose
368
                "repository:s"  => \$opt_repo,          # Name of repository
522
                'repository:s'      => \$opt_repo,          # Name of repository
369
                'rbase:s'       => \$opt_repo_base,     # Base of the repo
523
                'rbase:s'           => \$opt_repo_base,     # Base of the repo
370
                "flat!"         => \$opt_flat,          # Flat structure
524
                'flat!'             => \$opt_flat,          # Flat structure
371
                "test!"         => \$opt_test,          # Test operations
525
                'test!'             => \$opt_test,          # Test operations
372
                "reuse:1"       => \$opt_reuse,         # Reuse ClearCase views 0:None, 1=Retain, 2=Use+Delete
526
                'reuse:1'           => \$opt_reuse,         # Reuse ClearCase views 0:None, 1=Retain, 2=Use+Delete
373
                "age:i"         => \$opt_age,           # Only recent versions
527
                'age:i'             => \$opt_age,           # Only recent versions
374
                "dump:1"        => \$opt_dump,          # Dump Data
528
                'dump:1'            => \$opt_dump,          # Dump Data
375
                "images:1"      => \$opt_images,        # Create DOT images
529
                'images:1'          => \$opt_images,        # Create DOT images
376
                "retain:i"      => \$opt_retaincount,   # Retain N packages
530
                'retain:i'          => \$opt_retaincount,   # Retain N packages
377
                "pruneMode:s"   => \$opt_pruneModeString,
531
                'pruneMode:s'       => \$opt_pruneModeString,
378
                "listtags:i"    => \$opt_listTags,
532
                'listtags:i'        => \$opt_listTags,
379
                "name:s"        => \$opt_name,          # Alternate output
533
                'name:s'            => \$opt_name,          # Alternate output
380
                "tip:s"         => \@opt_tip,           # Force tip version(s)
534
                'tip:s'             => \@opt_tip,           # Force tip version(s)
381
                "log!"          => \$opt_log,
535
                'log!'              => \$opt_log,
382
                "delete!"       => \$opt_delete,
536
                'delete!'           => \$opt_delete,
383
                "postimage!"    => \$opt_postimage,
537
                'postimage!'        => \$opt_postimage,
384
                'workdir:s'         => \$opt_workDir,
538
                'workdir:s'         => \$opt_workDir,
385
                'relabel!'          => \$opt_relabel,
539
                'relabel!'          => \$opt_relabel,
386
                'svn!'              => \$opt_useSvn,
540
                'svn!'              => \$opt_useSvn,
387
                'testRmDatabase'    => \$opt_testRmDatabase,
541
                'testRmDatabase'    => \$opt_testRmDatabase,
388
                'fromSvn!'          => \$opt_extractFromSvn,
-
 
389
                'resume'            => \$opt_resume,
542
                'resume'            => \$opt_resume,
390
                'mergePackages:s'   => \$opt_mergePackages,
543
                'mergePackages:s'   => \$opt_mergePackages,
391
 
544
 
392
                # File list support
545
                # File list support
393
                'filelist:s'    => \$opt_fileList,      # A list of CC tags
546
                'filelist:s'        => \$opt_fileList,      # A list of CC tags
394
                'subdir:s'      => \$opt_repoSubdir,    # Subdir within repo
547
                'subdir:s'          => \$opt_repoSubdir,    # Subdir within repo
395
                'ccbase:s'      => \$opt_ccbase,        # ClearCase Base for CC Tags
548
                'ccbase:s'          => \$opt_ccbase,        # ClearCase Base for CC Tags
-
 
549
                'testRepo!'         => \$opt_useTestRepo,
-
 
550
                'novcs'             => \$opt_noVCS,
396
                
551
                
397
                );
552
                );
398
 
553
 
399
#
554
#
400
#   Process help and manual options
555
#   Process help and manual options
Line 442... Line 597...
442
#
597
#
443
if ( $opt_mergePackages )
598
if ( $opt_mergePackages )
444
{
599
{
445
    if ( $opt_mergePackages eq 'LinuxDrivers' )
600
    if ( $opt_mergePackages eq 'LinuxDrivers' )
446
    {
601
    {
-
 
602
        $opt_name = $opt_mergePackages;
447
        @ARGV = qw (linux_drivers_eb5600
603
        @ARGV = qw (linux_drivers_eb5600
448
                    linux_drivers_viper
604
                    linux_drivers_viper
449
                    linux_drivers_cobra
605
                    linux_drivers_cobra
450
                    linux_drivers_etx86
606
                    linux_drivers_etx86
451
                    linux_drivers_tp5600);
607
                    linux_drivers_tp5600);
452
#                    linux_drivers_bcp4600
608
#                    linux_drivers_bcp4600
453
                    
609
                    
454
        $opt_name = $opt_mergePackages;
-
 
455
 
610
 
456
    } elsif ( $opt_mergePackages eq 'flashCopier' )
611
    } elsif ( $opt_mergePackages eq 'flashCopier' ) {
457
    {
612
        $opt_name = $opt_mergePackages;
458
        @ARGV = qw (
613
        @ARGV = qw (
459
                flash_copier_eb5600
614
                flash_copier_eb5600
460
                flash_copier_pcp5700
615
                flash_copier_pcp5700
461
                flash_copier_tp5600
616
                flash_copier_tp5600
462
                );
617
                );
463
 
618
 
-
 
619
    } elsif ( $opt_mergePackages eq 'u-boot' ) {
464
        $opt_name = $opt_mergePackages;
620
        $opt_name = $opt_mergePackages;
-
 
621
        @ARGV = qw (
-
 
622
                u-boot
-
 
623
                u-boot-hk
-
 
624
                );
465
 
625
 
-
 
626
    } elsif ( $opt_mergePackages eq 'dams_gen1' ) {
-
 
627
        $opt_name = $opt_mergePackages;
-
 
628
        @ARGV = qw (
-
 
629
                    dams_eb5600
-
 
630
                    dams_pcp5700
-
 
631
                    dams_tp5600
-
 
632
                );
-
 
633
 
-
 
634
    } elsif ( $opt_mergePackages eq 'linux_day0fs_gen1' ) {
-
 
635
        $opt_name = $opt_mergePackages;
-
 
636
        @ARGV = qw (
-
 
637
                    linux_day0fs_eb5600
-
 
638
                    linux_day0fs_tp5600
-
 
639
                    linux_day0fs_etx86
-
 
640
                );
-
 
641
 
-
 
642
    } elsif ( $opt_mergePackages eq 'linux_kernel_gen1' ) {
-
 
643
        $opt_name = $opt_mergePackages;
-
 
644
        @ARGV = qw (
-
 
645
                    linux_kernel_etx86
-
 
646
                    linux_kernel_tp5600
-
 
647
                    linux_kernel_eb5600
-
 
648
                    linux_kernel_bcp4600
-
 
649
                );
-
 
650
 
-
 
651
    } elsif ( $opt_mergePackages eq 'serpent' ) {
-
 
652
        $opt_name = $opt_mergePackages;
-
 
653
        @ARGV = qw (
-
 
654
                    linux_kernel_viper
-
 
655
                    linux_kernel_cobra
-
 
656
                );
-
 
657
 
-
 
658
    } elsif ( $opt_mergePackages eq 'emv_raw_cs_merge' ) {
-
 
659
        $opt_name = 'emv_raw_cs';
-
 
660
        @ARGV = qw (
-
 
661
                    emv_raw_cs
-
 
662
                    emv_raw_cs-w32
-
 
663
                );
-
 
664
                
-
 
665
 
-
 
666
    } elsif ( $opt_mergePackages eq 'seattleBr' ) {
-
 
667
        $opt_name = 'br_applets';
-
 
668
        @ARGV = qw (
-
 
669
                    br_applet_cst
-
 
670
                    br_applet_gak_wsf
-
 
671
                    br_applet_gak_wsf_pos
-
 
672
                    br_applet_obftp_ct
-
 
673
                    br_applet_obftp_et
-
 
674
                    br_applet_obftp_kcm
-
 
675
                    br_applet_obftp_kt
-
 
676
                    br_applet_obftp_pt
-
 
677
                    br_applet_obftp_st
-
 
678
                    br_applet_pftp_ct_brt
-
 
679
                    br_applet_pftp_ct_vanpool
-
 
680
                    br_applet_pftp_kcm_dart
-
 
681
                    br_applet_pftp_kcm_rr
-
 
682
                    br_applet_pftp_kcm_vanpool
-
 
683
                    br_applet_pftp_kt
-
 
684
                    br_applet_pftp_pt_vanpool
-
 
685
                    br_applet_pftp_st
-
 
686
                    br_applet_pftp_st_llr
-
 
687
                    br_applet_pftp_wsf
-
 
688
                    br_applet_saftp_ct_brt
-
 
689
                    br_applet_saftp_kcm_rr
-
 
690
                    br_applet_saftp_st
-
 
691
                    br_applet_saftp_st_llr
-
 
692
                    br_applet_tru
-
 
693
                    br_applet_tvm
-
 
694
                    unit_test_br_cst
-
 
695
                    unit_test_br_gak
-
 
696
                    unit_test_br_kcm_ct_saftp
-
 
697
                    unit_test_br_obftp
-
 
698
                    unit_test_br_st_saftp
-
 
699
                    unit_test_br_vanpool
-
 
700
                    SalesConfiguration
-
 
701
                );
466
    } else
702
    } else
467
    {
703
    {
468
        Error ("Unknown Merge Package Name: $opt_mergePackages");
704
        Error ("Unknown Merge Package Name: $opt_mergePackages");
469
    }
705
    }
470
}
706
}
Line 552... Line 788...
552
#    @flatOrder = sort {$versions{$a}{created} cmp $versions{$b}{created}} keys(%versions);
788
#    @flatOrder = sort {$versions{$a}{created} cmp $versions{$b}{created}} keys(%versions);
553
 
789
 
554
    if ( $flatMode == 1 ) {
790
    if ( $flatMode == 1 ) {
555
        Message ("Flat import. Sorted by TimeStamp");
791
        Message ("Flat import. Sorted by TimeStamp");
556
        @flatOrder = sort {$versions{$a}{TimeStamp} cmp $versions{$b}{TimeStamp}} keys(%versions);
792
        @flatOrder = sort {$versions{$a}{TimeStamp} cmp $versions{$b}{TimeStamp}} keys(%versions);
-
 
793
    } elsif ( $flatMode == 2 ) {
-
 
794
        Message ("Flat import. Sorted by Version");
-
 
795
 
-
 
796
        # Only iff all the bits are numeric
-
 
797
        sub sortCotsVersion
-
 
798
        {
-
 
799
            my @va = split '\.', $versions{$a}{vname};
-
 
800
            my @vb = split '\.', $versions{$b}{vname};
-
 
801
 
-
 
802
            my $rv = scalar @va <=> scalar @vb;
-
 
803
            return $rv if ( $rv );
-
 
804
 
-
 
805
            foreach my $ii ( 0 .. scalar @va )
-
 
806
            {
-
 
807
                $va[$ii] = '' unless ( defined $va[$ii] );
-
 
808
                $vb[$ii] = '' unless ( defined $vb[$ii] );
-
 
809
                if ( ($va[$ii] =~ m~^\d+$~) && ($va[$ii] =~ m~^\d+$~)  )
-
 
810
                {
-
 
811
                    $rv = $va[$ii] <=> $vb[$ii];
-
 
812
                }
-
 
813
                else
-
 
814
                {
-
 
815
                    $rv = $va[$ii] cmp $vb[$ii];
-
 
816
                }
-
 
817
                return $rv if ( $rv );
-
 
818
            }
-
 
819
            return $rv;
-
 
820
        }
-
 
821
 
-
 
822
        @flatOrder = sort sortCotsVersion keys(%versions);
-
 
823
#        @flatOrder = sort {$versions{$a}{vname} cmp $versions{$b}{vname}} keys(%versions);
557
    } else {
824
    } else {
558
        @flatOrder = sort {$a <=> $b} keys(%versions);
825
        @flatOrder = sort {$a <=> $b} keys(%versions);
559
    }
826
    }
560
    my $tip = $flatOrder[-1];
827
    my $tip = $flatOrder[-1];
561
    $versions{$tip}{Tip} = 1 if $tip;
828
    $versions{$tip}{Tip} = 1 if $tip;
562
}
829
}
563
 
830
 
564
#
831
#
565
#   Generate dumps and images
832
#   Generate dumps and images
566
#
833
#
567
if ( $opt_images )
834
if ( $opt_images || 1 )
568
{
835
{
569
    createImages();
836
    createImages();
570
}
837
}
571
 
838
 
572
if ( $opt_dump )
839
if ( $opt_dump )
Line 648... Line 915...
648
    {
915
    {
649
        newProject();
916
        newProject();
650
        foreach my $entry (@flatOrder )
917
        foreach my $entry (@flatOrder )
651
        {
918
        {
652
            newPackageVersion( $entry, $versions{$entry}{suffix} );
919
            newPackageVersion( $entry, $versions{$entry}{suffix} );
653
            unless ( $globalError )
-
 
654
            {
-
 
655
                getSvnData();
-
 
656
                createImages();
-
 
657
            }
-
 
658
        }
920
        }
659
    }
921
    }
660
    else
922
    else
661
    {
923
    {
662
        processBranch(@allStartPoints);
924
        processBranch(@allStartPoints);
Line 816... Line 1078...
816
            Message ("Flatten import tree. Sort by Time");
1078
            Message ("Flatten import tree. Sort by Time");
817
            $opt_flat = 1;
1079
            $opt_flat = 1;
818
            $flatMode = 1;          # By Time
1080
            $flatMode = 1;          # By Time
819
            $opt_processRipples = 0;
1081
            $opt_processRipples = 0;
820
        }
1082
        }
-
 
1083
 
-
 
1084
        if ( index( $data, ',flatVersion,' ) >= 0) {
-
 
1085
            Message ("Flatten import tree. Sort by Version");
-
 
1086
            $opt_flat = 1;
-
 
1087
            $flatMode = 2;          # By Version
-
 
1088
            $opt_processRipples = 0;
821
        
1089
        }
-
 
1090
 
-
 
1091
        if ( index( $data, ',processRipples,' ) >= 0) {
-
 
1092
            $opt_processRipples = 1;
-
 
1093
        }
-
 
1094
 
-
 
1095
        if ( index( $data, ',NoProcessRipples,' ) >= 0) {
-
 
1096
            $opt_processRipples = 0;
-
 
1097
            Message ("Disable Processing of ripples");
-
 
1098
        }
-
 
1099
 
-
 
1100
        if ( index( $data, ',noVCS,' ) >= 0) {
-
 
1101
            $opt_noVCS = 1;
-
 
1102
            Message ("Use of ClearCase disabled.");
-
 
1103
        }
822
 
1104
 
823
        if ( index( $data, ',SetProjectBase,' ) >= 0) {
1105
        if ( index( $data, ',SetProjectBase,' ) >= 0) {
824
            $opt_preserveProjectBase = 1;
1106
            $opt_preserveProjectBase = 1;
825
            $opt_ignoreProjectBaseErrors = 1;
1107
            $opt_ignoreProjectBaseErrors = 1;
826
            Message ("Preserving ProjectBase");
1108
            Message ("Preserving ProjectBase");
Line 829... Line 1111...
829
        if ( index( $data, ',AllowMultiPath,' ) >= 0) {
1111
        if ( index( $data, ',AllowMultiPath,' ) >= 0) {
830
            $opt_AllowMuliplePaths = 1;
1112
            $opt_AllowMuliplePaths = 1;
831
            Message ("Allowing Multiple Paths");
1113
            Message ("Allowing Multiple Paths");
832
        }
1114
        }
833
 
1115
 
-
 
1116
        if ( index( $data, ',IgnoreBadSourcePath,' ) >= 0) {
-
 
1117
            $opt_IgnoreBadSourcePath = 1;
-
 
1118
            Message ("Ignore Source Paths tagged as Bad");
-
 
1119
        }
-
 
1120
        
834
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
1121
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
835
            $opt_forceProjectBase = $1;
1122
            $opt_forceProjectBase = $1;
836
            $opt_AllowMuliplePaths = 1;
1123
            $opt_AllowMuliplePaths = 1;
837
            Message ("Force Project Base: $opt_forceProjectBase");
1124
            Message ("Force Project Base: $opt_forceProjectBase");
838
        }
1125
        }
839
 
1126
 
-
 
1127
 
840
        if ( $data =~ m~,LimitProjectBase=(.*?),~ ) {
1128
        if ( $data =~ m~,LimitProjectBase=(.*?),~ ) {
841
            $opt_AllowMuliplePaths = 1;
1129
            $opt_AllowMuliplePaths = 1;
842
            @opt_limitProjectBase = split(':', $1);
1130
            @opt_limitProjectBase = split(':', $1);
843
            Message ("Limit Project Base: @opt_limitProjectBase");
1131
            Message ("Limit Project Base: @opt_limitProjectBase");
844
        }
1132
        }
845
 
1133
 
-
 
1134
        if ( $data =~ m~,SelectProjectBase=(.*?),~ ) {
-
 
1135
            $opt_AllowMuliplePaths = 1;
-
 
1136
            @opt_selectProjectBase = split(':', $1);
-
 
1137
            Message ("Select Project Base from: @opt_selectProjectBase");
-
 
1138
        }
-
 
1139
        
846
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
1140
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
847
            @opt_mergePaths = split(':', $1);
1141
            @opt_mergePaths = split(':', $1);
848
            Message ("Merge Paths: @opt_mergePaths");
1142
            Message ("Merge Paths: @opt_mergePaths");
849
        }
1143
        }
850
 
1144
 
-
 
1145
        if ( $data =~ m~,DeleteFiles=(.*?),~ ) {
-
 
1146
            @opt_deleteFiles = split(':', $1);
-
 
1147
            Message ("Delete Files: @opt_deleteFiles");
-
 
1148
        }
-
 
1149
 
-
 
1150
        if ( $data =~ m~,DeleteLinks,~ ) {
-
 
1151
            $opt_deleteLinks = 1;
-
 
1152
            Message ("Delete soft links");
-
 
1153
        }
-
 
1154
 
-
 
1155
        if ( index( $data, ',ForceSuck,' ) >= 0) {
-
 
1156
            $opt_forceSuck = 1;
-
 
1157
            Message ("Force sucking empty directories");
-
 
1158
        }
-
 
1159
 
851
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
1160
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
852
            $opt_ignoreProjectBaseErrors = 1;
1161
            $opt_ignoreProjectBaseErrors = 1;
853
            Message ("Ignore ProjectBase Errors");
1162
            Message ("Ignore ProjectBase Errors");
854
        }
1163
        }
855
 
1164
 
856
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
1165
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
857
            $opt_ignoreMakeProjectErrors = 1;
1166
            $opt_ignoreMakeProjectErrors = 1;
858
            Message ("Ignore MakeProject Usage");
1167
            Message ("Ignore MakeProject Usage");
859
        }
1168
        }
860
 
1169
 
-
 
1170
        if ( index( $data, ',NoBuildFileCheck,' ) >= 0) {
-
 
1171
            $opt_ignoreBuildFileClashes = 1;
-
 
1172
            Message ("Ignoring Build File Clashes");
-
 
1173
        }
-
 
1174
 
-
 
1175
        if ( index( $data, ',SkipBuildFileCheck,' ) >= 0) {
-
 
1176
            $opt_skipBuildNameCheck = 1;
-
 
1177
            Message ("Skip Build File Clashes Testing");
-
 
1178
        }
-
 
1179
        
861
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
1180
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
862
            $opt_ignoreBadPaths = 1;
1181
            $opt_ignoreBadPaths = 1;
863
            Message ("Ignore Bad Paths in makefile Usage");
1182
            Message ("Ignore Bad Paths in makefile Usage");
864
        }
1183
        }
865
        
1184
        
866
        if ( index( $data, ',utf8,' ) >= 0) {
1185
        if ( index( $data, ',utf8,' ) >= 0) {
867
            $mustConvertFileNames = 1;
1186
            $mustConvertFileNames = 1;
868
            Message ("Convert filenames to UTF8");
1187
            Message ("Convert filenames to UTF8");
869
        }
1188
        }
-
 
1189
 
-
 
1190
        if ( index( $data, ',NoRetain,' ) >= 0) {
-
 
1191
            $opt_reuse = 2;
-
 
1192
            Message ("Package Versions not Retained");
-
 
1193
        }
-
 
1194
 
-
 
1195
        if ( index( $data, ',RetainCompressed,' ) >= 0) {
-
 
1196
            $opt_saveCompressed = 1;
-
 
1197
            Message ("Package Versions will be retained as compressed images");
-
 
1198
        }
-
 
1199
        
-
 
1200
 
-
 
1201
        if ( $data =~ m~,Trunk=(.*?),~ ) {
-
 
1202
            my $tt = $1;
-
 
1203
            $Projects{$tt}{Trunk} = 1;
-
 
1204
            Message ("Force project to trunk: $tt");
-
 
1205
        }
870
    }
1206
    }
871
 
1207
 
872
    Message("Package Type: $packageType, $pruneModeString");
1208
    Message("Package Type: $packageType, $pruneModeString");
873
}
1209
}
874
 
1210
 
Line 961... Line 1297...
961
            {
1297
            {
962
                my $ep = $versions{$entry};
1298
                my $ep = $versions{$entry};
963
                unless ( $ep->{last} || $ep->{next}[0] )
1299
                unless ( $ep->{last} || $ep->{next}[0] )
964
                {
1300
                {
965
#                    if (  $ep->{isaWip}  )
1301
#                    if (  $ep->{isaWip}  )
966
                    if ( (exists $ep->{badVcsTag} && $ep->{badVcsTag}) || $ep->{isaWip}  )
1302
                    if ( (!$opt_IgnoreBadSourcePath  && (exists $ep->{badVcsTag}  && $ep->{badVcsTag})) || $ep->{isaWip} )
967
                    {
1303
                    {
968
                        $ep->{badSingleton} = 1;
1304
                        $ep->{badSingleton} = 1;
969
                        $reprocess = 1;
1305
                        $reprocess = 1;
970
                        $badSingletonCount++;
1306
                        $badSingletonCount++;
971
 
1307
 
Line 981... Line 1317...
981
            calcLinks()
1317
            calcLinks()
982
                if ( $reprocess );
1318
                if ( $reprocess );
983
        }
1319
        }
984
 
1320
 
985
        #
1321
        #
-
 
1322
        #   True Patches show up as singletons - they have no parent
-
 
1323
        #   Need to create strands of patches to be glued onto the base
-
 
1324
        #
-
 
1325
        unless( $opt_fileList ){
-
 
1326
            my %patchTree;
-
 
1327
            my $patchSeen;
-
 
1328
            Message ("Creating patch threads");
-
 
1329
            foreach my $entry ( sort {$versions{$a}{version} cmp $versions{$b}{version}} @startPoints )
-
 
1330
            {
-
 
1331
                my $ep = $versions{$entry};
-
 
1332
                next unless ( defined $ep->{buildVersion} );
-
 
1333
 
-
 
1334
                my $suffix = $ep->{name} . $ep->{suffix};
-
 
1335
 
-
 
1336
                my ($major, $minor, $patch, $build) = @{$ep->{buildVersion}};
-
 
1337
 
-
 
1338
                my $patchBase = sprintf ("%3.3d.%3.3d.%3.3d.$suffix", $major, $minor, $patch);
-
 
1339
                
-
 
1340
                if ( defined $ep->{buildVersion} )
-
 
1341
                {
-
 
1342
                    if ( $ep->{isaPatch} )
-
 
1343
                    {
-
 
1344
                        push @{$patchTree{$patchBase}}, $entry;
-
 
1345
                        $ep->{patchRoot} = $patchBase;
-
 
1346
                        $patchSeen++;
-
 
1347
                    }
-
 
1348
                }
-
 
1349
            }
-
 
1350
 
-
 
1351
            my %patchRoot;
-
 
1352
            if ($patchSeen)
-
 
1353
            {
-
 
1354
                foreach my $entry ( sort {$versions{$a}{version} cmp $versions{$b}{version}} keys %versions )
-
 
1355
                {
-
 
1356
                    my $ep = $versions{$entry};
-
 
1357
                    next if ( $ep->{isaPatch} );
-
 
1358
                    next unless ( defined $ep->{buildVersion} );
-
 
1359
 
-
 
1360
                    my $suffix = $ep->{name} . $ep->{suffix};
-
 
1361
                    my ($major, $minor, $patch, $build) = @{$ep->{buildVersion}};
-
 
1362
                    my $patchBase = sprintf ("%3.3d.%3.3d.%3.3d.$suffix", $major, $minor, $patch);
-
 
1363
 
-
 
1364
                    if ( defined $patchRoot{$patchBase})
-
 
1365
                    {
-
 
1366
                        Warning ("Multiple Patch Roots identified", $versions{$patchRoot{$patchBase}}{vname},$ep->{vname}, "Both hash to: " . $patchBase );
-
 
1367
                    }
-
 
1368
                    else
-
 
1369
                    {
-
 
1370
                        $patchRoot{$patchBase} = $entry;
-
 
1371
                    }
-
 
1372
                }
-
 
1373
 
-
 
1374
#DebugDumpData('%patchRoot', \%patchRoot );
-
 
1375
                foreach  ( keys %patchTree )
-
 
1376
                {
-
 
1377
                    my $last;
-
 
1378
                    foreach my $entry ( sort {$versions{$a}{version} cmp $versions{$b}{version}} @{$patchTree{$_}} )
-
 
1379
                    {
-
 
1380
                        if ( $last )
-
 
1381
                        {
-
 
1382
                            $versions{$last}{MakeTree} = 1;
-
 
1383
                            push @{$versions{$last}{next}}, $entry;
-
 
1384
                            $reprocess = 1;
-
 
1385
                        }
-
 
1386
                        else
-
 
1387
                        {
-
 
1388
                            # First entry in thread.
-
 
1389
 
-
 
1390
# print "--- Patch Branch $versions{$entry}{vname}\n";
-
 
1391
                            $versions{$entry}{branchPoint} = 2;
-
 
1392
                            
-
 
1393
 
-
 
1394
                            my $patchBase = $versions{$entry}{patchRoot};
-
 
1395
                            my $patchBaseEntry = $patchRoot{$patchBase};
-
 
1396
                            if ( $patchBase )
-
 
1397
                            {
-
 
1398
 
-
 
1399
                                if ( defined($patchBaseEntry) && exists ($versions{$patchBaseEntry}) )
-
 
1400
                                {
-
 
1401
                                    push @{$versions{$patchBaseEntry}{next}}, $entry;
-
 
1402
#    Message( "Attaching ",$versions{$entry}{version}," to $patchBase");
-
 
1403
                                }
-
 
1404
                                else
-
 
1405
                                {
-
 
1406
    Message( "Cannot Attach ",$versions{$entry}{version}," to $patchBase" );
-
 
1407
                                    Warning ("Cannot attach thread. No base version");
-
 
1408
                                }
-
 
1409
                            }
-
 
1410
                        }
-
 
1411
                        $last = $entry;
-
 
1412
                    }
-
 
1413
                }
-
 
1414
            }
-
 
1415
            calcLinks()
-
 
1416
                if ( $reprocess );
-
 
1417
        }
-
 
1418
#DebugDumpData('$verions', \%versions );
-
 
1419
 
-
 
1420
        #
986
        #   Create simple trees out of the chains
1421
        #   Create simple trees out of the chains
987
        #   Tree is based on suffix (project) and version
1422
        #   Tree is based on suffix (project) and version
988
        #
1423
        #
989
        {
1424
        {
990
            my %trees;
1425
            my %trees;
Line 996... Line 1431...
996
            }
1431
            }
997
 
1432
 
998
            foreach  ( keys %trees )
1433
            foreach  ( keys %trees )
999
            {
1434
            {
1000
                my $last;
1435
                my $last;
1001
                foreach my $entry ( sort { $versions{$a}{version} cmp $versions{$b}{version}  } @{$trees{$_}} )
1436
                foreach my $entry ( sort {$versions{$a}{version} cmp $versions{$b}{version}} @{$trees{$_}} )
1002
                {
1437
                {
1003
                    if ( $last )
1438
                    if ( $last )
1004
                    {
1439
                    {
1005
                        $versions{$last}{MakeTree} = 1;
1440
                        $versions{$last}{MakeTree} = 1;
1006
                        push @{$versions{$last}{next}}, $entry;
1441
                        push @{$versions{$last}{next}}, $entry;
Line 1543... Line 1978...
1543
    #   Display warnings about Bad Essential Packages
1978
    #   Display warnings about Bad Essential Packages
1544
    #
1979
    #
1545
    $allSvn = 1;
1980
    $allSvn = 1;
1546
    foreach my $entry ( keys(%versions) )
1981
    foreach my $entry ( keys(%versions) )
1547
    {
1982
    {
-
 
1983
        markDpkgArchive($entry);
1548
        $rippleCount++ if ( exists($versions{$entry}{isaRipple}) && $versions{$entry}{isaRipple} );
1984
        $rippleCount++ if ( exists($versions{$entry}{isaRipple}) && $versions{$entry}{isaRipple} );
1549
        $allSvn = 0 unless ( $versions{$entry}{isSvn} );
1985
        $allSvn = 0 unless ( $versions{$entry}{isSvn} );
1550
        next unless ( exists $versions{$entry}{Essential}  );
1986
        next unless ( exists $versions{$entry}{Essential}  );
1551
        next unless ( $versions{$entry}{badVcsTag}  );
1987
        next unless ( $versions{$entry}{badVcsTag}  );
1552
        push @badEssentials, $entry;
1988
        push @badEssentials, $entry;
1553
        Warning ("BadVCS Essential: " . GetVname($entry))
1989
        Warning ("BadVCS Essential: " . GetVname($entry));
1554
    }
1990
    }
1555
 
1991
 
1556
    #
1992
    #
1557
    #   All done
1993
    #   All done
1558
    #
1994
    #
Line 1671... Line 2107...
1671
    {
2107
    {
1672
        my $ep = $versions{$entry};
2108
        my $ep = $versions{$entry};
1673
        if ( defined $ep->{buildVersion} )
2109
        if ( defined $ep->{buildVersion} )
1674
        {
2110
        {
1675
            my $suffix = $ep->{suffix};
2111
            my $suffix = $ep->{suffix};
-
 
2112
            my $pname = $ep->{name};
-
 
2113
            $suffix = $pname . $suffix;
-
 
2114
 
1676
            my ($major, $minor, $patch, $build) = @{$ep->{buildVersion}};
2115
            my ($major, $minor, $patch, $build) = @{$ep->{buildVersion}};
1677
#print "--- $major, $minor, $patch, $build, $suffix\n";
2116
#print "--- $major, $minor, $patch, $build, $suffix\n";
-
 
2117
 
-
 
2118
            my $key;
-
 
2119
            my $type = 'patch';
-
 
2120
            $type = $packageRippleControl{$pname} if ( exists  $packageRippleControl{$pname});
-
 
2121
            if ( $type eq 'patch' ) {
-
 
2122
                $key = "$major.$minor.$patch";
-
 
2123
#                $build = $build;
-
 
2124
 
-
 
2125
            } elsif ( $type eq 'minor' ) {
-
 
2126
                $key = "$major.$minor";
-
 
2127
#                $build = ($patch * 1000) + $build;
-
 
2128
 
-
 
2129
            } elsif ( $type eq 'major' ) {
-
 
2130
                $key = "$major";
-
 
2131
#                $build = ($minor * 1000000) + ($patch * 1000) + $build;
-
 
2132
            } else {
-
 
2133
                Error ("Invalid type in packageRippleControl for package $pname: $type");
-
 
2134
            }
-
 
2135
 
1678
            $rippleVersions{$suffix}{"$major.$minor.$patch"}{count}++;
2136
            $rippleVersions{$suffix}{$key}{count}++;
1679
            my $rp = $rippleVersions{$suffix}{"$major.$minor.$patch"};
2137
            my $rp = $rippleVersions{$suffix}{$key};
1680
            $rp->{list}{$entry} = 1;
2138
            $rp->{list}{$entry} = $versions{$entry}{version};
1681
 
2139
 
1682
            next if ( $ep->{badVcsTag} );
2140
#            next if ( $ep->{badVcsTag} );
1683
            next if ( $ep->{locked} eq 'N');
2141
#            next if ( $ep->{locked} eq 'N');
-
 
2142
 
1684
            if (!defined ($rp->{min}) || $rp->{min} > $build )
2143
#            if (!defined ($rp->{min}) || $rp->{min} > $build )
1685
            {
2144
#            {
1686
                $rp->{pvid} = $entry;
2145
#                $rp->{pvid} = $entry;
1687
                $rp->{min} = $build;
2146
#                $rp->{min} = $build;
1688
            }
2147
#            }
1689
        }
2148
        }
1690
    }
2149
    }
1691
#            DebugDumpData("rippleVersions", \%rippleVersions );
2150
#            DebugDumpData("rippleVersions", \%rippleVersions );
1692
 
2151
 
1693
    while ( my($suffix, $e1) = each %rippleVersions )
2152
    while ( my($suffix, $e1) = each %rippleVersions )
1694
    {
2153
    {
-
 
2154
#DebugDumpData("rippleVersions. Suffix , e1", $suffix, $e1 );
-
 
2155
        
1695
        while ( my( $mmp, $e2) = each %{$e1} )
2156
        while ( my( $mmp, $e2) = each %{$e1} )
1696
        {
2157
        {
1697
            next unless ( exists  $e2->{pvid} );
2158
#            next unless ( exists  $e2->{pvid} );
1698
            my $entry = $e2->{pvid};
2159
#            my $entry = $e2->{pvid};
1699
            if ( !exists $versions{$entry} )
2160
#            if ( !exists $versions{$entry} )
1700
            {
2161
#            {
1701
                Error ("Internal: Expected entry not found: $entry, $mmp");
2162
#                Error ("Internal: Expected entry not found: $entry, $mmp");
1702
            }
2163
#            }
1703
 
2164
#
1704
            $versions{$entry}{keepLowestRipple} = 1;
2165
#            $versions{$entry}{keepLowestRipple} = 1;
1705
#print "--- Keep Riple $versions{$entry}{vname}\n";
2166
#print "--- Keep Ripple: $versions{$entry}{name} $versions{$entry}{vname}\n";
1706
 
2167
 
1707
            #
2168
            #
1708
            #   Update entry with list of associated ripples, removing lowest
2169
            #   Update entry with list of associated ripples, removing lowest
1709
            #
2170
            #
-
 
2171
            my @rippleList = sort {$e2->{list}{$a} cmp $e2->{list}{$b}} keys %{$e2->{list}};
1710
            delete $e2->{list}{$entry};
2172
            my $firstEntry = shift @rippleList;
1711
            my @rippleList = sort keys %{$e2->{list}};
2173
            $versions{$firstEntry}{keepLowestRipple} = 1;
-
 
2174
#print "--- Keep Lowest: $versions{$firstEntry}{name} $versions{$firstEntry}{vname}\n";
-
 
2175
 
1712
            if ( @rippleList)
2176
            if ( @rippleList)
1713
            {
2177
            {
1714
#DebugDumpData("LIST: $entry", $e2->{list}, \@rippleList  );
2178
#DebugDumpData("LIST: $entry", $e2->{list}, \@rippleList  );
1715
                @{$versions{$entry}{rippleList}} = @rippleList;
2179
                @{$versions{$firstEntry}{rippleList}} = @rippleList;
-
 
2180
 
-
 
2181
#                foreach my $pvid ( @rippleList )
-
 
2182
#                {
-
 
2183
#                    print "----- $versions{$pvid}{name} $versions{$pvid}{vname}\n";
-
 
2184
#                }
1716
            }
2185
            }
1717
        }
2186
        }
1718
    }
2187
    }
-
 
2188
#    Error ("Just Testing");
1719
}
2189
}
1720
 
2190
 
1721
#-------------------------------------------------------------------------------
2191
#-------------------------------------------------------------------------------
1722
# Function        : processBranch
2192
# Function        : processBranch
1723
#
2193
#
Line 1742... Line 2212...
1742
            $createBranch = 1;
2212
            $createBranch = 1;
1743
            $createSuffix = 1 if $versions{$entry}{newSuffix};
2213
            $createSuffix = 1 if $versions{$entry}{newSuffix};
1744
        }
2214
        }
1745
 
2215
 
1746
        newPackageVersion( $entry );
2216
        newPackageVersion( $entry );
1747
        unless ( $globalError )
-
 
1748
        {
-
 
1749
            getSvnData();
-
 
1750
            createImages();
-
 
1751
        }
-
 
1752
 
2217
 
1753
no warnings "recursion";
2218
no warnings "recursion";
1754
        processBranch (@{$versions{$entry}{next}});
2219
        processBranch (@{$versions{$entry}{next}});
1755
    }
2220
    }
1756
}
2221
}
Line 1806... Line 2271...
1806
    }
2271
    }
1807
    else
2272
    else
1808
    {
2273
    {
1809
        #
2274
        #
1810
        #   Call worker function
2275
        #   Call worker function
1811
        #   It will exist on any error so that it can be logged
2276
        #   It will exit on any error so that it can be logged
1812
        #
2277
        #
1813
        $rv = newPackageVersionBody( \%data, @_ );
2278
        $rv = newPackageVersionBody( \%data, @_ );
1814
        $globalError = 1 if ( $rv >= 10 );
2279
        $globalError = 1 if ( $rv >= 10 );
1815
    }
2280
    }
1816
 
2281
 
Line 1867... Line 2332...
1867
    #   Delete the created view
2332
    #   Delete the created view
1868
    #   Its just a directory, so delete it
2333
    #   Its just a directory, so delete it
1869
    #
2334
    #
1870
    if ( $data{ViewRoot} && -d $data{ViewRoot})
2335
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1871
    {
2336
    {
-
 
2337
        my $cfile = saneLabel($entry) . '.tgz';
1872
        if ( $opt_reuse == 0 || $opt_reuse == 2 || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
2338
        if ( $opt_reuse == 0 || $opt_reuse == 2 || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
1873
        {
2339
        {
1874
            Message ("Delete View: $data{ViewRoot}");
2340
            Message ("Delete View: $data{ViewRoot}");
1875
            RmDirTree ($data{ViewRoot} );
2341
            RmDirTree ($data{ViewRoot} );
-
 
2342
            unlink $cfile;
1876
        }
2343
        }
1877
        else
2344
        else
1878
        {
2345
        {
1879
            Message ("Retaining View: $data{ViewRoot}");
2346
            Message ("Retaining View: $data{ViewRoot}");
-
 
2347
            if ( $opt_saveCompressed )
-
 
2348
            {
-
 
2349
                Message ("Compressing the retained directory");
-
 
2350
                unless ( -f $cfile || -f "more/$cfile" )
-
 
2351
                {
-
 
2352
                    my $rv = System ('tar', '-czf', $cfile, $data{ViewRoot} );
-
 
2353
                    if ( $rv )
-
 
2354
                    {
-
 
2355
                        Warning("Failed to compress directory");
-
 
2356
                    }
-
 
2357
                }
-
 
2358
                else
-
 
2359
                {
-
 
2360
                    Message ("Reusing compressed file");
-
 
2361
                }
-
 
2362
                RmDirTree ($data{ViewRoot} );
-
 
2363
            }
1880
        }
2364
        }
1881
 
2365
 
1882
    }
2366
    }
1883
    else
2367
    else
1884
    {
2368
    {
1885
        Message ("No view to delete");
2369
        Message ("No view to delete");
1886
    }
2370
    }
1887
 
2371
 
-
 
2372
    #
-
 
2373
    #   Create pretty pictures
-
 
2374
    #
-
 
2375
    unless ( $rv )
-
 
2376
    {
-
 
2377
        getSvnData();
-
 
2378
        createImages();
-
 
2379
    }
-
 
2380
 
1888
 
2381
 
1889
    if($opt_processRipples)
2382
    if($opt_processRipples)
1890
    {
2383
    {
1891
        #
2384
        #
1892
        #   If this version has any 'ripples' then process them while we have the
2385
        #   If this version has any 'ripples' then process them while we have the
Line 1905... Line 2398...
1905
 
2398
 
1906
            Message ("Proccessing associated Ripple: " . GetVname($rentry));
2399
            Message ("Proccessing associated Ripple: " . GetVname($rentry));
1907
            newPackageVersion($rentry);
2400
            newPackageVersion($rentry);
1908
        }
2401
        }
1909
    }
2402
    }
-
 
2403
 
1910
}
2404
}
1911
 
2405
 
1912
#-------------------------------------------------------------------------------
2406
#-------------------------------------------------------------------------------
1913
# Function        : newPackageVersionBody
2407
# Function        : newPackageVersionBody
1914
#
2408
#
Line 1940... Line 2434...
1940
    my $rv;
2434
    my $rv;
1941
    my $vcs_type;
2435
    my $vcs_type;
1942
    my $cc_label;
2436
    my $cc_label;
1943
    my $cc_path;
2437
    my $cc_path;
1944
    my $cc_path_original;
2438
    my $cc_path_original;
-
 
2439
    my $selectDir;
1945
 
2440
 
1946
    #
2441
    #
1947
    #   Init Data
2442
    #   Init Data
1948
    #
2443
    #
1949
    $data->{rmRef} = 'ERROR';
2444
    $data->{rmRef} = 'ERROR';
Line 2012... Line 2507...
2012
#        $data->{errStr} = 'Package is DeadWood';
2507
#        $data->{errStr} = 'Package is DeadWood';
2013
#        return 3;
2508
#        return 3;
2014
#    }
2509
#    }
2015
 
2510
 
2016
    #
2511
    #
-
 
2512
    #   Check for a handcrafted substitute package
2017
    #   Determine version information
2513
    #       May have been created with gen_cots
2018
    #
2514
    #
2019
    $data->{tag} = $versions{$entry}{vcsTag} || '';
2515
    testDpkgArchive($entry);
2020
    if ( $versions{$entry}{badVcsTag} )
2516
    if (extractFilesFromStore($data, $entry) )
2021
    {
2517
    {
2022
        Warning ("Error: Bad VcsTag for: " . GetVname($entry),
-
 
2023
                 "Tag: $data->{tag}" );
2518
        Message ("Using package from store");
2024
        $data->{errStr} = 'VCS Tag Marked as Bad';
-
 
2025
        return 1;
-
 
2026
 
-
 
2027
    }
2519
    }
-
 
2520
    else
-
 
2521
    {
-
 
2522
        #
-
 
2523
        #   Determine version information
-
 
2524
        #
-
 
2525
        if ($opt_IgnoreBadSourcePath)
-
 
2526
        {
-
 
2527
            # Ignore versions tagged with a bad source path
-
 
2528
            #   Will expect that the Vob will be forced
-
 
2529
            #   Hope that we have a label
-
 
2530
            delete $versions{$entry}{badVcsTag};
-
 
2531
        }
2028
 
2532
 
2029
 
-
 
2030
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
-
 
2031
    $vcs_type = $1;
-
 
2032
    $cc_label = $4;
-
 
2033
    $cc_path = $2;
-
 
2034
    $cc_path = '/' . $cc_path;
-
 
2035
    $cc_path =~ tr~\\/~/~s;
-
 
2036
    $cc_path_original = $cc_path;
-
 
2037
 
-
 
2038
    #
-
 
2039
    #   Correct well known path mistakes in CC paths
-
 
2040
    #
-
 
2041
    if ( $vcs_type eq 'CC' )
-
 
2042
    {
-
 
2043
        $cc_path =~ s~/build.pl$~~i;
-
 
2044
        $cc_path =~ s~/src$~~i;
-
 
2045
        $cc_path =~ s~/cpp$~~i;
-
 
2046
        $cc_path =~ s~/MASS_Dev/Infra/~/MASS_Dev_Infra/~i;
-
 
2047
        $cc_path =~ s~/MASS_Dev/Tools/~/MASS_Dev_Tools/~i;
-
 
2048
        $cc_path =~ s~/MASS_Dev/Bus/~/MASS_Dev_Bus/~i;
-
 
2049
        $cc_path =~ s~/MASS_Dev_Bus/Cbp/~/MASS_Dev_Bus/CBP/~i;
-
 
2050
        $cc_path =~ s~/MREF_Package/ergpostmongui$~/MREF_Package/ergpostmongui~i;
-
 
2051
        $cc_path =~ s~/MREF_../MREF_Package/~/MREF_Package/~i;
-
 
2052
        $cc_path =~ s~/MREF_Package/mass_ergocdp/~/MREF_Package/ergocdp/~i;
-
 
2053
        $cc_path =~ s~/MASS_Dev_Bus/CBP/systemCD.ejb~/MASS_Dev_Bus/CBP/systemCD/ejb~i;
-
 
2054
        $cc_path =~ s~/MASS_Dev_Bus/Financial/cpp/paymentmanager~/MASS_Dev_Bus/Financial/cpp/paymentmanager~i;
-
 
2055
        $cc_path =~ s~/MASS_Dev_Bus/WebServices~/MASS_Dev_Bus/WebServices~i;
-
 
2056
        $cc_path =~ s~/MASS_Dev_Bus/CBP/nullAdapter~//MASS_Dev_Bus/CBP/nullAdaptor~i;
-
 
2057
 
-
 
2058
        $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
2059
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
-
 
2060
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
-
 
2061
        $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
-
 
2062
        $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
-
 
2063
 
-
 
2064
        if (   $versions{$entry}{name} =~ m/^ERGagency$/i
-
 
2065
            || $versions{$entry}{name} =~ m/^ERGavm$/i
-
 
2066
            || $versions{$entry}{name} =~ m/^ERGboi$/i
-
 
2067
            || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
-
 
2068
            || $versions{$entry}{name} =~ m/^ERGcardholder$/i
-
 
2069
            || $versions{$entry}{name} =~ m/^ERGcdaimports$/i
-
 
2070
            || $versions{$entry}{name} =~ m/^ERGcda$/i
-
 
2071
            || $versions{$entry}{name} =~ m/^ERGcscedit$/i
-
 
2072
            || $versions{$entry}{name} =~ m/^ERGcs$/i
2533
        $data->{tag} = $versions{$entry}{vcsTag} || '';
2073
            || $versions{$entry}{name} =~ m/^ERGofs$/i
-
 
2074
            || $versions{$entry}{name} =~ m/^ERGols$/i
-
 
2075
            || $versions{$entry}{name} =~ m/^ERGtpf$/i
-
 
2076
            || $versions{$entry}{name} =~ m/^ERGorasys$/i
-
 
2077
            || $versions{$entry}{name} =~ m/^ERGoracs$/i
-
 
2078
            || $versions{$entry}{name} =~ m/^ERGpxyif$/i
-
 
2079
            || $versions{$entry}{name} =~ m/^ERGtp5upg$/i
-
 
2080
            || $versions{$entry}{name} =~ m/^ERGinstitutional$/i
-
 
2081
            || $versions{$entry}{name} =~ m/^ERGinfra$/i
-
 
2082
            || $versions{$entry}{name} =~ m/^ERGcrrpts$/i
-
 
2083
            || $versions{$entry}{name} =~ m/^ERGmiddle$/i
-
 
2084
            || $versions{$entry}{name} =~ m/^ERGmiddleapi$/i
-
 
2085
            || $versions{$entry}{name} =~ m/^ERGwebapi$/i
-
 
2086
            || $versions{$entry}{name} =~ m/^ERGwebtestui$/i
-
 
2087
            || $versions{$entry}{name} =~ m/^ERGwebesbui$/i
-
 
2088
            || $versions{$entry}{name} =~ m/^ERGwspiv$/i
-
 
2089
            || $versions{$entry}{name} =~ m/^ERGwscst$/i
-
 
2090
            || $versions{$entry}{name} =~ m/^sposMUG$/i
-
 
2091
            || $versions{$entry}{name} =~ m/^ERGfinman$/i
-
 
2092
            || $versions{$entry}{name} =~ m/^ERGkm$/i
2534
        if ( $versions{$entry}{badVcsTag} )
2093
            || $versions{$entry}{name} =~ m/^ERGxml$/i
-
 
2094
            || $versions{$entry}{name} =~ m/^ERGoradacw$/i
-
 
2095
            || $versions{$entry}{name} =~ m/^ERGtru$/i
-
 
2096
            )
-
 
2097
        {
2535
        {
-
 
2536
            Warning ("Error: Bad VcsTag for: " . GetVname($entry),
2098
            $cc_path = '/MREF_Package';
2537
                     "Tag: $data->{tag}" );
-
 
2538
            $data->{errStr} = 'VCS Tag Marked as Bad';
-
 
2539
            return 1;
-
 
2540
 
2099
        }
2541
        }
2100
 
2542
 
-
 
2543
 
-
 
2544
        $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
-
 
2545
        $vcs_type = $1;
-
 
2546
        $cc_label = $4;
-
 
2547
        $cc_path = $2;
-
 
2548
        $cc_path = '/' . $cc_path;
-
 
2549
        $cc_path =~ tr~\\/~/~s;
-
 
2550
        $cc_path_original = $cc_path;
-
 
2551
 
-
 
2552
        #
-
 
2553
        #   Process IgnoreBadSourcePath
-
 
2554
        #
2101
        if (   $versions{$entry}{name} =~ m/^tp5000_MUG$/i )
2555
        if ($opt_IgnoreBadSourcePath)
2102
        {
2556
        {
-
 
2557
            if (($vcs_type eq 'UC') || (length($cc_label) < 1))
-
 
2558
            {
-
 
2559
                $versions{$entry}{badVcsTag} = 98;
-
 
2560
                Warning ("Error: Bad VcsTag for: " . GetVname($entry),
-
 
2561
                         "Tag: $data->{tag}" );
-
 
2562
                $data->{errStr} = 'VCS Tag Marked as Bad - and has no label';
-
 
2563
                return 1;
-
 
2564
            }
-
 
2565
        }
-
 
2566
 
-
 
2567
        #
-
 
2568
        #   Correct well known path mistakes in CC paths
-
 
2569
        #
-
 
2570
        if ( $vcs_type eq 'CC' )
-
 
2571
        {
-
 
2572
            $cc_path =~ s~/build.pl$~~i;
-
 
2573
            $cc_path =~ s~/src$~~i;
-
 
2574
            $cc_path =~ s~/cpp$~~i;
-
 
2575
            $cc_path =~ s~/MASS_Dev/Infra/~/MASS_Dev_Infra/~i;
-
 
2576
            $cc_path =~ s~/MASS_Dev/Tools/~/MASS_Dev_Tools/~i;
-
 
2577
            $cc_path =~ s~/MASS_Dev/Bus/~/MASS_Dev_Bus/~i;
-
 
2578
            $cc_path =~ s~/MASS_Dev_Bus/Cbp/~/MASS_Dev_Bus/CBP/~i;
-
 
2579
            $cc_path =~ s~/MREF_Package/ergpostmongui$~/MREF_Package/ergpostmongui~i;
-
 
2580
            $cc_path =~ s~/MREF_../MREF_Package/~/MREF_Package/~i;
-
 
2581
            $cc_path =~ s~/MREF_Package/mass_ergocdp/~/MREF_Package/ergocdp/~i;
-
 
2582
            $cc_path =~ s~/MASS_Dev_Bus/CBP/systemCD.ejb~/MASS_Dev_Bus/CBP/systemCD/ejb~i;
-
 
2583
            $cc_path =~ s~/MASS_Dev_Bus/Financial/cpp/paymentmanager~/MASS_Dev_Bus/Financial/cpp/paymentmanager~i;
-
 
2584
            $cc_path =~ s~/MASS_Dev_Bus/WebServices~/MASS_Dev_Bus/WebServices~i;
-
 
2585
            $cc_path =~ s~/MASS_Dev_Bus/CBP/nullAdapter~//MASS_Dev_Bus/CBP/nullAdaptor~i;
-
 
2586
            $cc_path =~ s~/DPG_SWBase/Services~/DPG_SWBase/services~i;
-
 
2587
 
-
 
2588
 
-
 
2589
            $cc_path = '/MASS_Dev_Bus/Application' if ( $versions{$entry}{name} eq 'application');
-
 
2590
            $cc_path = '/MASS_Dev_Bus/Product'     if ( $versions{$entry}{name} eq 'product');
-
 
2591
            $cc_path = '/MASS_Dev_Bus/Financial'   if ( $versions{$entry}{name} eq 'FinRun');
-
 
2592
 
-
 
2593
            $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
2594
            $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
2595
            $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
-
 
2596
            $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
-
 
2597
            $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
-
 
2598
            $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
-
 
2599
 
-
 
2600
            if (   $versions{$entry}{name} =~ m/^ERGagency$/i
-
 
2601
                || $versions{$entry}{name} =~ m/^ERGavm$/i
-
 
2602
                || $versions{$entry}{name} =~ m/^ERGboi$/i
-
 
2603
                || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
-
 
2604
                || $versions{$entry}{name} =~ m/^ERGcardholder$/i
-
 
2605
                || $versions{$entry}{name} =~ m/^ERGcdaimports$/i
-
 
2606
                || $versions{$entry}{name} =~ m/^ERGcda$/i
-
 
2607
                || $versions{$entry}{name} =~ m/^ERGcscedit$/i
-
 
2608
                || $versions{$entry}{name} =~ m/^ERGcs$/i
-
 
2609
                || $versions{$entry}{name} =~ m/^ERGofs$/i
-
 
2610
                || $versions{$entry}{name} =~ m/^ERGols$/i
-
 
2611
                || $versions{$entry}{name} =~ m/^ERGtpf$/i
-
 
2612
                || $versions{$entry}{name} =~ m/^ERGorasys$/i
-
 
2613
                || $versions{$entry}{name} =~ m/^ERGoracs$/i
-
 
2614
                || $versions{$entry}{name} =~ m/^ERGpxyif$/i
-
 
2615
                || $versions{$entry}{name} =~ m/^ERGtp5upg$/i
-
 
2616
                || $versions{$entry}{name} =~ m/^ERGinstitutional$/i
-
 
2617
                || $versions{$entry}{name} =~ m/^ERGinfra$/i
-
 
2618
                || $versions{$entry}{name} =~ m/^ERGcrrpts$/i
-
 
2619
                || $versions{$entry}{name} =~ m/^ERGmiddle$/i
-
 
2620
                || $versions{$entry}{name} =~ m/^ERGmiddleapi$/i
-
 
2621
                || $versions{$entry}{name} =~ m/^ERGwebapi$/i
-
 
2622
                || $versions{$entry}{name} =~ m/^ERGwebtestui$/i
-
 
2623
                || $versions{$entry}{name} =~ m/^ERGwebesbui$/i
-
 
2624
                || $versions{$entry}{name} =~ m/^ERGwspiv$/i
-
 
2625
                || $versions{$entry}{name} =~ m/^ERGwscst$/i
-
 
2626
                || $versions{$entry}{name} =~ m/^sposMUG$/i
-
 
2627
                || $versions{$entry}{name} =~ m/^ERGfinman$/i
2103
            if ( $versions{$entry}{version} =~ m~vtk$~ )
2628
                || $versions{$entry}{name} =~ m/^ERGkm$/i
-
 
2629
                || $versions{$entry}{name} =~ m/^ERGxml$/i
-
 
2630
                || $versions{$entry}{name} =~ m/^ERGoradacw$/i
-
 
2631
                || $versions{$entry}{name} =~ m/^ERGtru$/i
-
 
2632
                )
2104
            {
2633
            {
2105
                $cc_path = '/MREF_Package';
2634
                $cc_path = '/MREF_Package';
2106
            }
2635
            }
2107
        }
-
 
2108
 
2636
 
-
 
2637
            if (   $versions{$entry}{name} =~ m/^tp5000_MUG$/i )
-
 
2638
            {
-
 
2639
                if ( $versions{$entry}{version} =~ m~vtk$~ )
-
 
2640
                {
-
 
2641
                    $cc_path = '/MREF_Package';
-
 
2642
                }
-
 
2643
            }
-
 
2644
 
2109
        $cc_path = $opt_forceProjectBase
2645
            $cc_path = $opt_forceProjectBase
2110
            if ( $opt_forceProjectBase );
2646
                if ( $opt_forceProjectBase );
2111
 
2647
 
2112
        foreach ( @opt_limitProjectBase )
2648
            foreach ( @opt_limitProjectBase )
2113
        {
-
 
2114
            if ( $cc_path =~ m~$_~ )
-
 
2115
            {
2649
            {
-
 
2650
                if ( $cc_path =~ m~$_~ )
-
 
2651
                {
2116
                $cc_path = $_;
2652
                    $cc_path = $_;
2117
                last;
2653
                    last;
-
 
2654
                }
-
 
2655
            }
-
 
2656
 
-
 
2657
            if ( $cc_path_original ne $cc_path )
-
 
2658
            {
-
 
2659
                    Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
2118
            }
2660
            }
2119
        }
2661
        }
2120
        
2662
    
-
 
2663
    #print "--- Path: $cc_path, Label: $cc_label\n";
-
 
2664
 
2121
        if ( $cc_path_original ne $cc_path )
2665
        if ( $vcs_type eq 'SVN' )
2122
        {
2666
        {
-
 
2667
            $rv = extractFilesFromSubversion( $data, $entry );
-
 
2668
            return $rv if ( $rv );
-
 
2669
        }
-
 
2670
        else
-
 
2671
        {
-
 
2672
            #
-
 
2673
            #   Create CC view
-
 
2674
            #   Import into Subversion View
-
 
2675
            #
2123
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
2676
            $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label, $entry );
-
 
2677
            return $rv if ( $rv );
-
 
2678
 
-
 
2679
            #
-
 
2680
            #   May need to limit the extracted source tree
-
 
2681
            #   Use the first selected directory that we have
-
 
2682
            #
-
 
2683
            if ( @opt_selectProjectBase )
-
 
2684
            {
-
 
2685
                foreach ( @opt_selectProjectBase )
-
 
2686
                {
-
 
2687
                    my $testDir = join('/', $data->{ViewRoot}, $_);
-
 
2688
                    if ( -d $testDir )
-
 
2689
                    {
-
 
2690
                        $selectDir = $_;
-
 
2691
                        $data->{ViewPath} = $testDir;
-
 
2692
                        last;
-
 
2693
                    }
-
 
2694
                }
-
 
2695
 
-
 
2696
                unless ( $selectDir )
-
 
2697
                {
-
 
2698
                    Warning ("No directory selected from list");
-
 
2699
                }
-
 
2700
                else
-
 
2701
                {
-
 
2702
                    Message ("Selecting Dir: /$selectDir");
-
 
2703
                }
-
 
2704
            }
2124
        }
2705
        }
2125
    }
2706
    }
2126
    
-
 
2127
#print "--- Path: $cc_path, Label: $cc_label\n";
-
 
2128
 
2707
 
-
 
2708
    #
-
 
2709
    #   Delete specified files from the source tree
-
 
2710
    #
2129
    if ( $vcs_type eq 'SVN' )
2711
    if ( @opt_deleteFiles )
2130
    {
2712
    {
-
 
2713
        my @args;
-
 
2714
        foreach my $delFileSpec ( @opt_deleteFiles )
-
 
2715
        {
-
 
2716
            Message ("Deleting files that match: $delFileSpec");
-
 
2717
            push @args, "--FilterIn=$delFileSpec";
-
 
2718
        }
2131
        $rv = extractFilesFromSubversion( $data, $entry );
2719
        my $search = JatsLocateFiles->new("--Recurse=1", @args );
-
 
2720
        my @rmFiles = $search->search($data->{ViewRoot});
2132
        return $rv if ( $rv );
2721
        foreach my $rmFile ( @rmFiles )
-
 
2722
        {
-
 
2723
            Information("Deleting: $rmFile");
-
 
2724
            unlink ( join ('/', $data->{ViewRoot}, $rmFile) )|| Warning "Cannot delete: $rmFile";
-
 
2725
        }
2133
    }
2726
    }
-
 
2727
 
-
 
2728
    #
-
 
2729
    #   Some packages contain softlinks - that break the file scanner
2134
    else
2730
    #
-
 
2731
    if ( $opt_deleteLinks )
2135
    {
2732
    {
2136
        #
-
 
2137
        #   Create CC view
-
 
2138
        #   Import into Subversion View
2733
        # Not doing anything yet - fixed the JATS find bit
2139
        #
-
 
2140
        $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label );
-
 
2141
        return $rv if ( $rv );
-
 
2142
    }
2734
    }
2143
 
2735
 
2144
    #
2736
    #
2145
    #   Developers have been slack
2737
    #   Developers have been slack
2146
    #       Sometime the mark the source path as 'GMTPE2005'
2738
    #       Sometime the mark the source path as 'GMTPE2005'
2147
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
2739
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
2148
    #
2740
    #
2149
    #   Attempt to suck up empty directories below the specified
2741
    #   Attempt to suck up empty directories below the specified
2150
    #   source path
2742
    #   source path
2151
    #
2743
    #
2152
    unless ( $opt_preserveProjectBase || $opt_forceProjectBase || @opt_limitProjectBase)
2744
    unless (($opt_preserveProjectBase || $opt_forceProjectBase || @opt_limitProjectBase || $selectDir) && ! $opt_forceSuck)
2153
    {
2745
    {
2154
        #
2746
        #
2155
        #   Look in ViewPath
2747
        #   Look in ViewPath
2156
        #   If it contains only ONE directory then we can suck it up
2748
        #   If it contains only ONE directory then we can suck it up
2157
        #
2749
        #
Line 2170... Line 2762...
2170
    #
2762
    #
2171
    #   Check for bad source paths
2763
    #   Check for bad source paths
2172
    #
2764
    #
2173
    if (detectBadMakePaths($data) )
2765
    if (detectBadMakePaths($data) )
2174
    {
2766
    {
-
 
2767
        $count_BadPaths++;
2175
        unless ( $opt_ignoreBadPaths )
2768
        unless ( $opt_ignoreBadPaths )
2176
        {
2769
        {
2177
            $data->{BadPath}++;
2770
            $data->{BadPath}++;
2178
            $data->{errStr} = 'Bad Paths in Makefile';
2771
            $data->{errStr} = 'Bad Paths in Makefile';
2179
            return 4;           # Lets see what the others look like too
2772
            return 4;           # Lets see what the others look like too
Line 2323... Line 2916...
2323
        RmDirTree ('SvnImportDir');
2916
        RmDirTree ('SvnImportDir');
2324
    }
2917
    }
2325
 
2918
 
2326
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
2919
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
2327
    my $datafile = "importdata.$import_label.properties";
2920
    my $datafile = "importdata.$import_label.properties";
-
 
2921
 
-
 
2922
    my @mergeArg;
2328
    push (@args, "-mergePaths", join(',', @opt_mergePaths) ) if ( @opt_mergePaths );
2923
    push (@mergeArg, "-mergePaths", join(',', @opt_mergePaths) ) if ( @opt_mergePaths );
-
 
2924
 
-
 
2925
    if ( exists $mergePathExtended{$packageNames}  )
-
 
2926
    {
-
 
2927
        my $eentry = $mergePathExtended{$packageNames};
-
 
2928
        if ( exists $eentry->{$import_label} )
-
 
2929
        {
-
 
2930
            @opt_mergePaths = split(':', $eentry->{$import_label});
-
 
2931
            Message("New MergePath Info: @opt_mergePaths");
-
 
2932
 
-
 
2933
            #
-
 
2934
            #   Args take effect next version
-
 
2935
            #   In this version have no merging - reset the image
-
 
2936
            #
-
 
2937
            @mergeArg = ();
-
 
2938
        }
-
 
2939
    }
2329
 
2940
 
2330
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2941
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2331
                    "-package=$svnRepo/$packageNames",
2942
                    "-package=$svnRepo/$packageNames",
2332
                    "-dir=$data->{ViewPath}",
2943
                    "-dir=$data->{ViewPath}",
2333
                    "-label=$import_label",
2944
                    "-label=$import_label",
2334
                    "-datafile=$datafile",
2945
                    "-datafile=$datafile",
2335
                    @args,
2946
                    @args,
-
 
2947
                    @mergeArg,
2336
                     );
2948
                     );
2337
 
2949
 
2338
    if ( $rv )
2950
    if ( $rv )
2339
    {
2951
    {
2340
        $data->{errStr} = 'Failed to import to SVN';
2952
        $data->{errStr} = 'Failed to import to SVN';
2341
        return 12;
2953
        return 12;
2342
    }
2954
    }
2343
 
2955
 
-
 
2956
    #
-
 
2957
    #   Some packages generate multiple packages
-
 
2958
    #   Some of these are the result of merging several packages
-
 
2959
    #   so we can only do this detection After the import
-
 
2960
    #
-
 
2961
    #   Detect potential build problems where multiple buildfiles
-
 
2962
    #   exists and cannot be resolved by our build system
-
 
2963
    #
-
 
2964
    #   This is not a show stopper (yet)
-
 
2965
    #
-
 
2966
    unless ( $opt_skipBuildNameCheck )
-
 
2967
    {
-
 
2968
        if (detectBuildFileClashes($data, 'SvnImportDir'))
-
 
2969
        {
-
 
2970
            unless ( $opt_ignoreBuildFileClashes )
-
 
2971
            {
-
 
2972
                $data->{BuildFileClash}++;
-
 
2973
                Message ("Build File Clash detected");
-
 
2974
            }
-
 
2975
        }
-
 
2976
    }
-
 
2977
    else
-
 
2978
    {
-
 
2979
        Message ('Detect Build File Clashes - skipped');
-
 
2980
    }
-
 
2981
 
2344
    $versions{$entry}{TagCreated} = 1;
2982
    $versions{$entry}{TagCreated} = 1;
2345
    $firstVersionCreated = $entry unless ( $firstVersionCreated );
2983
    $firstVersionCreated = $entry unless ( $firstVersionCreated );
2346
 
2984
 
2347
    #
2985
    #
2348
    #   Read in the Rm Reference
2986
    #   Read in the Rm Reference
Line 2527... Line 3165...
2527
#                   Perform the calculation to determine the details of
3165
#                   Perform the calculation to determine the details of
2528
#                   the branch point. The work will only be done when its
3166
#                   the branch point. The work will only be done when its
2529
#                   needed. This will avoid the creation of branchpoints
3167
#                   needed. This will avoid the creation of branchpoints
2530
#                   that are not used.
3168
#                   that are not used.
2531
#
3169
#
2532
# Inputs          : $entry                  Entry being processed
3170
# Inputs          : $entry          - Entry being processed
2533
#                   $author         - Who done it
3171
#                   $author         - Who done it
2534
#                   $date           - When
3172
#                   $date           - When
2535
#
3173
#
2536
# Returns         : 
3174
# Returns         : 
2537
#
3175
#
Line 2592... Line 3230...
2592
 
3230
 
2593
    #
3231
    #
2594
    #   Create target name
3232
    #   Create target name
2595
    #
3233
    #
2596
    my $tgt_label;
3234
    my $tgt_label;
-
 
3235
    if ($versions{$entry}{isaPatch} )
-
 
3236
    {
-
 
3237
        my $parent = $versions{$entry}{last};
-
 
3238
        my $pver = $versions{$parent}{vname};
-
 
3239
        $tgt_label = 'Patching_' . $pver;
-
 
3240
    }
2597
    if ( $forceNewProject || $versions{$entry}{newSuffix} || $createSuffix || !defined $src_label )
3241
    elsif ( $forceNewProject || $versions{$entry}{newSuffix} || $createSuffix || !defined $src_label )
2598
    {
3242
    {
2599
        #
3243
        #
2600
        #   Create target name based on project
3244
        #   Create target name based on project
2601
        #
3245
        #
2602
        return if ( $singleProject );
3246
        return if ( $singleProject );
Line 2612... Line 3256...
2612
            #
3256
            #
2613
            if ( $Projects{$suffix}{Trunk} )
3257
            if ( $Projects{$suffix}{Trunk} )
2614
            {
3258
            {
2615
                # This project can use the trunk, if it has not been allocated.
3259
                # This project can use the trunk, if it has not been allocated.
2616
                $ProjectTrunk = $suffix unless ( defined $ProjectTrunk );
3260
                $ProjectTrunk = $suffix unless ( defined $ProjectTrunk );
2617
                
3261
#                Message ("ProjectTrunk allocated to: $ProjectTrunk");
2618
                #
3262
                #
2619
                #   If this package has multiple instances of the potential
3263
                #   If this package has multiple instances of the potential
2620
                #   trunk, then don't place either of them on the trunk as it
3264
                #   trunk, then don't place either of them on the trunk as it
2621
                #   may cause confusion
3265
                #   may cause confusion
2622
                #
3266
                #
Line 2660... Line 3304...
2660
 
3304
 
2661
    #
3305
    #
2662
    #   Save branch name for use when populating sandbox
3306
    #   Save branch name for use when populating sandbox
2663
    #
3307
    #
2664
    $currentBranchName = $tgt_label;
3308
    $currentBranchName = $tgt_label;
-
 
3309
#    Message ("Setting currentBranchName: $currentBranchName");
2665
 
3310
 
2666
    #
3311
    #
2667
    #   Perform the branch
3312
    #   Perform the branch
2668
    #
3313
    #
2669
    if ( defined $src_label )
3314
    if ( defined $src_label )
Line 2716... Line 3361...
2716
    my $inernalErrorCount = 0;
3361
    my $inernalErrorCount = 0;
2717
    my $notProcessedCount = 0;
3362
    my $notProcessedCount = 0;
2718
    my $badPathCount = 0;
3363
    my $badPathCount = 0;
2719
    my $badProjectBaseCount = 0;
3364
    my $badProjectBaseCount = 0;
2720
    my $badMakeProjectCount = 0;
3365
    my $badMakeProjectCount = 0;
-
 
3366
    my $buildFileClashes = 0;
2721
 
3367
 
2722
    #
3368
    #
2723
    #   Display versions that did get captured
3369
    #   Display versions that did get captured
2724
    #
3370
    #
2725
    foreach my $entry ( @processOrder )
3371
    foreach my $entry ( @processOrder )
Line 2740... Line 3386...
2740
        {
3386
        {
2741
            $processedCount++;
3387
            $processedCount++;
2742
            $badPathCount++ if ($versions{$entry}{data}{BadPath} );
3388
            $badPathCount++ if ($versions{$entry}{data}{BadPath} );
2743
            $badProjectBaseCount++ if ($versions{$entry}{data}{BadProjectBase} );
3389
            $badProjectBaseCount++ if ($versions{$entry}{data}{BadProjectBase} );
2744
            $badMakeProjectCount++ if ($versions{$entry}{data}{BadMakeProject} );
3390
            $badMakeProjectCount++ if ($versions{$entry}{data}{BadMakeProject} );
-
 
3391
            $buildFileClashes++ if ($versions{$entry}{data}{BuildFileClash} );
2745
            next;
3392
            next;
2746
        }
3393
        }
2747
 
3394
 
2748
        my $reason = $versions{$entry}{data}{errStr} || '';
3395
        my $reason = $versions{$entry}{data}{errStr} || '';
2749
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
3396
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
Line 2777... Line 3424...
2777
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
3424
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
2778
    Warning ("Internal Errors: $inernalErrorCount") if ( $inernalErrorCount );
3425
    Warning ("Internal Errors: $inernalErrorCount") if ( $inernalErrorCount );
2779
    Warning ("Multiple source paths", @multiplePaths ) if ( scalar @multiplePaths > 1 );
3426
    Warning ("Multiple source paths", @multiplePaths ) if ( scalar @multiplePaths > 1 );
2780
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
3427
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
2781
    Warning ("Packages with Bad Paths: $badPathCount") if ( $badPathCount );
3428
    Warning ("Packages with Bad Paths: $badPathCount") if ( $badPathCount );
-
 
3429
    Warning ("Packages with Ignored Bad Paths: $badPathCount") if ( $count_BadPaths );
-
 
3430
 
2782
    Warning ("Packages with Bad ProjectBase: $badProjectBaseCount") if ( $badProjectBaseCount );
3431
    Warning ("Packages with Bad ProjectBase: $badProjectBaseCount") if ( $badProjectBaseCount );
2783
    Warning ("Packages with MakeProjects: $badMakeProjectCount") if ( $badMakeProjectCount );
3432
    Warning ("Packages with MakeProjects: $badMakeProjectCount") if ( $badMakeProjectCount );
-
 
3433
    Warning ("Build File Clashes Found: $buildFileClashes") if ( $buildFileClashes );
2784
    Warning ("Global Error Detected") if ( $globalError );
3434
    Warning ("Global Error Detected") if ( $globalError );
2785
    Message ("---- All Done -----");
3435
    Message ("---- All Done -----");
2786
}
3436
}
2787
 
3437
 
2788
#-------------------------------------------------------------------------------
3438
#-------------------------------------------------------------------------------
Line 2792... Line 3442...
2792
#                   May take a while as we handle nasty errors
3442
#                   May take a while as we handle nasty errors
2793
#
3443
#
2794
# Inputs          : $data           - Hash of good stuff from newPackageVersionBody
3444
# Inputs          : $data           - Hash of good stuff from newPackageVersionBody
2795
#                   $cc_path
3445
#                   $cc_path
2796
#                   $cc_label
3446
#                   $cc_label
-
 
3447
#                   $entry          - original PV entry
2797
#
3448
#
2798
# Returns         : exit code
3449
# Returns         : exit code
2799
#                   Sets up
3450
#                   Sets up
2800
#                       $data->{errStr}
3451
#                       $data->{errStr}
2801
#                       $data->{errCode}
3452
#                       $data->{errCode}
2802
#                   As per newPackageVersionBody
3453
#                   As per newPackageVersionBody
2803
#
3454
#
2804
sub extractFilesFromClearCase
3455
sub extractFilesFromClearCase
2805
{
3456
{
2806
    my ($data, $cc_path, $cc_label) = @_;
3457
    my ($data, $cc_path, $cc_label, $entry) = @_;
2807
    my $tryCount = 0;
3458
    my $tryCount = 0;
2808
    my $rv = 99;
3459
    my $rv = 99;
2809
 
3460
 
2810
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : "$cc_label";
3461
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : "$cc_label";
2811
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
3462
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
Line 2818... Line 3469...
2818
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
3469
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
2819
        Message ("Preserving Project Base");
3470
        Message ("Preserving Project Base");
2820
    }
3471
    }
2821
    $data->{ViewPath} =~  tr~/~/~s;
3472
    $data->{ViewPath} =~  tr~/~/~s;
2822
 
3473
 
-
 
3474
    #
-
 
3475
    #   Some versions are bad and have been manually marked as bad
-
 
3476
    #   Use touch cc2svn_ignore - to create file
-
 
3477
    #
-
 
3478
    if ( $opt_reuse && -f "$data->{ViewRoot}/cc2svn_ignore" )
-
 
3479
    {
-
 
3480
        Message ("View specifically ignored");
-
 
3481
        $data->{errStr} = 'View specifically ignored';
-
 
3482
        $data->{errCode} = '0';
-
 
3483
        return 4;               # Will Retain view
-
 
3484
    }
-
 
3485
 
-
 
3486
    #
-
 
3487
    #   Attempt to reuse compressed file
-
 
3488
    #
-
 
3489
    if ( $opt_reuse )
-
 
3490
    {
-
 
3491
        my $cfile = saneLabel($entry) . '.tgz';
-
 
3492
        if ( -f "more/$cfile" ) {
-
 
3493
            $cfile = "more/$cfile";
-
 
3494
        }
-
 
3495
        if ( -f $cfile )
-
 
3496
        {
-
 
3497
            Message ("Restoring compressed image");
-
 
3498
            my $rv = System ('tar', '-xzf', $cfile );
-
 
3499
            if ( $rv )
-
 
3500
            {
-
 
3501
                Warning("Failed to decompress directory");
-
 
3502
                $data->{errStr} = 'Failed to de-tar compressed image';
-
 
3503
                return 2;
-
 
3504
            }
-
 
3505
            else
-
 
3506
            {
-
 
3507
                my $cc_vob = $cc_path;
-
 
3508
                $cc_vob =~ s~^/~~;
-
 
3509
                $cc_vob =~ s~/.*~~;
-
 
3510
                my $detarPath =  $data->{ViewRoot} . '/' . $cc_vob;
-
 
3511
 
-
 
3512
 
-
 
3513
                unless ( -d $detarPath  )
-
 
3514
                {
-
 
3515
                    Warning ("Logic error: Did not de-tar into expected location", $detarPath)
-
 
3516
                }
-
 
3517
                else
-
 
3518
                {
-
 
3519
                    if ( -d $data->{ViewPath}  )
-
 
3520
                    {
-
 
3521
                        # All is good
-
 
3522
                        return 0;
-
 
3523
                    }
-
 
3524
 
-
 
3525
                    # Recalc ViewPath to the root of the VOB
-
 
3526
                    $cc_path =~ s~^/~~;
-
 
3527
                    $cc_path =~ s~/.*~~;
-
 
3528
                    $cc_path = '/' . $cc_path;
-
 
3529
                    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
-
 
3530
                    return 0;
-
 
3531
                }
-
 
3532
            }
-
 
3533
        }
-
 
3534
    }
-
 
3535
 
2823
    if ( $opt_reuse && -d $data->{ViewPath}  )
3536
    if ( $opt_reuse && -d $data->{ViewPath}  )
2824
    {
3537
    {
2825
        Message ("Reusing view: $cc_label");
3538
        Message ("Reusing view: $cc_label");
-
 
3539
 
-
 
3540
        #
-
 
3541
        #   Br applet kludge - can be removed later
-
 
3542
        #   Add some nice data to each view
-
 
3543
#        open (FH, '>' , $data->{ViewRoot} . '/cc2svn_tag' ) || Error ("Cannot open '$data->{ViewRoot}/cc2svn_tag'");
-
 
3544
#        print FH $versions{$entry}{name},' ',$versions{$entry}{vname},"\n";
-
 
3545
#        close FH;
2826
        return 0;
3546
        return 0;
2827
    }
3547
    }
2828
 
3548
 
2829
    while ( $rv == 99 ) {
3549
    while ( ($rv == 99)  && ! $opt_noVCS) {
2830
        my @args;
3550
        my @args;
2831
        push (@args, '-view', $opt_name ) if ( defined $opt_name && ! defined $opt_mergePackages );
3551
        push (@args, '-view', $opt_name ) if ( defined $opt_name && ! defined $opt_mergePackages );
2832
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
3552
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
2833
                    "-label=$cc_label" ,
3553
                    "-label=$cc_label" ,
2834
                    "-path=$cc_path",
3554
                    "-path=$cc_path",
Line 2919... Line 3639...
2919
 
3639
 
2920
    #
3640
    #
2921
    #   Create a nice name for the import
3641
    #   Create a nice name for the import
2922
    #
3642
    #
2923
    my $import_label = saneLabel($entry);
3643
    my $import_label = saneLabel($entry);
2924
    
-
 
2925
 
3644
 
2926
    $data->{ViewRoot} = $opt_name ? $opt_name : $import_label;
3645
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : $import_label;
2927
    $data->{ViewPath} =  $data->{ViewRoot};
3646
    $data->{ViewPath} =  $data->{ViewRoot};
2928
    $data->{ViewPath} =~  tr~/~/~s;
3647
    $data->{ViewPath} =~  tr~/~/~s;
2929
 
3648
    
2930
    if ( $opt_reuse && -d $data->{ViewPath}  )
3649
    if ( $opt_reuse && -d $data->{ViewPath}  )
2931
    {
3650
    {
-
 
3651
        #
-
 
3652
        #   Br applet kludge - can be removed later
-
 
3653
        #   Add some nice data to each view
-
 
3654
#        open (FH, '>' , $data->{ViewRoot} . '/cc2svn_tag' ) || Error ("Cannot open '$data->{ViewRoot}/cc2svn_tag'");
-
 
3655
#        print FH $versions{$entry}{name},' ',$versions{$entry}{vname},"\n";
-
 
3656
#        close FH;
-
 
3657
        
2932
        Message ("Reusing view: $import_label");
3658
        Message ("Reusing view: $import_label");
2933
        return 0;
3659
        return 0;
2934
    }
3660
    }
2935
 
3661
 
2936
    #
3662
    #
Line 2980... Line 3706...
2980
    #
3706
    #
2981
    return 0;
3707
    return 0;
2982
}
3708
}
2983
 
3709
 
2984
#-------------------------------------------------------------------------------
3710
#-------------------------------------------------------------------------------
-
 
3711
# Function        : extractFilesFromStore
-
 
3712
#
-
 
3713
# Description     : Extract files from Store
-
 
3714
#                   Local directory under dpkgExtract
-
 
3715
#
-
 
3716
# Inputs          : $data           - Hash of good stuff from newPackageVersionBody
-
 
3717
#                   $entry          - All the PV information
-
 
3718
#
-
 
3719
# Returns         : exit code
-
 
3720
#                       1 - Files found
-
 
3721
#                       0 - Not found
-
 
3722
#
-
 
3723
sub extractFilesFromStore
-
 
3724
{
-
 
3725
    my ($data, $entry ) = @_;
-
 
3726
    #
-
 
3727
    #   Create a nice name for the import
-
 
3728
    #
-
 
3729
    my $import_label = saneLabel($entry);
-
 
3730
 
-
 
3731
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : $import_label;
-
 
3732
    $data->{ViewPath} =  'dpkgExtract/' . $data->{ViewRoot};
-
 
3733
    $data->{ViewPath} =~  tr~/~/~s;
-
 
3734
    
-
 
3735
    if ( -d $data->{ViewPath}  )
-
 
3736
    {
-
 
3737
        $data->{fromStore} = 1;
-
 
3738
        Message ("Reusing Stored view: $import_label");
-
 
3739
        return 1;
-
 
3740
    }
-
 
3741
 
-
 
3742
    #
-
 
3743
    #   Not found in store
-
 
3744
    #
-
 
3745
    delete $data->{ViewRoot};
-
 
3746
    delete $data->{ViewPath};
-
 
3747
    return 0;
-
 
3748
}
-
 
3749
 
-
 
3750
#-------------------------------------------------------------------------------
-
 
3751
# Function        : testDpkgArchive
-
 
3752
#
-
 
3753
# Description     : Indicate if the package exists in dpkg_archive
-
 
3754
#
-
 
3755
# Inputs          : 
-
 
3756
#
-
 
3757
# Returns         : 
-
 
3758
#
-
 
3759
sub testDpkgArchive
-
 
3760
{
-
 
3761
    my ($entry) = @_;
-
 
3762
    my $vname = $versions{$entry}{vname};
-
 
3763
 
-
 
3764
    if ( -d join('/', $ENV{GBE_DPKG}, $packageNames, $vname )) {
-
 
3765
        Message ("Version found in dpkg_archive");
-
 
3766
    } else {
-
 
3767
        Message ("Version NOT found in dpkg_archive");
-
 
3768
    }
-
 
3769
}
-
 
3770
 
-
 
3771
#-------------------------------------------------------------------------------
-
 
3772
# Function        : markDpkgArchive
-
 
3773
#
-
 
3774
# Description     : Indicate if the package exists in dpkg_archive
-
 
3775
#
-
 
3776
# Inputs          : 
-
 
3777
#
-
 
3778
# Returns         : 
-
 
3779
#
-
 
3780
sub markDpkgArchive
-
 
3781
{
-
 
3782
    my ($entry) = @_;
-
 
3783
    my $vname = $versions{$entry}{vname};
-
 
3784
    my $path = join('/', $ENV{GBE_DPKG}, $packageNames, $vname );
-
 
3785
    delete $versions{$entry}{dpkgArchive};
-
 
3786
    if ( -d $path ) {
-
 
3787
        $versions{$entry}{dpkgArchive} = $path;
-
 
3788
    }
-
 
3789
}
-
 
3790
 
-
 
3791
#-------------------------------------------------------------------------------
2985
# Function        : detectMakeProjectUsage
3792
# Function        : detectMakeProjectUsage
2986
#
3793
#
2987
# Description     : etect and report usage of the MakeProject directive
3794
# Description     : etect and report usage of the MakeProject directive
2988
#
3795
#
2989
# Inputs          : $data               - Ref to a hash of bits
3796
# Inputs          : $data               - Ref to a hash of bits
Line 3390... Line 4197...
3390
                    {
4197
                    {
3391
                        #
4198
                        #
3392
                        #   Determine the depth of the view root
4199
                        #   Determine the depth of the view root
3393
                        #
4200
                        #
3394
                        Warning ("Build: $buildFile");
4201
                        Warning ("Build: $buildFile");
-
 
4202
                        #
-
 
4203
                        #   Whats the file for
-
 
4204
                        #
-
 
4205
                        if (open (BF, '<', $buildFile ))
-
 
4206
                        {
-
 
4207
                            while ( <BF> )
-
 
4208
                            {
-
 
4209
                                s~\s+$~~;
-
 
4210
                                if ( m~\s*BuildName~ )
-
 
4211
                                {
-
 
4212
                                    Warning ("BuildName: $_");
-
 
4213
                                    last;
-
 
4214
                                }
-
 
4215
                            }
-
 
4216
                            close BF;
-
 
4217
                        }
-
 
4218
 
-
 
4219
 
-
 
4220
                        #
-
 
4221
                        #   Determine the depth of the view root
-
 
4222
                        #
3395
                        my $countPath = ($data->{ViewPath} =~ tr~/~/~);
4223
                        my $countPath = ($data->{ViewPath} =~ tr~/~/~);
3396
                        my $countBuild = ($buildFile =~ tr~/~/~);
4224
                        my $countBuild = ($buildFile =~ tr~/~/~);
3397
                        my $max_up = $countBuild - $countPath -1;
4225
                        my $max_up = $countBuild - $countPath -1;
3398
 
4226
 
3399
                        m~--Up=(\d+)~i;
4227
                        m~--Up=(\d+)~i;
Line 3436... Line 4264...
3436
    #
4264
    #
3437
    #   Detect defined, but not used
4265
    #   Detect defined, but not used
3438
    #
4266
    #
3439
    if ( $usesProjectBase && ! $definesProjectBase )
4267
    if ( $usesProjectBase && ! $definesProjectBase )
3440
    {
4268
    {
3441
        Warning ("SetProjectBase - Uses ProjectBase without defining it");
4269
        Warning ("SetProjectBase - Uses Default ProjectBase");
3442
    }
4270
    }
3443
 
4271
 
3444
    if ( ! $usesProjectBase && $definesProjectBase )
4272
    if ( ! $usesProjectBase && $definesProjectBase )
3445
    {
4273
    {
3446
        Warning ("SetProjectBase - Defines ProjectBase without using it");
4274
        Warning ("SetProjectBase - Defines ProjectBase without using it");
Line 3453... Line 4281...
3453
    }
4281
    }
3454
    return $retval;
4282
    return $retval;
3455
}
4283
}
3456
 
4284
 
3457
#-------------------------------------------------------------------------------
4285
#-------------------------------------------------------------------------------
-
 
4286
# Function        : detectBuildFileClashes
-
 
4287
#
-
 
4288
# Description     : Scan a directory for multiple buildfiles and conflicts
-
 
4289
#                   Only works for Jats build.pl files - at the moment
-
 
4290
#
-
 
4291
# Inputs          : $data       - PackageVersion Data
-
 
4292
#                   $rootDir    - Directory to scan
-
 
4293
#
-
 
4294
# Returns         : 0                   - All is well
-
 
4295
#                   !0                  - Multiple build files found
-
 
4296
#
-
 
4297
sub detectBuildFileClashes
-
 
4298
{
-
 
4299
    my ($pvdata, $rootDir) = @_;
-
 
4300
    my %data;
-
 
4301
    my $rv = 0;
-
 
4302
Message ('Detect Build File Clashes');
-
 
4303
 
-
 
4304
    my $bscanner = BuildFileScanner ( $rootDir, 'build.pl' );
-
 
4305
    my $count = $bscanner->locate();
-
 
4306
 
-
 
4307
    #
-
 
4308
    #   None found - OK ( but not good )
-
 
4309
    #
-
 
4310
    return $rv unless ( $count );
-
 
4311
 
-
 
4312
    #
-
 
4313
    #   Process all the build files in the tree
-
 
4314
    #
-
 
4315
    $bscanner->scan();
-
 
4316
    my @buildfiles = $bscanner->getMatchList();
-
 
4317
#   DebugDumpData('$bscanner', $bscanner );
-
 
4318
#   DebugDumpData('@buildfiles', \@buildfiles );
-
 
4319
#   exit 99;
-
 
4320
 
-
 
4321
    foreach my $bf ( @buildfiles )
-
 
4322
    {
-
 
4323
        my $bdir = $bf->{dir};
-
 
4324
        my $bname = $bf->{name};
-
 
4325
        my $bversion = $bf->{version};
-
 
4326
        next unless ( defined($bname) );
-
 
4327
Information ("BuildFiles: $bname, $bversion : $bdir");
-
 
4328
 
-
 
4329
        if ( exists ($data{$bname}{count}) && ($data{$bname}{count} >= 1) )
-
 
4330
        {
-
 
4331
            Warning ("MultipleBuildFiles for $bname ($bversion)");
-
 
4332
            $rv = 1;
-
 
4333
        }
-
 
4334
        $data{$bname}{count}++;
-
 
4335
        push @{$data{$bname}{versions}}, $bversion;
-
 
4336
    }
-
 
4337
 
-
 
4338
    return $rv;
-
 
4339
}
-
 
4340
 
-
 
4341
#-------------------------------------------------------------------------------
3458
# Function        : findDirWithStuff
4342
# Function        : findDirWithStuff
3459
#
4343
#
3460
# Description     : Find a directory that contains more than just another subdir
4344
# Description     : Find a directory that contains more than just another subdir
3461
#                   Note: don't use 'glob' it doesn't work if the name has a space in it.
4345
#                   Note: don't use 'glob' it doesn't work if the name has a space in it.
3462
#
4346
#
Line 3537... Line 4421...
3537
 
4421
 
3538
#-------------------------------------------------------------------------------
4422
#-------------------------------------------------------------------------------
3539
# Function        : saneLabel
4423
# Function        : saneLabel
3540
#
4424
#
3541
# Description     : Generate a sane version label
4425
# Description     : Generate a sane version label
3542
#                   Handle suplicates (due to character squishing)
4426
#                   Handle duplicates (due to character squishing)
3543
#                   Cache results for repeatability
4427
#                   Cache results for repeatability
3544
#
4428
#
3545
# Inputs          : $entry          - Version info
4429
# Inputs          : $entry          - Version info
3546
#                   $pkgname        - Alternate pkgname (branching)
4430
#                   $pkgname        - Alternate pkgname (branching)
3547
#
4431
#
Line 3760... Line 4644...
3760
                    #
4644
                    #
3761
                    #   Some developers have a 'special' package version
4645
                    #   Some developers have a 'special' package version
3762
                    #   We really need to ignore them
4646
                    #   We really need to ignore them
3763
                    #
4647
                    #
3764
                    next if ( $pkg_ver eq '23.23.23.ssw' );
4648
                    next if ( $pkg_ver eq '23.23.23.ssw' );
3765
                    
-
 
-
 
4649
 
3766
                    #
4650
                    #
3767
                    #   Add data to the hash
4651
                    #   Add data to the hash
3768
                    #       Remove entries that address themselves
-
 
3769
                    #
4652
                    #
3770
                    push (@{$versions{$last_pv_id}{next}}, $pv_id) unless ($pv_id == $last_pv_id || $last_pv_id == 0) ;
-
 
3771
                    $versions{$pv_id}{name} = $pkg_name;
4653
                    $versions{$pv_id}{name} = $pkg_name;
3772
                    $versions{$pv_id}{pvid} = $pv_id;
4654
                    $versions{$pv_id}{pvid} = $pv_id;
3773
                    $versions{$pv_id}{vname} = $pkg_ver;
4655
                    $versions{$pv_id}{vname} = $pkg_ver;
3774
                    $versions{$pv_id}{vcsTag} = $vcstag;
4656
                    $versions{$pv_id}{vcsTag} = $vcstag;
3775
                    $versions{$pv_id}{created} = $created;
4657
                    $versions{$pv_id}{created} = $created;
Line 3783... Line 4665...
3783
                    examineVcsTag($pv_id);
4665
                    examineVcsTag($pv_id);
3784
 
4666
 
3785
                    #
4667
                    #
3786
                    #   Process version number
4668
                    #   Process version number
3787
                    #
4669
                    #
3788
                    my ($suffix, $version, $isaR, $isaWip, $buildVersion ) = massageVersion($pkg_ver, $pkg_name);
4670
                    my ($suffix, $version, $isaR, $isaWip, $buildVersion, $isaPatch ) = massageVersion($pkg_ver, $pkg_name);
3789
 
4671
 
3790
                    $versions{$pv_id}{version} = $version;
4672
                    $versions{$pv_id}{version} = $version;
3791
                    $versions{$pv_id}{buildVersion} = $buildVersion;
4673
                    $versions{$pv_id}{buildVersion} = $buildVersion;
3792
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
4674
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
-
 
4675
                    $versions{$pv_id}{isaPatch} = 1 if ( $isaPatch );
-
 
4676
 
-
 
4677
                    # Remove entries that address themselves
-
 
4678
                    push (@{$versions{$last_pv_id}{next}}, $pv_id) unless ($pv_id == $last_pv_id || $last_pv_id == 0 || $isaPatch) ;
-
 
4679
                    
3793
 
4680
 
3794
                    #
4681
                    #
3795
                    #   New methof for detecting a ripple
4682
                    #   New method for detecting a ripple
3796
                    #       Don't look at the version number
4683
                    #       Don't look at the version number
3797
                    #       Use RM data
4684
                    #       Use RM data
3798
                    #       Inlude the comment - there are some cases where the comment
4685
                    #       Inlude the comment - there are some cases where the comment
3799
                    #       appears to have been user modified.
4686
                    #       appears to have been user modified.
3800
                    #
4687
                    #
Line 3848... Line 4735...
3848
    my ($major, $minor, $patch, $build, $suffix);
4735
    my ($major, $minor, $patch, $build, $suffix);
3849
    my $result;
4736
    my $result;
3850
    my $buildVersion;
4737
    my $buildVersion;
3851
    my $isaRipple;
4738
    my $isaRipple;
3852
    my $isaWIP;
4739
    my $isaWIP;
-
 
4740
    my $isaPatch;
3853
    $build = 0;
4741
    $build = 0;
3854
 
4742
 
3855
#print "--- $name, $version\n";
4743
#print "--- $name, $version\n";
3856
    $version =~ s~^_~~;
4744
    $version =~ s~^_~~;
3857
    $version =~ s~^${name}_~~;
4745
    $version =~ s~^${name}_~~;
Line 3860... Line 4748...
3860
    #   xxxxxxxxx.nnnn.cots
4748
    #   xxxxxxxxx.nnnn.cots
3861
    #
4749
    #
3862
    if ( $version =~ m~(.*)\.cots$~ ) {
4750
    if ( $version =~ m~(.*)\.cots$~ ) {
3863
        my $cots_base = $1;
4751
        my $cots_base = $1;
3864
        $suffix = '.cots';
4752
        $suffix = '.cots';
3865
        if ( $version =~ m~(.*?)\.([0-9]{4})\.cots$~ )
4753
        if ( $version =~ m~(.*?)\.([0-9]{4,5})\.cots$~ )
3866
        {
4754
        {
3867
            $result = $1 . sprintf (".%4.4d", $2) . $suffix;
4755
            $result = $1 . sprintf (".%4.4d", $2) . $suffix;
3868
        }
4756
        }
3869
        else
4757
        else
3870
        {
4758
        {
3871
            $result = $cots_base . '.0000.cots';
4759
            $result = $cots_base . '.0000.cots';
3872
        }
4760
        }
-
 
4761
        if ( $result =~ m~(.*)\.(\d+)(\d\d\d)\.cots$~ )
-
 
4762
        {
-
 
4763
            $buildVersion = [$1, 0 , $2, $3 ];
-
 
4764
        }
3873
    }
4765
    }
3874
    #
4766
    #
3875
    #   Convert version into full form for comparisions
4767
    #   Convert version into full form for comparisions
3876
    #       nnn.nnn.nnn.[p]nnn.xxx
4768
    #       nnn.nnn.nnn.[p]nnn.xxx
3877
    #       nnn.nnn.nnn.[p]nnn-xxx
4769
    #       nnn.nnn.nnn.[p]nnn-xxx
Line 3885... Line 4777...
3885
        $minor = $2;
4777
        $minor = $2;
3886
        $patch = $3;
4778
        $patch = $3;
3887
        $build = $4;
4779
        $build = $4;
3888
        $suffix = defined $6 ? ".$6" : '';
4780
        $suffix = defined $6 ? ".$6" : '';
3889
        $isaRipple = 0;
4781
        $isaRipple = 0;
-
 
4782
        $isaPatch = 1;
3890
    }
4783
    }
3891
    #
4784
    #
3892
    #       nn.nnn.nnnnn.xxx
4785
    #       nn.nnn.nnnnn.xxx
3893
    #       nn.nnn.nnnnn-xxx
4786
    #       nn.nnn.nnnnn-xxx
3894
    #       nnn.nnn.nnnx.xxx
4787
    #       nnn.nnn.nnnx.xxx
Line 3949... Line 4842...
3949
        $major = $1;
4842
        $major = $1;
3950
        $minor = $2;
4843
        $minor = $2;
3951
        $patch = 0;
4844
        $patch = 0;
3952
        $suffix = $3;
4845
        $suffix = $3;
3953
    }
4846
    }
-
 
4847
 
-
 
4848
    #
-
 
4849
    #       nnn.nnn.c.xxx
-
 
4850
    #
-
 
4851
    elsif ( $version =~ m~^(\d+)\.(\d+)\.(\w)(\.\w+)$~ ) {
-
 
4852
        $major = $1;
-
 
4853
        $minor = $2;
-
 
4854
        $patch = ord($3);
-
 
4855
        $suffix = $4;
-
 
4856
    }
-
 
4857
    
3954
    
4858
    
3955
    #
4859
    #
3956
    #       nnn.nnn.nnnz
4860
    #       nnn.nnn.nnnz
3957
    #
4861
    #
3958
    elsif ( $version =~ m~^(\d+)\.(\d+)\.(\d+)([a-z])$~ ) {
4862
    elsif ( $version =~ m~^(\d+)\.(\d+)\.(\d+)([a-z])$~ ) {
Line 3966... Line 4870...
3966
    #
4870
    #
3967
    #       ???REV=???
4871
    #       ???REV=???
3968
    #
4872
    #
3969
    elsif ( $version =~ m~REV=~ ) {
4873
    elsif ( $version =~ m~REV=~ ) {
3970
        $suffix = '.cots';
4874
        $suffix = '.cots';
3971
        $result = $version . '.0000.cots';
4875
        $result = $version . '.000000.cots';
3972
    }
4876
    }
3973
 
4877
 
3974
    #
4878
    #
3975
    #   Wip Packages
4879
    #   Wip Packages
3976
    #   (nnnnnn).xxx
4880
    #   (nnnnnn).xxx
3977
    #   Should be essential, but want to sort very low
4881
    #   Should be essential, but want to sort very low
3978
    #
4882
    #
3979
    elsif ($version =~ m~\((.*)\)(\..*)?~) {
4883
    elsif ($version =~ m~\((.*)\)(\..*)?~) {
3980
        $suffix = $2 || '';
4884
        $suffix = $2 || '';
3981
        $result = "000.000.000.000$suffix";
4885
        $result = "000.000.000.00000$suffix";
3982
        $isaWIP = 1;
4886
        $isaWIP = 1;
3983
    }
4887
    }
3984
 
4888
 
3985
    #
4889
    #
3986
    #   !current
4890
    #   !current
3987
    #
4891
    #
3988
    elsif ($version eq '!current' || $version eq 'current_$USER' || $version eq 'current' || $version eq 'beta' || $version eq 'latest' || $version eq 'beta.cr' || $version eq 'CREATE') {
4892
    elsif ($version eq '!current' || $version eq 'current_$USER' || $version eq 'current' || $version eq 'beta' || $version eq 'latest' || $version eq 'beta.cr' || $version eq 'CREATE') {
3989
        $suffix = '';
4893
        $suffix = '';
3990
        $result = "000.000.000.000$suffix";
4894
        $result = "000.000.000.00000$suffix";
3991
        $isaWIP = 1;
4895
        $isaWIP = 1;
3992
    }
4896
    }
3993
    
4897
    
3994
    #
4898
    #
3995
    #   Also WIP: FINRUN.103649.BEI.WIP
4899
    #   Also WIP: FINRUN.103649.BEI.WIP
3996
    elsif ($version =~ m~(\.[a-zA-Z]+)\.WIP$~) {
4900
    elsif ($version =~ m~(\.[a-zA-Z]+)\.WIP$~) {
3997
        $suffix = lc($1);
4901
        $suffix = lc($1);
3998
        $result = "000.000.000.000$suffix";
4902
        $result = "000.000.000.00000$suffix";
3999
        $isaWIP = 1;
4903
        $isaWIP = 1;
4000
    }
4904
    }
4001
 
4905
 
4002
    #
4906
    #
4003
    #   Also ERGOFSSLS190100_015
4907
    #   Also ERGOFSSLS190100_015
Line 4008... Line 4912...
4008
        $patch = $3;
4912
        $patch = $3;
4009
        $build = $4;
4913
        $build = $4;
4010
        $suffix = $5 || '.sls';
4914
        $suffix = $5 || '.sls';
4011
        $isaRipple = 0;
4915
        $isaRipple = 0;
4012
    }
4916
    }
-
 
4917
 
4013
    
4918
    #
-
 
4919
    #   nnnn
-
 
4920
    #
-
 
4921
    elsif ($version =~ m~[0-9]{4}~) {
-
 
4922
        $suffix = '';
-
 
4923
        $major = 0;
-
 
4924
        $minor = 0;
-
 
4925
        $patch = $version;
-
 
4926
        $build = 0;
-
 
4927
    }
4014
    #
4928
    #
4015
    #   Stuff we don't yet handle
4929
    #   Stuff we don't yet handle
4016
    #
4930
    #
4017
    else  {
4931
    else  {
4018
        Warning ("Unknown version number: $name,$version");
4932
        Warning ("Unknown version number: $name,$version");
Line 4032... Line 4946...
4032
            $major = 0;
4946
            $major = 0;
4033
            $minor = 0;
4947
            $minor = 0;
4034
            $patch = 0;
4948
            $patch = 0;
4035
        }
4949
        }
4036
        
4950
        
4037
        $result = sprintf("%3.3d.%3.3d.%3.3d.%3.3d%s", $major,$minor,$patch,$build,$suffix || '.0000');
4951
        $result = sprintf("%3.3d.%3.3d.%3.3d.%5.5d%s", $major,$minor,$patch,$build,$suffix || '.0000');
4038
        $buildVersion = [ $major, $minor, $patch, $build ];
4952
        $buildVersion = [ $major, $minor, $patch, $build ];
4039
    }
4953
    }
4040
 
4954
 
4041
    $suffix = lc( $suffix );
4955
    $suffix = lc( $suffix );
4042
    if ( exists $suffixFixup{$suffix} )
4956
    if ( exists $suffixFixup{$suffix} )
4043
    {
4957
    {
4044
        $suffix = $suffixFixup{$suffix} ;
4958
        $suffix = $suffixFixup{$suffix} ;
4045
    }
4959
    }
4046
 
4960
 
4047
    return ($suffix, $result, $isaRipple, $isaWIP, $buildVersion );
4961
    return ($suffix, $result, $isaRipple, $isaWIP, $buildVersion, $isaPatch );
4048
}
4962
}
4049
 
4963
 
4050
#-------------------------------------------------------------------------------
4964
#-------------------------------------------------------------------------------
4051
# Function        : vcsCleanup
4965
# Function        : vcsCleanup
4052
#
4966
#
Line 4171... Line 5085...
4171
#
5085
#
4172
sub createImages
5086
sub createImages
4173
{
5087
{
4174
 
5088
 
4175
    my $filebase = "${packageNames}";
5089
    my $filebase = "${packageNames}";
-
 
5090
    my $openOk;
-
 
5091
    foreach my $ii ( 0 .. 5 )
-
 
5092
    {
4176
    open (FH, '>', $cwd . "/$filebase.dot" ) or die "Cannot open output";
5093
        if (open (FH, '>', $cwd . "/$filebase.dot" ))
-
 
5094
        {
-
 
5095
            $openOk = 1;
-
 
5096
            last;
-
 
5097
        }
-
 
5098
        sleep (2);
-
 
5099
    }
-
 
5100
    unless ( $openOk )
-
 
5101
    {
-
 
5102
        Warning ("Cannot open image output: $filebase.dot");
-
 
5103
        return;
-
 
5104
    }
-
 
5105
 
-
 
5106
 
4177
    print FH "digraph \"${packageNames}\" {\n";
5107
    print FH "digraph \"${packageNames}\" {\n";
4178
    #print FH "rankdir=LR;\n";
5108
    #print FH "rankdir=LR;\n";
4179
    print FH "node[fontsize=16];\n";
5109
    print FH "node[fontsize=16];\n";
4180
    print FH "node[target=_graphviz];\n";
5110
    print FH "node[target=_graphviz];\n";
4181
#    print FH "subgraph cluster_A {\n";
5111
#    print FH "subgraph cluster_A {\n";
Line 4230... Line 5160...
4230
        #
5160
        #
4231
        if ( scalar @multiplePaths > 1 )
5161
        if ( scalar @multiplePaths > 1 )
4232
        {
5162
        {
4233
            push @text, '|';
5163
            push @text, '|';
4234
            push @text, 'Multiple Paths';
5164
            push @text, 'Multiple Paths';
-
 
5165
            if ( $opt_AllowMuliplePaths )
-
 
5166
            {
-
 
5167
                push @text, 'Multiple Paths allowed:' . scalar @multiplePaths . ' found';
-
 
5168
            }
-
 
5169
            else
-
 
5170
            {
4235
            push @text, @multiplePaths;
5171
                push @text, @multiplePaths;
-
 
5172
            }
4236
        }
5173
        }
4237
 
5174
 
4238
        #
5175
        #
4239
        #   Bad essentials
5176
        #   Bad essentials
4240
        #
5177
        #
Line 4287... Line 5224...
4287
        push @text, 'Creation Date: yyyy-mm-dd';
5224
        push @text, 'Creation Date: yyyy-mm-dd';
4288
        push @text, '(Coded information)';
5225
        push @text, '(Coded information)';
4289
        push @text, '|{Code';
5226
        push @text, '|{Code';
4290
        push @text, '|{N: Not Locked';
5227
        push @text, '|{N: Not Locked';
4291
        push @text, 'b: Bad Singleton';
5228
        push @text, 'b: Bad Singleton';
4292
        push @text, 'd: A dependency';
-
 
4293
        push @text, 'B: Bad VCS Tag';
5229
        push @text, 'B: Bad VCS Tag';
-
 
5230
        push @text, 'd: Package in dpkg_archive';
4294
        push @text, 'D: DeadWood';
5231
        push @text, 'D: DeadWood';
4295
        push @text, 'e: Essential BOM Version';
-
 
4296
        push @text, 'E: Essential Release Version';
5232
        push @text, 'E: Essential Release Version';
4297
        push @text, 'F: Package directories labled';
5233
        push @text, 'F: Package directories labled';
4298
        push @text, 'G: Glued into Version Tree';
5234
        push @text, 'G: Glued into Version Tree';
4299
        push @text, 'L: Label not in VOB';
5235
        push @text, 'L: Label not in VOB';
-
 
5236
        push @text, 'p: Is a Patch';
4300
        push @text, 'r: Recent version';
5237
        push @text, 'r: Recent version';
4301
        push @text, 'R: Ripple';
5238
        push @text, 'R: Ripple';
4302
        push @text, 'S: Splitpoint';
5239
        push @text, 'S: Splitpoint';
4303
        push @text, 't: Glued into Project Tree';
5240
        push @text, 't: Glued into Project Tree';
4304
        push @text, 'T: Tip version';
5241
        push @text, 'T: Tip version';
Line 4355... Line 5292...
4355
 
5292
 
4356
    sub genLabelText
5293
    sub genLabelText
4357
    {
5294
    {
4358
        my ($entry) = @_;
5295
        my ($entry) = @_;
4359
        my @label;
5296
        my @label;
-
 
5297
        if ( $opt_fileList ) {
-
 
5298
            push @label, $versions{$entry}{realLabel};
-
 
5299
        } else {
4360
        push @label, $versions{$entry}{name} if ( $multiPackages );
5300
            push @label, $versions{$entry}{name} if ( $multiPackages );
4361
        push @label, $versions{$entry}{vname};
5301
            push @label, $versions{$entry}{vname};
-
 
5302
        }    
4362
#        push @label, $entry;       # Add PVID
5303
#        push @label, $entry;       # Add PVID
4363
        push @label, substr( $versions{$entry}{created}, 0, 10); #  2008-02-19
5304
        push @label, substr( $versions{$entry}{created}, 0, 10); #  2008-02-19
4364
#        push @label, 'V=' . $versions{$entry}{maxVersion};
5305
#        push @label, 'V=' . $versions{$entry}{maxVersion};
4365
#        push @label, 'B=' . $versions{$entry}{svnBranchTip} if ( exists $versions{$entry}{svnBranchTip} );
5306
#        push @label, 'B=' . $versions{$entry}{svnBranchTip} if ( exists $versions{$entry}{svnBranchTip} );
4366
 
5307
 
4367
        my $reason = '';
-
 
4368
        if (exists $versions{$entry}{Essential})
-
 
4369
        {
-
 
4370
            $reason = 'E';
-
 
4371
            if (exists $versions{$entry}{Reason})
-
 
4372
            {
-
 
4373
                if ( $versions{$entry}{Reason} =~ m~bom~ )
-
 
4374
                {
-
 
4375
                    $reason = 'e';
-
 
4376
                }
-
 
4377
                if ( $versions{$entry}{Reason} =~ m~Depend~ )
-
 
4378
                {
-
 
4379
                    $reason .= 'd';
-
 
4380
                }
-
 
4381
            }
-
 
4382
        }
-
 
4383
 
5308
 
4384
        my $stateText = '';
5309
        my $stateText = '';
4385
        $stateText .= 'N' if ($versions{$entry}{locked} eq 'N');
5310
        $stateText .= 'N' if ($versions{$entry}{locked} eq 'N');
4386
        $stateText .= 'b' if (exists $versions{$entry}{badSingleton});
5311
        $stateText .= 'b' if (exists $versions{$entry}{badSingleton});
4387
        $stateText .= 'B' if (exists $versions{$entry}{badVcsTag});
5312
        $stateText .= 'B' if (exists $versions{$entry}{badVcsTag});
4388
        $stateText .= 'G' if (exists $versions{$entry}{GluedIn});
5313
        $stateText .= 'G' if (exists $versions{$entry}{GluedIn});
4389
        $stateText .= 't' if (exists $versions{$entry}{MakeTree});
5314
        $stateText .= 't' if (exists $versions{$entry}{MakeTree});
4390
#        $stateText .= 'E' if (exists $versions{$entry}{Essential});
5315
        $stateText .= 'E' if (exists $versions{$entry}{Essential});
4391
        $stateText .= $reason if ( $reason );
5316
        $stateText .= 'd' if (exists $versions{$entry}{dpkgArchive});
4392
        $stateText .= 'D' if (exists $versions{$entry}{DeadWood});
5317
        $stateText .= 'D' if (exists $versions{$entry}{DeadWood});
-
 
5318
        $stateText .= 'p' if ( $versions{$entry}{isaPatch} );
4393
        $stateText .= 'R' if ( $versions{$entry}{isaRipple} );
5319
        $stateText .= 'R' if ( $versions{$entry}{isaRipple} );
4394
        $stateText .= 'r' if (exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
5320
        $stateText .= 'r' if (exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
4395
        $stateText .= 'S' if (exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
5321
        $stateText .= 'S' if (exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
4396
        $stateText .= 'T' if (exists $versions{$entry}{Tip} );
5322
        $stateText .= 'T' if (exists $versions{$entry}{Tip} );
4397
        $stateText .= 'V' if (exists $versions{$entry}{isSvn} );
5323
        $stateText .= 'V' if (exists $versions{$entry}{isSvn} );
Line 4609... Line 5535...
4609
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
5535
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4610
        if (exists $ScmRepoMap{$packageNames});
5536
        if (exists $ScmRepoMap{$packageNames});
4611
 
5537
 
4612
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
5538
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
4613
        if (exists $ScmRepoMap{$packageNames}{protected});
5539
        if (exists $ScmRepoMap{$packageNames}{protected});
-
 
5540
 
-
 
5541
    $opt_vobMap = '' if ( $opt_repoSubdir );
-
 
5542
 
4614
    #
5543
    #
4615
    #   Free the memory
5544
    #   Free the memory
4616
    #
5545
    #
4617
    %ScmRepoMap = ();
5546
    %ScmRepoMap = ();
4618
 
5547
 
4619
    #
5548
    #
4620
    #   Calculate Target Repo
5549
    #   Calculate Target Repo
4621
    #
5550
    #
4622
    Warning ("No VOB Mapping found")
5551
    Warning ("No VOB Mapping found")
4623
        unless ($opt_vobMap);
5552
        unless ($opt_vobMap || ($opt_repoSubdir && $opt_repo));
4624
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
5553
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4625
        unless ( $opt_repo || $opt_vobMap );
5554
        unless ( $opt_repo || $opt_vobMap );
4626
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
5555
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
-
 
5556
    $r1 = 'Import_test/' . $r1 if ( $opt_useTestRepo );
4627
    $r1 =~ s~//~/~g;
5557
    $r1 =~ s~//~/~g;
4628
    $r1 =~ s~^/~~;
5558
    $r1 =~ s~^/~~;
-
 
5559
    $r1 =~ s~/\.$~~;
4629
    $r1 =~ s~/$~~;
5560
    $r1 =~ s~/$~~;
4630
    $svnRepo = $opt_repo_base . $r1;
5561
    $svnRepo = $opt_repo_base . $r1;
4631
 
5562
 
4632
    Verbose( "Repo URL: $svnRepo");
5563
    Message( "Repo URL: $svnRepo");
4633
}
5564
}
4634
 
5565
 
4635
 
5566
 
4636
#-------------------------------------------------------------------------------
5567
#-------------------------------------------------------------------------------
4637
# Function        : getEssenialPackageVersions
5568
# Function        : getEssenialPackageVersions
Line 4671... Line 5602...
4671
        next unless ( exists  $pkg_ids{ $ScmPackages{$_}{pkgid} } );
5602
        next unless ( exists  $pkg_ids{ $ScmPackages{$_}{pkgid} } );
4672
        push @EssentialPackages, $_;
5603
        push @EssentialPackages, $_;
4673
        Error ("Essential Package Version not in extracted Release Manager Data: $_")
5604
        Error ("Essential Package Version not in extracted Release Manager Data: $_")
4674
            unless ( exists $versions{$_} );
5605
            unless ( exists $versions{$_} );
4675
        $versions{$_}{Essential} = 1;
5606
        $versions{$_}{Essential} = 1;
4676
        $versions{$_}{Reason} = $ScmPackages{$_}{Reason} if exists $ScmPackages{$_}{Reason}  ;
-
 
4677
 
5607
 
4678
        # Retain which RM Release this package-version is the tip
5608
        # Retain which RM Release this package-version is the tip
4679
        # Release of
5609
        # Release of
4680
        foreach my $rtag_id ( @{$ScmPackages{$_}{'release'}} )
5610
        foreach my $rtag_id ( @{$ScmPackages{$_}{'release'}} )
4681
        {
5611
        {
Line 4825... Line 5755...
4825
    #
5755
    #
4826
    #   Process data
5756
    #   Process data
4827
    foreach my $entry ( @svnDataItems )
5757
    foreach my $entry ( @svnDataItems )
4828
    {
5758
    {
4829
        my $name;
5759
        my $name;
4830
        my $isaBranch;
-
 
4831
        my $target = $entry->{target};
5760
        my $target = $entry->{'target'};
4832
        if ( $target =~ m~/tags/(.*)~ ) {
5761
        if ( $target =~ m~/tags/(.*)~ ) {
4833
            $name = $1;
5762
            $name = $1;
4834
            $svnData{tags}{$name} = 1;
5763
            $svnData{tags}{$name} = 1;
4835
        } elsif ( $target =~ m~/branches/(.*)~ )  {
5764
        } elsif ( $target =~ m~/branches/(.*)~ )  {
4836
            $name = $1;
5765
            $name = $1;
Line 4838... Line 5767...
4838
        } else {
5767
        } else {
4839
            $svnData{nonTag}{$target} = 1;
5768
            $svnData{nonTag}{$target} = 1;
4840
        }
5769
        }
4841
 
5770
 
4842
        my $fromBranch;
5771
        my $fromBranch;
4843
        if ( $entry->{fromPath} =~ m~/trunk$~  ) {
5772
        if ( $entry->{'copyfrom-path'} =~ m~/trunk$~  ) {
4844
            $fromBranch = 'trunk';
5773
            $fromBranch = 'trunk';
4845
        } elsif ( $entry->{fromPath} =~ m~/branches/(.*)~ ) {
5774
        } elsif ( $entry->{'copyfrom-path'} =~ m~/branches/(.*)~ ) {
4846
            $fromBranch = $1;
5775
            $fromBranch = $1;
4847
        }
5776
        }
4848
 
5777
 
4849
        # largest Rev number on branch
5778
        # largest Rev number on branch
4850
        if ( exists $svnData{max}{$fromBranch} )
5779
        if ( exists $svnData{max} && exists $svnData{max}{$fromBranch} )
4851
        {
5780
        {
4852
            if ( $svnData{max}{$fromBranch}{rev} <  $entry->{fromRev} )
5781
            if ( $svnData{max}{$fromBranch}{rev} <  $entry->{'copyfrom-rev'} )
4853
            {
5782
            {
4854
                $svnData{max}{$fromBranch}{rev} =  $entry->{fromRev};
5783
                $svnData{max}{$fromBranch}{rev} =  $entry->{'copyfrom-rev'};
4855
                $svnData{max}{$fromBranch}{name} = $name;
5784
                $svnData{max}{$fromBranch}{name} = $name;
4856
            }
5785
            }
4857
        }
5786
        }
4858
        else
5787
        else
4859
        {
5788
        {
4860
            $svnData{max}{$fromBranch}{rev} =  $entry->{fromRev};
5789
            $svnData{max}{$fromBranch}{rev} =  $entry->{'copyfrom-rev'};
4861
            $svnData{max}{$fromBranch}{name} = $name;
5790
            $svnData{max}{$fromBranch}{name} = $name;
4862
        }
5791
        }
4863
    }
5792
    }
4864
 
5793
 
4865
    foreach my $branch ( keys %{$svnData{max}} )
5794
    foreach my $branch ( keys %{$svnData{max}} )
Line 4916... Line 5845...
4916
# Inputs          : 
5845
# Inputs          : 
4917
#
5846
#
4918
# Returns         : 
5847
# Returns         : 
4919
#
5848
#
4920
my $entryData;
5849
my $entryData;
-
 
5850
my $entryActive;
4921
sub  ProcessSvnLog
5851
sub  ProcessSvnLog
4922
{
5852
{
4923
    my ($self, $line ) = @_;
5853
    my ($self, $line ) = @_;
-
 
5854
    $entryActive = '' unless ( defined $entryActive );
-
 
5855
    return unless ( $line );
4924
#print "----- $line\n";
5856
#print "----- ($entryActive) $line\n";
-
 
5857
 
4925
    if ( $line =~ m~^<logentry~ ) {
5858
    if ( $line =~ m~^<logentry~ ) {
4926
        $entryData = ();
5859
        $entryData = ();
-
 
5860
        $entryActive = 'A';
4927
 
5861
 
4928
    } elsif ( $line =~ m~^\s+revision="(\d+)"~ ) {
5862
    } elsif ( ($line =~ s~\s*(.+?)="(.*)">(.*)</path>$~~) && ($entryActive eq 'A') ) {
-
 
5863
        #
-
 
5864
        #   Last entry has two items
-
 
5865
        #       Attribute
4929
        $entryData->{Rev} = $1;
5866
        #       Data Item
4930
 
5867
        #
4931
    } elsif ( $line =~ m~^\s+copyfrom-path="(.*)"~ ) {
5868
        $entryData->{$1} = $2;
4932
        $entryData->{fromPath} = $1;
5869
        $entryData->{target} = $3;
4933
 
5870
 
4934
    } elsif ( $line =~ m~^\s+copyfrom-rev="(\d+)"~ ) {
5871
    } elsif ( ($line =~ m~\s*(.*?)="(.*)"~) && ($entryActive eq 'A') ) {
-
 
5872
        #
4935
        $entryData->{fromRev} = $1;
5873
        #   Attribute
4936
        
5874
        #
4937
    } elsif ( $line =~ m~\s+action=.*?>(.*)</path~ ) {
-
 
4938
        $entryData->{target} = $1;
5875
        $entryData->{$1} = $2;
4939
 
5876
 
4940
    } elsif ( $line =~ m~</logentry~ ) {
5877
    } elsif ( $line =~ m~</logentry~ ) {
-
 
5878
        $entryActive = '';
4941
        if ( exists $entryData->{fromPath} )
5879
        if ( exists $entryData->{'copyfrom-path'} )
4942
        {
5880
        {
4943
#            DebugDumpData("Data", $entryData);
5881
#            DebugDumpData("Data", $entryData);
4944
            push @svnDataItems, $entryData;
5882
            push @svnDataItems, $entryData;
4945
        }
5883
        }
4946
    }
5884
    }
Line 5052... Line 5990...
5052
        next if ( m~^\s*\#~ );
5990
        next if ( m~^\s*\#~ );
5053
        my @data = split( /\s+/, $_);
5991
        my @data = split( /\s+/, $_);
5054
#print "@data\n";
5992
#print "@data\n";
5055
        if ( @data == 3 )
5993
        if ( @data == 3 )
5056
        {
5994
        {
-
 
5995
#print "--- $data[2]\n";
-
 
5996
            my $pkg_name;
-
 
5997
            my $pkg_ver;
5057
            $data[2] =~ m~^(.*)_(.*)~;
5998
            if ($data[2] =~ m~^(.*)[_](.*)~ ) {
5058
            my $pkg_name = $1;
5999
                $pkg_name = $1;
5059
            my $pkg_ver = $2;
6000
                $pkg_ver = $2;
-
 
6001
                if ( $pkg_ver =~ m~[0-9]+~ ) {
5060
            $pkg_ver =~ s~^[a-zA-Z]\.*~~;
6002
                    $pkg_ver =~ s~^[a-zA-Z]\.*~~;
-
 
6003
                }
-
 
6004
            } else {
-
 
6005
                $pkg_name = $data[2];
-
 
6006
                $pkg_ver = '0.0.0';
-
 
6007
            }
5061
print "$data[2] : $pkg_name, $pkg_ver\n";
6008
print "$data[2] : $pkg_name, $pkg_ver\n";
5062
 
6009
 
5063
#           Expecting Clearcase format:
6010
#           Expecting Clearcase format:
5064
#               2011-08-30T13:49:21+08
6011
#               2011-08-30T13:49:21+08
5065
#               2010-11-16T03:24:34Z
6012
#               2010-11-16T03:24:34Z
Line 5145... Line 6092...
5145
    -[no]postimage     - Create image after transger: Def: -post
6092
    -[no]postimage     - Create image after transger: Def: -post
5146
    -workdir=path      - Use for temp storage (def:/work)
6093
    -workdir=path      - Use for temp storage (def:/work)
5147
    -delete            - Delete SVN package before test
6094
    -delete            - Delete SVN package before test
5148
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
6095
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
5149
    -filelist=path     - Use named list of files
6096
    -filelist=path     - Use named list of files
-
 
6097
    -ccbase=VOB        - Clearcase Vob to use for filelist
5150
    -testRmDatabase    - Use test database
6098
    -testRmDatabase    - Use test database
5151
    -[no]fromSvn       - Also extract packages from SVN
6099
    -[no]fromSvn       - Also extract packages from SVN
-
 
6100
    -[no]testRepo      - Force use of a test repository.
-
 
6101
    -resume            - Resume aborted import (dangerous)
5152
 
6102
 
5153
=head1 OPTIONS
6103
=head1 OPTIONS
5154
 
6104
 
5155
=over 8
6105
=over 8
5156
 
6106