Subversion Repositories DevTools

Rev

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

Rev 2449 Rev 2635
Line 67... Line 67...
67
my @opt_tip;
67
my @opt_tip;
68
my $opt_postimage = 1;
68
my $opt_postimage = 1;
69
my $opt_workDir = '/work';
69
my $opt_workDir = '/work';
70
my $opt_vobMap;
70
my $opt_vobMap;
71
my $opt_fileList;
71
my $opt_fileList;
-
 
72
my $opt_ccbase;
72
my $opt_preserveProjectBase;
73
my $opt_preserveProjectBase;
73
my $opt_ignoreProjectBaseErrors;
74
my $opt_ignoreProjectBaseErrors;
74
my $opt_resume;
-
 
75
my $opt_ignoreMakeProjectErrors;
75
my $opt_ignoreMakeProjectErrors;
-
 
76
my $opt_forceProjectBase;
-
 
77
my @opt_limitProjectBase;
-
 
78
my @opt_mergePaths;
-
 
79
my $opt_ignoreBadPaths;
76
my $opt_delete;
80
my $opt_delete;
77
my $opt_recentAge = 14;             # Days
81
my $opt_recentAge = 14;             # Days
78
my $opt_relabel = 1;
82
my $opt_relabel = 0;
-
 
83
my $opt_protected;
-
 
84
my $opt_useSvn = 1;
-
 
85
my $opt_testRmDatabase;
-
 
86
my $opt_extractFromSvn;
-
 
87
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
-
 
88
my $opt_resume;
-
 
89
my $opt_processRipples = 1;
-
 
90
my $opt_mergePackages;
79
 
91
 
80
################################################################################
92
################################################################################
81
#   List of Projects Suffixes and Branch Names to be used within SVN
93
#   List of Projects Suffixes and Branch Names to be used within SVN
82
#
94
#
83
#       Name        - Name of branch for the project
95
#       Name        - Name of branch for the project
Line 133... Line 145...
133
    '.pxxx.sydddd'  => '.syd',
145
    '.pxxx.sydddd'  => '.syd',
134
    '.oslo'         => '.oso',
146
    '.oslo'         => '.oso',
135
    '.osl'          => '.oso',
147
    '.osl'          => '.oso',
136
);
148
);
137
 
149
 
138
my @excludeFromImport = (
-
 
139
 
-
 
140
    # 22-Oct-12: Excluded on request from Kasun Sirikumara
-
 
141
    # Pending VSS work
-
 
142
    'agency_website',
-
 
143
    'alx',
-
 
144
    'alx-api',
-
 
145
    'cardholder_website',
-
 
146
    'loginmodule-ad',
-
 
147
    'ols-enquiry',
-
 
148
    'ols-enquiry-api',
-
 
149
    'olsrpc4j',
-
 
150
    'orca-middleware',
-
 
151
    'orca-middleware-api',
-
 
152
    'orca-salesEngine',
-
 
153
    'orca-web-api',
-
 
154
    'orca-web-utils',
-
 
155
    'TestPaymentGateway',
-
 
156
    'tgen4j',
-
 
157
    'web-cd-client',
-
 
158
 
-
 
159
 
-
 
160
    # 05-Nov-12: Pending fixup for include.txt files that escape the VOB
-
 
161
    #
-
 
162
#    'ddu_app_manager',
-
 
163
#    'ddu_dog',
-
 
164
#    'ddu_dog_lib',
-
 
165
#    'ddu_fim',
-
 
166
#    'ddu_logging_lib',
-
 
167
#    'ddu_management',
-
 
168
#    'ddu_mccain',
-
 
169
#    'ddu_mon',
-
 
170
#    'ddu_rcu',
-
 
171
#    'ddu_status_logging',
-
 
172
    
-
 
173
);
-
 
174
 
-
 
175
my %specialPackages = (
150
my %specialPackages = (
176
    'core_devl'           =>  ',all,protected,',
151
    'core_devl'           =>  ',all,protected,',
177
    'daf_utils_mos'       => ',flat,',
152
    'daf_utils_mos'       => ',flat,',
178
    'mos_packager'        => ',all,',
153
    'mos_packager'        => ',all,',
179
    'cfmgr-cfmgr'         => ',flat,',
154
    'cfmgr-cfmgr'         => ',flat,',
Line 181... Line 156...
181
    'ReleaseName'         => ',flat,',
156
    'ReleaseName'         => ',flat,',
182
    'reports'             => ',utf8,',
157
    'reports'             => ',utf8,',
183
    'cda_imports'         => ',utf8,',
158
    'cda_imports'         => ',utf8,',
184
    'cdxforms'            => ',utf8,',
159
    'cdxforms'            => ',utf8,',
185
    'db_cda'              => ',utf8,',
160
    'db_cda'              => ',utf8,',
186
    'Dataman'             => ',utf8,',
-
 
187
    'CommandServer'       => ',IgnoreMakeProject,',
161
    'CommandServer'       => ',IgnoreMakeProject,',
188
    'TDSExporterControl'  => ',IgnoreMakeProject,',
162
    'TDSExporterControl'  => ',IgnoreMakeProject,',
189
    'cdagui'              => ',IgnoreMakeProject,',
163
    'cdagui'              => ',IgnoreMakeProject,',
190
 
164
 
191
 
165
 
192
    # Need to be handled in a special manner
166
    'ftp'                   => ',SetProjectBase,',
-
 
167
    'ddu_app_manager'       => ',SetProjectBase,IgnoreMakeProject,',
-
 
168
    'ddu_afc'               => ',SetProjectBase,IgnoreMakeProject,',
-
 
169
    'ddu_dog'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
170
    'ddu_management'        => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode,',
193
    # Not done by this utility
171
    'ddu_fim'               => ',IgnoreMakeProject,',
194
    #
-
 
-
 
172
    'ddu_mccain'            => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
173
    'ddu_mon'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle,',
-
 
174
    'ddu_rcu'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode,',
-
 
175
    'ddu_status_logging'    => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle,',
-
 
176
    'ddu_logging_lib'       => ',SetProjectBase,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
177
    'verifone'              => ',ForceProjectBase=/DPG_SWCode/products/verifone,',
195
    'linux_drivers_eb5600'  => ',protected,',
178
    'dm_devcdfile'          => 'AllowMultiPath',
196
    'linux_drivers_viper'   => ',protected,',
179
    'daf_ct_mcr_unified'    => 'AllowMultiPath',
197
    'linux_drivers_cobra'   => ',protected,',
180
    'cst-rms-db'            => 'AllowMultiPath',
198
    'linux_drivers_bcp4600' => ',protected,',
181
    'daf_common'            => 'IgnoreProjectBase',
199
    'linux_drivers_etx86'   => ',protected,',
182
    'devcd'                 => 'AllowMultiPath',
-
 
183
    'daf_dll'                   => 'AllowMultiPath,IgnoreMakeProject',  # MakeProject not in used makefile
-
 
184
    'daf_transap_proxyman_edf'  => 'AllowMultiPath,IgnoreProjectBase',
200
    'linux_drivers_tp5600'  => ',protected,',
185
    'devrelease'                => 'AllowMultiPath',
201
 
186
 
-
 
187
    'dm_devrelease'             => 'AllowMultiPath',
-
 
188
    'dm_rtswis'                 => 'AllowMultiPath',
-
 
189
    'dm_devcd'                  => 'AllowMultiPath',
-
 
190
    'dm_documentation'          => 'AllowMultiPath,IgnoreBadPath',
-
 
191
    'dm_eventhdr'               => 'AllowMultiPath',
-
 
192
    'dm_javaenums'              => 'AllowMultiPath',
-
 
193
    'dm_solidbasetypes'         => 'AllowMultiPath',
-
 
194
    'dm_swismetadata'           => 'AllowMultiPath',
-
 
195
    'dm_cuttables'              => 'AllowMultiPath',
202
# Not in the ukHops migration at the moment
196
    'dm_devudapi'               => 'AllowMultiPath',
-
 
197
    'buscdapi'                  => 'AllowMultiPath',
-
 
198
    'daf_bvt'                   => 'AllowMultiPath,IgnoreMakeProject,',  # Look OK
-
 
199
    'daf_cd_transap'            => 'AllowMultiPath,IgnoreBadPath,IgnoreProjectBase',
203
    'cs'                        => ',protected,',
200
    'cdref'                     => 'AllowMultiPath',
204
 
-
 
-
 
201
    'dm_sysbasetypes'           => 'AllowMultiPath',
-
 
202
    'dm_sysswis'                => 'AllowMultiPath',
-
 
203
    'dm_syscd'                  => 'AllowMultiPath',
205
    'DBA-Common'                => ',protected,',
204
    'dm_udtypes'                => 'AllowMultiPath',
206
    'DBA-DatabaseInstall'       => ',protected,',
205
    'dm_systemcdtables'         => 'AllowMultiPath',
-
 
206
    'dm_utils'                  => 'AllowMultiPath',
207
    'DBA-ExternalPerlModules'   => ',protected,',
207
    'dm_udxml'                  => 'AllowMultiPath',
208
    'DBA-OraUserBuild'          => ',protected,',
208
    'HCP5000_resources'         => 'AllowMultiPath',
-
 
209
    'massrtswis'                => 'AllowMultiPath',
-
 
210
    'pcp5000'                   => 'AllowMultiPath,ForceProjectBase=/DPG_SWCode',
-
 
211
    'PFTPi'                     => 'AllowMultiPath,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',  # Looks OK
-
 
212
    'PFTPu'                     => 'AllowMultiPath,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',  # Looks OK
-
 
213
    'WinCEBlocker'              => ',IgnoreMakeProject,',  # Looks OK
-
 
214
    'WinCEDeviceAutoInject'     => ',IgnoreMakeProject,',  # Looks OK
-
 
215
    'WinCEReboot'               => ',IgnoreMakeProject,',  # Looks OK
-
 
216
    'rsmaint'                   => 'AllowMultiPath',
-
 
217
    'sysbasetypes'              => 'AllowMultiPath',
-
 
218
    'syscd'                     => 'AllowMultiPath',
209
    'DBA-OST'                   => ',protected,',
219
    'sysswis'                   => 'AllowMultiPath',
210
    'orahops-install'           => ',protected,',
220
    'udserialiser'              => 'AllowMultiPath',
-
 
221
    'systemcdtables'            => 'AllowMultiPath',
-
 
222
    'udxml'                     => 'AllowMultiPath',
211
    'orahops-patch'             => ',protected,',
223
    'ERGoracs'                  => 'AllowMultiPath',
-
 
224
    'daf_cd_desfireparams'      => 'AllowMultiPath',
212
    'orahops-ssw-install'       => ',protected,',
225
    'daf_ct_mag_virtual'        => 'AllowMultiPath',
213
    'orahops-ssw-patch'         => ',protected,',
226
    'daf_br_applets'            => 'AllowMultiPath',
-
 
227
    'daf_paper_variables'       => 'AllowMultiPath',
-
 
228
    'daf_transap_api'           => 'AllowMultiPath,ForceProjectBase=/DPG_SWBase/transap',
-
 
229
    'daf_br_applets'            => 'AllowMultiPath,IgnoreProjectBase',  # Not used
-
 
230
    'daf_udlib_api'             => 'AllowMultiPath,ForceProjectBase=/DPG_SWBase/ud',
-
 
231
    'daf_ct_mcr_14443'          => 'LimitProjectBase=/DPG_SWBase/ct',
-
 
232
 
-
 
233
 
-
 
234
    'daftestcd_sales'               => 'AllowMultiPath,ForceProjectBase=/ProjectCD/seattle',
-
 
235
    'daftestcd_vanpool'             => 'AllowMultiPath,ForceProjectBase=/ProjectCD',
-
 
236
    'daf_transap_edf'               => 'AllowMultiPath,IgnoreProjectBase',
-
 
237
    'daf_transap_extensions'        => 'AllowMultiPath',
-
 
238
    'daf_transap_proxyman_rkf_mag'  => 'AllowMultiPath',
214
# End of ukHops migration exclussion
239
    'daf_utils_appupgrade'          => 'AllowMultiPath',
-
 
240
    'dc5000'                        => 'AllowMultiPath,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',
-
 
241
    'uiconv'                        => 'AllowMultiPath',
-
 
242
 
-
 
243
    'daf_ct_api'                    => 'AllowMultiPath',
-
 
244
    
-
 
245
 
-
 
246
    'ocpsupport'                    => 'AllowMultiPath,IgnoreMakeProject', # MakeProject Tested on at least one
-
 
247
    'emv_cs_test_ingenico'          => 'AllowMultiPath,IgnoreMakeProject', # MakeProject Tested on at least one
-
 
248
    'deviceicons'                   => 'AllowMultiPath,LimitProjectBase=/DPG_SWBase/resources:/DPG_SWCode/resources',
-
 
249
    'pcv_final_wce'                 => 'IgnoreMakeProject', # MakeProject Tested on at least one
-
 
250
    'pcv_wce'                       => 'IgnoreMakeProject', # MakeProject Tested on at least one
-
 
251
    'WinCEDeviceUpgrade'            => 'IgnoreMakeProject', # MakeProject Tested on at least one
-
 
252
    'scil'                          => 'LimitProjectBase=/DPG_SWCode/projects/seattle/tvm',
-
 
253
    'daf_br_compiler_support'       => 'ForceProjectBase=/DPG_SWBase/daf_br_compiler/support',
-
 
254
 
-
 
255
    'LinuxDrivers'                  => 'flatTime,LimitProjectBase=/LMOS/linux/drivers'.
-
 
256
                                       ',mergePaths=modules:bcp4600:cobra:eb5600:etx86:tp5600:viper'.
-
 
257
                                       ',Packages=linux_drivers_eb5600:linux_drivers_viper:linux_drivers_cobra:linux_drivers_bcp4600:linux_drivers_etx86:linux_drivers_tp5600',
215
 
258
 
216
    'ftp'                   => 'SetProjectBase,',
-
 
217
    'ddu_app_manager'       => 'SetProjectBase,',
-
 
218
 
259
 
219
    'icl'                   => 'IgnoreProjectBase,',
260
    'icl'                   => 'IgnoreProjectBase,',
220
    'itso'                  => 'IgnoreProjectBase,',
261
    'itso'                  => 'IgnoreProjectBase,',
221
    'daf_osa_mos'           => 'IgnoreProjectBase,',
262
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
222
    'daf_utils_mos'         => 'IgnoreProjectBase,',
263
    'daf_utils_mos'         => 'IgnoreProjectBase,',
223
    'itso_ud'               => 'IgnoreProjectBase,',
264
    'itso_ud'               => 'IgnoreProjectBase,',
224
#    'mos_api'               => 'IgnoreProjectBase,',
265
#    'mos_api'               => 'IgnoreProjectBase,',
225
#    'mos_fonts'             => 'IgnoreProjectBase,',
266
#    'mos_fonts'             => 'IgnoreProjectBase,',
226
#    'sntp'                  => 'IgnoreProjectBase,',
267
#    'sntp'                  => 'IgnoreProjectBase,',
Line 280... Line 321...
280
my $globalError;
321
my $globalError;
281
my @unknownProjects;
322
my @unknownProjects;
282
my %knownProjects;
323
my %knownProjects;
283
my $badSingletonCount = 0;
324
my $badSingletonCount = 0;
284
my @flatOrder;
325
my @flatOrder;
-
 
326
my $flatMode;
285
my $pruneMode;
327
my $pruneMode;
286
my $pruneModeString;
328
my $pruneModeString;
287
my $threadId = 0;
329
my $threadId = 0;
288
my $threadCount;
330
my $threadCount;
289
my %tipVersions;
331
my %tipVersions;
Line 305... Line 347...
305
my $processCount = 0;
347
my $processCount = 0;
306
my $processTotal = 0;
348
my $processTotal = 0;
307
my $recentCount = 0;
349
my $recentCount = 0;
308
my $packageReLabelCount = 0;
350
my $packageReLabelCount = 0;
309
my %saneLabels;
351
my %saneLabels;
-
 
352
my $adjustedPath = 0;
-
 
353
my $forceImportFlush = 0;
-
 
354
my %restoreData;
-
 
355
my @ComboPackageList;
310
 
356
 
311
our $GBE_RM_URL;
357
our $GBE_RM_URL;
312
my $UNIX = $ENV{'GBE_UNIX'};
358
my $UNIX = $ENV{'GBE_UNIX'};
313
 
359
 
314
my $result = GetOptions (
360
my $result = GetOptions (
315
                "help+"         => \$opt_help,          # flag, multiple use allowed
361
                "help+"         => \$opt_help,          # flag, multiple use allowed
316
                "manual:3"      => \$opt_help,
362
                "manual:3"      => \$opt_help,
317
                "verbose:+"     => \$opt_verbose,       # Versose
363
                "verbose:+"     => \$opt_verbose,       # Versose
318
                "repository:s"  => \$opt_repo,          # Name of repository
364
                "repository:s"  => \$opt_repo,          # Name of repository
319
                'subdir:s'      => \$opt_repoSubdir,    # Subdir within repo
-
 
320
                'rbase:s'       => \$opt_repo_base,     # Base of the repo
365
                'rbase:s'       => \$opt_repo_base,     # Base of the repo
321
                "flat!"         => \$opt_flat,          # Flat structure
366
                "flat!"         => \$opt_flat,          # Flat structure
322
                "test!"         => \$opt_test,          # Test operations
367
                "test!"         => \$opt_test,          # Test operations
323
                "reuse!"        => \$opt_reuse,         # Reuse ClearCase views
368
                "reuse!"        => \$opt_reuse,         # Reuse ClearCase views
324
                "age:i"         => \$opt_age,           # Only recent versions
369
                "age:i"         => \$opt_age,           # Only recent versions
Line 330... Line 375...
330
                "name:s"        => \$opt_name,          # Alternate output
375
                "name:s"        => \$opt_name,          # Alternate output
331
                "tip:s"         => \@opt_tip,           # Force tip version(s)
376
                "tip:s"         => \@opt_tip,           # Force tip version(s)
332
                "log!"          => \$opt_log,
377
                "log!"          => \$opt_log,
333
                "delete!"       => \$opt_delete,
378
                "delete!"       => \$opt_delete,
334
                "postimage!"    => \$opt_postimage,
379
                "postimage!"    => \$opt_postimage,
335
                'workdir:s'     => \$opt_workDir,
380
                'workdir:s'         => \$opt_workDir,
-
 
381
                'relabel!'          => \$opt_relabel,
-
 
382
                'svn!'              => \$opt_useSvn,
-
 
383
                'testRmDatabase'    => \$opt_testRmDatabase,
-
 
384
                'fromSvn!'          => \$opt_extractFromSvn,
-
 
385
                'resume'            => \$opt_resume,
-
 
386
                'mergePackages:s'   => \$opt_mergePackages,
-
 
387
 
-
 
388
                # File list support
336
                'filelist:s'    => \$opt_fileList,      # A list of CC tags
389
                'filelist:s'    => \$opt_fileList,      # A list of CC tags
337
                'resume:s'      => \$opt_resume,
390
                'subdir:s'      => \$opt_repoSubdir,    # Subdir within repo
338
                'relabel!'      => \$opt_relabel,
391
                'ccbase:s'      => \$opt_ccbase,        # ClearCase Base for CC Tags
-
 
392
                
339
                );
393
                );
340
 
394
 
341
#
395
#
342
#   Process help and manual options
396
#   Process help and manual options
343
#
397
#
Line 353... Line 407...
353
             'verbose' => $opt_verbose,
407
             'verbose' => $opt_verbose,
354
              );
408
              );
355
 
409
 
356
Error("Workdir does not exist" ) unless ( -d $opt_workDir );
410
Error("Workdir does not exist" ) unless ( -d $opt_workDir );
357
Error("Specify a package as 'name'" ) unless ( defined $ARGV[0] );
411
Error("Specify a package as 'name'" ) unless ( defined $ARGV[0] );
-
 
412
Error("-Filelist requires -ccbase") unless ( !$opt_fileList || ($opt_fileList && $opt_ccbase) );
-
 
413
 
358
EnvImport('GBE_RM_URL');
414
EnvImport('GBE_RM_URL');
359
$cwd = Getcwd();
415
$cwd = Getcwd();
360
 
416
 
361
#
417
#
-
 
418
#   Allow use of the test database
-
 
419
#   Defaut is live data, but some error recovery stuff can be done via
-
 
420
#   the test database.
-
 
421
#
-
 
422
if ( $opt_testRmDatabase )
-
 
423
{
-
 
424
    Warning ("Using Test Database");
-
 
425
    $ENV{GBE_RM_USERNAME} = 'RELEASE_MANAGER';
-
 
426
    $ENV{GBE_RM_PASSWORD} = 'RELEASE_MANAGER';
-
 
427
    $ENV{GBE_RM_LOCATION} = 'jdbc:oracle:thin:@auperaora07.vix.local:1521:RELMANU1';
-
 
428
}
-
 
429
 
-
 
430
#
362
#   Init the pruning mode
431
#   Init the pruning mode
363
#
432
#
364
setPruneMode( $opt_pruneModeString || 'ripple');
433
setPruneMode( $opt_pruneModeString || 'ripple');
365
 
434
 
-
 
435
#
-
 
436
#   Detect Merge Package Request
-
 
437
#   These use pre-configured bits
-
 
438
#
-
 
439
if ( $opt_mergePackages )
-
 
440
{
-
 
441
    if ( $opt_mergePackages eq 'LinuxDrivers' )
-
 
442
    {
-
 
443
        @ARGV = qw (linux_drivers_eb5600
-
 
444
                    linux_drivers_viper
-
 
445
                    linux_drivers_cobra
-
 
446
                    linux_drivers_etx86
-
 
447
                    linux_drivers_tp5600);
-
 
448
#                    linux_drivers_bcp4600
-
 
449
                    
-
 
450
        $opt_name = $opt_mergePackages;
-
 
451
    } else
-
 
452
    {
-
 
453
        Error ("Unknown Merge Package Name: $opt_mergePackages");
-
 
454
    }
-
 
455
}
-
 
456
 
-
 
457
 
366
if ( $opt_fileList )
458
if ( $opt_fileList )
367
{
459
{
368
    GetData_by_filelist( $opt_fileList );
460
    GetData_by_filelist( $opt_fileList );
369
    push @packageNames, $ARGV[0];
461
    push @packageNames, $ARGV[0];
370
    $multiPackages++;
462
    $multiPackages++;
Line 432... Line 524...
432
smartPackageType();                 # Determine special prune mode
524
smartPackageType();                 # Determine special prune mode
433
ReportPathVariance();
525
ReportPathVariance();
434
massageData();
526
massageData();
435
getSvnData();
527
getSvnData();
436
smartPackageType();                 # Have another go
528
smartPackageType();                 # Have another go
-
 
529
restoreData() if ( $opt_resume );
437
 
530
 
438
my @missedTips = keys %tipVersions;
531
my @missedTips = keys %tipVersions;
439
Error ("Specified tip version not found: @missedTips") if ( @missedTips );
532
Error ("Specified tip version not found: @missedTips") if ( @missedTips );
440
 
533
 
441
if ( $opt_flat )
534
if ( $opt_flat )
442
{
535
{
443
#    @flatOrder = sort {$versions{$a}{version} cmp $versions{$b}{version}} keys(%versions);
536
#    @flatOrder = sort {$versions{$a}{version} cmp $versions{$b}{version}} keys(%versions);
444
#    @flatOrder = sort {$versions{$a}{created} cmp $versions{$b}{created}} keys(%versions);
537
#    @flatOrder = sort {$versions{$a}{created} cmp $versions{$b}{created}} keys(%versions);
-
 
538
 
-
 
539
    if ( $flatMode == 1 ) {
-
 
540
        Message ("Flat import. Sorted by TimeStamp");
-
 
541
        @flatOrder = sort {$versions{$a}{TimeStamp} cmp $versions{$b}{TimeStamp}} keys(%versions);
-
 
542
    } else {
445
    @flatOrder = sort {$a <=> $b} keys(%versions);
543
        @flatOrder = sort {$a <=> $b} keys(%versions);
-
 
544
    }
446
    my $tip = $flatOrder[-1];
545
    my $tip = $flatOrder[-1];
447
    $versions{$tip}{Tip} = 1 if $tip;
546
    $versions{$tip}{Tip} = 1 if $tip;
448
}
547
}
449
 
548
 
450
#
549
#
Line 501... Line 600...
501
 
600
 
502
    #
601
    #
503
    #   Going to do serious work
602
    #   Going to do serious work
504
    #   Need to ensure we have more arguments
603
    #   Need to ensure we have more arguments
505
    #
604
    #
-
 
605
    if ( $opt_protected )
-
 
606
    {
-
 
607
        Warning("Protected Package not transferred: $packageNames - $opt_protected",
-
 
608
                "See cc2svn_protected.txt for details");
-
 
609
        exit 0;
-
 
610
    }
-
 
611
 
506
    if ( $noTransfer )
612
    if ( $noTransfer )
507
    {
613
    {
508
        Warning("Protected Package not transferred: $packageNames[0]");
614
        Warning("Protected Package not transferred: $packageNames",
-
 
615
                "Configured within this program");
509
        exit 0;
616
        exit 0;
510
    }
617
    }
511
 
618
 
512
    #
619
    #
513
    #   Perform all the work in a package specific subdirectory
620
    #   Perform all the work in a package specific subdirectory
Line 526... Line 633...
526
    {
633
    {
527
        newProject();
634
        newProject();
528
        foreach my $entry (@flatOrder )
635
        foreach my $entry (@flatOrder )
529
        {
636
        {
530
            newPackageVersion( $entry, $versions{$entry}{suffix} );
637
            newPackageVersion( $entry, $versions{$entry}{suffix} );
-
 
638
            unless ( $globalError )
-
 
639
            {
-
 
640
                getSvnData();
-
 
641
                createImages();
-
 
642
            }
531
        }
643
        }
532
    }
644
    }
533
    else
645
    else
534
    {
646
    {
535
        processBranch(@allStartPoints);
647
        processBranch(@allStartPoints);
Line 662... Line 774...
662
        $opt_flat = 1;
774
        $opt_flat = 1;
663
        setPruneMode('none') unless (defined $opt_pruneModeString);
775
        setPruneMode('none') unless (defined $opt_pruneModeString);
664
    }
776
    }
665
 
777
 
666
 
778
 
667
    if ( $packageNames[0] =~ m'^br_applet_' )
779
    if ( $packageNames =~ m'^br_applet_' )
668
    {
780
    {
669
      $opt_flat = 1 unless defined $opt_flat;
781
      $opt_flat = 1 unless defined $opt_flat;
670
    }
782
    }
671
 
783
 
672
    foreach  ( @excludeFromImport )
784
    if ( exists $specialPackages{$packageNames} )
673
    {
785
    {
674
         $specialPackages{$_} .= 'protected,';
786
        my $data = ',' . $specialPackages{$packageNames} . ',';
675
    }
-
 
676
 
787
 
677
    if ( exists $specialPackages{$packageNames[0]} )
-
 
678
    {
-
 
679
        my $data = $specialPackages{$packageNames[0]};
-
 
680
        if ( index( $data, ',all' ) >= 0) {
788
        if ( index( $data, ',all' ) >= 0) {
681
            setPruneMode('none') unless (defined $opt_pruneModeString);
789
            setPruneMode('none') unless (defined $opt_pruneModeString);
682
        }
790
        }
683
        
791
        
684
        if ( index( $data, 'protected,' ) >= 0) {
792
        if ( index( $data, ',protected,' ) >= 0) {
685
            $noTransfer = 1;
793
            $noTransfer = 1;
686
        }
794
        }
687
 
795
 
688
        if ( index( $data, 'flat,' ) >= 0) {
796
        if ( index( $data, ',flat,' ) >= 0) {
689
            $opt_flat = 1;
797
            $opt_flat = 1;
690
        }
798
        }
691
 
799
 
-
 
800
        if ( index( $data, ',flatTime,' ) >= 0) {
-
 
801
            Message ("Flatten import tree. Sort by Time");
-
 
802
            $opt_flat = 1;
-
 
803
            $flatMode = 1;          # By Time
-
 
804
            $opt_processRipples = 0;
-
 
805
        }
-
 
806
        
-
 
807
 
692
        if ( index( $data, 'SetProjectBase,' ) >= 0) {
808
        if ( index( $data, ',SetProjectBase,' ) >= 0) {
693
            $opt_preserveProjectBase = 1;
809
            $opt_preserveProjectBase = 1;
694
            $opt_ignoreProjectBaseErrors = 1;
810
            $opt_ignoreProjectBaseErrors = 1;
695
            Message ("Preserving ProjectBase");
811
            Message ("Preserving ProjectBase");
696
        }
812
        }
697
 
813
 
-
 
814
        if ( index( $data, ',AllowMultiPath,' ) >= 0) {
-
 
815
            $opt_AllowMuliplePaths = 1;
-
 
816
            Message ("Allowing Multiple Paths");
-
 
817
        }
-
 
818
 
-
 
819
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
-
 
820
            $opt_forceProjectBase = $1;
-
 
821
            $opt_AllowMuliplePaths = 1;
-
 
822
            Message ("Force Project Base: $opt_forceProjectBase");
-
 
823
        }
-
 
824
 
-
 
825
        if ( $data =~ m~,LimitProjectBase=(.*?),~ ) {
-
 
826
            $opt_AllowMuliplePaths = 1;
-
 
827
            @opt_limitProjectBase = split(':', $1);
-
 
828
            Message ("Limit Project Base: @opt_limitProjectBase");
-
 
829
        }
-
 
830
 
-
 
831
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
-
 
832
            @opt_mergePaths = split(':', $1);
-
 
833
            Message ("Merge Paths: @opt_mergePaths");
-
 
834
        }
-
 
835
 
-
 
836
        if ( $data =~ m~,Packages=(.*?),~ ) {
-
 
837
            @ComboPackageList =  split(':', $1);
-
 
838
            Message ("ComboPackage: @ComboPackageList");
-
 
839
        }
-
 
840
 
698
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
841
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
699
            $opt_ignoreProjectBaseErrors = 1;
842
            $opt_ignoreProjectBaseErrors = 1;
700
            Message ("Ignore ProjectBase Errors");
843
            Message ("Ignore ProjectBase Errors");
701
        }
844
        }
702
 
845
 
703
        if ( index( $data, 'IgnoreMakeProject,' ) >= 0) {
846
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
704
            $opt_ignoreMakeProjectErrors = 1;
847
            $opt_ignoreMakeProjectErrors = 1;
705
            Message ("Ignore MakeProject Usage");
848
            Message ("Ignore MakeProject Usage");
706
        }
849
        }
707
        
-
 
708
 
850
 
-
 
851
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
-
 
852
            $opt_ignoreBadPaths = 1;
-
 
853
            Message ("Ignore Bad Paths in makefile Usage");
-
 
854
        }
-
 
855
        
709
        if ( index( $data, 'utf8,' ) >= 0) {
856
        if ( index( $data, ',utf8,' ) >= 0) {
710
            $mustConvertFileNames = 1;
857
            $mustConvertFileNames = 1;
711
            Message ("Convert filenames to UTF8");
858
            Message ("Convert filenames to UTF8");
712
        }
859
        }
713
    }
860
    }
714
 
861
 
Line 1017... Line 1164...
1017
        }
1164
        }
1018
    }
1165
    }
1019
    
1166
    
1020
    #
1167
    #
1021
    #   Prune
1168
    #   Prune
1022
    #   Marks paths to root for all essential packages
1169
    #       Marks paths to root for all essential packages
1023
    #   Marks the last-N from all essential packages
1170
    #       Marks the last-N from all essential packages
1024
    #
1171
    #
1025
    if ( $pruneMode )
1172
    if ( $pruneMode )
1026
    {
1173
    {
1027
        Message ("Prune Tree: $pruneModeString");
1174
        Message ("Prune Tree: $pruneModeString");
1028
        foreach ( @EssentialPackages )
1175
        foreach ( @EssentialPackages )
Line 1048... Line 1195...
1048
        #
1195
        #
1049
        #   Keep recent versions
1196
        #   Keep recent versions
1050
        #       Keep versions created in the last N days
1197
        #       Keep versions created in the last N days
1051
        #       Will keep recent ripples too
1198
        #       Will keep recent ripples too
1052
        #
1199
        #
1053
        if ( $pruneMode == 1 )
1200
        if ( $pruneMode == 1 )                      # 1 == ripple
1054
        {
1201
        {
1055
            foreach my $entry ( keys(%versions) )
1202
            foreach my $entry ( keys(%versions) )
1056
            {
1203
            {
1057
                next unless ( $versions{$entry}{Age} <= $opt_recentAge  );
1204
                next unless ( $versions{$entry}{Age} <= $opt_recentAge  );
1058
                $versions{$entry}{keepRecent} = 1;
1205
                $versions{$entry}{keepRecent} = 1;
1059
                $recentCount++;
1206
                $recentCount++;
1060
#print "--- Recent version $versions{$entry}{vname}, $versions{$entry}{Age} <= $opt_recentAge\n";
1207
#print "--- Recent version $versions{$entry}{vname}, $versions{$entry}{Age} <= $opt_recentAge\n";
1061
            }
1208
            }
1062
 
1209
 
1063
#            #
1210
            #
1064
#            #   Keep the tip of each branch
1211
            #   Keep the tip of each branch
1065
#            #
1212
            #
1066
#            foreach my $entry ( @endPoints )
1213
            foreach my $entry ( @endPoints )
1067
#            {
1214
            {
-
 
1215
#print "--- Tip version $versions{$entry}{vname}\n";
-
 
1216
                my $count = 0;
-
 
1217
                while ( $entry && $count < 2)
-
 
1218
                {
1068
#                next if exists $versions{$entry}{keepRecent};
1219
                    last if ( $versions{$entry}{Essential} );
1069
#                $versions{$entry}{keepRecent} = 1;
1220
                    last if ( $versions{$entry}{keepRecent} );
-
 
1221
 
-
 
1222
                    next if ( $versions{$entry}{locked} eq 'N'  );
-
 
1223
                    next if ( $versions{$entry}{DeadWood} );
-
 
1224
 
1070
##print "--- Tip version $versions{$entry}{vname}\n";
1225
#print "--- Keeping Tip version $versions{$entry}{vname}\n";
-
 
1226
                    $versions{$entry}{keepRecent} = 1;
-
 
1227
                    $count++;
-
 
1228
 
-
 
1229
                } continue {
-
 
1230
                    $entry = $versions{$entry}{last};
-
 
1231
                }
1071
#            }
1232
            }
1072
        }
1233
        }
1073
        
1234
        
1074
        #
1235
        #
1075
        #   Keep versions that are common parents to Essential Versions
1236
        #   Keep versions that are common parents to Essential Versions
1076
        #       Mark paths through the tree to essential versions
1237
        #       Mark paths through the tree to essential versions
Line 1594... Line 1755...
1594
    if ( -f $cwd . '/stopfile' )
1755
    if ( -f $cwd . '/stopfile' )
1595
    {
1756
    {
1596
        $globalError = 1;
1757
        $globalError = 1;
1597
        Message ("Stop file located");
1758
        Message ("Stop file located");
1598
    }
1759
    }
1599
    if ( $opt_resume )
-
 
1600
    {
-
 
1601
        return
-
 
1602
        unless ( $opt_resume eq $versions{$entry}{vcsTag} );
-
 
1603
        $opt_resume = '';
-
 
1604
    }
-
 
1605
 
1760
 
1606
    #
1761
    #
1607
    #   If we have a global error,then we pretend to process, but we
1762
    #   If we have a global error,then we pretend to process, but we
1608
    #   report errors for the logging system
1763
    #   report errors for the logging system
1609
    #
1764
    #
Line 1657... Line 1812...
1657
    logToFile( $cwd . '/importsummary.txt', ";$line;");
1812
    logToFile( $cwd . '/importsummary.txt', ";$line;");
1658
 
1813
 
1659
    #
1814
    #
1660
    #   Sava data
1815
    #   Sava data
1661
    #
1816
    #
-
 
1817
    if ( $rv != 6 )
-
 
1818
    {
1662
    $data{errFlags} = $flags;
1819
        $data{errFlags} = $flags;
1663
    $data{duration} = $duration;
1820
        $data{duration} = $duration;
-
 
1821
    }
1664
    $versions{$entry}{rmRef} = $data{rmRef};
1822
    $versions{$entry}{rmRef} = $data{rmRef};
1665
    delete $data{rmRef};
1823
    delete $data{rmRef};
1666
    delete $data{tag};
1824
    delete $data{tag};
1667
    ##delete $data{ViewRoot};
1825
    ##delete $data{ViewRoot};
1668
    $versions{$entry}{data} = \%data;
1826
    $versions{$entry}{data} = \%data;
Line 1671... Line 1829...
1671
    #   Delete the created view
1829
    #   Delete the created view
1672
    #   Its just a directory, so delete it
1830
    #   Its just a directory, so delete it
1673
    #
1831
    #
1674
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1832
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1675
    {
1833
    {
1676
        if ( !$opt_reuse || ($rv && ($rv != 4 && $rv != 12 )) )
1834
        if ( !$opt_reuse || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
1677
        {
1835
        {
1678
            Message ("Delete View: $data{ViewRoot}");
1836
            Message ("Delete View: $data{ViewRoot}");
1679
            RmDirTree ($data{ViewRoot} );
1837
            RmDirTree ($data{ViewRoot} );
1680
        }
1838
        }
1681
        else
1839
        else
Line 1688... Line 1846...
1688
    {
1846
    {
1689
        Message ("No view to delete");
1847
        Message ("No view to delete");
1690
    }
1848
    }
1691
 
1849
 
1692
 
1850
 
1693
    #
-
 
1694
    #   If this version has any 'ripples' then process them while we have the
-
 
1695
    #   main view. Note the ripple list may contain entries that do not
-
 
1696
    #   exist - they will have been pruned.
1851
    if($opt_processRipples)
1697
    #
-
 
1698
if(1) {
-
 
1699
    foreach my $rentry ( @{$versions{$entry}{rippleList}} )
-
 
1700
    {
1852
    {
-
 
1853
        #
-
 
1854
        #   If this version has any 'ripples' then process them while we have the
-
 
1855
        #   main view. Note the ripple list may contain entries that do not
1701
        next unless( exists $versions{$rentry} );
1856
        #   exist - they will have been pruned.
1702
 
1857
        #
1703
        if ($versions{$rentry}{Processed})
1858
        foreach my $rentry ( @{$versions{$entry}{rippleList}} )
1704
        {
1859
        {
-
 
1860
            next unless( exists $versions{$rentry} );
-
 
1861
 
-
 
1862
            if ($versions{$rentry}{Processed})
-
 
1863
            {
1705
            Warning ("Ripple Processed before main entry");
1864
                Warning ("Ripple Processed before main entry");
1706
            $versions{$rentry}{rippleProcessed} = 1;
1865
                $versions{$rentry}{rippleProcessed} = 1;
1707
        }
1866
            }
1708
 
1867
 
1709
        Message ("Proccessing associated Ripple: " . GetVname($rentry));
1868
            Message ("Proccessing associated Ripple: " . GetVname($rentry));
1710
        newPackageVersion($rentry);
1869
            newPackageVersion($rentry);
-
 
1870
        }
1711
    }
1871
    }
1712
}
1872
}
1713
}
-
 
1714
 
1873
 
1715
#-------------------------------------------------------------------------------
1874
#-------------------------------------------------------------------------------
1716
# Function        : newPackageVersionBody
1875
# Function        : newPackageVersionBody
1717
#
1876
#
1718
# Description     : Perform the bulk of the work in creating a new PackageVersion
1877
# Description     : Perform the bulk of the work in creating a new PackageVersion
Line 1723... Line 1882...
1723
#                   $entry              - Package entry to process
1882
#                   $entry              - Package entry to process
1724
#
1883
#
1725
# Returns         : Error Code
1884
# Returns         : Error Code
1726
#                         0 - All is well
1885
#                         0 - All is well
1727
#                       <10 - Recoverable error
1886
#                       <10 - Recoverable error
-
 
1887
#                               1 - Bad VCS Tag
-
 
1888
#                               2 - No Files in the extracted view
-
 
1889
#                                   Label not found
-
 
1890
#                                   Failed to extract files from CC
-
 
1891
#                                   No Files in the extracted view after labeling dirs
-
 
1892
#                               3 - Deadwood
-
 
1893
#                               4 - Bad usage of ProjectBase detected
-
 
1894
#                                   Use of MakeProject detected
-
 
1895
#                               5  - Subversion Import disabled
-
 
1896
#                               6  - Restored via resume
1728
#                       >10 - Fatal error
1897
#                       >10 - Fatal error
1729
#
1898
#
1730
sub newPackageVersionBody
1899
sub newPackageVersionBody
1731
{
1900
{
1732
    my ($data, $entry) = @_;
1901
    my ($data, $entry) = @_;
1733
    my $rv;
1902
    my $rv;
-
 
1903
    my $vcs_type;
1734
    my $cc_label;
1904
    my $cc_label;
1735
    my $cc_path;
1905
    my $cc_path;
1736
    my $cc_path_original;
1906
    my $cc_path_original;
1737
 
1907
 
1738
    #
1908
    #
Line 1749... Line 1919...
1749
    SystemConfig ('ExitOnError' => 0);
1919
    SystemConfig ('ExitOnError' => 0);
1750
 
1920
 
1751
    push @processOrder, $entry;
1921
    push @processOrder, $entry;
1752
    return 0 if ( $opt_test );
1922
    return 0 if ( $opt_test );
1753
 
1923
 
-
 
1924
    #
-
 
1925
    #   Calculate the label for the target package
-
 
1926
    #   Use format <packageName>_<PackageVersion>
-
 
1927
    #   Need to handle WIPs too.
-
 
1928
    #
-
 
1929
    my $import_label = saneLabel($entry);
-
 
1930
 
-
 
1931
    #
-
 
1932
    #   If resuming - then test existence
-
 
1933
    #
-
 
1934
    if ( $opt_resume )
-
 
1935
    {
-
 
1936
        if ( exists $restoreData{$entry}  )
-
 
1937
        {
-
 
1938
 
-
 
1939
            #
-
 
1940
            #   May be able to test existence by looking at $versions{$entry}{svnVersion}
-
 
1941
            #   The hard work may have been done
-
 
1942
            #
-
 
1943
            my $isInSvn = 0;
-
 
1944
            if ( exists $versions{$entry}{svnVersion} && $versions{$entry}{svnVersion}  )
-
 
1945
            {
-
 
1946
                $isInSvn = 1;
-
 
1947
            }
-
 
1948
            Message("SvnVersion check: $isInSvn");
-
 
1949
 
-
 
1950
            $rv = testSvnLabel( "$svnRepo/$packageNames", $import_label );
-
 
1951
            unless ( $rv )
-
 
1952
            {
-
 
1953
                Message ("Skip import - resume detected presense");
-
 
1954
                $firstVersionCreated = $entry unless ( $firstVersionCreated );
-
 
1955
                $versions{$entry}{TagCreated} = 2;
-
 
1956
                foreach  ( keys %{$restoreData{$entry}} )
-
 
1957
                {
-
 
1958
                    $data->{$_} = $restoreData{$entry}{$_};
-
 
1959
                }
-
 
1960
                $forceImportFlush = 1;
-
 
1961
DebugDumpData('Data', $data );
-
 
1962
                return 6;
-
 
1963
            }
-
 
1964
        }
-
 
1965
        else
-
 
1966
        {
-
 
1967
            Warning ("Resume data missing");
-
 
1968
        }
-
 
1969
    }
-
 
1970
    
1754
#   Keep DeadWood. May be a WIP
1971
#   Keep DeadWood. May be a WIP
1755
#    if ( exists $versions{$entry}{DeadWood} && $versions{$entry}{DeadWood} )
1972
#    if ( exists $versions{$entry}{DeadWood} && $versions{$entry}{DeadWood} )
1756
#    {
1973
#    {
1757
#        $data->{errStr} = 'Package is DeadWood';
1974
#        $data->{errStr} = 'Package is DeadWood';
1758
#        return 3;
1975
#        return 3;
Line 1766... Line 1983...
1766
    {
1983
    {
1767
        Warning ("Error: Bad VcsTag for: " . GetVname($entry),
1984
        Warning ("Error: Bad VcsTag for: " . GetVname($entry),
1768
                 "Tag: $data->{tag}" );
1985
                 "Tag: $data->{tag}" );
1769
        $data->{errStr} = 'VCS Tag Marked as Bad';
1986
        $data->{errStr} = 'VCS Tag Marked as Bad';
1770
        return 1;
1987
        return 1;
-
 
1988
 
1771
    }
1989
    }
1772
 
1990
 
1773
 
1991
 
1774
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
1992
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
-
 
1993
    $vcs_type = $1;
1775
    $cc_label = $4;
1994
    $cc_label = $4;
1776
    $cc_path = $2;
1995
    $cc_path = $2;
1777
    $cc_path = '/' . $cc_path;
1996
    $cc_path = '/' . $cc_path;
1778
    $cc_path =~ tr~\\/~/~s;
1997
    $cc_path =~ tr~\\/~/~s;
1779
    $cc_path_original = $cc_path;
1998
    $cc_path_original = $cc_path;
1780
 
1999
 
1781
    #
2000
    #
1782
    #   Correct well known path mistakes
2001
    #   Correct well known path mistakes in CC paths
1783
    #
2002
    #
1784
    $cc_path =~ s~/build.pl$~~i;
-
 
1785
    $cc_path =~ s~/src$~~i;
-
 
1786
    $cc_path =~ s~/cpp$~~i;
-
 
1787
    $cc_path =~ s~/MASS_Dev/Infra/~/MASS_Dev_Infra/~i;
-
 
1788
    $cc_path =~ s~/MASS_Dev/Tools/~/MASS_Dev_Tools/~i;
-
 
1789
    $cc_path =~ s~/MASS_Dev/Bus/~/MASS_Dev_Bus/~i;
-
 
1790
    $cc_path =~ s~/MASS_Dev_Bus/Cbp/~/MASS_Dev_Bus/CBP/~i;
-
 
1791
    $cc_path =~ s~/MREF_Package/ergpostmongui$~/MREF_Package/ergpostmongui~i;
-
 
1792
    $cc_path =~ s~/MREF_../MREF_Package/~/MREF_Package/~i;
-
 
1793
    $cc_path =~ s~/MREF_Package/mass_ergocdp/~/MREF_Package/ergocdp/~i;
-
 
1794
    $cc_path =~ s~/MASS_Dev_Bus/CBP/systemCD.ejb~/MASS_Dev_Bus/CBP/systemCD/ejb~i;
-
 
1795
    $cc_path =~ s~/MASS_Dev_Bus/Financial/cpp/paymentmanager~/MASS_Dev_Bus/Financial/cpp/paymentmanager~i;
-
 
1796
    $cc_path =~ s~/MASS_Dev_Bus/WebServices~/MASS_Dev_Bus/WebServices~i;
-
 
1797
    $cc_path =~ s~/MASS_Dev_Bus/CBP/nullAdapter~//MASS_Dev_Bus/CBP/nullAdaptor~i;
-
 
1798
 
-
 
1799
    $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
1800
    $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
-
 
1801
    $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
-
 
1802
    $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
-
 
1803
    $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
-
 
1804
 
-
 
1805
    if (   $versions{$entry}{name} =~ m/^ERGagency$/i
-
 
1806
        || $versions{$entry}{name} =~ m/^ERGavm$/i
-
 
1807
        || $versions{$entry}{name} =~ m/^ERGboi$/i
-
 
1808
        || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
-
 
1809
        || $versions{$entry}{name} =~ m/^ERGcardholder$/i
-
 
1810
        || $versions{$entry}{name} =~ m/^ERGcdaimports$/i
-
 
1811
        || $versions{$entry}{name} =~ m/^ERGcda$/i
-
 
1812
        || $versions{$entry}{name} =~ m/^ERGcscedit$/i
-
 
1813
        || $versions{$entry}{name} =~ m/^ERGcs$/i
-
 
1814
        || $versions{$entry}{name} =~ m/^ERGofs$/i
-
 
1815
        || $versions{$entry}{name} =~ m/^ERGols$/i
-
 
1816
        || $versions{$entry}{name} =~ m/^ERGtpf$/i
-
 
1817
        || $versions{$entry}{name} =~ m/^ERGorasys$/i
-
 
1818
        || $versions{$entry}{name} =~ m/^ERGoracs$/i
-
 
1819
        || $versions{$entry}{name} =~ m/^ERGpxyif$/i
-
 
1820
        || $versions{$entry}{name} =~ m/^ERGtp5upg$/i
-
 
1821
        || $versions{$entry}{name} =~ m/^ERGinstitutional$/i
-
 
1822
        || $versions{$entry}{name} =~ m/^ERGinfra$/i
-
 
1823
        || $versions{$entry}{name} =~ m/^ERGcrrpts$/i
-
 
1824
        || $versions{$entry}{name} =~ m/^ERGmiddle$/i
-
 
1825
        || $versions{$entry}{name} =~ m/^ERGmiddleapi$/i
-
 
1826
        || $versions{$entry}{name} =~ m/^ERGwebapi$/i
-
 
1827
        || $versions{$entry}{name} =~ m/^ERGwebtestui$/i
-
 
1828
        || $versions{$entry}{name} =~ m/^ERGwebesbui$/i
-
 
1829
        || $versions{$entry}{name} =~ m/^ERGwspiv$/i
-
 
1830
        || $versions{$entry}{name} =~ m/^ERGwscst$/i
-
 
1831
        || $versions{$entry}{name} =~ m/^sposMUG$/i
-
 
1832
        || $versions{$entry}{name} =~ m/^ERGfinman$/i
-
 
1833
        || $versions{$entry}{name} =~ m/^ERGkm$/i
-
 
1834
        || $versions{$entry}{name} =~ m/^ERGxml$/i
-
 
1835
        || $versions{$entry}{name} =~ m/^ERGoradacw$/i
-
 
1836
        || $versions{$entry}{name} =~ m/^ERGtru$/i
-
 
1837
        )
-
 
1838
    {
-
 
1839
        $cc_path = '/MREF_Package';
2003
    if ( $vcs_type eq 'CC' )
1840
    }
-
 
1841
 
-
 
1842
    if (   $versions{$entry}{name} =~ m/^tp5000_MUG$/i )
-
 
1843
    {
2004
    {
-
 
2005
        $cc_path =~ s~/build.pl$~~i;
-
 
2006
        $cc_path =~ s~/src$~~i;
-
 
2007
        $cc_path =~ s~/cpp$~~i;
-
 
2008
        $cc_path =~ s~/MASS_Dev/Infra/~/MASS_Dev_Infra/~i;
-
 
2009
        $cc_path =~ s~/MASS_Dev/Tools/~/MASS_Dev_Tools/~i;
-
 
2010
        $cc_path =~ s~/MASS_Dev/Bus/~/MASS_Dev_Bus/~i;
-
 
2011
        $cc_path =~ s~/MASS_Dev_Bus/Cbp/~/MASS_Dev_Bus/CBP/~i;
-
 
2012
        $cc_path =~ s~/MREF_Package/ergpostmongui$~/MREF_Package/ergpostmongui~i;
-
 
2013
        $cc_path =~ s~/MREF_../MREF_Package/~/MREF_Package/~i;
-
 
2014
        $cc_path =~ s~/MREF_Package/mass_ergocdp/~/MREF_Package/ergocdp/~i;
-
 
2015
        $cc_path =~ s~/MASS_Dev_Bus/CBP/systemCD.ejb~/MASS_Dev_Bus/CBP/systemCD/ejb~i;
-
 
2016
        $cc_path =~ s~/MASS_Dev_Bus/Financial/cpp/paymentmanager~/MASS_Dev_Bus/Financial/cpp/paymentmanager~i;
-
 
2017
        $cc_path =~ s~/MASS_Dev_Bus/WebServices~/MASS_Dev_Bus/WebServices~i;
-
 
2018
        $cc_path =~ s~/MASS_Dev_Bus/CBP/nullAdapter~//MASS_Dev_Bus/CBP/nullAdaptor~i;
-
 
2019
 
-
 
2020
        $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
2021
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
-
 
2022
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
-
 
2023
        $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
-
 
2024
        $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
-
 
2025
 
-
 
2026
        if (   $versions{$entry}{name} =~ m/^ERGagency$/i
-
 
2027
            || $versions{$entry}{name} =~ m/^ERGavm$/i
-
 
2028
            || $versions{$entry}{name} =~ m/^ERGboi$/i
-
 
2029
            || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
-
 
2030
            || $versions{$entry}{name} =~ m/^ERGcardholder$/i
-
 
2031
            || $versions{$entry}{name} =~ m/^ERGcdaimports$/i
-
 
2032
            || $versions{$entry}{name} =~ m/^ERGcda$/i
-
 
2033
            || $versions{$entry}{name} =~ m/^ERGcscedit$/i
-
 
2034
            || $versions{$entry}{name} =~ m/^ERGcs$/i
-
 
2035
            || $versions{$entry}{name} =~ m/^ERGofs$/i
-
 
2036
            || $versions{$entry}{name} =~ m/^ERGols$/i
-
 
2037
            || $versions{$entry}{name} =~ m/^ERGtpf$/i
-
 
2038
            || $versions{$entry}{name} =~ m/^ERGorasys$/i
-
 
2039
            || $versions{$entry}{name} =~ m/^ERGoracs$/i
-
 
2040
            || $versions{$entry}{name} =~ m/^ERGpxyif$/i
-
 
2041
            || $versions{$entry}{name} =~ m/^ERGtp5upg$/i
-
 
2042
            || $versions{$entry}{name} =~ m/^ERGinstitutional$/i
-
 
2043
            || $versions{$entry}{name} =~ m/^ERGinfra$/i
-
 
2044
            || $versions{$entry}{name} =~ m/^ERGcrrpts$/i
-
 
2045
            || $versions{$entry}{name} =~ m/^ERGmiddle$/i
-
 
2046
            || $versions{$entry}{name} =~ m/^ERGmiddleapi$/i
-
 
2047
            || $versions{$entry}{name} =~ m/^ERGwebapi$/i
-
 
2048
            || $versions{$entry}{name} =~ m/^ERGwebtestui$/i
-
 
2049
            || $versions{$entry}{name} =~ m/^ERGwebesbui$/i
-
 
2050
            || $versions{$entry}{name} =~ m/^ERGwspiv$/i
-
 
2051
            || $versions{$entry}{name} =~ m/^ERGwscst$/i
-
 
2052
            || $versions{$entry}{name} =~ m/^sposMUG$/i
-
 
2053
            || $versions{$entry}{name} =~ m/^ERGfinman$/i
1844
        if ( $versions{$entry}{version} =~ m~vtk$~ )
2054
            || $versions{$entry}{name} =~ m/^ERGkm$/i
-
 
2055
            || $versions{$entry}{name} =~ m/^ERGxml$/i
-
 
2056
            || $versions{$entry}{name} =~ m/^ERGoradacw$/i
-
 
2057
            || $versions{$entry}{name} =~ m/^ERGtru$/i
-
 
2058
            )
1845
        {
2059
        {
1846
            $cc_path = '/MREF_Package';
2060
            $cc_path = '/MREF_Package';
1847
        }
2061
        }
1848
    }
-
 
1849
 
2062
 
-
 
2063
        if (   $versions{$entry}{name} =~ m/^tp5000_MUG$/i )
-
 
2064
        {
-
 
2065
            if ( $versions{$entry}{version} =~ m~vtk$~ )
-
 
2066
            {
-
 
2067
                $cc_path = '/MREF_Package';
-
 
2068
            }
-
 
2069
        }
-
 
2070
 
-
 
2071
        $cc_path = $opt_forceProjectBase
-
 
2072
            if ( $opt_forceProjectBase );
-
 
2073
 
-
 
2074
        foreach ( @opt_limitProjectBase )
-
 
2075
        {
-
 
2076
            if ( $cc_path =~ m~$_~ )
-
 
2077
            {
-
 
2078
                $cc_path = $_;
-
 
2079
                last;
-
 
2080
            }
-
 
2081
        }
-
 
2082
        
1850
    if ( $cc_path_original ne $cc_path )
2083
        if ( $cc_path_original ne $cc_path )
1851
    {
2084
        {
1852
            Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
2085
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
-
 
2086
        }
1853
    }
2087
    }
1854
    
2088
    
1855
#print "--- Path: $cc_path, Label: $cc_label\n";
2089
#print "--- Path: $cc_path, Label: $cc_label\n";
1856
 
2090
 
-
 
2091
    if ( $vcs_type eq 'SVN' )
1857
    #
2092
    {
-
 
2093
        $rv = extractFilesFromSubversion( $data, $entry );
-
 
2094
        return $rv if ( $rv );
-
 
2095
    }
-
 
2096
    else
-
 
2097
    {
-
 
2098
        #
1858
    #   Create CC view
2099
        #   Create CC view
1859
    #   Import into Subversion View
2100
        #   Import into Subversion View
1860
    #
2101
        #
1861
    $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label );
2102
        $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label );
1862
    return $rv if ( $rv );
2103
        return $rv if ( $rv );
-
 
2104
    }
1863
 
2105
 
1864
    #
2106
    #
1865
    #   Developers have been slack
2107
    #   Developers have been slack
1866
    #       Sometime the mark the source path as 'GMTPE2005'
2108
    #       Sometime the mark the source path as 'GMTPE2005'
1867
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
2109
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
1868
    #
2110
    #
1869
    #   Attempt to suck up empty directories below the specified
2111
    #   Attempt to suck up empty directories below the specified
1870
    #   source path
2112
    #   source path
1871
    #
2113
    #
1872
    unless ( $opt_preserveProjectBase )
2114
    unless ( $opt_preserveProjectBase || $opt_forceProjectBase || @opt_limitProjectBase)
1873
    {
2115
    {
1874
        #
2116
        #
1875
        #   Look in ViewPath
2117
        #   Look in ViewPath
1876
        #   If it contains only ONE directory then we can suck it up
2118
        #   If it contains only ONE directory then we can suck it up
1877
        #
2119
        #
Line 1880... Line 2122...
1880
        unless ( $data->{ViewPath} eq $testDir  )
2122
        unless ( $data->{ViewPath} eq $testDir  )
1881
        {
2123
        {
1882
            Message ("Adjust Base Dir: $testDir");
2124
            Message ("Adjust Base Dir: $testDir");
1883
            $data->{adjustedPath} = $data->{ViewPath};
2125
            $data->{adjustedPath} = $data->{ViewPath};
1884
            $data->{ViewPath} = $testDir;
2126
            $data->{ViewPath} = $testDir;
-
 
2127
            $adjustedPath++;
1885
        }
2128
        }
1886
    }
2129
    }
-
 
2130
    Message ("BaseDir: $data->{ViewPath}");
-
 
2131
 
-
 
2132
    #
-
 
2133
    #   Check for bad source paths
1887
    
2134
    #
-
 
2135
    if (detectBadMakePaths($data) )
-
 
2136
    {
-
 
2137
        unless ( $opt_ignoreBadPaths )
-
 
2138
        {
-
 
2139
            $data->{BadPath}++;
-
 
2140
            $data->{errStr} = 'Bad Paths in Makefile';
-
 
2141
            return 4;           # Lets see what the others look like too
-
 
2142
#            return 14;
-
 
2143
        }
-
 
2144
    }
-
 
2145
 
1888
    #
2146
    #
1889
    #   Some really ugly packages make use of a Jats feature called 'SetProjectBase'
2147
    #   Some really ugly packages make use of a Jats feature called 'SetProjectBase'
1890
    #   Detect such packages as we will need to handle them differently
2148
    #   Detect such packages as we will need to handle them differently
1891
    #   Can't really handle it on the fly
2149
    #   Can't really handle it on the fly
1892
    #   All we can do is detect it and report it - at the moment
2150
    #   All we can do is detect it and report it - at the moment
1893
    #
2151
    #
1894
    if (detectProjectBaseUsage($data, $cc_path) )
2152
    if (detectProjectBaseUsage($data) )
1895
    {
2153
    {
1896
        unless ( $opt_ignoreProjectBaseErrors )
2154
        unless ( $opt_ignoreProjectBaseErrors )
1897
        {
2155
        {
1898
            $data->{BadProjectBase}++;
2156
            $data->{BadProjectBase}++;
1899
            $data->{errStr} = 'Bad usage of ProjectBase detected';
2157
            $data->{errStr} = 'Bad usage of ProjectBase detected';
-
 
2158
            Warning ("ProjectBase Error");
1900
            return 4;           # Lets see what the others look like too
2159
            return 4;           # Lets see what the others look like too
1901
#            return 14;
2160
#            return 14;
1902
        }
2161
        }
1903
    }
2162
    }
1904
 
2163
 
Line 1911... Line 2170...
1911
    #       Vob Name is not a part of the migration
2170
    #       Vob Name is not a part of the migration
1912
    #       If we 'SuckUp' empty directories then this may break
2171
    #       If we 'SuckUp' empty directories then this may break
1913
    #       the pathing.
2172
    #       the pathing.
1914
    #   All we can do is detect it and report it - at the moment
2173
    #   All we can do is detect it and report it - at the moment
1915
    #
2174
    #
1916
    if (detectMakeProjectUsage($data, $cc_path) )
2175
    if (detectMakeProjectUsage($data) )
1917
    {
2176
    {
1918
        unless ( $opt_ignoreMakeProjectErrors )
2177
        unless ( $opt_ignoreMakeProjectErrors )
1919
        {
2178
        {
1920
            $data->{BadMakeProject}++;
2179
            $data->{BadMakeProject}++;
1921
            $data->{errStr} = 'Use of MakeProject detected';
2180
            $data->{errStr} = 'Use of MakeProject detected';
Line 1957... Line 2216...
1957
    #
2216
    #
1958
    #   Have a CC view
2217
    #   Have a CC view
1959
    #   Now we can create the SVN package and branching point before we
2218
    #   Now we can create the SVN package and branching point before we
1960
    #   import the CC data into SVN
2219
    #   import the CC data into SVN
1961
    #
2220
    #
-
 
2221
    if ( !$opt_useSvn )
-
 
2222
    {
-
 
2223
            $data->{errStr} = 'Subversion Import disabled' unless $data->{errStr};
-
 
2224
            return 5;
-
 
2225
    }
-
 
2226
 
1962
    my @args;
2227
    my @args;
1963
 
2228
 
1964
    #
2229
    #
1965
    #   Calculate args for functions
2230
    #   Calculate args for functions
1966
    #
2231
    #
Line 1992... Line 2257...
1992
        $data->{errStr} = 'Failed to create Package';
2257
        $data->{errStr} = 'Failed to create Package';
1993
        return 10;
2258
        return 10;
1994
    }
2259
    }
1995
 
2260
 
1996
    #
2261
    #
1997
    #   Calculate the label for the target package
-
 
1998
    #   Use format <packageName>_<PackageVersion>
-
 
1999
    #   Need to handle WIPs too.
-
 
2000
    #
-
 
2001
    my $import_label = saneLabel($entry);
-
 
2002
 
-
 
2003
    #
-
 
2004
    #   May need to create the branchpoint
2262
    #   May need to create the branchpoint
2005
    #   The process is delayed until its needed so avoid creating unneeded
2263
    #   The process is delayed until its needed so avoid creating unneeded
2006
    #   branch points
2264
    #   branch points
2007
    #
2265
    #
2008
    if ( $createBranch )
2266
    if ( $createBranch )
Line 2014... Line 2272...
2014
        {
2272
        {
2015
            $data->{errStr} = 'Failed to create Branch Point';
2273
            $data->{errStr} = 'Failed to create Branch Point';
2016
            return 11;
2274
            return 11;
2017
        }
2275
        }
2018
    }
2276
    }
2019
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
-
 
2020
 
2277
 
-
 
2278
    #
-
 
2279
    #   If we are in resume mode then we MUST kill the import directory
-
 
2280
    #   if we have skipped anything
-
 
2281
    #
-
 
2282
    if ( $forceImportFlush )
-
 
2283
    {
-
 
2284
        $forceImportFlush = 0;
-
 
2285
        RmDirTree ('SvnImportDir');
-
 
2286
    }
-
 
2287
 
-
 
2288
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
2021
    my $datafile = "importdata.$import_label.properties";
2289
    my $datafile = "importdata.$import_label.properties";
-
 
2290
    push (@args, "-mergePaths", join(',', @opt_mergePaths) ) if ( @opt_mergePaths );
-
 
2291
 
2022
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2292
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2023
                    "-package=$svnRepo/$packageNames",
2293
                    "-package=$svnRepo/$packageNames",
2024
                    "-dir=$data->{ViewPath}",
2294
                    "-dir=$data->{ViewPath}",
2025
                    "-label=$import_label",
2295
                    "-label=$import_label",
2026
                    "-datafile=$datafile",
2296
                    "-datafile=$datafile",
Line 2041... Line 2311...
2041
    #   Retain entries in a global file
2311
    #   Retain entries in a global file
2042
    #
2312
    #
2043
    if ( -f $datafile  )
2313
    if ( -f $datafile  )
2044
    {
2314
    {
2045
        my $rmData = JatsProperties::New($datafile);
2315
        my $rmData = JatsProperties::New($datafile);
-
 
2316
        if ( $rmData->getProperty('subversion.tag') )
-
 
2317
        {
2046
        $data->{rmRef} = 'SVN::' . $rmData->getProperty('subversion.tag');
2318
            $data->{rmRef} = 'SVN::' . $rmData->getProperty('subversion.tag');
-
 
2319
        }
-
 
2320
        else
-
 
2321
        {
-
 
2322
            Warning ("Property files has no subversion.tag");
-
 
2323
        }
-
 
2324
        $data->{fileCount}    = $rmData->getProperty('files.base', 0);
-
 
2325
        $data->{filesRemoved} = $rmData->getProperty('files.removed',0);
-
 
2326
        $data->{filesAdded}   = $rmData->getProperty('files.added',0);
2047
    }
2327
    }
2048
 
2328
 
2049
    unless ( $data->{rmRef}  )
2329
    unless ( $data->{rmRef}  )
2050
    {
2330
    {
2051
        $data->{errStr} = 'Failed to determine Rm Reference';
2331
        $data->{errStr} = 'Failed to determine Rm Reference';
Line 2182... Line 2462...
2182
    push (@opts, '-author', $author) if ( $author );
2462
    push (@opts, '-author', $author) if ( $author );
2183
    #
2463
    #
2184
    #   Only do once
2464
    #   Only do once
2185
    #
2465
    #
2186
    return unless ( $createPackageDone );
2466
    return unless ( $createPackageDone );
-
 
2467
    return if ( $opt_resume );
2187
    $createPackageDone = 0;
2468
    $createPackageDone = 0;
2188
 
2469
 
2189
    #
2470
    #
2190
    #   Real import
2471
    #   Real import
2191
    #       Do not Delete package if it exists
2472
    #       Do not Delete package if it exists
Line 2347... Line 2628...
2347
    #
2628
    #
2348
    #   Perform the branch
2629
    #   Perform the branch
2349
    #
2630
    #
2350
    if ( defined $src_label )
2631
    if ( defined $src_label )
2351
    {
2632
    {
-
 
2633
        if ( $opt_resume )
-
 
2634
        {
-
 
2635
            my $rv = JatsToolPrint ( 'jats_svnlabel',
-
 
2636
                        '-check',
-
 
2637
                        '-packagebase', "$svnRepo/$packageNames",
-
 
2638
                        '-branch',
-
 
2639
                        $tgt_label );
-
 
2640
            return unless ( $rv );
-
 
2641
        }
-
 
2642
 
2352
        #
2643
        #
2353
        #   The 'clone' operation will backtrack the branch point
2644
        #   The 'clone' operation will backtrack the branch point
2354
        #   to the source of the label. This will make the output version
2645
        #   to the source of the label. This will make the output version
2355
        #   tree much prettier
2646
        #   tree much prettier
2356
        #
2647
        #
Line 2381... Line 2672...
2381
#
2672
#
2382
sub endPackage
2673
sub endPackage
2383
{
2674
{
2384
    Message ("-- Import Summary ------------------------------------------------" );
2675
    Message ("-- Import Summary ------------------------------------------------" );
2385
    RmDirTree ('SvnImportDir');
2676
    RmDirTree ('SvnImportDir');
-
 
2677
    my $processedCount = 0;
-
 
2678
    my $inernalErrorCount = 0;
-
 
2679
    my $notProcessedCount = 0;
-
 
2680
    my $badPathCount = 0;
-
 
2681
    my $badProjectBaseCount = 0;
-
 
2682
    my $badMakeProjectCount = 0;
2386
 
2683
 
2387
    #
2684
    #
2388
    #   Display versions that did get captured
2685
    #   Display versions that did get captured
2389
    #
2686
    #
2390
    foreach my $entry ( @processOrder )
2687
    foreach my $entry ( @processOrder )
2391
    {
2688
    {
2392
        $versions{$entry}{Scanned} = 1;
2689
        $versions{$entry}{Scanned} = 1;
2393
        next unless ( $versions{$entry}{TagCreated} );
2690
        next unless ( $versions{$entry}{TagCreated} );
-
 
2691
        my $eflag = $versions{$entry}{Essential} ? 'E' : ' ';
2394
        Warning ("Processed: " . GetVname($entry) . ' :: ' . $versions{$entry}{rmRef} || $versions{$entry}{errStr} || '???' );
2692
        Warning ("Processed:$eflag:" . GetVname($entry) . ' :: ' . $versions{$entry}{rmRef} || $versions{$entry}{errStr} || '???' );
2395
    }
2693
    }
2396
 
2694
 
2397
    #
2695
    #
2398
    #   Display versions that did not get created
2696
    #   Display versions that did not get created
2399
    #
2697
    #
2400
    foreach my $entry ( @processOrder )
2698
    foreach my $entry ( @processOrder )
2401
    {
2699
    {
2402
        $versions{$entry}{Scanned} = 1;
2700
        $versions{$entry}{Scanned} = 1;
2403
        next if ( $versions{$entry}{TagCreated} );
2701
        if ( $versions{$entry}{TagCreated} )
-
 
2702
        {
-
 
2703
            $processedCount++;
-
 
2704
            $badPathCount++ if ($versions{$entry}{data}{BadPath} );
-
 
2705
            $badProjectBaseCount++ if ($versions{$entry}{data}{BadProjectBase} );
-
 
2706
            $badMakeProjectCount++ if ($versions{$entry}{data}{BadMakeProject} );
-
 
2707
            next;
-
 
2708
        }
-
 
2709
 
2404
        my $reason = $versions{$entry}{data}{errStr} || '';
2710
        my $reason = $versions{$entry}{data}{errStr} || '';
2405
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
2711
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
-
 
2712
        my $eflag = $versions{$entry}{Essential} ? 'E' : ' ';
2406
        Warning ("Not Processed: " . GetVname($entry) . ':' . $tag . ' : ' . $reason );
2713
        Warning ("Not Processed:$eflag: " . GetVname($entry) . ':' . $tag . ' : ' . $reason );
-
 
2714
        $notProcessedCount++;
2407
    }
2715
    }
2408
 
2716
 
2409
    foreach my $entry ( keys(%versions) )
2717
    foreach my $entry ( keys(%versions) )
2410
    {
2718
    {
2411
        next if ( $versions{$entry}{Scanned} );
2719
        next if ( $versions{$entry}{Scanned} );
2412
        Warning ("(E) INTERNAL ERROR. Package Not Processed: " . GetVname($entry) );
2720
        Warning ("(E) INTERNAL ERROR. Package Not Processed: " . GetVname($entry) );
-
 
2721
        $inernalErrorCount++;
-
 
2722
    }
-
 
2723
 
-
 
2724
    if ( $adjustedPath || 1 )
-
 
2725
    {
-
 
2726
        Information ("Package Info: Files, Removed, Added, Version, ViewPath");
-
 
2727
        foreach my $entry ( @processOrder )
-
 
2728
        {
-
 
2729
            my $viewPath = $versions{$entry}{data}{ViewPath} || '';
-
 
2730
            Information (sprintf "%4s, %4s, %4s, %20s : %s",
-
 
2731
                        $versions{$entry}{data}{fileCount} || '-',
-
 
2732
                        $versions{$entry}{data}{filesRemoved} || '-',
-
 
2733
                        $versions{$entry}{data}{filesAdded} || '-',
-
 
2734
                        GetVname($entry), $viewPath);
-
 
2735
        }
2413
    }
2736
    }
2414
 
2737
 
-
 
2738
    Message ("Packages processed: $processedCount");
-
 
2739
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
-
 
2740
    Warning ("Internal Errors: $inernalErrorCount") if ( $inernalErrorCount );
-
 
2741
    Warning ("Multiple source paths", @multiplePaths ) if ( scalar @multiplePaths > 1 );
2415
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
2742
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
-
 
2743
    Warning ("Packages with Bad Paths: $badPathCount") if ( $badPathCount );
-
 
2744
    Warning ("Packages with Bad ProjectBase: $badProjectBaseCount") if ( $badProjectBaseCount );
-
 
2745
    Warning ("Packages with MakeProjects: $badMakeProjectCount") if ( $badMakeProjectCount );
-
 
2746
    Warning ("Global Error Detected") if ( $globalError );
2416
    Message ("All Done");
2747
    Message ("---- All Done -----");
2417
}
2748
}
2418
 
2749
 
2419
#-------------------------------------------------------------------------------
2750
#-------------------------------------------------------------------------------
2420
# Function        : extractFilesFromClearCase
2751
# Function        : extractFilesFromClearCase
2421
#
2752
#
Line 2436... Line 2767...
2436
{
2767
{
2437
    my ($data, $cc_path, $cc_label) = @_;
2768
    my ($data, $cc_path, $cc_label) = @_;
2438
    my $tryCount = 0;
2769
    my $tryCount = 0;
2439
    my $rv = 99;
2770
    my $rv = 99;
2440
 
2771
 
2441
    $data->{ViewRoot} = $opt_name ? $opt_name : "$cc_label";
2772
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : "$cc_label";
2442
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
2773
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
2443
    
2774
    
2444
    if ( $opt_preserveProjectBase )
2775
    if ( $opt_preserveProjectBase && !$opt_forceProjectBase )
2445
    {
2776
    {
2446
        my $cc_vob = $cc_path;
2777
        my $cc_vob = $cc_path;
2447
        $cc_vob =~ s~^/~~;
2778
        $cc_vob =~ s~^/~~;
2448
        $cc_vob =~ s~/.*~~;
2779
        $cc_vob =~ s~/.*~~;
2449
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
2780
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
Line 2457... Line 2788...
2457
        return 0;
2788
        return 0;
2458
    }
2789
    }
2459
 
2790
 
2460
    while ( $rv == 99 ) {
2791
    while ( $rv == 99 ) {
2461
        my @args;
2792
        my @args;
2462
        push (@args, '-view', $opt_name ) if ( defined $opt_name );
2793
        push (@args, '-view', $opt_name ) if ( defined $opt_name && ! defined $opt_mergePackages );
2463
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
2794
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
2464
                    "-label=$cc_label" ,
2795
                    "-label=$cc_label" ,
2465
                    "-path=$cc_path",
2796
                    "-path=$cc_path",
2466
                    @args
2797
                    @args
2467
                    );
2798
                    );
Line 2526... Line 2857...
2526
    return 2;
2857
    return 2;
2527
 
2858
 
2528
}
2859
}
2529
 
2860
 
2530
#-------------------------------------------------------------------------------
2861
#-------------------------------------------------------------------------------
-
 
2862
# Function        : extractFilesFromSubversion
-
 
2863
#
-
 
2864
# Description     : Extract files from Subversion
-
 
2865
#                   May take a while as we handle nasty errors
-
 
2866
#
-
 
2867
# Inputs          : $data           - Hash of good stuff from newPackageVersionBody
-
 
2868
#                   $entry          - All the PV information
-
 
2869
#
-
 
2870
# Returns         : exit code
-
 
2871
#                   Sets up
-
 
2872
#                       $data->{errStr}
-
 
2873
#                       $data->{errCode}
-
 
2874
#                   As per newPackageVersionBody
-
 
2875
#
-
 
2876
sub extractFilesFromSubversion
-
 
2877
{
-
 
2878
    my ($data, $entry ) = @_;
-
 
2879
    my $tryCount = 0;
-
 
2880
    my $rv = 99;
-
 
2881
 
-
 
2882
    #
-
 
2883
    #   Create a nice name for the import
-
 
2884
    #
-
 
2885
    my $import_label = saneLabel($entry);
-
 
2886
    
-
 
2887
 
-
 
2888
    $data->{ViewRoot} = $opt_name ? $opt_name : $import_label;
-
 
2889
    $data->{ViewPath} =  $data->{ViewRoot};
-
 
2890
    $data->{ViewPath} =~  tr~/~/~s;
-
 
2891
 
-
 
2892
    if ( $opt_reuse && -d $data->{ViewPath}  )
-
 
2893
    {
-
 
2894
        Message ("Reusing view: $import_label");
-
 
2895
        return 0;
-
 
2896
    }
-
 
2897
 
-
 
2898
    #
-
 
2899
    #   Only allow import from SVN if asked nicely
-
 
2900
    #   May be used if we are correcting a package - and some have been
-
 
2901
    #   placed in SVN
-
 
2902
    #
-
 
2903
    unless ( $opt_extractFromSvn )
-
 
2904
    {
-
 
2905
        $data->{errStr} = 'Some Packages are in SVN';
-
 
2906
        return 15;
-
 
2907
    }
-
 
2908
    
-
 
2909
 
-
 
2910
#print "--- ViewRoot: $data->{ViewPath}\n";
-
 
2911
    $rv = JatsToolPrint ( 'jats_svnrelease',
-
 
2912
                          '-extractfiles',
-
 
2913
                          '-root=.' ,
-
 
2914
                          '-noprefix',
-
 
2915
                          '-DevMode=escrow',
-
 
2916
                          '-label', $data->{tag},
-
 
2917
                          '-view', $data->{ViewPath},
-
 
2918
                );
-
 
2919
 
-
 
2920
    if ( $rv == 10 ) {
-
 
2921
        $data->{errStr}  = 'No Files in the extracted view';
-
 
2922
        $data->{errCode} = '0';
-
 
2923
        return 2;
-
 
2924
 
-
 
2925
    } elsif ( $rv == 11 ) {
-
 
2926
        $data->{errStr} = 'Label not found';
-
 
2927
        $data->{errCode} = 'L';
-
 
2928
        return 2;
-
 
2929
    } elsif ( $rv ) {
-
 
2930
        $data->{errStr} = 'Subversion reported error';
-
 
2931
        return 2;
-
 
2932
    }
-
 
2933
 
-
 
2934
    unless ( -d $data->{ViewPath}  )
-
 
2935
    {
-
 
2936
        $data->{errStr} = 'Failed to extract files from Subversion';
-
 
2937
        return 2;
-
 
2938
    }
-
 
2939
 
-
 
2940
    #
-
 
2941
    #   Looks good
-
 
2942
    #
-
 
2943
    return 0;
-
 
2944
}
-
 
2945
 
-
 
2946
#-------------------------------------------------------------------------------
2531
# Function        : detectMakeProjectUsage
2947
# Function        : detectMakeProjectUsage
2532
#
2948
#
2533
# Description     : etect and report usage of the MakeProject directive
2949
# Description     : etect and report usage of the MakeProject directive
2534
#
2950
#
2535
# Inputs          : $data               - Ref to a hash of bits
2951
# Inputs          : $data               - Ref to a hash of bits
2536
#                   $cc_path            - Packages cc_path
-
 
2537
#
2952
#
2538
# Returns         : true    - Bad usage (Really good usage not detected)
2953
# Returns         : true    - Bad usage (Really good usage not detected)
2539
#                   false   - Good usage detected
2954
#                   false   - Good usage detected
2540
#
2955
#
2541
sub detectMakeProjectUsage
2956
sub detectMakeProjectUsage
2542
{
2957
{
2543
    my ($data, $cc_path) = @_;
2958
    my ($data) = @_;
2544
    my $retval = 0;
2959
    my $retval = 0;
2545
    my $eSuf = $opt_ignoreMakeProjectErrors ? '' : 'Error';
2960
    my $eSuf = $opt_ignoreMakeProjectErrors ? '' : 'Error';
2546
 
2961
 
2547
    #
2962
    #
2548
    #   Find makefile.pl
2963
    #   Find makefile.pl
2549
    #
2964
    #
2550
    Message ("Locate JATS makefiles");
2965
    Message ("Detect MakeProject Usage");
2551
    my $usesMakeProject = 0;
2966
    my $usesMakeProject = 0;
2552
    my $badIncludeFile = 0;
2967
    my $badIncludeFile = 0;
2553
 
2968
 
2554
    my $search = JatsLocateFiles->new("--Recurse=1",
2969
    my $search = JatsLocateFiles->new("--Recurse=1",
2555
                                       "--FilterIn=makefile.pl",
2970
                                       "--FilterIn=makefile.pl",
Line 2597... Line 3012...
2597
                    #
3012
                    #
2598
                    my @myArgs;
3013
                    my @myArgs;
2599
                    my $myProjectDir;
3014
                    my $myProjectDir;
2600
                    my $myProject = "$data->{ViewRoot}/$file";
3015
                    my $myProject = "$data->{ViewRoot}/$file";
2601
                    $myProject =~ s~/[^/]+$~~;
3016
                    $myProject =~ s~/[^/]+$~~;
-
 
3017
 
2602
                    $line =~ s~MakeProject~push \@myArgs,~;
3018
                    unless ($line =~ m~\s*(\w+)\s*\((.*)\)\s*;\s*$~ )
2603
                    eval $line;
3019
                    {
2604
                    Error("Line did not compiler: $line", "Err: $@" ) if ($@);
3020
                        Error("Could not detect arguments: $line");
-
 
3021
                    }
-
 
3022
                    my $args = $2;
-
 
3023
                    $args =~ tr~'" ~ ~s;
-
 
3024
                    @myArgs = split (/\s*,\s*/, $args);
2605
                    shift @myArgs;
3025
                    shift @myArgs;
2606
                    foreach ( @myArgs )
3026
                    foreach ( @myArgs )
2607
                    {
3027
                    {
2608
                        next if ( m~^--~ );
3028
                        next if ( m~^--~ );
2609
                        $myProject .= '/' . $_;
3029
                        $myProject .= '/' . $_;
2610
                        $myProjectDir = $myProject;
3030
                        $myProjectDir = $myProject;
2611
                        $myProjectDir =~ s~/[^/]+$~~;
3031
                        $myProjectDir =~ s~/[^/]+$~~;
2612
                        last;
3032
                        last;
2613
                    }
3033
                    }
2614
                    Error ("No project Found") unless ( defined $myProjectDir);
3034
                    Error ("No project Found") unless ( defined $myProjectDir);
-
 
3035
 
-
 
3036
                    #
-
 
3037
                    #   Look for 'include.txt' that may be bwteen the makefile and the project
-
 
3038
                    #
-
 
3039
 
-
 
3040
 
2615
                    if ( -f "$myProjectDir/include.txt" )
3041
                    if ( -f "$myProjectDir/include.txt" )
2616
                    {
3042
                    {
2617
                        Warning ("Co-located 'include.txt' file also found");
3043
                        Warning ("Co-located 'include.txt' file also found");
2618
                    }
3044
                    }
2619
 
3045
 
Line 2717... Line 3143...
2717
    
3143
    
2718
    return $retval;
3144
    return $retval;
2719
}
3145
}
2720
 
3146
 
2721
#-------------------------------------------------------------------------------
3147
#-------------------------------------------------------------------------------
-
 
3148
# Function        : detectBadMakePaths
-
 
3149
#
-
 
3150
# Description     : Detect and report bad usage of some directives
-
 
3151
#
-
 
3152
# Inputs          : $data               - Ref to a hash of bits
-
 
3153
#
-
 
3154
# Returns         : true    - Bad usage (Really good usage not detected)
-
 
3155
#                   false   - Good usage detected
-
 
3156
#
-
 
3157
sub detectBadMakePaths
-
 
3158
{
-
 
3159
    my ($data) = @_;
-
 
3160
    my $retval = 0;
-
 
3161
    my $eSuf = $opt_ignoreBadPaths ? '' : 'Error';
-
 
3162
 
-
 
3163
    #
-
 
3164
    #   Find makefile.pl
-
 
3165
    #
-
 
3166
    Message ("Detect Bad Source Paths");
-
 
3167
    my $badPath = 0;
-
 
3168
 
-
 
3169
    my $search = JatsLocateFiles->new("--Recurse=1",
-
 
3170
                                       "--FilterIn=makefile.pl",
-
 
3171
                                       );
-
 
3172
    my @makefiles = $search->search($data->{ViewPath});
-
 
3173
    foreach my $file ( @makefiles )
-
 
3174
    {
-
 
3175
        $file =~ tr~/~/~s;
-
 
3176
        my $max_up = ($file =~ tr~/~/~);
-
 
3177
        my $shownPath;
-
 
3178
#print "---Reading: $workDir/$data->{ViewPath}/$file\n";
-
 
3179
        if ( open( my $fh, '<', "$data->{ViewPath}/$file" ) )
-
 
3180
        {
-
 
3181
            my $eof = 0;
-
 
3182
            my $line = '';
-
 
3183
 
-
 
3184
            until ( $eof )
-
 
3185
            {
-
 
3186
                my $in = <$fh>;
-
 
3187
                unless ( defined $in )
-
 
3188
                {
-
 
3189
                    $eof = 1;
-
 
3190
                }
-
 
3191
                else
-
 
3192
                {
-
 
3193
                $in =~ s~\s+$~~;
-
 
3194
                $in =~ s~^\s+~~;
-
 
3195
                $in =~ s~^#.*$~~;
-
 
3196
                $in =~ s~\s*[^\$]#.*$~~;
-
 
3197
                $line .= ' ' if ( $line );
-
 
3198
                $line .= $in;
-
 
3199
                $line =~ s~\s+~ ~g;
-
 
3200
#print "====== '$line'\n";
-
 
3201
                redo unless ( $line =~ m~;$~  );
-
 
3202
                }
-
 
3203
                if ( $line =~ m~^AddDir~ || $line =~ m~^AddSrcDir~ || $line =~ m~^AddIncDir~ || $line =~ m~^Src~ )
-
 
3204
                {
-
 
3205
                    #
-
 
3206
                    #   Extract out the arguments
-
 
3207
                    #
-
 
3208
                    my @myArgs;
-
 
3209
                    my $myProjectDir;
-
 
3210
                    my $myProject = "$data->{ViewRoot}/$file";
-
 
3211
                    $myProject =~ s~/[^/]+$~~;
-
 
3212
 
-
 
3213
                    unless ($line =~ m~\s*(\w+)\s*\((.*)\)\s*;\s*$~ )
-
 
3214
                    {
-
 
3215
                        Error("Could not detect arguments: $line");
-
 
3216
                    }
-
 
3217
                    my $args = $2;
-
 
3218
                    $args =~ tr~'" ~ ~s;
-
 
3219
                    @myArgs = split (/\s*,\s*/, $args);
-
 
3220
                    shift @myArgs;
-
 
3221
                    foreach ( @myArgs )
-
 
3222
                    {
-
 
3223
                        next if ( m~^--~ );
-
 
3224
                        next unless ( m~^\.\./~ );
-
 
3225
                        my $tmp = $_;
-
 
3226
                        $tmp =~ s~Z~z~g;
-
 
3227
                        $tmp =~ s~\.\./~Z~g;
-
 
3228
                        my $upCount = ( $tmp =~ tr~Z~Z~ );
-
 
3229
                        if ( $upCount > $max_up )
-
 
3230
                        {
-
 
3231
                            Warning ("Makefile Path: $file ") unless $shownPath;
-
 
3232
                            Warning ("Path escapes view: $max_up, $upCount, $_");
-
 
3233
                            $badPath++;
-
 
3234
                            $shownPath = 1;
-
 
3235
                        }
-
 
3236
#print "---x Path : $max_up, $upCount, $_\n";
-
 
3237
                    }
-
 
3238
                }
-
 
3239
                $line = '';
-
 
3240
            }
-
 
3241
            close $fh;
-
 
3242
        }
-
 
3243
        else
-
 
3244
        {
-
 
3245
            Warning ("detectBadMakePaths$eSuf - Cannot open makefile: $file");
-
 
3246
            $retval = 1;
-
 
3247
        }
-
 
3248
    }
-
 
3249
 
-
 
3250
    #
-
 
3251
    #   Used
-
 
3252
    #   May be improved latter
-
 
3253
    #
-
 
3254
    if ( $badPath )
-
 
3255
    {
-
 
3256
        Warning ("detectBadMakePaths$eSuf - Bad Path seen. Must check manually");
-
 
3257
        $retval = 1;
-
 
3258
    }
-
 
3259
    
-
 
3260
    return $retval;
-
 
3261
}
-
 
3262
 
-
 
3263
 
-
 
3264
#-------------------------------------------------------------------------------
2722
# Function        : detectProjectBaseUsage
3265
# Function        : detectProjectBaseUsage
2723
#
3266
#
2724
# Description     : Detect and report usage of the SetProjectBase directive
3267
# Description     : Detect and report usage of the SetProjectBase directive
2725
#
3268
#
2726
# Inputs          : $data               - Ref to a hash of bits
3269
# Inputs          : $data               - Ref to a hash of bits
2727
#                   $cc_path            - Packages cc_path
-
 
2728
#
3270
#
2729
# Returns         : true    - Bad usage (Really good usage not detected)
3271
# Returns         : true    - Bad usage (Really good usage not detected)
2730
#                   false   - Good usage detected
3272
#                   false   - Good usage detected
2731
#
3273
#
2732
sub detectProjectBaseUsage
3274
sub detectProjectBaseUsage
2733
{
3275
{
2734
    my ($data, $cc_path) = @_;
3276
    my ($data) = @_;
2735
    my $retval = 0;
3277
    my $retval = 0;
2736
    my $eSuf = $opt_ignoreProjectBaseErrors ? '' : 'Error';
3278
    my $eSuf = $opt_ignoreProjectBaseErrors ? '' : 'Error';
2737
 
3279
 
2738
    #
3280
    #
2739
    #   Find makefile.pl
3281
    #   Find makefile.pl
2740
    #
3282
    #
2741
    Message ("Locate JATS makefiles");
3283
    Message ("Detect ProjectBase Usage");
2742
    my $usesProjectBase = 0;
3284
    my $usesProjectBase = 0;
2743
    my $definesProjectBase = 0;
3285
    my $definesProjectBase = 0;
2744
    my $definitionError = 0;
3286
    my $definitionError = 0;
2745
 
3287
 
2746
    my $search = JatsLocateFiles->new("--Recurse=1",
3288
    my $search = JatsLocateFiles->new("--Recurse=1",
2747
                                       "--FilterIn=makefile.pl",
3289
                                       "--FilterIn=makefile.pl",
2748
                                       );
3290
                                       );
2749
    my @makefiles = $search->search($data->{ViewRoot});
3291
    my @makefiles = $search->search($data->{ViewPath});
2750
    foreach my $file ( @makefiles )
3292
    foreach my $file ( @makefiles )
2751
    {
3293
    {
2752
        if ( open( my $fh, '<', "$data->{ViewRoot}/$file" ) )
3294
        if ( open( my $fh, '<', "$data->{ViewPath}/$file" ) )
2753
        {
3295
        {
2754
            while ( <$fh> )
3296
            while ( <$fh> )
2755
            {
3297
            {
2756
                s~\s+$~~;
3298
                s~\s+$~~;
2757
                s~^\s+~~;
3299
                s~^\s+~~;
Line 2767... Line 3309...
2767
                if ( m~^SetProjectBase~ )
3309
                if ( m~^SetProjectBase~ )
2768
                {
3310
                {
2769
                    $definesProjectBase++;
3311
                    $definesProjectBase++;
2770
                    $data->{DefinesProjectBase}++;
3312
                    $data->{DefinesProjectBase}++;
2771
                    Warning ("Package initialises SetProjectBase:",
3313
                    Warning ("Package initialises SetProjectBase:",
2772
                             "Line: " . $_,
3314
                             "Line : " . $_,
2773
                             "Root: " . "$data->{ViewRoot}",
3315
                             "Root : " . "$data->{ViewRoot}",
-
 
3316
                             "Path : " . "$data->{ViewPath}",
2774
                             "File: " . "$data->{ViewRoot}/$file",
3317
                             "File : " . "$data->{ViewPath}/$file",
2775
                            );
3318
                            );
2776
 
3319
 
2777
                    # The only problem is if the user attempts to escape
3320
                    # The only problem is if the user attempts to escape
2778
                    # from the root of the view.
3321
                    # from the root of the view.
2779
                    #
3322
                    #
Line 2784... Line 3327...
2784
                    # Locate the build.pl file
3327
                    # Locate the build.pl file
2785
                    # This is the basis for for the directive
3328
                    # This is the basis for for the directive
2786
                    #
3329
                    #
2787
                    my $blevel;
3330
                    my $blevel;
2788
                    my @bpaths = split ('/', $file );
3331
                    my @bpaths = split ('/', $file );
-
 
3332
                    my $buildFile;
2789
                    while ( @bpaths )
3333
                    while ( @bpaths )
2790
                    {
3334
                    {
2791
                        $bpaths[-1] = 'build.pl';
3335
                        $bpaths[-1] = 'build.pl';
2792
                        my $bfile = join '/', @bpaths ;
3336
                        my $bfile = join '/', @bpaths ;
2793
                        if ( -f "$data->{ViewRoot}/$bfile" )
3337
                        $buildFile = "$data->{ViewPath}/$bfile";
-
 
3338
                        if ( -f $buildFile )
2794
                        {
3339
                        {
2795
                            $blevel = scalar @bpaths;
3340
                            $blevel = scalar @bpaths;
2796
                            last;
3341
                            last;
2797
                        }
3342
                        }
2798
                        pop @bpaths;
3343
                        pop @bpaths;
Line 2805... Line 3350...
2805
                    }
3350
                    }
2806
                    else
3351
                    else
2807
                    {
3352
                    {
2808
                        #
3353
                        #
2809
                        #   Determine the depth of the view root
3354
                        #   Determine the depth of the view root
2810
                        #   This is given by cc_path, but cc_path has a leading /
-
 
2811
                        #
3355
                        #
-
 
3356
                        Warning ("Build: $buildFile");
2812
                        my @cpaths = split ('/', $cc_path );
3357
                        my $countPath = ($data->{ViewPath} =~ tr~/~/~);
2813
                        my $clevel = (scalar @cpaths) - 1;
3358
                        my $countBuild = ($buildFile =~ tr~/~/~);
2814
                        my $max_up = $blevel - $clevel - 1;
3359
                        my $max_up = $countBuild - $countPath -1;
2815
 
3360
 
2816
                        m~--Up=(\d+)~i;
3361
                        m~--Up=(\d+)~i;
2817
                        my $ulevel = $1;
3362
                        my $ulevel = $1;
2818
                        if ( defined $ulevel )
3363
                        if ( defined $ulevel )
2819
                        {
3364
                        {
Line 2823... Line 3368...
2823
#print "--- blevel: $blevel\n";
3368
#print "--- blevel: $blevel\n";
2824
#print "--- bpaths: @bpaths\n";
3369
#print "--- bpaths: @bpaths\n";
2825
#print "--- ulevel: $ulevel\n";
3370
#print "--- ulevel: $ulevel\n";
2826
#print "--- paths: @paths\n";
3371
#print "--- paths: @paths\n";
2827
#print "--- plevel: $plevel\n";
3372
#print "--- plevel: $plevel\n";
2828
#print "--- cpaths: @cpaths\n";
-
 
2829
#print "--- clevel: $clevel\n";
-
 
2830
#print "--- max_up: $max_up\n";
3373
#print "--- max_up: $max_up\n";
2831
 
3374
 
2832
                            if ( $ulevel > $max_up )
3375
                            if ( $ulevel > $max_up )
2833
                            {
3376
                            {
2834
                                Warning ("SetProjectBase escapes view. MaxUp: $max_up, Up: $ulevel");
3377
                                Warning ("SetProjectBase escapes view. MaxUp: $max_up, Up: $ulevel");
Line 3480... Line 4023...
3480
# Returns         : Cleaned up vcs tag
4023
# Returns         : Cleaned up vcs tag
3481
#
4024
#
3482
sub vcsCleanup
4025
sub vcsCleanup
3483
{
4026
{
3484
    my ($tag) = @_;
4027
    my ($tag) = @_;
3485
    $tag =~ tr~\\/~/~;
4028
    $tag =~ tr~\\/~/~;                              # Force use of /
-
 
4029
    $tag =~ s~/+$~~;                                # Trailing /
3486
    if ( $tag =~ m~^CC::~ )
4030
    if ( $tag =~ m~^CC::~ )
3487
    {
4031
    {
-
 
4032
        $tag =~ s~CC::/VOB:/~CC::/~;                # Kill stuff
3488
        $tag =~ s~CC::load\s+~CC::~;                # Load rule
4033
        $tag =~ s~CC::load\s+~CC::~;                # Load rule
3489
        $tag =~ s~CC::\s+~CC::~;                    # Leading white space
4034
        $tag =~ s~CC::\s+~CC::~;                    # Leading white space
3490
        $tag =~ s~CC::[A-Za-z]\:/~CC::/~;           # Leading driver letter
4035
        $tag =~ s~CC::[A-Za-z]\:/~CC::/~;           # Leading driver letter
3491
        $tag =~ s~CC::/+~CC::/~;                    # Multiple initial /'s
4036
        $tag =~ s~CC::/+~CC::/~;                    # Multiple initial /'s
3492
        $tag =~ s~/build.pl::~::~i;
4037
        $tag =~ s~/build.pl::~::~i;
Line 3536... Line 4081...
3536
        $bad = 1 if ( $path =~ m~^/devl/~ || $path  =~ m~^devl/~ );
4081
        $bad = 1 if ( $path =~ m~^/devl/~ || $path  =~ m~^devl/~ );
3537
        $bad = 1 if ( $path =~ m~^CVS~ );
4082
        $bad = 1 if ( $path =~ m~^CVS~ );
3538
        $bad = 1 if ( $path =~ m~^http:~i );
4083
        $bad = 1 if ( $path =~ m~^http:~i );
3539
        $bad = 1 if ( $path =~ m~^[A-Za-z]\:~ );
4084
        $bad = 1 if ( $path =~ m~^[A-Za-z]\:~ );
3540
        $bad = 1 if ( $path =~ m~^//~ );
4085
        $bad = 1 if ( $path =~ m~^//~ );
-
 
4086
        $bad = 1 if ( $path =~ m~^/blade1/~ );
-
 
4087
        $bad = 1 if ( $path =~ m~^/devl/~ );
3541
        $bad = 1 if ( $path =~ m~^/*none~i );
4088
        $bad = 1 if ( $path =~ m~^/*none~i );
3542
        $bad = 1 if ( $path =~ m~^/*NoWhere~i );
4089
        $bad = 1 if ( $path =~ m~^/*NoWhere~i );
3543
        $bad = 1 if ( $path =~ m~^-$~i );
4090
        $bad = 1 if ( $path =~ m~^-$~i );
3544
        $bad = 1 if ( $path =~ m~^cvsserver:~ );
4091
        $bad = 1 if ( $path =~ m~^cvsserver:~ );
3545
        $bad = 1 if ( $path =~ m~,\s*module:~ );
4092
        $bad = 1 if ( $path =~ m~,\s*module:~ );
-
 
4093
        $bad = 1 if ( $path =~ m~[()]~ );
3546
#        $bad = 1 unless ( $path =~ m~^/~ );
4094
#        $bad = 1 unless ( $path =~ m~^/~ );
3547
    }
4095
    }
3548
    else
4096
    else
3549
    {
4097
    {
3550
        $bad = 1;
4098
        $bad = 1;
Line 3840... Line 4388...
3840
        unless ( $opt_fileList )
4388
        unless ( $opt_fileList )
3841
        {
4389
        {
3842
            push @attributes, 'URL="' . dotUrl($entry) . '"';
4390
            push @attributes, 'URL="' . dotUrl($entry) . '"';
3843
            push @attributes, 'tooltip="' . "Goto: $versions{$entry}{vname}, PVID=$entry" ,'"';
4391
            push @attributes, 'tooltip="' . "Goto: $versions{$entry}{vname}, PVID=$entry" ,'"';
3844
        }
4392
        }
-
 
4393
        else
3845
        {
4394
        {
3846
            push @attributes, 'URL="' . "Dummy" . '"';
4395
            push @attributes, 'URL="' . "Dummy" . '"';
3847
            push @attributes, 'tooltip="' . "Original Label: $versions{$entry}{realLabel}" ,'"';
4396
            push @attributes, 'tooltip="' . "Original Label: $versions{$entry}{realLabel}" ,'"';
3848
        }
4397
        }
3849
        my $shape;
4398
        my $shape;
Line 4020... Line 4569...
4020
        unless ( keys(%ScmRepoMap) >= 0 );
4569
        unless ( keys(%ScmRepoMap) >= 0 );
4021
 
4570
 
4022
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4571
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4023
        if (exists $ScmRepoMap{$packageNames});
4572
        if (exists $ScmRepoMap{$packageNames});
4024
 
4573
 
-
 
4574
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
-
 
4575
        if (exists $ScmRepoMap{$packageNames}{protected});
4025
    #
4576
    #
4026
    #   Free the memory
4577
    #   Free the memory
4027
    #
4578
    #
4028
    %ScmRepoMap = ();
4579
    %ScmRepoMap = ();
4029
 
4580
 
Line 4082... Line 4633...
4082
        next unless ( exists  $pkg_ids{ $ScmPackages{$_}{pkgid} } );
4633
        next unless ( exists  $pkg_ids{ $ScmPackages{$_}{pkgid} } );
4083
        push @EssentialPackages, $_;
4634
        push @EssentialPackages, $_;
4084
        Error ("Essential Package Version not in extracted Release Manager Data: $_")
4635
        Error ("Essential Package Version not in extracted Release Manager Data: $_")
4085
            unless ( exists $versions{$_} );
4636
            unless ( exists $versions{$_} );
4086
        $versions{$_}{Essential} = 1;
4637
        $versions{$_}{Essential} = 1;
4087
        $versions{$_}{Reason} = $ScmPackages{$_}{Reason};
4638
        $versions{$_}{Reason} = $ScmPackages{$_}{Reason} if exists $ScmPackages{$_}{Reason}  ;
4088
 
4639
 
4089
        # Retain which RM Release this package-version is the tip
4640
        # Retain which RM Release this package-version is the tip
4090
        # Release of
4641
        # Release of
4091
        foreach my $rtag_id ( @{$ScmPackages{$_}{'release'}} )
4642
        foreach my $rtag_id ( @{$ScmPackages{$_}{'release'}} )
4092
        {
4643
        {
Line 4135... Line 4686...
4135
        my $vcsType = $1;
4686
        my $vcsType = $1;
4136
        my $cc_label = $4;
4687
        my $cc_label = $4;
4137
        my $cc_path = $2;
4688
        my $cc_path = $2;
4138
        $cc_path = '/' . $cc_path;
4689
        $cc_path = '/' . $cc_path;
4139
        $cc_path =~ tr~\\/~/~s;
4690
        $cc_path =~ tr~\\/~/~s;
-
 
4691
        $cc_path =~ s~/+$~~;
4140
 
4692
 
4141
        $VobPaths{$cc_path}++;
4693
        $VobPaths{$cc_path}++;
4142
    }
4694
    }
4143
 
4695
 
4144
    @multiplePaths = sort keys %VobPaths;
4696
    @multiplePaths = sort keys %VobPaths;
4145
    if ( scalar @multiplePaths > 1 )
4697
    if ( scalar @multiplePaths > 1 )
4146
    {
4698
    {
4147
        Warning ("Multiple Paths:" . $_ ) foreach (@multiplePaths);
4699
        Warning ("Multiple Paths:" . $_ ) foreach (@multiplePaths);
-
 
4700
 
-
 
4701
        # Kill SVN import
-
 
4702
        # User will need to configure one path
-
 
4703
        unless ( $opt_AllowMuliplePaths )
-
 
4704
        {
-
 
4705
            Warning ("Multiple Paths detected: Import supressed");
-
 
4706
            $opt_useSvn = 0
-
 
4707
        }
-
 
4708
        else
-
 
4709
        {
-
 
4710
            Message ("Multiple Paths detected: Allowed");
-
 
4711
        }
4148
    }
4712
    }
4149
}
4713
}
4150
 
4714
 
4151
sub isSet
4715
sub isSet
4152
{
4716
{
Line 4371... Line 4935...
4371
    #
4935
    #
4372
    #   Close out the file
4936
    #   Close out the file
4373
    #
4937
    #
4374
    $fh->Close();
4938
    $fh->Close();
4375
}
4939
}
-
 
4940
 
-
 
4941
#-------------------------------------------------------------------------------
-
 
4942
# Function        : restoreData
-
 
4943
#
-
 
4944
# Description     : Read in essential information
-
 
4945
#                   Used during a resume operation
-
 
4946
#
-
 
4947
# Inputs          : 
-
 
4948
#
-
 
4949
# Returns         : 
-
 
4950
#
-
 
4951
our %ScmVersions;
-
 
4952
sub restoreData
-
 
4953
{
-
 
4954
    my $file = $cwd . "/${packageNames}.data";
-
 
4955
    Message ("Restoring: $file");
-
 
4956
    Error "Cannot locate restoration file: $file" unless ( -f $file );
-
 
4957
    require $file;
-
 
4958
 
-
 
4959
    Error "Resume Data in $file is not valid\n"
-
 
4960
        unless ( keys(%ScmVersions) >= 0 );
-
 
4961
 
-
 
4962
    foreach  ( keys %ScmVersions )
-
 
4963
    {
-
 
4964
        $restoreData{$_} = $ScmVersions{$_}{data};
-
 
4965
        $restoreData{$_}{rmRef} = $ScmVersions{$_}{rmRef};
-
 
4966
    }
-
 
4967
    %ScmVersions = ();
-
 
4968
}
-
 
4969
 
-
 
4970
#-------------------------------------------------------------------------------
-
 
4971
# Function        : testSvnLabel
-
 
4972
#
-
 
4973
# Description     : Test existence of an SVN label
-
 
4974
#
-
 
4975
# Inputs          :     Package
-
 
4976
#                       Label to test
-
 
4977
#
-
 
4978
# Returns         : 0   - Tag in place
-
 
4979
#                   1   - Not in place
-
 
4980
#
-
 
4981
sub testSvnLabel
-
 
4982
{
-
 
4983
    my ($svnPkg, $svnTag) = @_;
-
 
4984
 
-
 
4985
    my $rv = JatsToolPrint ( 'jats_svnlabel',
-
 
4986
                    '-check',
-
 
4987
                    "-packagebase=$svnPkg",
-
 
4988
                    "$svnTag",
-
 
4989
                     );
-
 
4990
    Message ("testSvnLabel: $svnTag - $rv");
-
 
4991
    return $rv;
-
 
4992
}
-
 
4993
 
-
 
4994
 
4376
#-------------------------------------------------------------------------------
4995
#-------------------------------------------------------------------------------
4377
# Function        : GetData_by_filelist
4996
# Function        : GetData_by_filelist
4378
#
4997
#
4379
# Description     : Read in source data from a file
4998
# Description     : Read in source data from a file
4380
#
4999
#
Line 4416... Line 5035...
4416
            $pv_id++;
5035
            $pv_id++;
4417
#            $versions{$pv_id}{fileListEntry} = $_;
5036
#            $versions{$pv_id}{fileListEntry} = $_;
4418
            $versions{$pv_id}{name} = $pkg_name;
5037
            $versions{$pv_id}{name} = $pkg_name;
4419
            $versions{$pv_id}{pvid} = $pv_id;
5038
            $versions{$pv_id}{pvid} = $pv_id;
4420
            $versions{$pv_id}{vname} = $pkg_ver;
5039
            $versions{$pv_id}{vname} = $pkg_ver;
4421
            $versions{$pv_id}{vcsTag} = "CC::/MASS_Dataman::$data[2]";
5040
            $versions{$pv_id}{vcsTag} = "CC::/${opt_ccbase}::$data[2]";
4422
            $versions{$pv_id}{created} = $cdate;
5041
            $versions{$pv_id}{created} = $cdate;
4423
            $versions{$pv_id}{created_id} = $data[1];
5042
            $versions{$pv_id}{created_id} = $data[1];
4424
            $versions{$pv_id}{realLabel} = $data[2];
5043
            $versions{$pv_id}{realLabel} = $data[2];
4425
            $versions{$pv_id}{comment} = "Label Import: $data[2]";
5044
            $versions{$pv_id}{comment} = "Label Import: $data[2]";
4426
            $versions{$pv_id}{locked} = 'Y';
5045
            $versions{$pv_id}{locked} = 'Y';
Line 4452... Line 5071...
4452
        }
5071
        }
4453
    }
5072
    }
4454
    close $fh;
5073
    close $fh;
4455
}
5074
}
4456
 
5075
 
4457
 
-
 
4458
#-------------------------------------------------------------------------------
5076
#-------------------------------------------------------------------------------
4459
#   Documentation
5077
#   Documentation
4460
#
5078
#
4461
 
5079
 
4462
=pod
5080
=pod
Line 4489... Line 5107...
4489
    -[no]postimage     - Create image after transger: Def: -post
5107
    -[no]postimage     - Create image after transger: Def: -post
4490
    -workdir=path      - Use for temp storage (def:/work)
5108
    -workdir=path      - Use for temp storage (def:/work)
4491
    -delete            - Delete SVN package before test
5109
    -delete            - Delete SVN package before test
4492
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
5110
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
4493
    -filelist=path     - Use named list of files
5111
    -filelist=path     - Use named list of files
-
 
5112
    -testRmDatabase    - Use test database
-
 
5113
    -[no]fromSvn       - Also extract packages from SVN
4494
 
5114
 
4495
=head1 OPTIONS
5115
=head1 OPTIONS
4496
 
5116
 
4497
=over 8
5117
=over 8
4498
 
5118